ocean_wave_speed_init Subroutine

private subroutine ocean_wave_speed_init(this, grid)

Allocate the persistent (nx, ny) fields. Always allocates (configure runs after init, so enable is not known yet); the off-state footprint is four 2D arrays.

Type Bound

ocean_wave_speed_t

Arguments

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

Variables

Type Visibility Attributes Name Initial
integer, private :: nx
integer, private :: ny

Source Code

   subroutine ocean_wave_speed_init(this, grid)
      !! Allocate the persistent (nx, ny) fields.  Always allocates
      !! (configure runs after init, so `enable` is not known yet);
      !! the off-state footprint is four 2D arrays.
      class(ocean_wave_speed_t), intent(inout) :: this
      type(hgrid_t), intent(in) :: grid
      integer :: nx, ny

      nx = grid%nx_total
      ny = grid%ny_total
      allocate (this%f_centre(nx, ny), source=0.0_wp)
      allocate (this%beta_centre(nx, ny), source=0.0_wp)
      allocate (this%cg1(nx, ny), source=0.0_wp)
      allocate (this%rd(nx, ny), source=0.0_wp)
      allocate (this%rd_over_dx(nx, ny), source=0.0_wp)
      this%is_init = .true.
   end subroutine ocean_wave_speed_init