data_input_field_t Derived Type

type, public :: data_input_field_t

One registered (file, variable, destination-shape) triple. Array-of-derived-type element — NEVER dereference this from inside a do concurrent/device-kernel body (outer-shim + flat-impl rule); every place this type is touched below is a host-side registry walk that hands plain explicit-shape arrays to a pure flat-impl kernel.


Inherited by

type~~data_input_field_t~~InheritedByGraph type~data_input_field_t data_input_field_t type~ocean_data_input_t ocean_data_input_t type~ocean_data_input_t->type~data_input_field_t fields type~ocean_state_t ocean_state_t type~ocean_state_t->type~ocean_data_input_t data_input 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
logical, public :: active = .false.
real(kind=wp), public :: add_offset = 0.0_wp
real(kind=wp), public :: cycle_period = 0.0_wp
integer, public :: dest_i0 = 1
integer, public :: dest_j0 = 1
integer, public :: dest_n1 = 0
integer, public :: dest_n2 = 0
integer, public :: dest_n3 = 1
real(kind=wp), public, allocatable :: f0(:,:,:)

Bracketing records, shape (nx, ny, nz). Device-mapped by ocean_data_input_t%enter_data.

real(kind=wp), public, allocatable :: f1(:,:,:)

Bracketing records, shape (nx, ny, nz). Device-mapped by ocean_data_input_t%enter_data.

integer, public :: i0 = 1
logical, public :: is_3d = .false.
integer, public :: j0 = 1
integer, public :: ncid = -1
integer, public :: nreads = 0

Slab-read counter (test hook — T4 asserts exactly one read for a STATIC field’s whole run).

integer, public :: nt = 0
integer, public :: nx = 0
integer, public :: ny = 0
integer, public :: nz = 1
integer, public :: oor = DATA_OOR_ERROR
logical, public :: oor_warned = .false.
integer, public :: rec0 = -1

Currently-loaded record indices (1-based file record numbers); -1 = nothing loaded yet.

integer, public :: rec1 = -1

Currently-loaded record indices (1-based file record numbers); -1 = nothing loaded yet.

real(kind=wp), public :: scale = 1.0_wp
real(kind=wp), public, allocatable :: t_axis(:)

File time axis, converted to seconds (scale + t_offset NOT applied here — t_offset is applied to the QUERY time, not the axis; see data_input_refresh_brackets).

real(kind=wp), public :: t_last = -huge(1.0_wp)

Model time update_all most recently refreshed this field at. update_2d/_3d asserts the caller’s t matches (fail loud on an ordering bug — see module docstring). Ignored for DATA_TIME_STATIC (never refreshed after registration).

real(kind=wp), public :: t_offset = 0.0_wp
integer, public :: time_mode = DATA_TIME_LINEAR
integer, public :: varid = -1
real(kind=wp), public :: w = 0.0_wp

Current blend weight: f = (1-w)*f0 + w*f1.


Source Code

   type :: data_input_field_t
      !! One registered `(file, variable, destination-shape)` triple.
      !! Array-of-derived-type element — NEVER dereference this from
      !! inside a `do concurrent`/device-kernel body (outer-shim +
      !! flat-impl rule); every place this type is touched below is a
      !! host-side registry walk that hands plain explicit-shape arrays
      !! to a `pure` flat-impl kernel.
      logical :: active = .false.
      integer :: ncid = -1
      integer :: varid = -1
      logical :: is_3d = .false.
      integer :: time_mode = DATA_TIME_LINEAR
      integer :: oor = DATA_OOR_ERROR
      logical :: oor_warned = .false.

      ! Source-slab extents (this rank's own subdomain slab, source-k
      ! order, source-z count for a 3-D field, else 1).
      integer :: nx = 0, ny = 0, nz = 1
      ! File-side 1-based start offsets for THIS rank's horizontal slab.
      integer :: i0 = 1, j0 = 1
      ! Where the slab lands in the consumer's `dest` array.
      integer :: dest_i0 = 1, dest_j0 = 1
      ! Shape metadata of the consumer's `dest` — validated, not stored
      ! as a pointer (see module docstring).
      integer :: dest_n1 = 0, dest_n2 = 0, dest_n3 = 1

      real(wp) :: scale = 1.0_wp
      real(wp) :: add_offset = 0.0_wp
      real(wp) :: t_offset = 0.0_wp
      real(wp) :: cycle_period = 0.0_wp

      integer :: nt = 0
      real(wp), allocatable :: t_axis(:)
         !! File time axis, converted to seconds (scale + t_offset NOT
         !! applied here — t_offset is applied to the QUERY time, not
         !! the axis; see `data_input_refresh_brackets`).

      real(wp), allocatable :: f0(:, :, :), f1(:, :, :)
         !! Bracketing records, shape `(nx, ny, nz)`.  Device-mapped by
         !! `ocean_data_input_t%enter_data`.
      integer :: rec0 = -1, rec1 = -1
         !! Currently-loaded record indices (1-based file record
         !! numbers); -1 = nothing loaded yet.
      real(wp) :: w = 0.0_wp
         !! Current blend weight: `f = (1-w)*f0 + w*f1`.
      real(wp) :: t_last = -huge(1.0_wp)
         !! Model time `update_all` most recently refreshed this field
         !! at.  `update_2d/_3d` asserts the caller's `t` matches (fail
         !! loud on an ordering bug — see module docstring).  Ignored
         !! for `DATA_TIME_STATIC` (never refreshed after registration).
      integer :: nreads = 0
         !! Slab-read counter (test hook — T4 asserts exactly one read
         !! for a STATIC field's whole run).
   end type data_input_field_t