p_top_has_producer Function

public pure function p_top_has_producer(cfg) result(has)

Is there anything in this configuration that WRITES multilayer_state_t%p_top?

p_top = metrics%p_ice_ref + sf%p_surf has exactly two producers, and both halves count:

  • &ocean_psurf_nml enable — the atmospheric surface-pressure seam, which fills sf%p_surf and refreshes p_top once per outer step in ocean_dyn_step_split;
  • &ocean_cavity_dyn_nml enable — the STATIC ice-shelf load p_ice_ref = rho_ref*GRAVITY*z_draft, assembled into p_top by configure_ocean_cavity. Static is not the same as absent: the draft never changes, so the configure-time assembly is the final value and there is nothing to refresh.

Used by the &ocean_pgf_nml p_top_in_bc inert-knob warning, which must name both — a cavity run is precisely the case where p_top_in_bc is not merely live but REQUIRED (for a draft that varies), so warning that it is inert there was telling the user the opposite of the truth.

Arguments

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

Return Value logical


Called by

proc~~p_top_has_producer~~CalledByGraph proc~p_top_has_producer p_top_has_producer proc~validate_config validate_config proc~validate_config->proc~p_top_has_producer 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

Source Code

   pure function p_top_has_producer(cfg) result(has)
      !! Is there anything in this configuration that WRITES
      !! `multilayer_state_t%p_top`?
      !!
      !! `p_top = metrics%p_ice_ref + sf%p_surf` has exactly two
      !! producers, and both halves count:
      !!
      !!   * `&ocean_psurf_nml enable` — the atmospheric surface-pressure
      !!     seam, which fills `sf%p_surf` and refreshes `p_top` once per
      !!     outer step in `ocean_dyn_step_split`;
      !!   * `&ocean_cavity_dyn_nml enable` — the STATIC ice-shelf load
      !!     `p_ice_ref = rho_ref*GRAVITY*z_draft`, assembled into
      !!     `p_top` by `configure_ocean_cavity`.  Static is not the same
      !!     as absent: the draft never changes, so the configure-time
      !!     assembly is the final value and there is nothing to refresh.
      !!
      !! Used by the `&ocean_pgf_nml p_top_in_bc` inert-knob warning,
      !! which must name both — a cavity run is precisely the case where
      !! `p_top_in_bc` is not merely live but REQUIRED (for a draft that
      !! varies), so warning that it is inert there was telling the user
      !! the opposite of the truth.
      type(config_t), intent(in) :: cfg
      logical :: has
      has = cfg%ocean%psurf%enable .or. cfg%ocean%cavity_dyn%enable
   end function p_top_has_producer