relax_map_tracer_impl Subroutine

private pure subroutine relax_map_tracer_impl(hTr, h_layer, ref_tracer, it, n_tr, idamp_h, nx, ny, nz, dt)

Relax one tracer’s hTr toward ref_tracer(:,:,:,it)*h_layer at rate idamp_h, no budget mirror (every tracer except S/T — see relax_map_tracer_budget_impl). ref_tracer is passed WHOLE + indexed by the scalar it inside the kernel — never sliced by the caller (§6.4: a device array section of a mapped array is the descriptor-walk trap the dc-assumed-shape hook exists to catch).

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(inout) :: hTr(nx,ny,nz)
real(kind=wp), intent(in) :: h_layer(nx,ny,nz)
real(kind=wp), intent(in) :: ref_tracer(nx,ny,nz,n_tr)
integer, intent(in) :: it
integer, intent(in) :: n_tr
real(kind=wp), intent(in) :: idamp_h(nx,ny)
integer, intent(in) :: nx
integer, intent(in) :: ny
integer, intent(in) :: nz
real(kind=wp), intent(in) :: dt

Calls

proc~~relax_map_tracer_impl~~CallsGraph proc~relax_map_tracer_impl relax_map_tracer_impl local local proc~relax_map_tracer_impl->local proc~relax_toward relax_toward proc~relax_map_tracer_impl->proc~relax_toward

Called by

proc~~relax_map_tracer_impl~~CalledByGraph proc~relax_map_tracer_impl relax_map_tracer_impl proc~ocean_sponge_apply_maps ocean_sponge_apply_maps proc~ocean_sponge_apply_maps->proc~relax_map_tracer_impl proc~run_stage_split run_stage_split proc~run_stage_split->proc~ocean_sponge_apply_maps 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_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 :: decay
integer, private :: i
integer, private :: j
integer, private :: k
real(kind=wp), private :: tgt

Source Code

   pure subroutine relax_map_tracer_impl(hTr, h_layer, ref_tracer, it, n_tr, &
                                         idamp_h, nx, ny, nz, dt)
      !! Relax one tracer's `hTr` toward `ref_tracer(:,:,:,it)*h_layer` at
      !! rate `idamp_h`, no budget mirror (every tracer except S/T — see
      !! `relax_map_tracer_budget_impl`). `ref_tracer` is passed WHOLE +
      !! indexed by the scalar `it` inside the kernel — never sliced by the
      !! caller (§6.4: a device array section of a mapped array is the
      !! descriptor-walk trap the `dc-assumed-shape` hook exists to catch).
      integer, intent(in)    :: it, n_tr, nx, ny, nz
      real(wp), intent(inout) :: hTr(nx, ny, nz)
      real(wp), intent(in)    :: h_layer(nx, ny, nz)
      real(wp), intent(in)    :: ref_tracer(nx, ny, nz, n_tr)
      real(wp), intent(in)    :: idamp_h(nx, ny)
      real(wp), intent(in)    :: dt
      integer :: i, j, k
      real(wp) :: decay, tgt
      do concurrent(k=1:nz, j=1:ny, i=1:nx) local(decay, tgt)
         if (idamp_h(i, j) > 0.0_wp) then
            decay = exp(-idamp_h(i, j)*dt)
            tgt = ref_tracer(i, j, k, it)*h_layer(i, j, k)
            hTr(i, j, k) = relax_toward(hTr(i, j, k), tgt, decay)
         end if
      end do
   end subroutine relax_map_tracer_impl