public function diag_xtype_from_name(name) result(xtype)
Map the &ocean_diag_nml output_precision string onto a NetCDF
element type for the diagnostic DATA variables.
"double" (default, or anything empty) => NC_WP — the
working-precision type, i.e. byte-identical to the writer
before this knob existed.
"single" => NC_R4 — halves the bytes written per frame.
The value is validated by the namelist schema, so an unknown
string should never reach here; it is warned about and falls back
to NC_WP (never silently downgrades precision).
This governs the diagnostic stream ONLY. Restart files, gauges,
coastal output and the console conservation totals do not consult
it and cannot be made single precision.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
Source Code
function diag_xtype_from_name(name)result(xtype)!! Map the `&ocean_diag_nml output_precision` string onto a NetCDF!! element type for the diagnostic DATA variables.!!!! * `"double"` (default, or anything empty) => `NC_WP` — the!! working-precision type, i.e. byte-identical to the writer!! before this knob existed.!! * `"single"` => `NC_R4` — halves the bytes written per frame.!!!! The value is validated by the namelist schema, so an unknown!! string should never reach here; it is warned about and falls back!! to `NC_WP` (never silently downgrades precision).!!!! This governs the diagnostic stream ONLY. Restart files, gauges,!! coastal output and the console conservation totals do not consult!! it and cannot be made single precision.character(len=*),intent(in)::nameinteger::xtypeselect case(trim(name))case("","double")xtype=NC_WPcase("single")xtype=NC_R4case defaultcall logger%warning("&ocean_diag_nml output_precision = '"//trim(name)//&"' not recognised; writing double precision")xtype=NC_WPend select end function diag_xtype_from_name