subroutine register_output(cfg, schema)
!! `&output_nml`: file output + I/O + forcing/restart/gauge files.
type(config_t), target, intent(in) :: cfg
type(nml_schema_t), intent(inout) :: schema
type(nml_group_t) :: g
real(wp), pointer :: pr
integer, pointer :: pi
logical, pointer :: pl
character(len=:), pointer :: ps
g%name = "output"
g%doc = "File output, I/O server, forcing/restart/gauge files."
pl => cfg%output_to_file
call g%add(nml_logical("output_to_file", pl, "Enable file output (NetCDF snapshots)", &
dead_on_ocean_path="accepted and validated but read nowhere in "// &
"src/ -- NetCDF output is gated by RDB_ENABLE_NETCDF at build "// &
"time and by the diag/restart registries at run time, not by this "// &
"flag (found by the P4 dead-knob sweep, 2026-09-10)."))
ps => cfg%output_dir
call g%add(nml_string("output_dir", ps, "Directory for output files"))
pr => cfg%restart_interval
call g%add(nml_real("restart_interval", pr, "Time between restart writes (0 = none)", units="s"))
pl => cfg%compress_output
call g%add(nml_logical("compress_output", pl, "Deflate-compress NetCDF output"))
pi => cfg%compress_level
call g%add(nml_int("compress_level", pi, "Deflate level (1=fast, 9=max)", min=1, max=9))
pl => cfg%use_io_server
call g%add(nml_logical("use_io_server", pl, "Dedicate one MPI rank per node as I/O server"))
ps => cfg%bathymetry_file
call g%add(nml_string("bathymetry_file", ps, "NetCDF bathymetry file (empty = flat)"))
ps => cfg%restart_file
call g%add(nml_string("restart_file", ps, "Restart file for warm start (empty = cold)"))
call schema%add_group(g)
end subroutine register_output