Counted allocatable footprint of the ocean C-grid layer slot: the layer prognostics + face transports + RK2 saves + density/vertical diagnostics, the per-tracer registry (each tracer sums its own arrays; ideal-age rides the registry when on), and the device-resident conservation-budget accumulators.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multilayer_state_t), | intent(in) | :: | this |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | it |
pure function multilayer_state_bytes(this) result(nbytes) !! Counted allocatable footprint of the ocean C-grid layer slot: the !! layer prognostics + face transports + RK2 saves + density/vertical !! diagnostics, the per-tracer registry (each tracer sums its own !! arrays; ideal-age rides the registry when on), and the !! device-resident conservation-budget accumulators. class(multilayer_state_t), intent(in) :: this integer(int64) :: nbytes integer :: it nbytes = arr_bytes(this%h_layer) + arr_bytes(this%h_layer0) & + arr_bytes(this%u_face_x_layer) + arr_bytes(this%hu_face_x_layer) & + arr_bytes(this%v_face_y_layer) + arr_bytes(this%hv_face_y_layer) & + arr_bytes(this%u_face_x_layer0) + arr_bytes(this%v_face_y_layer0) & + arr_bytes(this%u_av_layer) + arr_bytes(this%v_av_layer) & + arr_bytes(this%h_av_layer) & + arr_bytes(this%mass_flux_x_layer) + arr_bytes(this%mass_flux_y_layer) & + arr_bytes(this%flux_h_layer) + arr_bytes(this%rho_layer) & + arr_bytes(this%p_top) & + arr_bytes(this%w_interface) + arr_bytes(this%wet_mask) & + arr_bytes(this%k_top) + arr_bytes(this%k_top_u) & + arr_bytes(this%k_top_v) & + arr_bytes(this%k_bot) + arr_bytes(this%k_bot_u) & + arr_bytes(this%k_bot_v) & + arr_bytes(this%mass_budget_continuity) & + arr_bytes(this%heat_budget_surface) + arr_bytes(this%salt_budget_surface) & + arr_bytes(this%heat_budget_geothermal) & + arr_bytes(this%heat_budget_sponge) + arr_bytes(this%salt_budget_sponge) & + arr_bytes(this%heat_budget_vert_adv) + arr_bytes(this%salt_budget_vert_adv) & + arr_bytes(this%heat_budget_vdiff) + arr_bytes(this%salt_budget_vdiff) & + arr_bytes(this%heat_budget_hdiff) + arr_bytes(this%salt_budget_hdiff) & + arr_bytes(this%heat_budget_horiz_adv) + arr_bytes(this%salt_budget_horiz_adv) & + arr_bytes(this%mass_budget_remap) & + arr_bytes(this%heat_budget_remap) + arr_bytes(this%salt_budget_remap) if (allocated(this%tracers)) then do it = 1, size(this%tracers) nbytes = nbytes + this%tracers(it)%bytes() end do end if end function multilayer_state_bytes