Wright

  • WrightEOS model ocean mom6

    Stage-2 implementation of the MOM6 equation of state (stage 1 boundary B1 of stage1/runs/MOM6_LANE.md; MOM6 dev/ncar_260909 @301879336, fork stage1/EqESM-cesm-mom6 branch instrument/mom6-dumps): the Wright 1997 full-range in-situ density rho(T, S, p) and its analytic first derivatives drho/dT, drho/dS, as evaluated by the model's calculate_density / calculate_density_derivs_scalar calls in KPP_compute_BLD (MOM_CVMix_KPP.F90:1437; the EOS law itself is density_elem_Wright_full / calculate_density_derivs_elem_Wright_full, MOM_EOS_Wright_full.F90:75-91 / 179-204). The model WrightEOS binds the 15 Fortran coefficients by reference from the wright_coeff_a0..c5 constant fragments of ./mom6_templates.esm (MOM_EOS_Wright_full.F90:23-37; the fragments are the single shared source of the coefficient values, also used by the wright_rho composition and by the KPPBLD model of mom6_kpp.esm), computes the three shared polynomials al0/p0/lambda as intermediate unknowns via the wright_alpha0 and wright_poly templates of ./mom6_templates.esm (p0 and lambda are the same wright_poly law under the b- and c-coefficients), then rho = (p + p0)/(lambda + al0*(p + p0)) via the wright_density template and the Fortran's hand-coded derivative formulas (wright_drho_dT / wright_drho_dS templates) with the shared denominator inverse I_denom2 = 1/(lambda + al0*(p + p0))^2 (F90:198). The derivatives are transcribed formulas, NOT symbolic D(rho, T)/D(rho, S): in esm 1.3.0 the D operator is a rewrite-target for discretization stencils (esm-spec 4.2 / 9.6.8) and the CLI 0.7.0 evaluator rejects it for algebraic expressions ('unlowered_operator ... reached evaluation without being lowered to a stencil'), so the Fortran derivative formulas are reproduced exactly instead (operation order identical to the Fortran, so the tests pin the derivative columns to round-off, rel 1e-12). State units: T potential temperature [degC], S salinity [ppt], p pressure at the top interface of the layer [Pa] (surface pressure + hydrostatic weight of the layers above, MOM_CVMix_KPP.F90:1428-1440), rho in-situ density [kg m-3], drho/dT [kg m-3 degC-1], drho/dS [kg m-3 ppt-1]. The run configuration (C_JRA_t62_mom6_inst) uses EQN_OF_STATE = WRIGHT_FULL (the MOM6 default), USE_PSURF_IN_EOS = True, and all unit rescale factors 1.0, so the dumped values are the physical-unit law values.