apply_w_to_h_layer Subroutine

private pure subroutine apply_w_to_h_layer(nx, ny, nz, dt, w_interface, h_layer)

h_layer(k) += dt * (w(k) - w(k+1)) per cell. Bed and surface interfaces feed through whatever w the caller set (zero for the bed by default after compute_w_from_continuity with enforce_bed_bc = true). No h-floor — plain accumulation; the caller is responsible for guarding against negative thickness if the prescribed w + dt is large.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nx
integer, intent(in) :: ny
integer, intent(in) :: nz
real(kind=wp), intent(in) :: dt
real(kind=wp), intent(in) :: w_interface(nx,ny,nz+1)
real(kind=wp), intent(inout) :: h_layer(nx,ny,nz)

Called by

proc~~apply_w_to_h_layer~~CalledByGraph proc~apply_w_to_h_layer apply_w_to_h_layer proc~tracer_advect_vertical tracer_advect_vertical proc~tracer_advect_vertical->proc~apply_w_to_h_layer proc~run_continuity_chain run_continuity_chain proc~run_continuity_chain->proc~tracer_advect_vertical proc~run_gm_step run_gm_step proc~run_gm_step->proc~tracer_advect_vertical proc~run_stage run_stage proc~run_stage->proc~tracer_advect_vertical proc~ocean_dyn_step ocean_dyn_step proc~ocean_dyn_step->proc~run_stage proc~ocean_dyn_step_split ocean_dyn_step_split proc~ocean_dyn_step_split->proc~run_gm_step proc~run_stage_split run_stage_split proc~ocean_dyn_step_split->proc~run_stage_split proc~run_stage_split->proc~run_continuity_chain proc~engine_step engine_step proc~engine_step->proc~ocean_dyn_step proc~engine_step->proc~ocean_dyn_step_split 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 apply_w_to_h_layer(nx, ny, nz, dt, w_interface, h_layer)
      !! `h_layer(k) += dt * (w(k) - w(k+1))` per cell.  Bed and
      !! surface interfaces feed through whatever w the caller set
      !! (zero for the bed by default after
      !! `compute_w_from_continuity` with `enforce_bed_bc = true`).
      !! No h-floor — plain accumulation; the caller is responsible
      !! for guarding against negative thickness if the prescribed
      !! w + dt is large.
      integer, intent(in) :: nx, ny, nz
      real(wp), intent(in) :: dt
      real(wp), intent(in) :: w_interface(nx, ny, nz + 1)
      real(wp), intent(inout) :: h_layer(nx, ny, nz)

      integer :: i, j, k

      do concurrent(k=1:nz, j=1:ny, i=1:nx)
         h_layer(i, j, k) = h_layer(i, j, k) + &
                            dt*(w_interface(i, j, k) - w_interface(i, j, k + 1))
      end do
   end subroutine apply_w_to_h_layer