evp_mi_face_impl Subroutine

private pure subroutine evp_mi_face_impl(mis, mi_u, mi_v, nx, ny)

mi_u(i,j) = 0.5*(mis(i-1,j)+mis(i,j)); mi_v(i,j) = 0.5*(mis(i,j-1)+mis(i,j)) (SIS2 :967-974, rdb index translation §1). Array-edge faces (i=1/i=nx+1, j=1/ j=ny+1) have no neighbour on one side; mis at those ghost rows/cols was already periodic-wrapped or zeroed, so a naive mis(i-1,j)/mis(i,j) read is always in-bounds here EXCEPT at the two hard array edges themselves — those faces are handled explicitly.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: mis(nx,ny)
real(kind=wp), intent(out) :: mi_u(nx+1,ny)
real(kind=wp), intent(out) :: mi_v(nx,ny+1)
integer, intent(in) :: nx
integer, intent(in) :: ny

Called by

proc~~evp_mi_face_impl~~CalledByGraph proc~evp_mi_face_impl evp_mi_face_impl proc~ice_evp_dynamics_impl ice_evp_dynamics_impl proc~ice_evp_dynamics_impl->proc~evp_mi_face_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
integer, private :: i
integer, private :: j

Source Code

   pure subroutine evp_mi_face_impl(mis, mi_u, mi_v, nx, ny)
      !! `mi_u(i,j) = 0.5*(mis(i-1,j)+mis(i,j))`; `mi_v(i,j) =
      !! 0.5*(mis(i,j-1)+mis(i,j))` (SIS2 :967-974, rdb index
      !! translation §1). Array-edge faces (`i=1`/`i=nx+1`, `j=1`/
      !! `j=ny+1`) have no neighbour on one side; `mis` at those ghost
      !! rows/cols was already periodic-wrapped or zeroed, so a naive
      !! `mis(i-1,j)`/`mis(i,j)` read is always in-bounds here EXCEPT at
      !! the two hard array edges themselves — those faces are handled
      !! explicitly.
      integer, intent(in) :: nx, ny
      real(wp), intent(in) :: mis(nx, ny)
      real(wp), intent(out) :: mi_u(nx + 1, ny)
      real(wp), intent(out) :: mi_v(nx, ny + 1)
      integer :: i, j

      do concurrent(j=1:ny, i=1:nx + 1)
         if (i == 1) then
            mi_u(i, j) = 0.5_wp*mis(1, j)
         else if (i == nx + 1) then
            mi_u(i, j) = 0.5_wp*mis(nx, j)
         else
            mi_u(i, j) = 0.5_wp*(mis(i - 1, j) + mis(i, j))
         end if
      end do
      do concurrent(j=1:ny + 1, i=1:nx)
         if (j == 1) then
            mi_v(i, j) = 0.5_wp*mis(i, 1)
         else if (j == ny + 1) then
            mi_v(i, j) = 0.5_wp*mis(i, ny)
         else
            mi_v(i, j) = 0.5_wp*(mis(i, j - 1) + mis(i, j))
         end if
      end do
   end subroutine evp_mi_face_impl