ice_evp_dynamics Subroutine

public subroutine ice_evp_dynamics(grid, metrics, f_corner, mis, mice, ci, uo, vo, tau_ax, tau_ay, ui, vi, str_d, str_t, str_s, fxoc, fyoc, dt_slow, par, periodic_x, periodic_y, ws, dt_transport, n_trunc, halo_x, halo_y, land_w, land_e, land_s, land_n)

One outer (slow) EVP call: evp_sub_steps subcycles advancing ui/vi/str_d/str_t/str_s, plus the subcycle-averaged ice->ocean stress fxoc/fyoc.

Thin public shim (test seam): unpacks the caller-supplied evp_workspace_t slot’s components into the explicit-shape flat-impl args of ice_evp_dynamics_impl — the outer-shim + flat-impl pattern. NEVER read ws%component inside a do concurrent (per-launch descriptor copies); the impl takes the scratch as explicit-shape (nx,ny) dummies instead. ws must be init+enter_data‘d for this (grid%nx_total, grid%ny_total) (the driver does this in ocean_sea_ice_t%init/enter_data; tests build a local evp_workspace_t).

Arguments

Type IntentOptional Attributes Name
type(hgrid_t), intent(in) :: grid
type(ocean_metrics_t), intent(in) :: metrics
real(kind=wp), intent(in) :: f_corner(:,:)
real(kind=wp), intent(in) :: mis(:,:)
real(kind=wp), intent(in) :: mice(:,:)
real(kind=wp), intent(in) :: ci(:,:)
real(kind=wp), intent(in) :: uo(:,:)
real(kind=wp), intent(in) :: vo(:,:)
real(kind=wp), intent(in) :: tau_ax(:,:)
real(kind=wp), intent(in) :: tau_ay(:,:)
real(kind=wp), intent(inout) :: ui(:,:)
real(kind=wp), intent(inout) :: vi(:,:)
real(kind=wp), intent(inout) :: str_d(:,:)
real(kind=wp), intent(inout) :: str_t(:,:)
real(kind=wp), intent(inout) :: str_s(:,:)
real(kind=wp), intent(inout) :: fxoc(:,:)
real(kind=wp), intent(inout) :: fyoc(:,:)
real(kind=wp), intent(in) :: dt_slow
type(ice_evp_params_t), intent(in) :: par
logical, intent(in) :: periodic_x
logical, intent(in) :: periodic_y
type(evp_workspace_t), intent(inout) :: ws
real(kind=wp), intent(in), optional :: dt_transport

PR 36: dt TRANSPORT will use for the CFL bound. Absent => dt_slow.

integer, intent(out), optional :: n_trunc

PR 36: count of ice-bearing faces the final clip touched.

logical, intent(in), optional :: halo_x

The x / y axis is split across ranks: exchange ui/vi through the ocean halo and skip the local periodic wrap on that axis. Absent => .false. (single rank, the unit-test seam).

logical, intent(in), optional :: halo_y

The x / y axis is split across ranks: exchange ui/vi through the ocean halo and skip the local periodic wrap on that axis. Absent => .false. (single rank, the unit-test seam).

logical, intent(in), optional :: land_w

Pin that ghost band of mask_t to land (a physical, non-periodic edge). Absent => .not. periodic_x (W/E) / .not. periodic_y (S/N): the single-rank wall-or-wrap policy.

logical, intent(in), optional :: land_e

Pin that ghost band of mask_t to land (a physical, non-periodic edge). Absent => .not. periodic_x (W/E) / .not. periodic_y (S/N): the single-rank wall-or-wrap policy.

logical, intent(in), optional :: land_s

Pin that ghost band of mask_t to land (a physical, non-periodic edge). Absent => .not. periodic_x (W/E) / .not. periodic_y (S/N): the single-rank wall-or-wrap policy.

logical, intent(in), optional :: land_n

Pin that ghost band of mask_t to land (a physical, non-periodic edge). Absent => .not. periodic_x (W/E) / .not. periodic_y (S/N): the single-rank wall-or-wrap policy.


Calls

