evp_workspace_destroy Subroutine

private subroutine evp_workspace_destroy(this)

Reverse of init (host deallocation). Idempotent — safe on an already-clean workspace. Device unmapping is exit_data’s job (call it first).

Type Bound

evp_workspace_t

Arguments

Type IntentOptional Attributes Name
class(evp_workspace_t), intent(inout) :: this

Called by

proc~~evp_workspace_destroy~~CalledByGraph proc~evp_workspace_destroy evp_workspace_t%evp_workspace_destroy proc~ocean_sea_ice_destroy ocean_sea_ice_t%ocean_sea_ice_destroy proc~ocean_sea_ice_destroy->proc~evp_workspace_destroy

Source Code

   subroutine evp_workspace_destroy(this)
      !! Reverse of `init` (host deallocation).  Idempotent — safe on an
      !! already-clean workspace.  Device unmapping is `exit_data`'s job
      !! (call it first).
      class(evp_workspace_t), intent(inout) :: this
      if (allocated(this%mis_w)) deallocate (this%mis_w)
      if (allocated(this%mice_w)) deallocate (this%mice_w)
      if (allocated(this%ci_w)) deallocate (this%ci_w)
      if (allocated(this%mis_in_w)) deallocate (this%mis_in_w)
      if (allocated(this%mice_in_w)) deallocate (this%mice_in_w)
      if (allocated(this%ci_in_w)) deallocate (this%ci_in_w)
      if (allocated(this%pres_mice_w)) deallocate (this%pres_mice_w)
      if (allocated(this%del_sh_min_pr_w)) deallocate (this%del_sh_min_pr_w)
      if (allocated(this%sh_dd_w)) deallocate (this%sh_dd_w)
      if (allocated(this%sh_dt_w)) deallocate (this%sh_dt_w)
      if (allocated(this%zeta_w)) deallocate (this%zeta_w)
      if (allocated(this%del_sh_w)) deallocate (this%del_sh_w)
      if (allocated(this%mask_t_w)) deallocate (this%mask_t_w)
      if (allocated(this%mi_u_w)) deallocate (this%mi_u_w)
      if (allocated(this%mask_u_w)) deallocate (this%mask_u_w)
      if (allocated(this%u_tmp_w)) deallocate (this%u_tmp_w)
      if (allocated(this%mi_v_w)) deallocate (this%mi_v_w)
      if (allocated(this%mask_v_w)) deallocate (this%mask_v_w)
      if (allocated(this%a_u_w)) deallocate (this%a_u_w)
      if (allocated(this%a_v_w)) deallocate (this%a_v_w)
      if (allocated(this%sh_ds_w)) deallocate (this%sh_ds_w)
      if (allocated(this%mi_ratio_a_q_w)) deallocate (this%mi_ratio_a_q_w)
      if (allocated(this%q_w)) deallocate (this%q_w)
      if (allocated(this%mask_q_w)) deallocate (this%mask_q_w)
      this%nx = 0
      this%ny = 0
   end subroutine evp_workspace_destroy