Iteration

  • AoFluxStep model coupler cmeps

    One-step update of the CMEPS atmosphere-ocean stability iteration (stage 2 of the EqESM project): a single pass of the do-while of flux_atmOcn_large in cesm/flux_atmocn/flux_atmocn_Large.F90:242-290 (the Large & Pond / Large & Yeager scheme of the CESM mediator, cesm3.0-alphabranch checkout), transcribed exactly and mounted six times by reference in cmeps_aoflux.esm (top-level models.step1..step5, esm-spec section 4.7; the 6th mount exit recomputes the exit-state fields from step5's frozen state, see the parent's metadata) so the 16-equation update law is authored once and the unrolled iteration is composed. Inputs are the update-invariant pointwise fields vmag/delt/delq/alz/zbot/thbot/qbot (the wind magnitude, the temperature and humidity differences, the height logarithm ln(zbot/10) and the Monin-Obukhov inputs of F90:252-254) and the water coefficient ren = 0.0346 (constant across the iteration, F90:277), the previous update's state (ustar_prev/tstar_prev/qstar_prev feeding the stability parameter and the convergence test |(ustar - ustar_prev)/ustar| <= flux_convergence = 0.01 of F90:286-287, and rdn_prev, the pre-update neutral drag used by the clamped wind shift rdw of F90:272; the heat coefficient rhn is recomputed from this update's stability each pass, F90:278, so no rhn_prev is needed), the previous convergence flag conv_prev, and the 4 previous frozen-state fields (ustar/tstar/qstar/rdn). The CESM constants karman = 0.4, g = 9.80616 m/s^2 and zvir = 28.966/18.016 - 1 (shr_const_mod.F90:32, 21, 31) are parameters with defaults, bound into the stability_parameter template call and not coupled (the parent carries the same constants, the ren precedent). Outputs are the 17 update states (hol_raw, the unclamped Monin-Obukhov parameter of F90:252-253; hol = stability_parameter_clamp(hol_raw), the sign-preserving |hol| <= 10 clamp of F90:254; stable, xsq, xqq, psimh, psixh, rdw, u10n, rdn, rhn, rd, rh, re, ustar, tstar, qstar), this update's own convergence flag conv, and 4 frozen-state fields (frozen_ustar_prev/frozen_tstar_prev/frozen_qstar_prev/frozen_rdn_prev) that pin the INPUT state of the first-converged update (frozen_state_select on the update inputs ustar_prev/tstar_prev/qstar_prev/rdn_prev: once conv_prev = 1 the frozen fields stop updating, so the 5th mount's frozen outputs are the state the first-converged update was computed from — the pre-converged update's outputs, which the parent's exit mount feeds back through the update law to reproduce the Fortran exit state exactly — and the all-5-iterations case leaves the fresh 4th-update values, which reproduce the 5th update). The frozen threading is required because the iteration states do not repeat after convergence (ustar_2 differs from ustar_4 at the 1.8e-4 level on the pinned rows) while the dump pins the first-converged state; all 15 exit-state fields are functions of the pinned 4-input state plus the fixed fields and are recomputed by the parent's exit mount rather than threaded. The expression templates of ./cmeps_templates.esm are imported by reference.