assign_h_layer Subroutine

private pure subroutine assign_h_layer(nx, ny, nz, h_new, mask, h_layer)

Copy the target field into h_layer on grounded columns only — non-grounded columns’ h_new was never written, and their old h_layer is already the exact target.

Arguments

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

Called by

proc~~assign_h_layer~~CalledByGraph proc~assign_h_layer assign_h_layer proc~ocean_apply_conservative_min_thickness ocean_apply_conservative_min_thickness proc~ocean_apply_conservative_min_thickness->proc~assign_h_layer proc~run_continuity_chain run_continuity_chain proc~run_continuity_chain->proc~ocean_apply_conservative_min_thickness proc~run_stage_split run_stage_split proc~run_stage_split->proc~run_continuity_chain proc~ocean_dyn_step_split ocean_dyn_step_split proc~ocean_dyn_step_split->proc~run_stage_split proc~engine_step engine_step proc~engine_step->proc~ocean_dyn_step_split

Variables

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

Source Code

   pure subroutine assign_h_layer(nx, ny, nz, h_new, mask, h_layer)
      !! Copy the target field into h_layer on grounded columns only —
      !! non-grounded columns' h_new was never written, and their old
      !! h_layer is already the exact target.
      integer, intent(in) :: nx, ny, nz
      real(wp), intent(in) :: h_new(nx, ny, nz)
      real(wp), intent(in) :: mask(nx, ny, 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)
         if (mask(i, j, 1) > 0.5_wp) then
            h_layer(i, j, k) = h_new(i, j, k)
         end if
      end do
   end subroutine assign_h_layer