fill_transport_x_impl Subroutine

private pure subroutine fill_transport_x_impl(h_layer, u_face, buf)

Arguments

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

Calls

proc~~fill_transport_x_impl~~CallsGraph proc~fill_transport_x_impl fill_transport_x_impl local local proc~fill_transport_x_impl->local

Called by

proc~~fill_transport_x_impl~~CalledByGraph proc~fill_transport_x_impl fill_transport_x_impl proc~fill_transport_x fill_transport_x proc~fill_transport_x->proc~fill_transport_x_impl

Variables

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

Source Code

   pure subroutine fill_transport_x_impl(h_layer, u_face, buf)
      ! assumed-shape-ok: diag fill — fires once per output frame (cadence-bounded).
      real(wp), intent(in)    :: h_layer(:, :, :), u_face(:, :, :)
      real(wp), intent(inout) :: buf(:, :, :)  ! assumed-shape-ok: diag fill — cadence-bounded
      integer :: i, j, k, nx, ny, nz
      real(wp) :: u_c, col
      nx = min(size(buf, 1), size(u_face, 1) - 1)
      ny = min(size(buf, 2), size(u_face, 2))
      nz = min(size(u_face, 3), size(h_layer, 3))
      do concurrent(j=1:ny, i=1:nx) &
         local(u_c, col, k)
         col = 0.0_wp
         do k = 1, nz
            u_c = 0.5_wp*(u_face(i, j, k) + u_face(i + 1, j, k))
            col = col + h_layer(i, j, k)*u_c
         end do
         buf(i, j, 1) = col
      end do
   end subroutine fill_transport_x_impl