ocean_dyn_bytes Function

private pure function ocean_dyn_bytes(this) result(nbytes)

Counted allocatable footprint of the split-RK2 driver (BT work state + wide-halo shadow state) slot (0 when unallocated).

Type Bound

ocean_dyn_t

Arguments

Type IntentOptional Attributes Name
class(ocean_dyn_t), intent(in) :: this

Return Value integer(kind=int64)


Calls

proc~~ocean_dyn_bytes~~CallsGraph proc~ocean_dyn_bytes ocean_dyn_t%ocean_dyn_bytes interface~arr_bytes arr_bytes proc~ocean_dyn_bytes->interface~arr_bytes proc~barotropic_workstate_bytes barotropic_workstate_t%barotropic_workstate_bytes proc~ocean_dyn_bytes->proc~barotropic_workstate_bytes proc~arr_bytes_i1 arr_bytes_i1 interface~arr_bytes->proc~arr_bytes_i1 proc~arr_bytes_i2 arr_bytes_i2 interface~arr_bytes->proc~arr_bytes_i2 proc~arr_bytes_i3 arr_bytes_i3 interface~arr_bytes->proc~arr_bytes_i3 proc~arr_bytes_l1 arr_bytes_l1 interface~arr_bytes->proc~arr_bytes_l1 proc~arr_bytes_l2 arr_bytes_l2 interface~arr_bytes->proc~arr_bytes_l2 proc~arr_bytes_l3 arr_bytes_l3 interface~arr_bytes->proc~arr_bytes_l3 proc~arr_bytes_r1 arr_bytes_r1 interface~arr_bytes->proc~arr_bytes_r1 proc~arr_bytes_r2 arr_bytes_r2 interface~arr_bytes->proc~arr_bytes_r2 proc~arr_bytes_r3 arr_bytes_r3 interface~arr_bytes->proc~arr_bytes_r3 proc~arr_bytes_r4 arr_bytes_r4 interface~arr_bytes->proc~arr_bytes_r4 proc~barotropic_workstate_bytes->interface~arr_bytes

Source Code

   pure function ocean_dyn_bytes(this) result(nbytes)
      !! Counted allocatable footprint of the split-RK2 driver (BT work state
      !! + wide-halo shadow state) slot (0 when unallocated).
      class(ocean_dyn_t), intent(in) :: this
      integer(int64) :: nbytes
      nbytes = this%bt_work%bytes()
      ! accel_visc_rem stage-entry snapshots (allocated at setup when the
      ! knob is on; 0 on the default-off path where they stay unallocated).
      nbytes = nbytes + arr_bytes(this%avr_u0) + arr_bytes(this%avr_v0)
      ! Wide-halo BT march-in shadow state (`&ocean_bt_nml bt_halo > 0`).
      ! Allocated + device-mapped by `ocean_dyn_enable_bt_wide`, which the
      ! driver runs AFTER `ocean_state_enter_data`; the driver therefore
      ! latches `mem_set_counted_budget` after that call so this term is in
      ! the snapshot.  Unallocated at bt_halo = 0 ⇒ 0.
      if (allocated(this%bt_wide)) nbytes = nbytes + this%bt_wide%bytes()
   end function ocean_dyn_bytes