PyREC scaffolding (from YREC development, 7be4133)/ difad3_mod.fGlossary

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 by SETUPV, from which VCIRC forms VESD2, VESD3 (0.2*FACD*WM, then rescaled by the μ-gradient factor); VESD2, VESD3 are read nowhere else.
  • FV0, FV1A, FV1B, FV2A, FV2B: set by SETUPV (FV2B with the FACT7 term added); VCIRC rescales FV0. FV1A–FV2B are read nowhere: unused? (So are VESD2, VESD3 above.)
  • DSS, DGSF: $r\,|v_\mathrm{SS}|$ and $r\,|v_\mathrm{GSF}|$, set by VCIRC, read nowhere: unused?
  • EV0, EV1A, EV1B, EV2A, EV2B, ECOD5, ECOD6, FGEOM, ESS, EGSF: read by DADCOEFT to build its coefficients (ESS, EGSF rescaled 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 coefficients ECOD3, ECOD4 that DADCOEFT computes from them are then zero (dadcoeft.f, lines 244–269↗), and DADCOEFT divides by FGEOM (dadcoeft.f, lines 592–597↗). This is DADCOEFT's suspected bug 1 (only with LDIFAD, off by default), whose possible fix takes them for the even-grid versions of the FV*, DSS, and DGSF on the model's grid; VESD2 and VESD3 may be missing inputs too, and FGEOM a 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

lines 19–50 · GitHub

Uses modules DIMENSIONS_MOD

Used by (3 units)

DADCOEFT, SETUPV, VCIRC

Change log

The changes since rp_1

Changed since rp_1. New file: COMMON/DIFAD3/ as a module.