ocean_slopes_mask_open_column Subroutine

private pure subroutine ocean_slopes_mask_open_column(nx, ny, nz, open_u, open_v, slope_x, slope_y, n2_u, n2_v)

Zero slope / N² at every interior interface K that is NOT strictly inside its face’s open column, i.e. unless both layers it separates (K above, K-1 below) are open at that face (&vcoord_nml zfixed_closed_faces). Assigned under a test, never multiplied by the 0/1 mask, so a non-finite value formed against a filler cannot survive as NaN·0.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nx
integer, intent(in) :: ny
integer, intent(in) :: nz
real(kind=wp), intent(in) :: open_u(nx+1,ny,nz)
real(kind=wp), intent(in) :: open_v(nx,ny+1,nz)
real(kind=wp), intent(inout) :: slope_x(nx+1,ny,nz+1)
real(kind=wp), intent(inout) :: slope_y(nx,ny+1,nz+1)
real(kind=wp), intent(inout) :: n2_u(nx+1,ny,nz+1)
real(kind=wp), intent(inout) :: n2_v(nx,ny+1,nz+1)

Called by

proc~~ocean_slopes_mask_open_column~~CalledByGraph proc~ocean_slopes_mask_open_column ocean_slopes_mask_open_column proc~ocean_slopes_compute_impl ocean_slopes_compute_impl proc~ocean_slopes_compute_impl->proc~ocean_slopes_mask_open_column proc~ocean_slopes_compute ocean_slopes_compute proc~ocean_slopes_compute->proc~ocean_slopes_compute_impl proc~ocean_dyn_step_split ocean_dyn_step_split proc~ocean_dyn_step_split->proc~ocean_slopes_compute proc~run_stage run_stage proc~run_stage->proc~ocean_slopes_compute proc~engine_step engine_step proc~engine_step->proc~ocean_dyn_step_split proc~ocean_dyn_step ocean_dyn_step proc~engine_step->proc~ocean_dyn_step proc~ocean_dyn_step->proc~run_stage proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_step proc~rdb_ocean_step rdb_ocean_step proc~rdb_ocean_step->proc~engine_step

Variables

Type Visibility Attributes Name Initial
integer, private :: i
integer, private :: j
integer, private :: k

Source Code

   pure subroutine ocean_slopes_mask_open_column(nx, ny, nz, open_u, open_v, &
                                                 slope_x, slope_y, n2_u, n2_v)
      !! Zero slope / N² at every interior interface `K` that is NOT
      !! strictly inside its face's open column, i.e. unless both layers it
      !! separates (`K` above, `K-1` below) are open at that face
      !! (`&vcoord_nml zfixed_closed_faces`).  Assigned under a test, never
      !! multiplied by the 0/1 mask, so a non-finite value formed against a
      !! filler cannot survive as `NaN·0`.
      integer, intent(in) :: nx, ny, nz
      real(wp), intent(in) :: open_u(nx + 1, ny, nz)
      real(wp), intent(in) :: open_v(nx, ny + 1, nz)
      real(wp), intent(inout) :: slope_x(nx + 1, ny, nz + 1)
      real(wp), intent(inout) :: slope_y(nx, ny + 1, nz + 1)
      real(wp), intent(inout) :: n2_u(nx + 1, ny, nz + 1)
      real(wp), intent(inout) :: n2_v(nx, ny + 1, nz + 1)
      integer :: i, j, k

      do concurrent(k=2:nz, j=1:ny, i=1:nx + 1)
         if (open_u(i, j, k) < 0.5_wp .or. open_u(i, j, k - 1) < 0.5_wp) then
            slope_x(i, j, k) = 0.0_wp
            n2_u(i, j, k) = 0.0_wp
         end if
      end do
      do concurrent(k=2:nz, j=1:ny + 1, i=1:nx)
         if (open_v(i, j, k) < 0.5_wp .or. open_v(i, j, k - 1) < 0.5_wp) then
            slope_y(i, j, k) = 0.0_wp
            n2_v(i, j, k) = 0.0_wp
         end if
      end do
   end subroutine ocean_slopes_mask_open_column