diag_var_bytes Function

private pure function diag_var_bytes(this) result(nbytes)

Counted allocatable footprint of ONE registered diagnostic (0 for every buffer that is unallocated).

All four terms are device-mapped by ocean_diag_enter_data_impl and, until this function existed, none of them appeared in any bytes() total — the single largest hole in the startup estimate (~3.2 GB for the default catalog at 1000x800x50, up to ~9.9 GB with the optional diags). Conditionality rides arr_bytes: layer_buffer is allocated only when output_vgrid /= LAYER, accumulator only when time_op /= INSTANT, mask only when a region was supplied at register time.

Type Bound

diag_var_t

Arguments

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

Return Value integer(kind=int64)


Calls

proc~~diag_var_bytes~~CallsGraph proc~diag_var_bytes diag_var_t%diag_var_bytes interface~arr_bytes arr_bytes proc~diag_var_bytes->interface~arr_bytes proc~diag_mask_bytes diag_mask_t%diag_mask_bytes proc~diag_var_bytes->proc~diag_mask_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~diag_mask_bytes->interface~arr_bytes

Called by

proc~~diag_var_bytes~~CalledByGraph proc~diag_var_bytes diag_var_t%diag_var_bytes proc~ocean_diag_bytes ocean_diag_t%ocean_diag_bytes proc~ocean_diag_bytes->proc~diag_var_bytes

Source Code

   pure function diag_var_bytes(this) result(nbytes)
      !! Counted allocatable footprint of ONE registered diagnostic
      !! (0 for every buffer that is unallocated).
      !!
      !! All four terms are device-mapped by `ocean_diag_enter_data_impl`
      !! and, until this function existed, none of them appeared in any
      !! `bytes()` total — the single largest hole in the startup estimate
      !! (~3.2 GB for the default catalog at 1000x800x50, up to ~9.9 GB
      !! with the optional diags).  Conditionality rides `arr_bytes`:
      !! `layer_buffer` is allocated only when `output_vgrid /= LAYER`,
      !! `accumulator` only when `time_op /= INSTANT`, `mask` only when a
      !! region was supplied at register time.
      class(diag_var_t), intent(in) :: this
      integer(int64) :: nbytes
      nbytes = arr_bytes(this%output_buffer) &
               + arr_bytes(this%layer_buffer) &
               + arr_bytes(this%accumulator)
      if (allocated(this%mask)) nbytes = nbytes + this%mask%bytes()
   end function diag_var_bytes