Generic, decomposition-aware, device-resident reader for
time-varying NetCDF fields field(x, y[, z], t). Owns the file
handles, the time axis, the bracket bookkeeping, the H->D motion
(only when the bracket advances), and the per-step linear-in-time
blend kernel. Owns NO field names and NO state-slot mapping: a
consumer registers its own (file, variable, destination) triple
via ocean_data_input_register_2d/_3d (or the edge-segment
variants for OBC files) and gets back an opaque id.
The binding seam (see PLAN_PR14_netcdf_input_reader.md §13):
(dest_i0, dest_j0). Passing a section into an explicit-shape
dummy would trigger a host copy-in/out and silently detach
from the device map — never do that.&ocean_data_nml carries no per-field entries — only
max_fields/verbose. Each consumer defines its own file/
variable keys in its own namelist group.DATA_OOR_ERROR);
DATA_OOR_CLAMP is opt-in per field.DATA_TIME_CYCLIC
wraps a climatology through an explicit period; DATA_TIME_STATIC
reads record 1 once and never touches the file again.t — no reader-side
restart state. A resumed run reproduces every field
bit-for-bit from t_current alone.ocean_data_input_update_all(this, t) refreshes every
registered field’s bracket (+ pushes any new slab to the
device) and is the driver’s one-line per-step hook — a no-op
when nfields == 0 (every shipped namelist today). It does
NOT write into any consumer array (the reader stores the
registration-time dest shape as metadata only, never a
pointer). Each consumer then calls update_2d/_3d with its
OWN array at its own point in the step, and that call is
checked against the t update_all most recently refreshed
with — calling update_2d/_3d before update_all has run
this step’s t is a fail-loud ordering bug, not a silent
stale read.ocean_data_input_fill_static_host is a one-shot HOST-side
fill for DATA_TIME_STATIC fields, legal at SETUP time before
the destination is device-mapped (PR-24 ice IC, PR-30 tidal
maps). Touches no device memory; fails loud on a non-static
field.Storage order: files must be FORTRAN-ordered (x, y[, z], t) —
v1 detects a horizontal-dimension mismatch and aborts rather than
silently transposing (a transposed field is exactly the class of
bug the analytical tests are built to catch); regrid/reorder the
file if this trips.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public, | parameter | :: | DATA_EDGE_EAST | = | 2 | |
| integer, | public, | parameter | :: | DATA_EDGE_NORTH | = | 4 | |
| integer, | public, | parameter | :: | DATA_EDGE_SOUTH | = | 3 | |
| integer, | public, | parameter | :: | DATA_EDGE_WEST | = | 1 | |
| integer, | public, | parameter | :: | DATA_OOR_CLAMP | = | 2 | |
| integer, | public, | parameter | :: | DATA_OOR_ERROR | = | 1 | |
| integer, | public, | parameter | :: | DATA_TIME_CYCLIC | = | 2 | |
| integer, | public, | parameter | :: | DATA_TIME_LINEAR | = | 1 | |
| integer, | public, | parameter | :: | DATA_TIME_STATIC | = | 3 | |
| real(kind=wp), | private, | allocatable | :: | data_input_ws(:,:,:) |
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.
| 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 |
||
| real(kind=wp), | public, | allocatable | :: | f1(:,:,:) |
Bracketing records, shape |
||
| 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 |
||
| real(kind=wp), | public | :: | t_last | = | -huge(1.0_wp) |
Model time |
|
| 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: |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(data_input_field_t), | public, | allocatable | :: | fields(:) | |||
| logical, | public | :: | is_init | = | .false. | ||
| integer, | public | :: | nfields | = | 0 | ||
| integer, | public | :: | nfields_max | = | 0 | ||
| logical, | public | :: | verbose | = | .false. |
| procedure, public, non_overridable :: bytes => ocean_data_input_bytes | |
| procedure, public, non_overridable :: destroy => ocean_data_input_destroy | |
| procedure, public, non_overridable :: enter_data => ocean_data_input_enter_data | |
| procedure, public, non_overridable :: exit_data => ocean_data_input_exit_data | |
| procedure, public, non_overridable :: init => ocean_data_input_init |
Self-contained, non-erroring dimension validator — the
single-rank (i_offset_global = j_offset_global = 0) testable
twin of register_common’s inline checks; mirrors
zinit_dims_ok. Opens filename, inspects var’s rank and
lengths, and returns .false. on any mismatch, missing
variable, or I/O error — NEVER aborts, so test code can probe
the false branch without a subprocess/death-test harness (the
house convention — see zinit_dims_ok).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | filename | |||
| character(len=*), | intent(in) | :: | var | |||
| integer, | intent(in) | :: | nx_phys | |||
| integer, | intent(in) | :: | ny_phys | |||
| logical, | intent(in) | :: | is_3d | |||
| integer, | intent(in), | optional | :: | nz_src |
Translate a namelist/registration-time string into a
DATA_TIME_* code. Fail-loud on anything not covered by
data_input_time_mode_is_implemented — an unrecognised tag
must never silently fall back to a default mode.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | tag |
.true. iff tag (case-insensitive) names a shipped time mode.
Drives the fail-loud dispatch in data_input_time_mode_from_string
— house idiom, see lateral_closure_is_implemented.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | tag |
Low-level geometry check used inline by register_common:
.true. iff the variable has the expected rank and its two
validated-length dims are each at least as long as required
(decomposition-safe: a subdomain slab only needs offset+extent
to fit, not to equal the file’s global length). Never aborts.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | nd | |||
| integer, | intent(in) | :: | expect_nd | |||
| integer, | intent(in) | :: | d_horiz1 | |||
| integer, | intent(in) | :: | d_horiz2 | |||
| integer, | intent(in) | :: | expect1 | |||
| integer, | intent(in) | :: | expect2 |
Counted allocatable footprint (0 when unallocated). Summed over
every registered field’s f0/f1 — the t_axis is small
(nt reals) and intentionally excluded, matching the house
convention of counting device-resident footprint only.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_data_input_t), | intent(in) | :: | this |
Translate a raw nc_check-style status (0 = ok) from one of the
nc_* reader calls in register_common into the caller’s ierr
contract: .true. on success; on failure, .false. with
ierr = OCEAN_STATUS_ERR_IO when ierr is present (closing
ncid first, when given, so a mid-registration failure does not
leak the file handle), or error stops with a generic message
when ierr is absent — the SPECIFIC reason was already logged by
nc_check/fail before this returns, so the legacy (no ierr)
log output is unchanged; only the raw error stop text is
generic (same idiom as rdb_bathymetry::bathy_io_ok, P0.1 F1/F2).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | local_ierr | |||
| integer, | intent(out), | optional | :: | ierr | ||
| integer, | intent(in), | optional | :: | ncid |
Bracket search + blend weight for a query time t (already in
file-time units/offset — the caller applies t_offset/t_scale
before calling). nt == 1 is degenerate: always returns
n0 = n1 = 1, w = 0, never out of range.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | t_axis(nt) | |||
| integer, | intent(in) | :: | nt | |||
| integer, | intent(in) | :: | mode | |||
| real(kind=wp), | intent(in) | :: | cycle_period | |||
| real(kind=wp), | intent(in) | :: | t | |||
| integer, | intent(out) | :: | n0 | |||
| integer, | intent(out) | :: | n1 | |||
| real(kind=wp), | intent(out) | :: | w | |||
| logical, | intent(out) | :: | out_of_range |
CF units attribute (“seconds since …”, “hours since …”, …)
-> a multiplier converting the raw file time axis to seconds.
Only the leading unit word matters (no calendar, no reference
date — see module docstring). ok = .false. for an
unrecognised leading word; caller decides the fallback.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | units | |||
| real(kind=wp), | intent(out) | :: | scale | |||
| logical, | intent(out) | :: | ok |
One-shot HOST-side fill of a DATA_TIME_STATIC field. Copies
the already-read record-1 slab into dest at the
registration-time offsets. Touches NO device memory —
callable at setup, before dest is mapped. Plain host do
loops (NOT do concurrent — on -stdpar=gpu a bare do
concurrent is unconditionally offloaded regardless of whether
dest is mapped, which is exactly the silent-stale-write bug
this routine exists to avoid). Fails loud for any non-static
field.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_data_input_t), | intent(in) | :: | this | |||
| integer, | intent(in) | :: | id | |||
| integer, | intent(in) | :: | n1 | |||
| integer, | intent(in) | :: | n2 | |||
| real(kind=wp), | intent(inout) | :: | dest(n1,n2) |
3-D twin of fill_static_host.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_data_input_t), | intent(in) | :: | this | |||
| integer, | intent(in) | :: | id | |||
| integer, | intent(in) | :: | n1 | |||
| integer, | intent(in) | :: | n2 | |||
| integer, | intent(in) | :: | n3 | |||
| real(kind=wp), | intent(inout) | :: | dest(n1,n2,n3) |
One-shot STATIC 2-D read: register, fill, close. The setup-time
convenience wrapper over register_2d(time_mode="static") +
fill_static_host for a field that is read ONCE and never
updated — a prescribed, time-constant geometry rather than a
forcing. &ocean_cavity_dyn_nml draft_config="file" is the
first consumer.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | file | |||
| character(len=*), | intent(in) | :: | var | |||
| type(hgrid_t), | intent(in) | :: | grid | |||
| integer, | intent(in) | :: | n1 |
Shape of |
||
| integer, | intent(in) | :: | n2 |
Shape of |
||
| integer, | intent(in) | :: | dest_i0 |
Destination index of the first PHYSICAL cell ( |
||
| integer, | intent(in) | :: | dest_j0 |
Destination index of the first PHYSICAL cell ( |
||
| real(kind=wp), | intent(inout) | :: | dest(n1,n2) | |||
| integer, | intent(out), | optional | :: | ierr |
Non-zero on a registry / file / dimension failure when
present; absent behaves as the rest of the reader
( |
Register a 2-D time-varying field f(x, y, t). Opens the file
now and keeps the handle for the run. See the module docstring
for the destination-offset contract.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_data_input_t), | intent(inout) | :: | this | |||
| character(len=*), | intent(in) | :: | file | |||
| character(len=*), | intent(in) | :: | var | |||
| type(hgrid_t), | intent(in) | :: | grid | |||
| integer, | intent(in) | :: | dest_n1 | |||
| integer, | intent(in) | :: | dest_n2 | |||
| integer, | intent(in) | :: | dest_i0 | |||
| integer, | intent(in) | :: | dest_j0 | |||
| integer, | intent(out) | :: | id | |||
| character(len=*), | intent(in), | optional | :: | time_mode | ||
| real(kind=wp), | intent(in), | optional | :: | cycle_period | ||
| real(kind=wp), | intent(in), | optional | :: | t_offset | ||
| real(kind=wp), | intent(in), | optional | :: | t_scale | ||
| real(kind=wp), | intent(in), | optional | :: | scale | ||
| real(kind=wp), | intent(in), | optional | :: | add_offset | ||
| integer, | intent(in), | optional | :: | oor | ||
| integer, | intent(in), | optional | :: | nx_extra | ||
| integer, | intent(in), | optional | :: | ny_extra | ||
| integer, | intent(out), | optional | :: | ierr |
Non-zero ( |
Register a 3-D time-varying field f(x, y, z, t). nz_src is
the source z-level count (the consumer’s own concern — the
reader validates it against the file’s z dim and does NOT flip
or remap k; see the module docstring).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_data_input_t), | intent(inout) | :: | this | |||
| character(len=*), | intent(in) | :: | file | |||
| character(len=*), | intent(in) | :: | var | |||
| type(hgrid_t), | intent(in) | :: | grid | |||
| integer, | intent(in) | :: | nz_src | |||
| integer, | intent(in) | :: | dest_n1 | |||
| integer, | intent(in) | :: | dest_n2 | |||
| integer, | intent(in) | :: | dest_n3 | |||
| integer, | intent(in) | :: | dest_i0 | |||
| integer, | intent(in) | :: | dest_j0 | |||
| integer, | intent(out) | :: | id | |||
| character(len=*), | intent(in), | optional | :: | time_mode | ||
| real(kind=wp), | intent(in), | optional | :: | cycle_period | ||
| real(kind=wp), | intent(in), | optional | :: | t_offset | ||
| real(kind=wp), | intent(in), | optional | :: | t_scale | ||
| real(kind=wp), | intent(in), | optional | :: | scale | ||
| real(kind=wp), | intent(in), | optional | :: | add_offset | ||
| integer, | intent(in), | optional | :: | oor | ||
| integer, | intent(out), | optional | :: | ierr |
Register a 2-D OBC-segment field. The degenerate horizontal
axis (x for west/east, y for south/north) reads as start=1,
count=1; the along-edge axis slices from the global index
range exactly as register_2d does. dest_i0/dest_j0 are
implied by edge (degenerate axis -> index 1; along-edge axis
-> grid%nghost + 1) — not arguments (see module docstring).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_data_input_t), | intent(inout) | :: | this | |||
| character(len=*), | intent(in) | :: | file | |||
| character(len=*), | intent(in) | :: | var | |||
| type(hgrid_t), | intent(in) | :: | grid | |||
| integer, | intent(in) | :: | edge | |||
| integer, | intent(in) | :: | dest_n1 | |||
| integer, | intent(in) | :: | dest_n2 | |||
| integer, | intent(out) | :: | id | |||
| character(len=*), | intent(in), | optional | :: | time_mode | ||
| real(kind=wp), | intent(in), | optional | :: | cycle_period | ||
| real(kind=wp), | intent(in), | optional | :: | t_offset | ||
| real(kind=wp), | intent(in), | optional | :: | t_scale | ||
| real(kind=wp), | intent(in), | optional | :: | scale | ||
| real(kind=wp), | intent(in), | optional | :: | add_offset | ||
| integer, | intent(in), | optional | :: | oor | ||
| integer, | intent(out), | optional | :: | ierr |
3-D twin of register_segment_2d (PR-22 OBC segment files).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_data_input_t), | intent(inout) | :: | this | |||
| character(len=*), | intent(in) | :: | file | |||
| character(len=*), | intent(in) | :: | var | |||
| type(hgrid_t), | intent(in) | :: | grid | |||
| integer, | intent(in) | :: | edge | |||
| integer, | intent(in) | :: | nz_src | |||
| integer, | intent(in) | :: | dest_n1 | |||
| integer, | intent(in) | :: | dest_n2 | |||
| integer, | intent(in) | :: | dest_n3 | |||
| integer, | intent(out) | :: | id | |||
| character(len=*), | intent(in), | optional | :: | time_mode | ||
| real(kind=wp), | intent(in), | optional | :: | cycle_period | ||
| real(kind=wp), | intent(in), | optional | :: | t_offset | ||
| real(kind=wp), | intent(in), | optional | :: | t_scale | ||
| real(kind=wp), | intent(in), | optional | :: | scale | ||
| real(kind=wp), | intent(in), | optional | :: | add_offset | ||
| integer, | intent(in), | optional | :: | oor | ||
| integer, | intent(out), | optional | :: | ierr |
Blend field id’s current bracket into the caller’s WHOLE,
device-mapped dest(n1, n2) array at the registration-time
offset. t must equal the value update_all most recently
refreshed this field with (fail-loud ordering check — a
consumer calling this before update_all has run for the
current step is a real bug, not a silent stale read). Exempt
for DATA_TIME_STATIC fields, whose bracket never changes.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_data_input_t), | intent(in) | :: | this | |||
| integer, | intent(in) | :: | id | |||
| real(kind=wp), | intent(in) | :: | t | |||
| integer, | intent(in) | :: | n1 | |||
| integer, | intent(in) | :: | n2 | |||
| real(kind=wp), | intent(inout) | :: | dest(n1,n2) |
3-D twin of update_2d.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_data_input_t), | intent(in) | :: | this | |||
| integer, | intent(in) | :: | id | |||
| real(kind=wp), | intent(in) | :: | t | |||
| integer, | intent(in) | :: | n1 | |||
| integer, | intent(in) | :: | n2 | |||
| integer, | intent(in) | :: | n3 | |||
| real(kind=wp), | intent(inout) | :: | dest(n1,n2,n3) |
Driver hook: refresh every registered field’s bracket for model
time t (reading + pushing a new slab to the device only when
the bracket actually advances). No-op when nfields == 0 —
every shipped namelist today. Does NOT write into any
consumer array (see module docstring) — call update_2d/_3d
afterwards for that.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_data_input_t), | intent(inout) | :: | this | |||
| real(kind=wp), | intent(in) | :: | t |
Ordering guard: update_2d/_3d must be called with the same
t update_all most recently refreshed this field’s bracket
with (skipped for STATIC — its bracket never changes, so
“freshness” is meaningless). Catches a consumer calling
update_2d/_3d before update_all has run this step, which
would otherwise silently blend a stale bracket.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_data_input_t), | intent(in) | :: | this | |||
| integer, | intent(in) | :: | id | |||
| real(kind=wp), | intent(in) | :: | t |
Fail-loud guard shared by every per-step/fill accessor: id
must name an active field of the right rank, and the caller’s
dest shape must match what was declared at registration.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_data_input_t), | intent(in) | :: | this | |||
| integer, | intent(in) | :: | id | |||
| logical, | intent(in) | :: | is_3d | |||
| integer, | intent(in) | :: | n1 | |||
| integer, | intent(in) | :: | n2 | |||
| integer, | intent(in), | optional | :: | n3 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | nxs | |||
| integer, | intent(in) | :: | nys | |||
| integer, | intent(in) | :: | dn1 | |||
| integer, | intent(in) | :: | dn2 | |||
| integer, | intent(in) | :: | i0 | |||
| integer, | intent(in) | :: | j0 | |||
| real(kind=wp), | intent(in) | :: | f0(nxs,nys) | |||
| real(kind=wp), | intent(in) | :: | f1(nxs,nys) | |||
| real(kind=wp), | intent(in) | :: | w | |||
| real(kind=wp), | intent(inout) | :: | dest(dn1,dn2) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | nxs | |||
| integer, | intent(in) | :: | nys | |||
| integer, | intent(in) | :: | nzs | |||
| integer, | intent(in) | :: | dn1 | |||
| integer, | intent(in) | :: | dn2 | |||
| integer, | intent(in) | :: | dn3 | |||
| integer, | intent(in) | :: | i0 | |||
| integer, | intent(in) | :: | j0 | |||
| real(kind=wp), | intent(in) | :: | f0(nxs,nys,nzs) | |||
| real(kind=wp), | intent(in) | :: | f1(nxs,nys,nzs) | |||
| real(kind=wp), | intent(in) | :: | w | |||
| real(kind=wp), | intent(inout) | :: | dest(dn1,dn2,dn3) |
Host-ONLY NetCDF slab read for file record rec -> fld%f0
(default) or fld%f1 (into_f1 = .true.), applying
scale/add_offset once at read. Uses the module-level host
workspace (registration/bracket-advance-time only — never a
per-step allocation). Deliberately carries NO !$acc directive:
called both before enter_data (STATIC field, at registration)
and after it (LINEAR/CYCLIC bracket advance) — the caller pushes
to the device itself, only when that is actually correct
(data_input_refresh_brackets).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(data_input_field_t), | intent(inout) | :: | fld | |||
| integer, | intent(in) | :: | rec | |||
| logical, | intent(in), | optional | :: | into_f1 |
Host-side registry walk (outer shim) for field id.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_data_input_t), | intent(inout) | :: | this | |||
| integer, | intent(in) | :: | id | |||
| real(kind=wp), | intent(in) | :: | t |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | nx | |||
| integer, | intent(in) | :: | ny | |||
| integer, | intent(in) | :: | nz |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_data_input_t), | intent(inout) | :: | this |
Type-bound wrapper — delegates to the non-polymorphic impl (the
AMD libomptarget cross-slot-overlap fix; see
rdb_ocean_surface_stress.F90).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_data_input_t), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(ocean_data_input_t), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_data_input_t), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(ocean_data_input_t), | intent(inout) | :: | this |
Allocate the field registry. cfg optional so ocean_state_init
(which many tests call directly with no config_t in hand) can
construct a default-sized (16 slots, quiet) reader identically to
the scaffold it replaces; ocean_state_init_from_config re-calls
this with the real cfg%ocean%data once cfg is available —
safe because nothing is registered between the two calls.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_data_input_t), | intent(inout) | :: | this | |||
| type(ocean_data_config_t), | intent(in), | optional | :: | cfg |
Shared registration body for register_2d/_3d/_segment_2d/_segment_3d.
(i0, j0, nx, ny, nz) are FILE-side start/count (already resolved
by the caller — plain global-offset slicing for the base
variants, degenerate-axis geometry for the segment variants).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_data_input_t), | intent(inout) | :: | this | |||
| character(len=*), | intent(in) | :: | file | |||
| character(len=*), | intent(in) | :: | var | |||
| logical, | intent(in) | :: | is_3d | |||
| integer, | intent(in) | :: | i0 | |||
| integer, | intent(in) | :: | j0 | |||
| integer, | intent(in) | :: | nx | |||
| integer, | intent(in) | :: | ny | |||
| integer, | intent(in) | :: | nz | |||
| integer, | intent(in) | :: | dest_i0 | |||
| integer, | intent(in) | :: | dest_j0 | |||
| integer, | intent(in) | :: | dest_n1 | |||
| integer, | intent(in) | :: | dest_n2 | |||
| integer, | intent(in) | :: | dest_n3 | |||
| character(len=*), | intent(in), | optional | :: | time_mode | ||
| real(kind=wp), | intent(in), | optional | :: | cycle_period | ||
| real(kind=wp), | intent(in), | optional | :: | t_offset | ||
| real(kind=wp), | intent(in), | optional | :: | t_scale | ||
| real(kind=wp), | intent(in), | optional | :: | scale | ||
| real(kind=wp), | intent(in), | optional | :: | add_offset | ||
| integer, | intent(in), | optional | :: | oor | ||
| integer, | intent(out) | :: | id | |||
| integer, | intent(in), | optional | :: | edge | ||
| integer, | intent(out), | optional | :: | ierr |
Non-zero ( |
Look up the time coordinate variable by the CF convention (dim
name == var name); fall back to a variable literally named
“time”. status is nf90_noerr iff found.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | ncid | |||
| integer, | intent(in) | :: | tdimid | |||
| integer, | intent(out) | :: | tvarid | |||
| integer, | intent(out) | :: | status |
Degenerate-axis + along-edge slab geometry for an OBC-segment
registration. i0/j0/nx/ny are FILE-side (start, count);
dest_i0/dest_j0 are where the slab lands in the consumer’s
staging array.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(hgrid_t), | intent(in) | :: | grid | |||
| integer, | intent(in) | :: | edge | |||
| integer, | intent(out) | :: | i0 | |||
| integer, | intent(out) | :: | j0 | |||
| integer, | intent(out) | :: | nx | |||
| integer, | intent(out) | :: | ny | |||
| integer, | intent(out) | :: | dest_i0 | |||
| integer, | intent(out) | :: | dest_j0 | |||
| integer, | intent(out), | optional | :: | ierr |
Non-zero ( |