cavity_draft_is_uniform Function

public 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).

Arguments

Type IntentOptional Attributes Name
type(config_t), intent(in) :: cfg

Return Value logical


Called by

proc~~cavity_draft_is_uniform~~CalledByGraph proc~cavity_draft_is_uniform cavity_draft_is_uniform proc~validate_config validate_config proc~validate_config->proc~cavity_draft_is_uniform proc~build_pending_handle build_pending_handle proc~build_pending_handle->proc~validate_config proc~rdb_ocean_create_from_string rdb_ocean_create_from_string proc~rdb_ocean_create_from_string->proc~build_pending_handle proc~rdb_ocean_create_pending rdb_ocean_create_pending proc~rdb_ocean_create_pending->proc~build_pending_handle

Variables

Type Visibility Attributes Name Initial
character(len=:), private, allocatable :: dcfg

Source Code

   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