Scratch for Joe vis a vis tracer concentration
Suppose we have a prescribed injection function with units of
and for the purposes
of physics update I will assume we are looking at a single point and thus we only care about
In CAM one might think that they have control over
From the following code snippet
src/physics/cam/physics_types.F90
! Update constituents, all schemes use time split q: no tendency kept
call cnst_get_ind('CLDICE', ixcldice, abort=.false.)
call cnst_get_ind('CLDLIQ', ixcldliq, abort=.false.)
! Check for number concentration of cloud liquid and cloud ice (if not present
! the indices will be set to -1)
call cnst_get_ind('NUMICE', ixnumice, abort=.false.)
call cnst_get_ind('NUMLIQ', ixnumliq, abort=.false.)
call cnst_get_ind('NUMRAI', ixnumrain, abort=.false.)
call cnst_get_ind('NUMSNO', ixnumsnow, abort=.false.)
do m = 1, pcnst
if(ptend%lq(m)) then
do k = ptend%top_level, ptend%bot_level
state%q(:ncol,k,m) = state%q(:ncol,k,m) + ptend%q(:ncol,k,m) * dt
end do
! now test for mixing ratios which are too small
! don't call qneg3 for number concentration variables
if (m /= ixnumice .and. m /= ixnumliq .and. &
m /= ixnumrain .and. m /= ixnumsnow ) then
call qneg3(trim(ptend%name), state%lchnk, ncol, state%psetcols, pver, m, m, qmin(m:m), state%q(:,1:pver,m:m))
else
do k = ptend%top_level, ptend%bot_level
! checks for number concentration
state%q(:ncol,k,m) = max(1.e-12_r8,state%q(:ncol,k,m))
state%q(:ncol,k,m) = min(1.e10_r8,state%q(:ncol,k,m))
end do
end if
end if
end do
!------------------------------------------------------------------------
! This is a temporary fix for the large H, H2 in WACCM-X
! Well, it was supposed to be temporary, but it has been here
! for a while now.
!------------------------------------------------------------------------
if ( waccmx_is('ionosphere') .or. waccmx_is('neutral') ) then
call cnst_get_ind('H', ixh)
do k = ptend%top_level, ptend%bot_level
state%q(:ncol,k,ixh) = min(state%q(:ncol,k,ixh), 0.01_r8)
end do
call cnst_get_ind('H2', ixh2)
do k = ptend%top_level, ptend%bot_level
state%q(:ncol,k,ixh2) = min(state%q(:ncol,k,ixh2), 6.e-5_r8)
end do
endif
we find that although we theoretically believe that we can set the
tracer tendency , the physics update is
actually a first order explicit scheme, and so we have control over
where
Note that we know the timestep
so we can cancel it automatically.
Note that the given here is the
using the notation
of this presentation
I only really understand the time substepping scheme for SE, but as far as I can tell the of the three options laid out in this article tracer quantity will be added to the state in its entirety at the physics time step unless you force it to do "dribbling" which would be a wild choice for a non-thermodynamic tracer.
If the addition is happening all at once at the time of the physics update, then for the purposes of conservation all we care about is that we add a total amount of tracer mass to the grid point at this sudden update.
To make this fully concrete, suppose we take our state before the physics update is called:
. This state represents
the diagnostic state of the atmosphere at the current time step after the previous dynamics
and physics are finished.
If what we care about is the total mass added to the atmosphere over the injection period,
then all we are about is that from the time of the last physics update to this physics update
we have added
of this tracer to the atmosphere.
As such, the discrete equation we need to satisfy is
given we want that
where the sudden injection that is happening at is compensating for
the injection over the last time step neglecting dynamics.
As such, we can calculate
and
And we can rearrange to find
The long and short of it is, this will precisely control the amount of mass added but will not spread tracer insertion over tracer advection timesteps. If you really want to have both, set the dynamics and the physics time step to be the same. In the HSW idealized setup the added time will be negligible.
To sum up the single trick that I used, because the code can be made to instantaneously update
the tracer by a quantity before dynamics or tracer advection starts up again,
we get to make a principled assumption that is constant
during our update step, which is actually what the code is doing.
The reason I'm using the state is that sometimes
these quantities are dribbled over the previous dynamics substepping. By doing the update right when the
physics step begins, your update will be consistent with the diagnosed density at the beginning of the physics timestep.