Canopy-Resistance
- NoahCanopyResistance
model
land_surface
noah
Canopy (bulk stomatal) resistance of WRF's unified Noah land-surface model, SUBROUTINE CANRES of phys/module_sf_noahlsm.F (WRF 4.8, sf_surface_physics = 2), and the plant coefficient pc it is converted into. Jarvis (1976) multiplicative stress form as implemented by Chen et al. (1996): rc = rsmin / (xlai rcs rct rcq rcsoil), with four independent stress factors, each floored -- rcs from incoming solar radiation, rct from air temperature about the optimum topt, rcq from the vapour-pressure deficit at the lowest model level, and rcsoil from root-zone soil moisture. The soil-moisture factor is written here as what the Fortran loop computes: rcsoil = (1/z_root) integral of the layer stress gx over the root zone, gx = clamp((sh2o - smcwlt)/(smcref - smcwlt), 0, 1), i.e. a THICKNESS-WEIGHTED MEAN of the layer stress over the root depth (the Fortran's PART(k) = (zsoil(k)-zsoil(k-1))/zsoil(nroot) gx(k) is dz[k]/z_root gx[k] because WRF's zsoil is negative downward). The integral runs over the whole soil column with the sub-root layers masked out by zc < z_root; a layer centre never coincides with z_root, which is by construction a layer interface, so the mask selects exactly the Fortran's layers 1..nroot. The plant coefficient pc converts rc into the factor that multiplies the LINEARISED Penman potential evaporation to give Penman-Monteith actual transpiration: pc = (rr + delta)/(rr (1 + rc ch) + delta), where rr is the radiative-plus-aerodynamic resistance ratio and delta = (slv/cp) dqsdt2 the saturation-humidity slope in the same units. Frozen-ground extension: WRF passes UNFROZEN soil water sh2o, not total smc, into this routine -- the `SMC` dummy argument of CANRES is bound to SH2O at the call site -- so the component's column input is named sh2o. GATING. SFLX calls CANRES only 'IF ((SHDFAC > 0.) .AND. (XLAI > 0.))' (module_sf_noahlsm.F:749) and otherwise sets rc = 0; this component reproduces that through `canres_called` and its new `shdfac` input, so a bare cell (shdfac = 0, e.g. the BARE category REDPRM zeroes) gives rc = 0 and finite zeros elsewhere instead of the NaN that xlai = 0 or z_root = 0 would put into rcs, rcsoil and rc. The denominators inside the active branch are guarded as well (xlai, and z_root for a vegetation type with no root layers), because an ifelse evaluates both branches. The `rr` here is CANRES's own, built from cp = 1004.5 (module_model_constants) and Noah's rd = 287.04 and sigma = 5.67e-8; it is NOT the `rr` of SUBROUTINE PENMAN, which is a different expression built from PENMAN's own cp = 1004.6 (FORTRAN_BUGS N88). Consumer-supplied column fields (ze, sh2o) are rewrite-target ops `input_<name>` lowered by the consumer, in the inline tests through per-test expression_template_imports libraries generated by tools/fill_tests.py.