ocean_sea_ice_exit_data_impl Subroutine

private subroutine ocean_sea_ice_exit_data_impl(this)

Reverse of enter_data_impl — all six PR-3a fields are prognostic state (post-run host inspection + restart write), same as the persistent frazil bank; the drain-and-zero budget scratch is dropped. PR 3b’s m_frozen_diag/salt_flux_diag are both PERSISTENT (restart-carried) — copyout, not delete. PR 3c: heat_flux_diag/m_melt_diag are likewise PERSISTENT (copyout); PR 31’s sw_thru_diag is PERSISTENT too (copyout, restart-carried — NOT its per-category parent sw_thru, which stays delete); the atm_* seam, fb/sst_seam/ssurf_seam/ tfw_seam, and the per-category column scratch (tsurf_out/h2o_ocn_to_ice/h2o_ice_to_ocn/heat_to_ocn/ sw_thru) are all recomputed every thermo step — delete. PR 4a: h_lim/mh_lim are delete (recomputed from ncat at init, never mutated after); fb_part_sum is delete (recomputed every thermo step, same lifecycle as the other scratch seams). PR 4b: u_ice/v_ice are copyout (post-run host inspection, same contract as the melt/frazil diags); the transport workspace is delete (pure scratch), gated the same if (this%transport) as the enter_data map. PR 5: str_d/str_t/str_s/fxoc/fyoc are copyout (PERSISTENT, restart-carried); tau_a_x/tau_a_y are delete (configure-time snapshot, not restart-carried — rebuilt fresh on every run). PR 26: atm_fprec is delete (same lifecycle as the rest of the atm_* seam); fprec_ocn_diag/ snow_part_ocn are delete (SCRATCH, recomputed every thermo step, same lifecycle as fb_part_sum). PR 63: tau_ocn_x/tau_ocn_y are copyout — PERSISTENT, restart-carried, and the restart write reads the host copy (opposite lifecycle to tau_a_x/tau_a_y, do not copy that pattern). tau_ocn_valid is never mapped, so there is nothing to unmap.

Arguments

Type IntentOptional Attributes Name
type(ocean_sea_ice_t), intent(inout) :: this

Calls

proc~~ocean_sea_ice_exit_data_impl~~CallsGraph proc~ocean_sea_ice_exit_data_impl ocean_sea_ice_exit_data_impl proc~evp_workspace_exit_data evp_workspace_t%evp_workspace_exit_data proc~ocean_sea_ice_exit_data_impl->proc~evp_workspace_exit_data proc~evp_workspace_exit_data_impl evp_workspace_exit_data_impl proc~evp_workspace_exit_data->proc~evp_workspace_exit_data_impl

Called by

proc~~ocean_sea_ice_exit_data_impl~~CalledByGraph proc~ocean_sea_ice_exit_data_impl ocean_sea_ice_exit_data_impl proc~ocean_sea_ice_exit_data ocean_sea_ice_t%ocean_sea_ice_exit_data proc~ocean_sea_ice_exit_data->proc~ocean_sea_ice_exit_data_impl

