subroutine register_vcoord(cfg, schema)
!! `&vcoord_nml`: vertical-coordinate + ALE-remap controls.
!! `vcoord_type` / `remap_method` / `zstar_stretching` are enums
!! with the canonical sets accepted by the rdb_vcoord parsers.
type(config_t), target, intent(in) :: cfg
type(nml_schema_t), intent(inout) :: schema
type(nml_group_t) :: g
integer, pointer :: pi
real(wp), pointer :: pr
real(wp), pointer :: pra(:)
character(len=:), pointer :: ps
logical, pointer :: pl
g%name = "vcoord"
g%doc = "Vertical-coordinate + ALE-remap controls."
ps => cfg%vcoord_type
call g%add(nml_enum("vcoord_type", ps, "Vertical coordinate type", &
allowed=[character(len=12) :: "sigma", "zsigma", &
"zstar", "zstar_full", "zstar_sigma", "z", &
"eulerian_z", "isopycnal", "lagrangian", "gprime", &
"z_fixed", "rho", "hycom"]))
ps => cfg%thickness_config
call g%add(nml_enum("thickness_config", ps, &
"Initial layer-thickness profile (ocean path)", &
allowed=[character(len=9) :: "sigma", "uniform_z"]))
ps => cfg%remap_method
call g%add(nml_enum("remap_method", ps, "Vertical remapping method", &
allowed=[character(len=6) :: "pcm", "plm", "ppm", "ppm_h4", "pqm"]))
pr => cfg%zstar_h_surf_target
call g%add(nml_real("zstar_h_surf_target", pr, &
"z*-full: target surface-layer thickness (0 = auto)", units="m"))
ps => cfg%zstar_stretching
call g%add(nml_enum("zstar_stretching", ps, &
"z*-full: surface-concentration stretching", &
allowed=[character(len=7) :: "log", "uniform"], &
dead_on_ocean_path="registered but never copied onto "// &
"ocean_state%vcoord -- the ocean path always runs "// &
"STRETCH_UNIFORM regardless of this setting "// &
"(rdb_ocean_vcoord.F90:179). See docs/ocean_python_api_plan.md P4.5."))
pr => cfg%zstar_h_min
call g%add(nml_real("zstar_h_min", pr, "z*-full: vanishing-layer floor", units="m"))
pi => cfg%zstar_n_surf
call g%add(nml_int("zstar_n_surf", pi, &
"z*-full: number of fine near-surface layers (0 = auto)", min=0, &
dead_on_ocean_path="registered but never copied onto "// &
"ocean_state%vcoord -- the ocean path always runs n_surf=0 "// &
"regardless of this setting (rdb_ocean_vcoord.F90:182). "// &
"See docs/ocean_python_api_plan.md P4.5."))
pr => cfg%rho_ref_pressure
call g%add(nml_real("rho_ref_pressure", pr, &
"rho-coord: reference pressure for potential density", units="Pa"))
pr => cfg%rho_target_light
call g%add(nml_real("rho_target_light", pr, &
"rho-coord: lightest (surface) target density", units="kg/m^3"))
pr => cfg%rho_target_dense
call g%add(nml_real("rho_target_dense", pr, &
"rho-coord: densest (bed) target density", units="kg/m^3"))
ps => cfg%rho_target_profile
call g%add(nml_enum("rho_target_profile", ps, &
"rho/hycom target densities: uniform (rho_target_light.."// &
"rho_target_dense linspace) or list (rho_target_list)", &
allowed=[character(len=7) :: "uniform", "list"]))
pra => cfg%rho_target_list
call g%add(nml_real_array("rho_target_list", pra, &
"rho_target_profile='list': interface densities, "// &
"lightest first (exactly nz_layers+1 entries)", &
units="kg/m^3"))
pr => cfg%regrid_time_scale
call g%add(nml_real("regrid_time_scale", pr, &
"ALE regrid grid time-filter timescale (0 = jump to target)", &
units="s", min=0.0_wp))
pl => cfg%remap_vel_conserve_ke
call g%add(nml_logical("remap_vel_conserve_ke", pl, &
"ALE velocity remap: KE-conserving baroclinic-anomaly rescale"))
pl => cfg%remap_boundary_extrap
call g%add(nml_logical("remap_boundary_extrap", pl, &
"ALE remap: linear-exact one-sided reconstruction in the "// &
"k=1/k=nz boundary cells (MOM6 BOUNDARY_EXTRAPOLATION)"))
pl => cfg%remap_nonuniform_weights
call g%add(nml_logical("remap_nonuniform_weights", pl, &
"ALE remap: non-uniform-grid PLM slope + PPM edge weights "// &
"(Colella-Woodward 1984 eqs 1.6-1.8) instead of the "// &
"equal-thickness specialisations"))
pl => cfg%remap_check_preconditions
call g%add(nml_logical("remap_check_preconditions", pl, &
"ALE remap: fail loud when a column violates the overlap "// &
"sweep's preconditions (non-negative thicknesses, "// &
"matching column totals)"))
pl => cfg%check_vanished_content
call g%add(nml_logical("check_vanished_content", pl, &
"I1' tripwire: fail loud if any layer at or below "// &
"H_VANISHED does not hold its donor live layer's "// &
"concentration (debug/validation)"))
pl => cfg%zfixed_closed_faces
call g%add(nml_logical("zfixed_closed_faces", pl, &
"z_fixed / zstar / zstar_full partial steps: close every face whose "// &
"layer is an inert filler on either side (z-level wall, "// &
"free-slip)"))
ps => cfg%z_fixed_profile
call g%add(nml_enum("z_fixed_profile", ps, &
"z_fixed / zstar levels / hycom z* floor nominal "// &
"layer-thickness profile: uniform (max_depth/nz), list "// &
"(z_fixed_dz) or tanh stretching", &
allowed=[character(len=7) :: "uniform", "list", "tanh"]))
pra => cfg%z_fixed_dz
call g%add(nml_real_array("z_fixed_dz", pra, &
"z_fixed_profile='list': nominal layer thicknesses, "// &
"surface first (exactly nz_layers entries)", units="m"))
pr => cfg%z_fixed_dz_top
call g%add(nml_real("z_fixed_dz_top", pr, &
"z_fixed_profile='tanh': surface-layer nominal thickness", &
units="m"))
pr => cfg%z_fixed_tanh_center
call g%add(nml_real("z_fixed_tanh_center", pr, &
"z_fixed_profile='tanh': transition centre, fraction of the "// &
"layer-index span (0 = surface, 1 = bed)", min=0.0_wp, max=1.0_wp))
pr => cfg%z_fixed_tanh_width
call g%add(nml_real("z_fixed_tanh_width", pr, &
"z_fixed_profile='tanh': transition width, fraction of the "// &
"layer-index span"))
call schema%add_group(g)
end subroutine register_vcoord