Will &ocean_vdiff_nml bbl_glue actually be ON after setup?
vdiff_bbl_configure (rdb_ocean_vdiff.F90) turns a requested
glue OFF when its effective drag coefficient or BBL thickness is
not positive: quadratic cd <= 0, linear bg_vel <= 0 (no
cd = r·hbbl/bg_vel) or r <= 0, or hbbl and its hbbl_visc
fallback both <= 0. This is the same predicate on cfg, so a
configure check that only holds while the glue is on (the
implicit_drag + hbbl > 0 exception) cannot accept a namelist
the setup then runs without it. Keep the two in step.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(config_t), | intent(in) | :: | cfg |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | private | :: | cd_eff | ||||
| real(kind=wp), | private | :: | hbbl |
pure function bbl_glue_is_effective(cfg) result(on) !! Will `&ocean_vdiff_nml bbl_glue` actually be ON after setup? !! !! `vdiff_bbl_configure` (`rdb_ocean_vdiff.F90`) turns a requested !! glue OFF when its effective drag coefficient or BBL thickness is !! not positive: quadratic `cd <= 0`, linear `bg_vel <= 0` (no !! `cd = r·hbbl/bg_vel`) or `r <= 0`, or `hbbl` and its `hbbl_visc` !! fallback both `<= 0`. This is the same predicate on `cfg`, so a !! configure check that only holds while the glue is on (the !! `implicit_drag` + `hbbl > 0` exception) cannot accept a namelist !! the setup then runs without it. Keep the two in step. type(config_t), intent(in) :: cfg logical :: on real(wp) :: hbbl, cd_eff on = .false. if (.not. cfg%ocean%vdiff%bbl_glue) return hbbl = cfg%ocean%bdrag%hbbl if (hbbl <= 0.0_wp) hbbl = cfg%ocean%vdiff%hbbl_visc if (trim(adjustl(cfg%ocean%bdrag%form)) == "linear") then cd_eff = 0.0_wp if (cfg%ocean%bdrag%bg_vel > 0.0_wp) then cd_eff = cfg%ocean%bdrag%r*hbbl/cfg%ocean%bdrag%bg_vel end if else cd_eff = cfg%ocean%bdrag%cd end if on = cd_eff > 0.0_wp .and. hbbl > 0.0_wp end function bbl_glue_is_effective