Source Code

   subroutine ocean_sea_ice_exit_data_impl(this)
      !! Reverse of `enter_data_impl` — all six PR-3a fields are
      !! prognostic state (post-run host inspection + restart write),
      !! same as the persistent frazil bank; the drain-and-zero budget
      !! scratch is dropped. PR 3b's `m_frozen_diag`/`salt_flux_diag`
      !! are both PERSISTENT (restart-carried) — `copyout`, not `delete`.
      !! PR 3c: `heat_flux_diag`/`m_melt_diag` are likewise PERSISTENT
      !! (`copyout`); PR 31's `sw_thru_diag` is PERSISTENT too (`copyout`,
      !! restart-carried — NOT its per-category parent `sw_thru`, which
      !! stays `delete`); the `atm_*` seam, `fb`/`sst_seam`/`ssurf_seam`/
      !! `tfw_seam`, and the per-category column scratch
      !! (`tsurf_out`/`h2o_ocn_to_ice`/`h2o_ice_to_ocn`/`heat_to_ocn`/
      !! `sw_thru`) are all recomputed every thermo step — `delete`. PR 4a:
      !! `h_lim`/`mh_lim` are `delete` (recomputed from `ncat` at `init`,
      !! never mutated after); `fb_part_sum` is `delete` (recomputed every
      !! thermo step, same lifecycle as the other scratch seams). PR 4b:
      !! `u_ice`/`v_ice` are `copyout` (post-run host inspection, same
      !! contract as the melt/frazil diags); the transport workspace is
      !! `delete` (pure scratch), gated the same `if (this%transport)` as
      !! the enter_data map.  PR 5: `str_d`/`str_t`/`str_s`/`fxoc`/`fyoc`
      !! are `copyout` (PERSISTENT, restart-carried); `tau_a_x`/`tau_a_y`
      !! are `delete` (configure-time snapshot, not restart-carried —
      !! rebuilt fresh on every run). PR 26: `atm_fprec` is `delete`
      !! (same lifecycle as the rest of the `atm_*` seam); `fprec_ocn_diag`/
      !! `snow_part_ocn` are `delete` (SCRATCH, recomputed every thermo
      !! step, same lifecycle as `fb_part_sum`). PR 63: `tau_ocn_x`/`tau_ocn_y`
      !! are `copyout` — PERSISTENT, restart-carried, and the restart write
      !! reads the host copy (opposite lifecycle to `tau_a_x`/`tau_a_y`,
      !! do not copy that pattern). `tau_ocn_valid` is never mapped, so
      !! there is nothing to unmap.
      type(ocean_sea_ice_t), intent(inout) :: this
      if (.not. this%is_init) return
      !$acc exit data copyout(this%frazil_heat)
      !$acc exit data delete(this%heat_budget_frazil)
      !$acc exit data copyout(this%part_size, this%m_ice, this%m_snow)
      !$acc exit data copyout(this%enth_ice, this%enth_snow, this%sal_ice)
      !$acc exit data copyout(this%m_frozen_diag, this%salt_flux_diag)
      !$acc exit data delete(this%atm_sf0, this%atm_dsfdt, this%atm_sw_dn, this%atm_fprec)
      !$acc exit data delete(this%fb, this%sst_seam, this%ssurf_seam, this%tfw_seam)
      !$acc exit data delete(this%tsurf_out, this%h2o_ocn_to_ice, this%h2o_ice_to_ocn)
      !$acc exit data delete(this%heat_to_ocn, this%sw_thru, this%snow_to_ice)
      !$acc exit data copyout(this%heat_flux_diag, this%sw_thru_diag, this%m_melt_diag)
      !$acc exit data delete(this%fprec_ocn_diag)
      !$acc exit data delete(this%h_lim, this%mh_lim, this%fb_part_sum, this%snow_part_ocn)
      !$acc exit data copyout(this%u_ice, this%v_ice)
      !$acc exit data copyout(this%str_d, this%str_t, this%str_s)
      !$acc exit data delete(this%tau_a_x, this%tau_a_y)
      !$acc exit data copyout(this%fxoc, this%fyoc)
      !$acc exit data copyout(this%tau_ocn_x, this%tau_ocn_y)
      if (this%dynamics) call this%evp_ws%exit_data()
      if (this%transport) then
         !$acc exit data delete(this%mca_ice, this%mca_snow)
         !$acc exit data delete(this%uh_ice, this%vh_ice, this%uh_snow, this%vh_snow)
         !$acc exit data delete(this%htot_work, this%hl_x_work, this%hr_x_work)
         !$acc exit data delete(this%hl_y_work, this%hr_y_work)
         !$acc exit data delete(this%uhtot_work, this%vhtot_work)
         !$acc exit data delete(this%tr_flux_x_work, this%tr_flux_y_work)
      end if
   end subroutine ocean_sea_ice_exit_data_impl