evp_workspace_init Subroutine

private subroutine evp_workspace_init(this, nx, ny)

Allocate the EVP scratch for an (nx,ny) T-cell domain, zero-init. Called ONCE per workspace lifetime — from ocean_sea_ice_init (gated on dynamics) and from the EVP test harness. nx/ny declared before the arrays that use them is unnecessary here (all allocatables), but the extents are cached for destroy.

Type Bound

evp_workspace_t

Arguments

Type IntentOptional Attributes Name
class(evp_workspace_t), intent(inout) :: this
integer, intent(in) :: nx
integer, intent(in) :: ny

Called by

proc~~evp_workspace_init~~CalledByGraph proc~evp_workspace_init evp_workspace_t%evp_workspace_init proc~ocean_sea_ice_init ocean_sea_ice_t%ocean_sea_ice_init proc~ocean_sea_ice_init->proc~evp_workspace_init

Source Code

   subroutine evp_workspace_init(this, nx, ny)
      !! Allocate the EVP scratch for an `(nx,ny)` T-cell domain, zero-init.
      !! Called ONCE per workspace lifetime — from `ocean_sea_ice_init`
      !! (gated on `dynamics`) and from the EVP test harness.  `nx`/`ny`
      !! declared before the arrays that use them is unnecessary here (all
      !! allocatables), but the extents are cached for `destroy`.
      class(evp_workspace_t), intent(inout) :: this
      integer, intent(in) :: nx, ny

      this%nx = nx
      this%ny = ny

      allocate (this%mis_w(nx, ny), source=0.0_wp)
      allocate (this%mice_w(nx, ny), source=0.0_wp)
      allocate (this%ci_w(nx, ny), source=0.0_wp)
      allocate (this%mis_in_w(nx, ny), source=0.0_wp)
      allocate (this%mice_in_w(nx, ny), source=0.0_wp)
      allocate (this%ci_in_w(nx, ny), source=0.0_wp)
      allocate (this%pres_mice_w(nx, ny), source=0.0_wp)
      allocate (this%del_sh_min_pr_w(nx, ny), source=0.0_wp)
      allocate (this%sh_dd_w(nx, ny), source=0.0_wp)
      allocate (this%sh_dt_w(nx, ny), source=0.0_wp)
      allocate (this%zeta_w(nx, ny), source=0.0_wp)
      allocate (this%del_sh_w(nx, ny), source=0.0_wp)
      allocate (this%mask_t_w(nx, ny), source=0.0_wp)

      allocate (this%mi_u_w(nx + 1, ny), source=0.0_wp)
      allocate (this%mask_u_w(nx + 1, ny), source=0.0_wp)
      allocate (this%u_tmp_w(nx + 1, ny), source=0.0_wp)
      allocate (this%mi_v_w(nx, ny + 1), source=0.0_wp)
      allocate (this%mask_v_w(nx, ny + 1), source=0.0_wp)
      allocate (this%a_u_w(nx + 1, ny), source=0.0_wp)
      allocate (this%a_v_w(nx, ny + 1), source=0.0_wp)

      allocate (this%sh_ds_w(nx + 1, ny + 1), source=0.0_wp)
      allocate (this%mi_ratio_a_q_w(nx + 1, ny + 1), source=0.0_wp)
      allocate (this%q_w(nx + 1, ny + 1), source=0.0_wp)
      allocate (this%mask_q_w(nx + 1, ny + 1), source=0.0_wp)
   end subroutine evp_workspace_init