Is the configured ice-shelf draft UNIFORM over the whole array?
The one predicate, so the two rules that turn on it cannot drift
apart: the &ocean_pgf_nml p_top_in_bc REFUSAL (a load with a
gradient must have a consumer — a uniform load is bit-identically
inert in the FV_MOM6 top BC, which is the theorem in
compute_fv_mom6_impl’s docstring), and the z_fixed x cavity
staircase WARNING (only a uniform draft is validated on a
quasi-geopotential coordinate).
draft_config = "none" is uniform because it is identically
zero. "flat" is uniform only when NO box bound clips it —
a clipped flat draft has a calving front, which is a step, and a
step is the largest gradient in the domain. "linear" and
"file" are never assumed uniform: this is a NAMELIST-level
predicate and cannot see the filled array (the configure-time
twin in configure_ocean_cavity tests maxval /= minval on the
field itself, which is the stricter check and runs later).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(config_t), | intent(in) | :: | cfg |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=:), | private, | allocatable | :: | dcfg |
pure function cavity_draft_is_uniform(cfg) result(uniform) !! Is the configured ice-shelf draft UNIFORM over the whole array? !! !! The one predicate, so the two rules that turn on it cannot drift !! apart: the `&ocean_pgf_nml p_top_in_bc` REFUSAL (a load with a !! gradient must have a consumer — a uniform load is bit-identically !! inert in the FV_MOM6 top BC, which is the theorem in !! `compute_fv_mom6_impl`'s docstring), and the `z_fixed` x cavity !! staircase WARNING (only a uniform draft is validated on a !! quasi-geopotential coordinate). !! !! `draft_config = "none"` is uniform because it is identically !! zero. `"flat"` is uniform only when NO box bound clips it — !! a clipped flat draft has a calving front, which is a step, and a !! step is the largest gradient in the domain. `"linear"` and !! `"file"` are never assumed uniform: this is a NAMELIST-level !! predicate and cannot see the filled array (the configure-time !! twin in `configure_ocean_cavity` tests `maxval /= minval` on the !! field itself, which is the stricter check and runs later). type(config_t), intent(in) :: cfg logical :: uniform character(len=:), allocatable :: dcfg dcfg = trim(adjustl(cfg%ocean%cavity_dyn%draft_config)) uniform = (dcfg == "none") if (dcfg == "flat") then uniform = abs(cfg%ocean%cavity_dyn%draft_x0) >= 1.0e29_wp .and. & abs(cfg%ocean%cavity_dyn%draft_x1) >= 1.0e29_wp .and. & abs(cfg%ocean%cavity_dyn%draft_y0) >= 1.0e29_wp .and. & abs(cfg%ocean%cavity_dyn%draft_y1) >= 1.0e29_wp end if end function cavity_draft_is_uniform