subroutine register_ocean_cavity_dyn(cfg, schema)
!! `&ocean_cavity_dyn` (P5.1 static ice-shelf cavity geometry: the
!! prescribed draft + the barotropic datum that absorbs it).
type(config_t), target, intent(in) :: cfg
type(nml_schema_t), intent(inout) :: schema
type(nml_group_t) :: g
logical, pointer :: pl
real(wp), pointer :: pr
character(len=:), pointer :: ps
g%name = "ocean_cavity_dyn"
g%doc = "Static ice-shelf cavity geometry: prescribed draft + "// &
"barotropic datum bt_H_ref = b - z_draft."
pl => cfg%ocean%cavity_dyn%enable
call g%add(nml_logical("enable", pl, &
"Master switch (single-rank, split solver, "// &
"fv_mom6 PGF, sigma/z_fixed only)"))
ps => cfg%ocean%cavity_dyn%draft_config
call g%add(nml_enum("draft_config", ps, &
"Draft source: analytic shape, or 'file' (static 2-D "// &
"NetCDF on the model grid, single rank)", &
allowed=[character(len=15) :: "none", "flat", &
"linear", "file"]))
ps => cfg%ocean%cavity_dyn%draft_source
call g%add(nml_enum("draft_source", ps, &
"Whether the formula gives the ice-base DEPTH or "// &
"an ice THICKNESS ('in_situ' isostasy is deferred)", &
allowed=[character(len=15) :: "draft", "thickness", &
"in_situ"]))
pr => cfg%ocean%cavity_dyn%draft_depth
call g%add(nml_real("draft_depth", pr, &
"Draft amplitude (ice thickness under "// &
"draft_source='thickness')", units="m"))
pr => cfg%ocean%cavity_dyn%draft_slope
call g%add(nml_real("draft_slope", pr, &
"d(draft)/dx for draft_config='linear' "// &
"(dimensionless; converted to grid units)"))
pr => cfg%ocean%cavity_dyn%draft_x0
call g%add(nml_real("draft_x0", pr, &
"Western edge of the shelf box, and the anchor of "// &
"the 'linear' profile (+/-1e30 => no limit)", units="m"))
pr => cfg%ocean%cavity_dyn%draft_x1
call g%add(nml_real("draft_x1", pr, &
"Eastern edge of the shelf box = the calving front "// &
"(+/-1e30 => no limit)", units="m"))
pr => cfg%ocean%cavity_dyn%draft_y0
call g%add(nml_real("draft_y0", pr, &
"Southern edge of the shelf box (+/-1e30 => no limit)", &
units="m"))
pr => cfg%ocean%cavity_dyn%draft_y1
call g%add(nml_real("draft_y1", pr, &
"Northern edge of the shelf box (+/-1e30 => no limit)", &
units="m"))
ps => cfg%ocean%cavity_dyn%draft_file
call g%add(nml_string("draft_file", ps, &
"draft_config='file': NetCDF path (variable must be "// &
"(x,y,t) Fortran order, on the model grid; record 1 read)"))
ps => cfg%ocean%cavity_dyn%draft_var
call g%add(nml_string("draft_var", ps, &
"draft_config='file': 2-D variable name (ISOMIP+ ships "// &
"'iceDraft')"))
ps => cfg%ocean%cavity_dyn%draft_sign
call g%add(nml_enum("draft_sign", ps, &
"draft_config='file': sign convention of the file values "// &
"(ISOMIP+ iceDraft is an ELEVATION)", &
allowed=[character(len=14) :: "depth", "positive_down", &
"elevation", "positive_up"]))
pr => cfg%ocean%cavity_dyn%h_min_cavity
call g%add(nml_real("h_min_cavity", pr, &
"Grounding cutoff: b - z_draft below this is LAND "// &
"(never a thin film under grounded ice)", units="m"))
pr => cfg%ocean%cavity_dyn%grounded_max_frac
call g%add(nml_real("grounded_max_frac", pr, &
"Fail loud if more than this fraction of the "// &
"interior columns ground"))
pr => cfg%ocean%cavity_dyn%rho_ice
call g%add(nml_real("rho_ice", pr, &
"Ice density, consulted only by "// &
"draft_source='thickness'", units="kg/m^3"))
pl => cfg%ocean%cavity_dyn%trim_ic_for_p_surf
call g%add(nml_logical("trim_ic_for_p_surf", pl, &
"Trim the initial column top so the displaced "// &
"water's weight equals the ice load (MOM6 "// &
"TRIM_IC_FOR_P_SURF; linear EOS + zinit "// &
"source='linear' only)"))
call schema%add_group(g)
end subroutine register_ocean_cavity_dyn