ocean_diag_nc_stream_t Derived Type

type, public :: ocean_diag_nc_stream_t

NetCDF output stream state. Carried inline on ocean_diag_t so the diag module stays NetCDF-free (no use netcdf here); the actual file operations live in rdb_ocean_diag_netcdf which manipulates these fields.


Inherited by

type~~ocean_diag_nc_stream_t~~InheritedByGraph type~ocean_diag_nc_stream_t ocean_diag_nc_stream_t type~ocean_diag_t ocean_diag_t type~ocean_diag_t->type~ocean_diag_nc_stream_t nc_stream type~ocean_state_t ocean_state_t type~ocean_state_t->type~ocean_diag_t diag type~ocean_engine_t ocean_engine_t type~ocean_engine_t->type~ocean_state_t state type~ocean_handle_t ocean_handle_t type~ocean_handle_t->type~ocean_state_t state type~ocean_handle_t->type~ocean_engine_t engine

Components

Type Visibility Attributes Name Initial
character(len=256), public :: filename = ""
logical, public :: is_open = .false.
integer, public :: ncid = -1
real(kind=real32), public, allocatable :: stage(:,:,:)

Host staging buffer for the fp64 -> fp32 conversion done immediately before nf90_put_var. Allocated by open_stream ONLY when xtype == NC_R4, sized to the largest registered variable’s output_buffer; unallocated (zero cost) on the default double-precision path.

integer, public :: x_dimid = -1
integer, public :: xtype = -1

Resolved NetCDF element type for the DATA variables of this stream (NC_WP / NC_R4 — see rdb_io_netcdf). -1 = unset; open_stream resolves it from &ocean_diag_nml output_precision (“double”, the default, => NC_WP => byte-identical output). Held as a bare integer so this module stays NetCDF-free; only rdb_ocean_diag_netcdf interprets it.

Scope note: this governs the DIAGNOSTIC stream only. Restarts, gauges, coastal output, console conservation totals and checksums are unconditionally NC_WP/wp — there is deliberately no knob that can make a restart lossy.

integer, public :: y_dimid = -1

Source Code

   type :: ocean_diag_nc_stream_t
      !! NetCDF output stream state.  Carried inline on `ocean_diag_t`
      !! so the diag module stays NetCDF-free (no `use netcdf` here);
      !! the actual file operations live in `rdb_ocean_diag_netcdf`
      !! which manipulates these fields.
      logical :: is_open = .false.
      integer :: ncid = -1
      character(len=256) :: filename = ""
      integer :: x_dimid = -1
      integer :: y_dimid = -1
      integer :: xtype = -1
         !! Resolved NetCDF element type for the DATA variables of this
         !! stream (`NC_WP` / `NC_R4` — see `rdb_io_netcdf`).  `-1` = unset;
         !! `open_stream` resolves it from `&ocean_diag_nml
         !! output_precision` ("double", the default, => `NC_WP` =>
         !! byte-identical output).  Held as a bare integer so this module
         !! stays NetCDF-free; only `rdb_ocean_diag_netcdf` interprets it.
         !!
         !! Scope note: this governs the DIAGNOSTIC stream only.  Restarts,
         !! gauges, coastal output, console conservation totals and
         !! checksums are unconditionally `NC_WP`/`wp` — there is
         !! deliberately no knob that can make a restart lossy.
      real(real32), allocatable :: stage(:, :, :)
         !! Host staging buffer for the fp64 -> fp32 conversion done
         !! immediately before `nf90_put_var`.  Allocated by `open_stream`
         !! ONLY when `xtype == NC_R4`, sized to the largest registered
         !! variable's `output_buffer`; unallocated (zero cost) on the
         !! default double-precision path.
   end type ocean_diag_nc_stream_t