register_ocean_ic Subroutine

private subroutine register_ocean_ic(cfg, schema)

&ocean_ic_nml: initial-condition overlay + EOS reference state. ic_config enum mirrors the IC dispatch in rdb_ocean_state (default “” keeps the analytical T(z) IC).

Arguments

Type IntentOptional Attributes Name
type(config_t), intent(in), target :: cfg
type(nml_schema_t), intent(inout) :: schema

Calls

proc~~register_ocean_ic~~CallsGraph proc~register_ocean_ic register_ocean_ic proc~group_add nml_group_t%group_add proc~register_ocean_ic->proc~group_add proc~nml_enum nml_enum proc~register_ocean_ic->proc~nml_enum proc~nml_int nml_int proc~register_ocean_ic->proc~nml_int proc~nml_real nml_real proc~register_ocean_ic->proc~nml_real proc~nml_real_array nml_real_array proc~register_ocean_ic->proc~nml_real_array proc~schema_add_group nml_schema_t%schema_add_group proc~register_ocean_ic->proc~schema_add_group error error proc~group_add->error proc~lower lower proc~group_add->proc~lower proc~schema_add_group->error proc~schema_add_group->proc~lower proc~move_group move_group proc~schema_add_group->proc~move_group

Called by

proc~~register_ocean_ic~~CalledByGraph proc~register_ocean_ic register_ocean_ic proc~build_rdb_schema build_rdb_schema proc~build_rdb_schema->proc~register_ocean_ic proc~read_config_from_string_impl read_config_from_string_impl proc~read_config_from_string_impl->proc~build_rdb_schema proc~read_config_impl read_config_impl proc~read_config_impl->proc~build_rdb_schema proc~read_config read_config proc~read_config->proc~read_config_impl proc~read_config_from_string read_config_from_string proc~read_config_from_string->proc~read_config_from_string_impl proc~build_pending_handle build_pending_handle proc~build_pending_handle->proc~read_config_from_string 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
type(nml_group_t), private :: g
integer, private, pointer :: pi
real(kind=wp), private, pointer :: pr
real(kind=wp), private, pointer :: pra(:)
character(len=:), private, pointer :: ps

