difad3_mod.f
50 lines · 1 definitions · on GitHub (7be4133)
Python version: difad3_mod.py, 40 lines, on the right (switch to Python above the code).
Variables on this page (22)
dgsf, dss, ecod5, ecod6, egsf, ess, ev0, ev1a, ev1b, ev2a, ev2b, facd2, facd3, fgeom, fv0, fv1a, fv1b, fv2a, fv2b, json, vesd2, vesd3
Purpose
DIFAD3_MOD holds the Zahn-type factors of the diffusion-plus-advection treatment of angular momentum (LDIFAD), shared by SETUPV, VCIRC and DADCOEFT. It replaces COMMON/DIFAD3/ (MHP via Claude, 10/14/26); JSON comes from DIMENSIONS_MOD. All 21 members are arrays of JSON.
What its variables hold, who sets them, who reads them.
FACD2,FACD3: factors set bySETUPV, from whichVCIRCformsVESD2,VESD3(0.2*FACD*WM, then rescaled by the μ-gradient factor);VESD2,VESD3are read nowhere else.FV0,FV1A,FV1B,FV2A,FV2B: set bySETUPV(FV2Bwith theFACT7term added);VCIRCrescalesFV0.FV1A–FV2Bare read nowhere: unused? (So areVESD2,VESD3above.)DSS,DGSF: $r\,|v_\mathrm{SS}|$ and $r\,|v_\mathrm{GSF}|$, set byVCIRC, read nowhere: unused?EV0,EV1A,EV1B,EV2A,EV2B,ECOD5,ECOD6,FGEOM,ESS,EGSF: read byDADCOEFTto build its coefficients (ESS,EGSFrescaled in place there), but set by no routine, so they keep their initial values (zero in practice, though a module variable without an initializer is formally undefined). The coefficientsECOD3,ECOD4that DADCOEFT computes from them are then zero (dadcoeft.f, lines 244–269↗), and DADCOEFT divides byFGEOM(dadcoeft.f, lines 592–597↗). This is DADCOEFT's suspected bug 1 (only withLDIFAD, off by default), whose possible fix takes them for the even-grid versions of theFV*,DSS, andDGSFon the model's grid;VESD2andVESD3may be missing inputs too, andFGEOMa geometric factor still to be computed.
Design
A blanket USE DIFAD3_MOD. The block looks like a half-finished link between the factors SETUPV computes (FV*) and those DADCOEFT reads (EV*), which differ only in their first letter.
Definitions
moduleDIFAD3_MOD
Uses modules DIMENSIONS_MOD
Change log
The changes since rp_1
Changed since rp_1. New file: COMMON/DIFAD3/ as a module.