ocean_diag_init Subroutine

private subroutine ocean_diag_init(this, grid)

Allocate an empty registry sized at INITIAL_CAPACITY slots. Subsequent register calls grow the array via doubling.

Type Bound

ocean_diag_t

Arguments

Type IntentOptional Attributes Name
class(ocean_diag_t), intent(inout) :: this
type(hgrid_t), intent(in) :: grid

Source Code

   subroutine ocean_diag_init(this, grid)
      !! Allocate an empty registry sized at `INITIAL_CAPACITY` slots.
      !! Subsequent `register` calls grow the array via doubling.
      class(ocean_diag_t), intent(inout) :: this
      type(hgrid_t), intent(in) :: grid
      this%grid = grid
      this%nvars = 0
      this%nvars_max = INITIAL_CAPACITY
      allocate (this%vars(this%nvars_max))
      this%is_init = .true.
   end subroutine ocean_diag_init