tfreeze_ib_impl Subroutine

private pure subroutine tfreeze_ib_impl(s_far, p_top, active, eos, buf)

Uses

  • proc~~tfreeze_ib_impl~~UsesGraph proc~tfreeze_ib_impl tfreeze_ib_impl module~rdb_eos rdb_eos proc~tfreeze_ib_impl->module~rdb_eos module~rdb_constants rdb_constants module~rdb_eos->module~rdb_constants module~rdb_grid rdb_grid module~rdb_eos->module~rdb_grid pic_types pic_types module~rdb_constants->pic_types module~rdb_grid->module~rdb_constants

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: s_far(:,:)
real(kind=wp), intent(in) :: p_top(:,:)
real(kind=wp), intent(in) :: active(:,:)
type(eos_t), intent(in) :: eos
real(kind=wp), intent(inout) :: buf(:,:,:)

Calls

proc~~tfreeze_ib_impl~~CallsGraph proc~tfreeze_ib_impl tfreeze_ib_impl proc~eos_freezing_point eos_freezing_point proc~tfreeze_ib_impl->proc~eos_freezing_point

Called by

proc~~tfreeze_ib_impl~~CalledByGraph proc~tfreeze_ib_impl tfreeze_ib_impl proc~fill_tfreeze_ib fill_tfreeze_ib proc~fill_tfreeze_ib->proc~tfreeze_ib_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 tfreeze_ib_impl(s_far, p_top, active, eos, buf)
      ! assumed-shape-ok: diag fill — fires once per output frame (cadence-bounded).
      use rdb_eos, only: eos_t, eos_freezing_point
      real(wp), intent(in)    :: s_far(:, :), p_top(:, :), active(:, :)  ! assumed-shape-ok: diag fill — cadence-bounded
      type(eos_t), intent(in) :: eos
      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(s_far, 1), size(p_top, 1), size(active, 1))
      ny = min(size(buf, 2), size(s_far, 2), size(p_top, 2), size(active, 2))
      qnan = ieee_value(0.0_wp, ieee_quiet_nan)
      do concurrent(j=1:ny, i=1:nx)
         if (active(i, j) > 0.5_wp) then
            buf(i, j, 1) = eos_freezing_point(eos, s_far(i, j), p_top(i, j))
         else
            buf(i, j, 1) = qnan
         end if
      end do
   end subroutine tfreeze_ib_impl