Resolve the bkgnd_kd_min “unset” sentinel to the reference
default HENYEY_KD_MIN_FRAC * kt_bg (MOM6 KD_MIN, default
0.01*KD). A NEGATIVE kd_min means “not set by the user”;
zero and positive values are taken literally, so kd_min = 0
is a legal way to ask for no floor at all.
Called from vmix_assemble on every entry rather than resolved
once at configure, so a directly-constructed slot (every unit test
that never goes through configure_ocean_vmix) gets exactly the
same default as a production run. It is a two-flop scalar.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | kd_min |
The raw |
||
| real(kind=wp), | intent(in) | :: | kt_bg |
Scalar background tracer diffusivity the default is a fraction of. |
pure function vmix_resolve_kd_min(kd_min, kt_bg) result(kd_min_eff) !! Resolve the `bkgnd_kd_min` "unset" sentinel to the reference !! default `HENYEY_KD_MIN_FRAC * kt_bg` (MOM6 `KD_MIN`, default !! `0.01*KD`). A NEGATIVE `kd_min` means "not set by the user"; !! zero and positive values are taken literally, so `kd_min = 0` !! is a legal way to ask for no floor at all. !! !! Called from `vmix_assemble` on every entry rather than resolved !! once at configure, so a directly-constructed slot (every unit test !! that never goes through `configure_ocean_vmix`) gets exactly the !! same default as a production run. It is a two-flop scalar. real(wp), intent(in) :: kd_min !! The raw `bkgnd_kd_min` knob; negative = unset sentinel. real(wp), intent(in) :: kt_bg !! Scalar background tracer diffusivity the default is a fraction of. real(wp) :: kd_min_eff kd_min_eff = merge(HENYEY_KD_MIN_FRAC*kt_bg, kd_min, kd_min < 0.0_wp) end function vmix_resolve_kd_min