ocean_slopes_build_e Subroutine

private pure subroutine ocean_slopes_build_e(nx, ny, nz, bathy, h_layer, e_int)

Build GEOPOTENTIAL interface heights bottom-up: e_int(:,:,1) = −bathy (the bed, below the z = 0 datum), e_int(:,:,K+1) = e_int(:,:,K) + h_layer(:,:,K). A per-column serial cumulative sum (parallel over i,j). The across-face difference e_W − e_E feeds the interface-tilt term, so the bed datum is NOT irrelevant: it must be the true bed depth, or a bathymetry step reads as an isopycnal slope.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nx
integer, intent(in) :: ny
integer, intent(in) :: nz
real(kind=wp), intent(in) :: bathy(nx,ny)
real(kind=wp), intent(in) :: h_layer(nx,ny,nz)
real(kind=wp), intent(out) :: e_int(nx,ny,nz+1)

Called by

proc~~ocean_slopes_build_e~~CalledByGraph proc~ocean_slopes_build_e ocean_slopes_build_e proc~ocean_slopes_compute_impl ocean_slopes_compute_impl proc~ocean_slopes_compute_impl->proc~ocean_slopes_build_e 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_build_e(nx, ny, nz, bathy, h_layer, e_int)
      !! Build GEOPOTENTIAL interface heights bottom-up: `e_int(:,:,1) =
      !! −bathy` (the bed, below the `z = 0` datum),
      !! `e_int(:,:,K+1) = e_int(:,:,K) + h_layer(:,:,K)`.  A per-column
      !! serial cumulative sum (parallel over i,j).  The across-face
      !! difference `e_W − e_E` feeds the interface-tilt term, so the bed
      !! datum is NOT irrelevant: it must be the true bed depth, or a
      !! bathymetry step reads as an isopycnal slope.
      integer, intent(in) :: nx, ny, nz
      real(wp), intent(in) :: bathy(nx, ny)
      real(wp), intent(in) :: h_layer(nx, ny, nz)
      real(wp), intent(out) :: e_int(nx, ny, nz + 1)
      integer :: i, j, k
      do concurrent(j=1:ny, i=1:nx)
         e_int(i, j, 1) = -bathy(i, j)
         do k = 1, nz
            e_int(i, j, k + 1) = e_int(i, j, k) + h_layer(i, j, k)
         end do
      end do
   end subroutine ocean_slopes_build_e