subroutine register_ocean_pgf(cfg, schema)
!! `&ocean_pgf_nml`: pressure-gradient-force kernel selector + knobs.
!! `form` enum mirrors `parse_opgf_variant` in rdb_ocean_pressure_force.
type(config_t), target, intent(in) :: cfg
type(nml_schema_t), intent(inout) :: schema
type(nml_group_t) :: g
real(wp), pointer :: pr
logical, pointer :: pl
integer, pointer :: pi
character(len=:), pointer :: ps
g%name = "ocean_pgf"
g%doc = "Pressure-gradient-force kernel selector + knobs."
ps => cfg%ocean%pgf%form
! "montgomery" is a long-spelling alias for "mont": `parse_opgf_variant`
! accepts it, so the schema must too or the alias is unreachable through
! the namelist (the enum gate rejects before the parser is ever called).
! Both canonicalise to OPGF_VARIANT_MONT; the only literal comparison on
! this key anywhere is against "gprime", so the extra spelling is inert.
call g%add(nml_enum("form", ps, "PGF kernel variant", &
allowed=[character(len=10) :: "mont", "montgomery", "fv_lite", &
"fv_wright", "gprime", "fv_mom6"]))
pr => cfg%ocean%pgf%gprime_gfs
call g%add(nml_real("gprime_gfs", pr, "Free-surface gravity for the gprime PGF", &
units="m/s^2"))
pr => cfg%ocean%pgf%gprime_gint
call g%add(nml_real("gprime_gint", pr, "Internal-interface reduced gravity (gprime PGF)", &
units="m/s^2"))
pr => cfg%ocean%pgf%gfs_scale
call g%add(nml_real("gfs_scale", pr, "Free-surface gravity scaling (FV_MOM6, MOM6 GFS_scale)"))
pr => cfg%ocean%pgf%maxvel
call g%add(nml_real("maxvel", pr, "Velocity-truncation clamp (0 = disabled)", units="m/s"))
pr => cfg%ocean%pgf%cfl_trunc
call g%add(nml_real("cfl_trunc", pr, "Advective-CFL velocity truncation threshold (0 = disabled)"))
pl => cfg%ocean%pgf%mass_weight
call g%add(nml_logical("mass_weight", pl, &
"FV_MOM6 shelf-break hWght mass-weighting at unequal-depth faces"))
pl => cfg%ocean%pgf%reconstruct_for_pressure
call g%add(nml_logical("reconstruct_for_pressure", pl, &
"FV_MOM6 in-layer PLM/PPM T/S reconstruction for the density integral"))
pi => cfg%ocean%pgf%recon_scheme
call g%add(nml_int("recon_scheme", pi, &
"In-layer reconstruction scheme: 1=PLM, 2=PPM", min=1, max=2))
pl => cfg%ocean%pgf%insitu_density
call g%add(nml_logical("insitu_density", pl, &
"FV_MOM6 constant-by-layer density at its in-situ pressure "// &
"(MOM6 PCM parity); .false. = legacy potential density at "// &
"&ocean_eos_nml p_ref. Inert for the linear EOS"))
pl => cfg%ocean%pgf%p_top_in_bc
call g%add(nml_logical("p_top_in_bc", pl, &
"FV_MOM6: add the top-of-column load ms%p_top to "// &
"the pressure-stack surface boundary condition "// &
"pa(nz+1) = rho_ref*g*eta + p_top"))
call schema%add_group(g)
end subroutine register_ocean_pgf