evp_sh_ds_impl Subroutine

private pure subroutine evp_sh_ds_impl(dx_dyBu, dy_dxBu, idxCu, idyCv, mask_q, ui, vi, sh_ds, nx, ny)

sh_Ds at corners (:1045-1050) — requirement (4): the SINGLE scalar no-slip factor (2-mask_q) on the WHOLE combined strain. Computed over the interior+1 ring (ic,jc in [1,nx+1]x[1,ny+1] — the full corner array; out-of-band neighbours contribute 0 via zero ghost velocities at the hard array edges, never per-term mirroring).

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: dx_dyBu(nx+1,ny+1)
real(kind=wp), intent(in) :: dy_dxBu(nx+1,ny+1)
real(kind=wp), intent(in) :: idxCu(nx+1,ny)
real(kind=wp), intent(in) :: idyCv(nx,ny+1)
real(kind=wp), intent(in) :: mask_q(nx+1,ny+1)
real(kind=wp), intent(in) :: ui(nx+1,ny)
real(kind=wp), intent(in) :: vi(nx,ny+1)
real(kind=wp), intent(out) :: sh_ds(nx+1,ny+1)
integer, intent(in) :: nx
integer, intent(in) :: ny

Calls

proc~~evp_sh_ds_impl~~CallsGraph proc~evp_sh_ds_impl evp_sh_ds_impl local local proc~evp_sh_ds_impl->local

Called by

proc~~evp_sh_ds_impl~~CalledByGraph proc~evp_sh_ds_impl evp_sh_ds_impl proc~ice_evp_dynamics_impl ice_evp_dynamics_impl proc~ice_evp_dynamics_impl->proc~evp_sh_ds_impl proc~ice_evp_dynamics ice_evp_dynamics proc~ice_evp_dynamics->proc~ice_evp_dynamics_impl 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

Variables

Type Visibility Attributes Name Initial
real(kind=wp), private :: du_term
real(kind=wp), private :: dv_term
integer, private :: ic
integer, private :: jc

Source Code

   pure subroutine evp_sh_ds_impl(dx_dyBu, dy_dxBu, idxCu, idyCv, mask_q, ui, vi, sh_ds, nx, ny)
      !! sh_Ds at corners (:1045-1050) — requirement (4): the SINGLE
      !! scalar no-slip factor `(2-mask_q)` on the WHOLE combined strain.
      !! Computed over the interior+1 ring (ic,jc in [1,nx+1]x[1,ny+1] —
      !! the full corner array; out-of-band neighbours contribute 0 via
      !! zero ghost velocities at the hard array edges, never per-term
      !! mirroring).
      integer, intent(in) :: nx, ny
      real(wp), intent(in) :: dx_dyBu(nx + 1, ny + 1), dy_dxBu(nx + 1, ny + 1)
      real(wp), intent(in) :: idxCu(nx + 1, ny), idyCv(nx, ny + 1)
      real(wp), intent(in) :: mask_q(nx + 1, ny + 1)
      real(wp), intent(in) :: ui(nx + 1, ny), vi(nx, ny + 1)
      real(wp), intent(out) :: sh_ds(nx + 1, ny + 1)
      integer :: ic, jc
      real(wp) :: du_term, dv_term

      do concurrent(jc=1:ny + 1, ic=1:nx + 1) local(du_term, dv_term)
         du_term = 0.0_wp
         if (jc <= ny .and. jc >= 1) then
            du_term = ui(ic, jc)*idxCu(ic, jc)
         end if
         if (jc - 1 >= 1 .and. jc - 1 <= ny) then
            du_term = du_term - ui(ic, jc - 1)*idxCu(ic, jc - 1)
         end if
         dv_term = 0.0_wp
         if (ic <= nx .and. ic >= 1) then
            dv_term = vi(ic, jc)*idyCv(ic, jc)
         end if
         if (ic - 1 >= 1 .and. ic - 1 <= nx) then
            dv_term = dv_term - vi(ic - 1, jc)*idyCv(ic - 1, jc)
         end if
         sh_ds(ic, jc) = (2.0_wp - mask_q(ic, jc))*(dx_dyBu(ic, jc)*du_term + &
                                                    dy_dxBu(ic, jc)*dv_term)
      end do
   end subroutine evp_sh_ds_impl