Allocate an empty registry sized at INITIAL_CAPACITY slots.
Subsequent register calls grow the array via doubling.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_diag_t), | intent(inout) | :: | this | |||
| type(hgrid_t), | intent(in) | :: | grid |
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