proc~~ice_evp_dynamics~~CallsGraph proc~ice_evp_dynamics ice_evp_dynamics proc~ice_evp_dynamics_impl ice_evp_dynamics_impl proc~ice_evp_dynamics->proc~ice_evp_dynamics_impl interface~ocean_halo_face_x ocean_halo_face_x proc~ice_evp_dynamics_impl->interface~ocean_halo_face_x interface~ocean_halo_face_y ocean_halo_face_y proc~ice_evp_dynamics_impl->interface~ocean_halo_face_y proc~evp_average_stress_impl evp_average_stress_impl proc~ice_evp_dynamics_impl->proc~evp_average_stress_impl proc~evp_build_masks_impl evp_build_masks_impl proc~ice_evp_dynamics_impl->proc~evp_build_masks_impl proc~evp_copy_u_impl evp_copy_u_impl proc~ice_evp_dynamics_impl->proc~evp_copy_u_impl proc~evp_fill_cell_fields_impl evp_fill_cell_fields_impl proc~ice_evp_dynamics_impl->proc~evp_fill_cell_fields_impl proc~evp_mi_face_impl evp_mi_face_impl proc~ice_evp_dynamics_impl->proc~evp_mi_face_impl proc~evp_pres_mice_impl evp_pres_mice_impl proc~ice_evp_dynamics_impl->proc~evp_pres_mice_impl proc~evp_project_ci_impl evp_project_ci_impl proc~ice_evp_dynamics_impl->proc~evp_project_ci_impl proc~evp_q_and_mi_ratio_impl evp_q_and_mi_ratio_impl proc~ice_evp_dynamics_impl->proc~evp_q_and_mi_ratio_impl proc~evp_sh_dd_dt_impl evp_sh_dd_dt_impl proc~ice_evp_dynamics_impl->proc~evp_sh_dd_dt_impl proc~evp_sh_ds_impl evp_sh_ds_impl proc~ice_evp_dynamics_impl->proc~evp_sh_ds_impl proc~evp_str_s_relax_impl evp_str_s_relax_impl proc~ice_evp_dynamics_impl->proc~evp_str_s_relax_impl proc~evp_stress_relax_impl evp_stress_relax_impl proc~ice_evp_dynamics_impl->proc~evp_stress_relax_impl proc~evp_truncate_final_impl evp_truncate_final_impl proc~ice_evp_dynamics_impl->proc~evp_truncate_final_impl proc~evp_truncate_velocity_impl evp_truncate_velocity_impl proc~ice_evp_dynamics_impl->proc~evp_truncate_velocity_impl proc~evp_u_momentum_impl evp_u_momentum_impl proc~ice_evp_dynamics_impl->proc~evp_u_momentum_impl proc~evp_v_momentum_impl evp_v_momentum_impl proc~ice_evp_dynamics_impl->proc~evp_v_momentum_impl proc~evp_wrap_corner_impl evp_wrap_corner_impl proc~ice_evp_dynamics_impl->proc~evp_wrap_corner_impl proc~evp_zero_massless_velocity_impl evp_zero_massless_velocity_impl proc~ice_evp_dynamics_impl->proc~evp_zero_massless_velocity_impl proc~evp_zero_stress_impl evp_zero_stress_impl proc~ice_evp_dynamics_impl->proc~evp_zero_stress_impl proc~evp_zeta_impl evp_zeta_impl proc~ice_evp_dynamics_impl->proc~evp_zeta_impl proc~ice_limit_stresses ice_limit_stresses proc~ice_evp_dynamics_impl->proc~ice_limit_stresses proc~ocean_periodic_wrap_centre_2d ocean_periodic_wrap_centre_2d proc~ice_evp_dynamics_impl->proc~ocean_periodic_wrap_centre_2d proc~ocean_periodic_wrap_face_x_2d ocean_periodic_wrap_face_x_2d proc~ice_evp_dynamics_impl->proc~ocean_periodic_wrap_face_x_2d proc~ocean_periodic_wrap_face_y_2d ocean_periodic_wrap_face_y_2d proc~ice_evp_dynamics_impl->proc~ocean_periodic_wrap_face_y_2d proc~ocean_halo_face_x_2d ocean_halo_face_x_2d interface~ocean_halo_face_x->proc~ocean_halo_face_x_2d proc~ocean_halo_face_x_3d ocean_halo_face_x_3d interface~ocean_halo_face_x->proc~ocean_halo_face_x_3d proc~ocean_halo_face_y_2d ocean_halo_face_y_2d interface~ocean_halo_face_y->proc~ocean_halo_face_y_2d proc~ocean_halo_face_y_3d ocean_halo_face_y_3d interface~ocean_halo_face_y->proc~ocean_halo_face_y_3d proc~evp_build_masks_impl->proc~ocean_periodic_wrap_centre_2d local local proc~evp_build_masks_impl->local proc~evp_pres_mice_impl->local proc~evp_project_ci_impl->local proc~evp_q_and_mi_ratio_impl->local proc~ice_evp_mi_ratio_point ice_evp_mi_ratio_point proc~evp_q_and_mi_ratio_impl->proc~ice_evp_mi_ratio_point proc~evp_sh_ds_impl->local proc~evp_str_s_relax_impl->local proc~evp_truncate_final_impl->local reduce reduce proc~evp_truncate_final_impl->reduce proc~evp_truncate_velocity_impl->local proc~evp_u_momentum_impl->local proc~evp_v_momentum_impl->local proc~evp_zero_massless_velocity_impl->local proc~evp_zeta_impl->local proc~ice_limit_stresses->local proc~ocean_halo_face_x_2d_impl ocean_halo_face_x_2d_impl proc~ocean_halo_face_x_2d->proc~ocean_halo_face_x_2d_impl proc~oh_count_face_x_2d oh_count_face_x_2d proc~ocean_halo_face_x_2d->proc~oh_count_face_x_2d comm_irecv_real_sp_array_n comm_irecv_real_sp_array_n proc~ocean_halo_face_x_3d->comm_irecv_real_sp_array_n comm_isend_real_sp_array_n comm_isend_real_sp_array_n proc~ocean_halo_face_x_3d->comm_isend_real_sp_array_n proc~comm_env_compute_comm comm_env_compute_comm proc~ocean_halo_face_x_3d->proc~comm_env_compute_comm proc~ew_rank_east ew_rank_east proc~ocean_halo_face_x_3d->proc~ew_rank_east proc~ew_rank_west ew_rank_west proc~ocean_halo_face_x_3d->proc~ew_rank_west proc~needs_flags needs_flags proc~ocean_halo_face_x_3d->proc~needs_flags proc~ns_rank_north ns_rank_north proc~ocean_halo_face_x_3d->proc~ns_rank_north proc~ns_rank_south ns_rank_south proc~ocean_halo_face_x_3d->proc~ns_rank_south proc~ocean_halo_buffers_ensure_nz ocean_halo_buffers_ensure_nz proc~ocean_halo_face_x_3d->proc~ocean_halo_buffers_ensure_nz proc~ocean_periodic_wrap_face_x_3d ocean_periodic_wrap_face_x_3d proc~ocean_halo_face_x_3d->proc~ocean_periodic_wrap_face_x_3d proc~oh_count_face_x_3d oh_count_face_x_3d proc~ocean_halo_face_x_3d->proc~oh_count_face_x_3d proc~oh_count_msgs oh_count_msgs proc~ocean_halo_face_x_3d->proc~oh_count_msgs waitall waitall proc~ocean_halo_face_x_3d->waitall proc~ocean_halo_face_y_2d_impl ocean_halo_face_y_2d_impl proc~ocean_halo_face_y_2d->proc~ocean_halo_face_y_2d_impl proc~oh_count_face_y_2d oh_count_face_y_2d proc~ocean_halo_face_y_2d->proc~oh_count_face_y_2d proc~ocean_halo_face_y_3d->comm_irecv_real_sp_array_n proc~ocean_halo_face_y_3d->comm_isend_real_sp_array_n proc~ocean_halo_face_y_3d->proc~comm_env_compute_comm proc~ocean_halo_face_y_3d->proc~ew_rank_east proc~ocean_halo_face_y_3d->proc~ew_rank_west proc~ocean_halo_face_y_3d->proc~needs_flags proc~ocean_halo_face_y_3d->proc~ns_rank_north proc~ocean_halo_face_y_3d->proc~ns_rank_south proc~ocean_halo_face_y_3d->proc~ocean_halo_buffers_ensure_nz proc~ocean_periodic_wrap_face_y_3d ocean_periodic_wrap_face_y_3d proc~ocean_halo_face_y_3d->proc~ocean_periodic_wrap_face_y_3d proc~oh_count_face_y_3d oh_count_face_y_3d proc~ocean_halo_face_y_3d->proc~oh_count_face_y_3d proc~ocean_halo_face_y_3d->proc~oh_count_msgs proc~ocean_halo_face_y_3d->waitall comm_world comm_world proc~comm_env_compute_comm->comm_world proc~decomp_rank_from_coords decomp_rank_from_coords proc~ew_rank_east->proc~decomp_rank_from_coords proc~ew_rank_west->proc~decomp_rank_from_coords proc~ns_rank_north->proc~decomp_rank_from_coords proc~ns_rank_south->proc~decomp_rank_from_coords to_string to_string proc~ocean_halo_buffers_ensure_nz->to_string warning warning proc~ocean_halo_buffers_ensure_nz->warning proc~ocean_halo_face_x_2d_impl->proc~ocean_periodic_wrap_face_x_2d proc~ocean_halo_face_x_2d_impl->comm_irecv_real_sp_array_n proc~ocean_halo_face_x_2d_impl->comm_isend_real_sp_array_n proc~ocean_halo_face_x_2d_impl->proc~comm_env_compute_comm proc~ocean_halo_face_x_2d_impl->proc~ew_rank_east proc~ocean_halo_face_x_2d_impl->proc~ew_rank_west proc~ocean_halo_face_x_2d_impl->proc~needs_flags proc~ocean_halo_face_x_2d_impl->proc~ns_rank_north proc~ocean_halo_face_x_2d_impl->proc~ns_rank_south proc~ocean_halo_face_x_2d_impl->proc~oh_count_msgs proc~ocean_halo_face_x_2d_impl->waitall proc~ocean_halo_face_y_2d_impl->proc~ocean_periodic_wrap_face_y_2d proc~ocean_halo_face_y_2d_impl->comm_irecv_real_sp_array_n proc~ocean_halo_face_y_2d_impl->comm_isend_real_sp_array_n proc~ocean_halo_face_y_2d_impl->proc~comm_env_compute_comm proc~ocean_halo_face_y_2d_impl->proc~ew_rank_east proc~ocean_halo_face_y_2d_impl->proc~ew_rank_west proc~ocean_halo_face_y_2d_impl->proc~needs_flags proc~ocean_halo_face_y_2d_impl->proc~ns_rank_north proc~ocean_halo_face_y_2d_impl->proc~ns_rank_south proc~ocean_halo_face_y_2d_impl->proc~oh_count_msgs proc~ocean_halo_face_y_2d_impl->waitall

