water_column_impl Subroutine

private pure subroutine water_column_impl(bt_H_ref, bt_eta, cover, buf)

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: bt_H_ref(:,:)
real(kind=wp), intent(in) :: bt_eta(:,:)
real(kind=wp), intent(in) :: cover(:,:)
real(kind=wp), intent(inout) :: buf(:,:,:)

Called by

proc~~water_column_impl~~CalledByGraph proc~water_column_impl water_column_impl proc~fill_water_column fill_water_column proc~fill_water_column->proc~water_column_impl

Variables

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

Source Code

   pure subroutine water_column_impl(bt_H_ref, bt_eta, cover, buf)
      ! assumed-shape-ok: diag fill — fires once per output frame (cadence-bounded).
      real(wp), intent(in)    :: bt_H_ref(:, :), bt_eta(:, :), cover(:, :)  ! assumed-shape-ok: diag fill — cadence-bounded
      real(wp), intent(inout) :: buf(:, :, :)  ! assumed-shape-ok: diag fill — cadence-bounded
      integer :: i, j, nx, ny
      real(wp) :: qnan
      nx = min(size(buf, 1), size(bt_H_ref, 1), size(bt_eta, 1), size(cover, 1))
      ny = min(size(buf, 2), size(bt_H_ref, 2), size(bt_eta, 2), size(cover, 2))
      qnan = ieee_value(0.0_wp, ieee_quiet_nan)
      do concurrent(j=1:ny, i=1:nx)
         if (cover(i, j) > 0.5_wp) then
            buf(i, j, 1) = bt_H_ref(i, j) + bt_eta(i, j)
         else
            buf(i, j, 1) = qnan
         end if
      end do
   end subroutine water_column_impl