private pure subroutine multilayer_scan_vanished_content(this, nx, ny, n_bad, worst)
Pure I1′ TRIPWIRE scan — counts the vanished cells that do NOT hold
their donor’s concentration (rdb_vl_holds_live_conc: |hTr −
h·c_live| > 1e-12·|h·c_live|, i.e. hTr ≠ 0 in a column with no
live layer) and reports the largest offending |hTr − h·c_live|,
without touching anything. Two device reductions per tracer, two
scalars out; no H←D copy on the healthy path.
The impure half (log + error stop) lives with the caller, in
rdb_ocean_dyn, because this type is below the logger in the
dependency order and because a pure scan is what a unit test can
assert against without provoking an abort.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
Variables
Type
Visibility
Attributes
Name
Initial
integer,
private
::
n_t
integer,
private
::
t
real(kind=wp),
private
::
w_t
Source Code
pure subroutine multilayer_scan_vanished_content(this,nx,ny,n_bad,worst)!! Pure I1′ TRIPWIRE scan — counts the vanished cells that do NOT hold!! their donor's concentration (`rdb_vl_holds_live_conc`: `|hTr −!! h·c_live| > 1e-12·|h·c_live|`, i.e. `hTr ≠ 0` in a column with no!! live layer) and reports the largest offending `|hTr − h·c_live|`,!! without touching anything. Two device reductions per tracer, two!! scalars out; no H←D copy on the healthy path.!!!! The impure half (log + `error stop`) lives with the caller, in!! `rdb_ocean_dyn`, because this type is below the logger in the!! dependency order and because a `pure` scan is what a unit test can!! assert against without provoking an abort.class(multilayer_state_t),intent(in)::thisinteger,intent(in)::nx,nyinteger,intent(out)::n_bad!! Number of `(i,j,k,tracer)` cells violating I1′.real(wp),intent(out)::worst!! Largest `|hTr − h·c_live|` found in a vanished layer (0 when clean).integer::t,n_treal(wp)::w_tn_bad=0worst=0.0_wpif(.not.allocated(this%h_layer))return if(.not.allocated(this%tracers))return do t=1,size(this%tracers)if(.not.allocated(this%tracers(t)%hTr))cycle call scan_vanished_one_impl(nx,ny,this%nz_ml,this%h_layer,&this%tracers(t)%hTr,n_t,w_t)n_bad=n_bad+n_tworst=max(worst,w_t)end do end subroutine multilayer_scan_vanished_content