ocean_surfstress_init Subroutine

private subroutine ocean_surfstress_init(this, grid, nz_ml)

Type Bound

ocean_surface_stress_t

Arguments

Type IntentOptional Attributes Name
class(ocean_surface_stress_t), intent(inout) :: this
type(hgrid_t), intent(in) :: grid
integer, intent(in), optional :: nz_ml

Calls

proc~~ocean_surfstress_init~~CallsGraph proc~ocean_surfstress_init ocean_surface_stress_t%ocean_surfstress_init proc~scratch_3d_buffer_init scratch_3d_buffer_t%scratch_3d_buffer_init proc~ocean_surfstress_init->proc~scratch_3d_buffer_init

Variables

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

Source Code

   subroutine ocean_surfstress_init(this, grid, nz_ml)
      class(ocean_surface_stress_t), intent(inout) :: this
      type(hgrid_t), intent(in) :: grid
      integer, intent(in), optional :: nz_ml
      integer :: nx, ny, nz

      nx = grid%nx_total
      ny = grid%ny_total
      nz = 1
      if (present(nz_ml)) nz = nz_ml

      allocate (this%tau_x(nx + 1, ny), source=0.0_wp)
      allocate (this%tau_y(nx, ny + 1), source=0.0_wp)
      allocate (this%stress_mag(nx, ny), source=0.0_wp)
      allocate (this%stress_shelf(nx, ny), source=0.0_wp)
      call this%du_stress%init(nx + 1, ny, nz, "ocean_surfstress_du_stress")
      call this%dv_stress%init(nx, ny + 1, nz, "ocean_surfstress_dv_stress")
      this%is_init = .true.
   end subroutine ocean_surfstress_init