register_ocean_grid Subroutine

private subroutine register_ocean_grid(cfg, schema)

&ocean_grid_nml: horizontal-grid generator + geometry (curvilinear-grid stream). grid_config / coriolis_scheme enums mirror parse_grid_config / parse_coriolis_scheme in rdb_ocean_metrics.

Arguments

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

Calls

proc~~register_ocean_grid~~CallsGraph proc~register_ocean_grid register_ocean_grid proc~group_add nml_group_t%group_add proc~register_ocean_grid->proc~group_add proc~nml_enum nml_enum proc~register_ocean_grid->proc~nml_enum proc~nml_real nml_real proc~register_ocean_grid->proc~nml_real proc~nml_string nml_string proc~register_ocean_grid->proc~nml_string proc~schema_add_group nml_schema_t%schema_add_group proc~register_ocean_grid->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_grid~~CalledByGraph proc~register_ocean_grid register_ocean_grid proc~build_rdb_schema build_rdb_schema proc~build_rdb_schema->proc~register_ocean_grid 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
real(kind=wp), private, pointer :: pr
character(len=:), private, pointer :: ps

Source Code

   subroutine register_ocean_grid(cfg, schema)
      !! `&ocean_grid_nml`: horizontal-grid generator + geometry
      !! (curvilinear-grid stream).  `grid_config` / `coriolis_scheme`
      !! enums mirror `parse_grid_config` / `parse_coriolis_scheme` in
      !! `rdb_ocean_metrics`.
      type(config_t), target, intent(in) :: cfg
      type(nml_schema_t), intent(inout) :: schema
      type(nml_group_t) :: g
      character(len=:), pointer :: ps
      real(wp), pointer :: pr

      g%name = "ocean_grid"
      g%doc = "Horizontal-grid generator + geometry (ocean curvilinear stream)."
      ps => cfg%ocean%grid%grid_config
      call g%add(nml_enum("grid_config", ps, &
                          "Horizontal grid generator", &
                          allowed=[character(len=12) :: "cartesian", "spherical", &
                                   "supergrid", "tripolar"]))
      pr => cfg%ocean%grid%lon_west
      call g%add(nml_real("lon_west", pr, &
                          "West edge of the domain (spherical)", units="degrees_east"))
      pr => cfg%ocean%grid%lat_south
      call g%add(nml_real("lat_south", pr, &
                          "South edge of the domain (spherical)", units="degrees_north", &
                          min=-90.0_wp, max=90.0_wp))
      pr => cfg%ocean%grid%rad_earth
      call g%add(nml_real("rad_earth", pr, "Earth radius for the spherical metric", &
                          units="m", min=0.0_wp))
      ps => cfg%ocean%grid%supergrid_file
      call g%add(nml_string("supergrid_file", ps, &
                            "Path to the MOM6 supergrid NetCDF (supergrid grid_config)"))
      ps => cfg%ocean%grid%coriolis_scheme
      call g%add(nml_enum("coriolis_scheme", ps, &
                          "Coriolis source for the metrics f-fill", &
                          allowed=[character(len=10) :: "beta_plane", "planetary"]))
      pr => cfg%ocean%grid%omega
      call g%add(nml_real("omega", pr, "Planetary rotation rate (planetary scheme)", &
                          units="rad/s"))
      pr => cfg%ocean%grid%phi_join
      call g%add(nml_real("phi_join", pr, &
                          "Join latitude for the tripolar bipolar cap", &
                          units="degrees_north", min=-90.0_wp, max=90.0_wp))
      pr => cfg%ocean%grid%lon_pole
      call g%add(nml_real("lon_pole", pr, &
                          "Longitude of the first tripolar cap pole (partner +180)", &
                          units="degrees_east"))
      ps => cfg%ocean%grid%axis_units
      call g%add(nml_enum("axis_units", ps, &
                          "Units of the Cartesian domain extent (MOM6 AXIS_UNITS)", &
                          allowed=[character(len=8) :: "meters", "degrees", "km"]))
      pr => cfg%ocean%grid%len_lon
      call g%add(nml_real("len_lon", pr, &
                          "Total x-extent of the Cartesian domain in axis_units "// &
                          "(MOM6 LENLON; derives dx when > 0)"))
      pr => cfg%ocean%grid%len_lat
      call g%add(nml_real("len_lat", pr, &
                          "Total y-extent of the Cartesian domain in axis_units "// &
                          "(MOM6 LENLAT; derives dy when > 0)"))
      call schema%add_group(g)
   end subroutine register_ocean_grid