Counted allocatable footprint of the whole ocean god state, summed
from each slot’s own bytes() (each term is 0 when that slot’s
arrays are unallocated, so the DEFAULT-OFF closures gated in
ocean_state_init contribute nothing — the total tracks the
conditional allocation directly). Reported before enter_data and
reconciled against the measured device mapping — a new array added
without a matching bytes() term makes the measured map exceed this
count and self-announces the drift (see rdb_mem_report). Slots with
no allocatables (eos, restart) carry no term. The diag%vars
registry USED to be excluded — it is now counted, per registered
variable, by diag_var_bytes (it was the single largest uncounted
device block: ~3.2 GB for the default catalog at 1000x800x50).
data_input (PR-14) DOES have
allocatables (f0/f1 per registered field) and IS
device-mapped, so it carries a real term below — zero registered
fields on every shipped namelist keeps that term at 0.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_state_t), | intent(in) | :: | this |
pure function ocean_state_bytes(this) result(nbytes) !! Counted allocatable footprint of the whole ocean god state, summed !! from each slot's own `bytes()` (each term is 0 when that slot's !! arrays are unallocated, so the DEFAULT-OFF closures gated in !! `ocean_state_init` contribute nothing — the total tracks the !! conditional allocation directly). Reported before `enter_data` and !! reconciled against the measured device mapping — a new array added !! without a matching `bytes()` term makes the measured map exceed this !! count and self-announces the drift (see rdb_mem_report). Slots with !! no allocatables (eos, restart) carry no term. The `diag%vars` !! registry USED to be excluded — it is now counted, per registered !! variable, by `diag_var_bytes` (it was the single largest uncounted !! device block: ~3.2 GB for the default catalog at 1000x800x50). !! `data_input` (PR-14) DOES have !! allocatables (`f0`/`f1` per registered field) and IS !! device-mapped, so it carries a real term below — zero registered !! fields on every shipped namelist keeps that term at 0. class(ocean_state_t), intent(in) :: this integer(int64) :: nbytes nbytes = this%barotropic%bytes() & + this%metrics%bytes() & + this%dyn%bytes() & + this%continuity%bytes() & + this%coriolis_adv%bytes() & + this%pressure_force%bytes() & + this%vmix%bytes() & + this%wavespeed%bytes() & + this%lateral_mix%bytes() & + this%hvisc%bytes() & + this%bdrag%bytes() & + this%tdrag%bytes() & + this%surface_stress%bytes() & + this%surface_flux%bytes() & + this%cavity_flux%bytes() & + this%vert_advect%bytes() & + this%hdiff_tracer%bytes() & + this%vdiff%bytes() & + this%vcoord%bytes() & + this%diag%bytes() & + this%epbl%bytes() & + this%kshear%bytes() & + this%vmix_tidal%bytes() & + this%slopes%bytes() & + this%mle%bytes() & + this%gm%bytes() & + this%redi%bytes() & + this%varmix%bytes() & + this%meke%bytes() & + this%ice%bytes() & + this%tides%bytes() & + this%p_surf%bytes() & + this%obc%bytes() & + this%bc%bytes() & + this%sponge%bytes() #ifndef RDB_NO_NETCDF nbytes = nbytes + this%data_input%bytes() #endif if (this%use_multilayer) nbytes = nbytes + this%multilayer%bytes() end function ocean_state_bytes