Called by

proc~~ice_evp_dynamics~~CalledByGraph proc~ice_evp_dynamics ice_evp_dynamics proc~ice_evp_step ice_evp_step proc~ice_evp_step->proc~ice_evp_dynamics proc~engine_step_ice engine_step_ice proc~engine_step_ice->proc~ice_evp_step proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_step_ice proc~rdb_ocean_step rdb_ocean_step proc~rdb_ocean_step->proc~engine_step_ice proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean

Variables

Type Visibility Attributes Name Initial
logical, private :: hx
logical, private :: hy
logical, private :: le
logical, private :: ln
logical, private :: ls
logical, private :: lw
integer, private :: nx
integer, private :: ny

Source Code

   subroutine ice_evp_dynamics(grid, metrics, f_corner, mis, mice, ci, uo, vo, &
                               tau_ax, tau_ay, ui, vi, str_d, str_t, str_s, &
                               fxoc, fyoc, dt_slow, par, periodic_x, periodic_y, ws, &
                               dt_transport, n_trunc, halo_x, halo_y, &
                               land_w, land_e, land_s, land_n)
      !! One outer (slow) EVP call: `evp_sub_steps` subcycles advancing
      !! `ui`/`vi`/`str_d`/`str_t`/`str_s`, plus the subcycle-averaged
      !! ice->ocean stress `fxoc`/`fyoc`.
      !!
      !! Thin public shim (test seam): unpacks the caller-supplied
      !! `evp_workspace_t` slot's components into the explicit-shape
      !! flat-impl args of `ice_evp_dynamics_impl` — the outer-shim +
      !! flat-impl pattern.  NEVER read `ws%component` inside a
      !! `do concurrent` (per-launch descriptor copies); the impl takes the
      !! scratch as explicit-shape `(nx,ny)` dummies instead.  `ws` must be
      !! `init`+`enter_data`'d for this `(grid%nx_total, grid%ny_total)`
      !! (the driver does this in `ocean_sea_ice_t%init`/`enter_data`; tests
      !! build a local `evp_workspace_t`).
      type(hgrid_t), intent(in) :: grid
      type(ocean_metrics_t), intent(in) :: metrics
      real(wp), intent(in) :: f_corner(:, :)
      real(wp), intent(in) :: mis(:, :), mice(:, :), ci(:, :)
      real(wp), intent(in) :: uo(:, :), vo(:, :)
      real(wp), intent(in) :: tau_ax(:, :), tau_ay(:, :)
      real(wp), intent(inout) :: ui(:, :), vi(:, :)
      real(wp), intent(inout) :: str_d(:, :), str_t(:, :), str_s(:, :)
      real(wp), intent(inout) :: fxoc(:, :), fyoc(:, :)
      real(wp), intent(in) :: dt_slow
      type(ice_evp_params_t), intent(in) :: par
      logical, intent(in) :: periodic_x, periodic_y
      type(evp_workspace_t), intent(inout) :: ws
      real(wp), intent(in), optional :: dt_transport
         !! PR 36: dt TRANSPORT will use for the CFL bound. Absent => `dt_slow`.
      integer, intent(out), optional :: n_trunc
         !! PR 36: count of ice-bearing faces the final clip touched.
      logical, intent(in), optional :: halo_x, halo_y
         !! The x / y axis is split across ranks: exchange `ui`/`vi`
         !! through the ocean halo and skip the local periodic wrap on that
         !! axis.  Absent => `.false.` (single rank, the unit-test seam).
      logical, intent(in), optional :: land_w, land_e, land_s, land_n
         !! Pin that ghost band of `mask_t` to land (a physical,
         !! non-periodic edge).  Absent => `.not. periodic_x` (W/E) /
         !! `.not. periodic_y` (S/N): the single-rank wall-or-wrap policy.
      integer :: nx, ny
      logical :: hx, hy, lw, le, ls, ln

      nx = grid%nx_total
      ny = grid%ny_total
      hx = .false.
      if (present(halo_x)) hx = halo_x
      hy = .false.
      if (present(halo_y)) hy = halo_y
      lw = .not. periodic_x
      if (present(land_w)) lw = land_w
      le = .not. periodic_x
      if (present(land_e)) le = land_e
      ls = .not. periodic_y
      if (present(land_s)) ls = land_s
      ln = .not. periodic_y
      if (present(land_n)) ln = land_n

      call ice_evp_dynamics_impl(grid, metrics, f_corner, mis, mice, ci, uo, vo, &
                                 tau_ax, tau_ay, ui, vi, str_d, str_t, str_s, &
                                 fxoc, fyoc, dt_slow, par, periodic_x, periodic_y, nx, ny, &
                                 ws%mis_w, ws%mice_w, ws%ci_w, ws%pres_mice_w, &
                                 ws%del_sh_min_pr_w, ws%sh_dd_w, ws%sh_dt_w, ws%zeta_w, &
                                 ws%del_sh_w, ws%mask_t_w, ws%mi_u_w, ws%mask_u_w, &
                                 ws%u_tmp_w, ws%mi_v_w, ws%mask_v_w, ws%a_u_w, ws%a_v_w, &
                                 ws%sh_ds_w, ws%mi_ratio_a_q_w, ws%q_w, ws%mask_q_w, &
                                 hx, hy, lw, le, ls, ln, dt_transport, n_trunc)
   end subroutine ice_evp_dynamics