fill_ssh_ml_impl Subroutine

private pure subroutine fill_ssh_ml_impl(h_layer, b, nz_ml, buf)

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: h_layer(:,:,:)
real(kind=wp), intent(in) :: b(:,:)
integer, intent(in) :: nz_ml
real(kind=wp), intent(inout) :: buf(:,:,:)

Calls

proc~~fill_ssh_ml_impl~~CallsGraph proc~fill_ssh_ml_impl fill_ssh_ml_impl local local proc~fill_ssh_ml_impl->local

Called by

proc~~fill_ssh_ml_impl~~CalledByGraph proc~fill_ssh_ml_impl fill_ssh_ml_impl proc~fill_ssh fill_ssh proc~fill_ssh->proc~fill_ssh_ml_impl

Variables

Type Visibility Attributes Name Initial
real(kind=wp), private :: col_sum
integer, private :: i
integer, private :: j
integer, private :: k
integer, private :: nx
integer, private :: ny

Source Code

   pure subroutine fill_ssh_ml_impl(h_layer, b, nz_ml, buf)
      ! assumed-shape-ok: diag fill — fires once per output frame (cadence-bounded).
      real(wp), intent(in)    :: h_layer(:, :, :)
      real(wp), intent(in)    :: b(:, :)  ! assumed-shape-ok: diag fill — cadence-bounded
      integer, intent(in)    :: nz_ml
      real(wp), intent(inout) :: buf(:, :, :)  ! assumed-shape-ok: diag fill — cadence-bounded
      integer :: i, j, k, nx, ny
      real(wp) :: col_sum
      nx = size(buf, 1)
      ny = size(buf, 2)
      do concurrent(j=1:ny, i=1:nx) local(col_sum, k)
         col_sum = 0.0_wp
         do k = 1, nz_ml
            col_sum = col_sum + h_layer(i, j, k)
         end do
         buf(i, j, 1) = col_sum - b(i, j)
      end do
   end subroutine fill_ssh_ml_impl