drain_rescale_hTr Subroutine

private pure subroutine drain_rescale_hTr(nx, ny, nz, h_new, h_old, hTr)

Re-weight a tracer’s thickness-weighted content onto a new layer thickness, holding the CONCENTRATION fixed:

hTr := hTr · h_new / h_old (⇒ hTr/h_new ≡ hTr/h_old)

Used by the windowed (dt_tracer_advect_ratio > 1) path, whose prognostic is the CONTENT hTr while MOM6’s is the CONCENTRATION Tr. Freezing a content across a window over which continuity keeps advancing h silently corrupts every consumer that derives T = hTr/h_layer — the EOS above all — by δT/T = −δh/h. Freezing a concentration (what MOM6 does) does not. See continuity_tracer_step_split / continuity_tracer_drain.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nx
integer, intent(in) :: ny
integer, intent(in) :: nz
real(kind=wp), intent(in) :: h_new(nx,ny,nz)
real(kind=wp), intent(in) :: h_old(nx,ny,nz)
real(kind=wp), intent(inout) :: hTr(nx,ny,nz)

Called by

proc~~drain_rescale_htr~~CalledByGraph proc~drain_rescale_htr drain_rescale_hTr proc~continuity_gm_apply continuity_gm_apply proc~continuity_gm_apply->proc~drain_rescale_htr proc~continuity_tracer_drain continuity_tracer_drain proc~continuity_tracer_drain->proc~drain_rescale_htr proc~continuity_tracer_step_split continuity_tracer_step_split proc~continuity_tracer_step_split->proc~drain_rescale_htr proc~ocean_dyn_flush_tracer_window ocean_dyn_flush_tracer_window proc~ocean_dyn_flush_tracer_window->proc~continuity_tracer_drain proc~ocean_dyn_step ocean_dyn_step proc~ocean_dyn_step->proc~continuity_tracer_drain proc~run_stage run_stage proc~ocean_dyn_step->proc~run_stage proc~ocean_dyn_step_split ocean_dyn_step_split proc~ocean_dyn_step_split->proc~continuity_tracer_drain proc~run_gm_step run_gm_step proc~ocean_dyn_step_split->proc~run_gm_step proc~run_stage_split run_stage_split proc~ocean_dyn_step_split->proc~run_stage_split proc~run_continuity_chain run_continuity_chain proc~run_continuity_chain->proc~continuity_tracer_step_split proc~run_gm_step->proc~continuity_gm_apply proc~run_stage->proc~continuity_tracer_step_split proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~ocean_dyn_flush_tracer_window proc~engine_step engine_step proc~driver_run_ocean->proc~engine_step proc~engine_step->proc~ocean_dyn_step proc~engine_step->proc~ocean_dyn_step_split proc~rdb_ocean_set_tracer rdb_ocean_set_tracer proc~rdb_ocean_set_tracer->proc~ocean_dyn_flush_tracer_window proc~run_stage_split->proc~run_continuity_chain proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean proc~rdb_ocean_step rdb_ocean_step proc~rdb_ocean_step->proc~engine_step

Variables

Type Visibility Attributes Name Initial
integer, private :: i
integer, private :: j
integer, private :: k

Source Code

   pure subroutine drain_rescale_hTr(nx, ny, nz, h_new, h_old, hTr)
      !! Re-weight a tracer's thickness-weighted content onto a new layer
      !! thickness, holding the CONCENTRATION fixed:
      !!
      !!   hTr := hTr · h_new / h_old      (⇒ hTr/h_new ≡ hTr/h_old)
      !!
      !! Used by the windowed (`dt_tracer_advect_ratio > 1`) path, whose
      !! prognostic is the CONTENT `hTr` while MOM6's is the CONCENTRATION
      !! `Tr`.  Freezing a content across a window over which continuity
      !! keeps advancing `h` silently corrupts every consumer that derives
      !! `T = hTr/h_layer` — the EOS above all — by `δT/T = −δh/h`.  Freezing
      !! a concentration (what MOM6 does) does not.  See
      !! `continuity_tracer_step_split` / `continuity_tracer_drain`.
      integer, intent(in) :: nx, ny, nz
      real(wp), intent(in) :: h_new(nx, ny, nz), h_old(nx, ny, nz)
      real(wp), intent(inout) :: hTr(nx, ny, nz)
      integer :: i, j, k
      do concurrent(k=1:nz, j=1:ny, i=1:nx)
         hTr(i, j, k) = hTr(i, j, k)*h_new(i, j, k)/max(h_old(i, j, k), DRAIN_MIN_H)
      end do
   end subroutine drain_rescale_hTr