canonical_diag_gate_hint Function

public pure function canonical_diag_gate_hint(name) result(hint)

The namelist gate whose closure suppresses canonical diagnostic name, for the “you asked for this and did not get it” warning. "" for the four unconditional diagnostics (SSH/u/v/KE) — a hint of "" means “this one should have registered; that is a bug, not a config”. MUST be kept in lock-step with register_default_diags’s gates; the count of non-empty hints must equal the number of conditionally-registered canonical diagnostics (test_ocean_diag/diag_gate_hint_covers_every_gate is the lock — any PR that adds a new gated canonical diagnostic must add its hint here or that test fails). This duplicates the gate NAMES only, never the gate LOGIC — the single if in register_default_diags remains the one place the gate is evaluated.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

Return Value character(len=64)


Called by

proc~~canonical_diag_gate_hint~~CalledByGraph proc~canonical_diag_gate_hint canonical_diag_gate_hint proc~gate_clause gate_clause proc~gate_clause->proc~canonical_diag_gate_hint proc~apply_diag_selection apply_diag_selection proc~apply_diag_selection->proc~gate_clause proc~engine_configure_diag engine_configure_diag proc~engine_configure_diag->proc~apply_diag_selection proc~engine_setup engine_setup proc~engine_setup->proc~engine_configure_diag proc~complete_ocean_create complete_ocean_create proc~complete_ocean_create->proc~engine_setup proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_setup proc~driver_validate driver_validate proc~driver_validate->proc~engine_setup

Source Code

   pure function canonical_diag_gate_hint(name) result(hint)
      !! The namelist gate whose closure suppresses canonical diagnostic
      !! `name`, for the "you asked for this and did not get it" warning.
      !! `""` for the four unconditional diagnostics (SSH/u/v/KE) — a hint
      !! of `""` means "this one should have registered; that is a bug,
      !! not a config".  MUST be kept in lock-step with
      !! `register_default_diags`'s gates; the count of non-empty hints
      !! must equal the number of conditionally-registered canonical
      !! diagnostics (`test_ocean_diag/diag_gate_hint_covers_every_gate` is
      !! the lock — any PR that adds a new gated canonical diagnostic must
      !! add its hint here or that test fails).  This duplicates the gate
      !! NAMES only, never the gate LOGIC — the single `if` in
      !! `register_default_diags` remains the one place the gate is
      !! evaluated.
      character(len=*), intent(in) :: name
      character(len=64) :: hint

      select case (trim(name))
      case ("temperature", "salinity")
         hint = "&ocean_thermo_nml enable_thermodynamics"
      case ("age")
         hint = "&ocean_tracers_nml enable_ideal_age"
      case ("MLD_EPBL", "Kd_EPBL")
         hint = "&ocean_epbl_nml enable"
      case ("Kd_KSHEAR")
         hint = "&ocean_kappa_shear_nml enable"
      case ("ice_conc", "ice_thick")
         hint = "&ocean_ice_nml enable"
      case default
         hint = ""
      end select
   end function canonical_diag_gate_hint