apply_surface_src_2d_nobudget_impl Subroutine

private pure subroutine apply_surface_src_2d_nobudget_impl(hTr, wet_mask, Q_field, inv_scale, k_top, nz, nx, ny)

Byte-for-byte copy of apply_surface_src_2d_impl with the budget dummy and its accumulation line removed — the pseudo-salt mirror of salinity’s surface flux, which by contract (budget_id = TRACER_BUDGET_NONE) must not touch salt_budget_surface. Separate _impl, not an in-loop present(budget) test (house idiom, see apply_surface_src_2d_dyn_impl’s docstring) — this keeps the production S/T impl untouched and the increment hTr receives bit-identical to salinity’s.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(inout) :: hTr(nx,ny,nz)
real(kind=wp), intent(in) :: wet_mask(nx,ny)
real(kind=wp), intent(in) :: Q_field(nx,ny)
real(kind=wp), intent(in) :: inv_scale
integer, intent(in) :: k_top(nx,ny)

See apply_surface_src_2d_impl. The SAME index salinity used, so the pseudo-salt increment stays bit-identical to salinity’s and the deviation keeps measuring transport.

integer, intent(in) :: nz
integer, intent(in) :: nx
integer, intent(in) :: ny

Calls

proc~~apply_surface_src_2d_nobudget_impl~~CallsGraph proc~apply_surface_src_2d_nobudget_impl apply_surface_src_2d_nobudget_impl local local proc~apply_surface_src_2d_nobudget_impl->local

Called by

proc~~apply_surface_src_2d_nobudget_impl~~CalledByGraph proc~apply_surface_src_2d_nobudget_impl apply_surface_src_2d_nobudget_impl proc~ocean_surface_flux_apply_tracers ocean_surface_flux_apply_tracers proc~ocean_surface_flux_apply_tracers->proc~apply_surface_src_2d_nobudget_impl proc~run_stage run_stage proc~run_stage->proc~ocean_surface_flux_apply_tracers proc~run_stage_split run_stage_split proc~run_stage_split->proc~ocean_surface_flux_apply_tracers proc~ocean_dyn_step ocean_dyn_step proc~ocean_dyn_step->proc~run_stage 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 proc~engine_step->proc~ocean_dyn_step_split proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_step proc~rdb_ocean_step rdb_ocean_step proc~rdb_ocean_step->proc~engine_step

Variables

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

Source Code

   pure subroutine apply_surface_src_2d_nobudget_impl(hTr, wet_mask, Q_field, &
                                                      inv_scale, k_top, nz, nx, ny)
      !! Byte-for-byte copy of `apply_surface_src_2d_impl` with the
      !! `budget` dummy and its accumulation line removed — the
      !! pseudo-salt mirror of salinity's surface flux, which by
      !! contract (`budget_id = TRACER_BUDGET_NONE`) must not touch
      !! `salt_budget_surface`.  Separate `_impl`, not an in-loop
      !! `present(budget)` test (house idiom, see
      !! `apply_surface_src_2d_dyn_impl`'s docstring) — this keeps the
      !! production S/T impl untouched and the increment `hTr` receives
      !! bit-identical to salinity's.
      integer, intent(in)    :: nz, nx, ny
      real(wp), intent(inout) :: hTr(nx, ny, nz)
      real(wp), intent(in)    :: wet_mask(nx, ny)
      real(wp), intent(in)    :: Q_field(nx, ny)
      real(wp), intent(in)    :: inv_scale
      integer, intent(in)    :: k_top(nx, ny)
         !! See `apply_surface_src_2d_impl`.  The SAME index salinity
         !! used, so the pseudo-salt increment stays bit-identical to
         !! salinity's and the deviation keeps measuring transport.
      integer :: i, j
      real(wp) :: cell
      do concurrent(j=1:ny, i=1:nx) local(cell)
         cell = inv_scale*Q_field(i, j)*wet_mask(i, j)
         hTr(i, j, k_top(i, j)) = hTr(i, j, k_top(i, j)) + cell
      end do
   end subroutine apply_surface_src_2d_nobudget_impl