Source Code

   subroutine register_ocean_ic(cfg, schema)
      !! `&ocean_ic_nml`: initial-condition overlay + EOS reference state.
      !! `ic_config` enum mirrors the IC dispatch in rdb_ocean_state
      !! (default "" keeps the analytical T(z) IC).
      type(config_t), target, intent(in) :: cfg
      type(nml_schema_t), intent(inout) :: schema
      type(nml_group_t) :: g
      real(wp), pointer :: pr
      real(wp), pointer :: pra(:)
      integer, pointer :: pi
      character(len=:), pointer :: ps

      g%name = "ocean_ic"
      g%doc = "Initial-condition overlay + EOS reference state."
      ps => cfg%ocean%ic%ic_config
      call g%add(nml_enum("ic_config", ps, "IC overlay tag", &
                          allowed=[character(len=22) :: "", "eady", &
                                   "geostrophic_adjustment", "baroclinic_jet"]))
      pr => cfg%ocean%ic%alpha_T
      call g%add(nml_real("alpha_T", pr, &
                          "Linear-EOS thermal-expansion coefficient (DIMENSIONAL: "// &
                          "multiply a fractional 1/degC coefficient by rho_0)", &
                          units="kg/m^3/degC"))
      pr => cfg%ocean%ic%beta_S
      call g%add(nml_real("beta_S", pr, &
                          "Linear-EOS haline contraction coefficient (DIMENSIONAL: "// &
                          "multiply a fractional 1/PSU coefficient by rho_0)", &
                          units="kg/m^3/PSU", min=0.0_wp))
      pr => cfg%ocean%ic%T_ref
      call g%add(nml_real("T_ref", pr, "Linear-EOS reference temperature", &
                          units="degC", min=-273.15_wp))
      pr => cfg%ocean%ic%S_ref
      call g%add(nml_real("S_ref", pr, "Linear-EOS reference salinity", &
                          units="PSU", min=0.0_wp))
      pr => cfg%ocean%ic%rho_0
      call g%add(nml_real("rho_0", pr, "Reference density for the linear EOS / Boussinesq PGF", &
                          units="kg/m^3"))
      pra => cfg%ocean%ic%layer_rho_init
      call g%add(nml_real_array("layer_rho_init", pra, &
                                "Per-layer initial density (k=1 bed -> k=nz surface; -1 = EOS init)", &
                                units="kg/m^3"))
      pr => cfg%ocean%ic%rho_lightest
      call g%add(nml_real("rho_lightest", pr, &
                          "Linear density-range IC: surface (lightest) layer density; -1 = off", &
                          units="kg/m^3"))
      pr => cfg%ocean%ic%rho_range
      call g%add(nml_real("rho_range", pr, &
                          "Linear density-range IC: top-to-bottom density contrast (MOM6 DENSITY_RANGE)", &
                          units="kg/m^3"))
      pr => cfg%ocean%ic%eady_dT_dy
      call g%add(nml_real("eady_dT_dy", pr, "Eady IC meridional T gradient", units="degC/m"))
      pr => cfg%ocean%ic%eady_dT_dz
      call g%add(nml_real("eady_dT_dz", pr, "Eady IC vertical stratification", units="degC/m"))
      pr => cfg%ocean%ic%eady_T_ref
      call g%add(nml_real("eady_T_ref", pr, "Eady IC reference temperature at z=0,y=y_mid", &
                          units="degC"))
      pr => cfg%ocean%ic%eady_pert_amp
      call g%add(nml_real("eady_pert_amp", pr, "Eady IC symmetry-breaking perturbation amplitude", &
                          units="degC"))
      pi => cfg%ocean%ic%eady_pert_seed
      call g%add(nml_int("eady_pert_seed", pi, "RNG seed for the Eady IC perturbation"))
      pr => cfg%ocean%ic%ga_eta_amp
      call g%add(nml_real("ga_eta_amp", pr, "Geostrophic-adjustment IC: SSH-bump amplitude", units="m"))
      pr => cfg%ocean%ic%ga_length_scale
      call g%add(nml_real("ga_length_scale", pr, "Geostrophic-adjustment IC: SSH-bump e-folding scale", &
                          units="m"))
      pr => cfg%ocean%ic%ga_x_center
      call g%add(nml_real("ga_x_center", pr, "Geostrophic-adjustment IC: bump x-centre (<0 = auto)", &
                          units="m"))
      pr => cfg%ocean%ic%ga_y_center
      call g%add(nml_real("ga_y_center", pr, "Geostrophic-adjustment IC: bump y-centre (<0 = auto)", &
                          units="m"))
      pr => cfg%ocean%ic%jet_half_width
      call g%add(nml_real("jet_half_width", pr, &
                          "Baroclinic-jet IC: tanh jet half-width L", units="m"))
      pr => cfg%ocean%ic%interface_amp
      call g%add(nml_real("interface_amp", pr, &
                          "Baroclinic-jet IC: interface displacement amplitude", units="m"))
      pr => cfg%ocean%ic%pert_amp_frac
      call g%add(nml_real("pert_amp_frac", pr, &
                          "Baroclinic-jet IC: meander amplitude as a fraction of interface_amp"))
      pi => cfg%ocean%ic%pert_nx
      call g%add(nml_int("pert_nx", pi, &
                         "Baroclinic-jet IC: zonal perturbation wavenumber (integer)"))
      pr => cfg%ocean%ic%upper_layer_rest
      call g%add(nml_real("upper_layer_rest", pr, &
                          "Baroclinic-jet IC: upper (surface) layer rest thickness H1", &
                          units="m"))
      call schema%add_group(g)
   end subroutine register_ocean_ic