Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

Variable TAQ (Advection of Sp. Humidity) in the source code

acsubram

New Member
I have been trying to track the variable TAQ (Q horz + vert + fixer advection tendency) in the source code for CAM (either FV dyn. core or EUL) to find where the variable is being saved (by calling the outfld subroutine) and if there is a way to separate this into horz and vert terms in another subroutine where it is computed. Am unable to find this in the code although I can save it in the output files and it is listed in the master history variable list!

Has anyone tracked this variable before ? If yes, which subroutine should I look for to find how this variable is computed in the code ?

Thanks
 

hannay

Cecile Hannay
AMWG Liaison
Staff member
You add the field TAQ in: models/atm/cam/src/dynamics/fv/dyn_comp.F90

You output teh field TAQ in: models/atm/cam/src/dynamics/fv/dyn/advect_tend.F90

Look for the lines:
call addfld (tottnam(m), 'kg/kg/s ',pver, 'A',trim(cnst_name(m))//' horz + vert + fixer tendency ',dyn_decomp)
and
call outfld( tottnam(i), tmpxy, idim, j)
repesctively
 

acsubram

New Member
Thanks, Cecile ! Found this.

Am trying to figure out if there is a way to separate the advective tendency terms (for humidity and temp.) into horizontal and vertical advective tendency terms online, if possible. Don't see an easy way to do this yet.
 

olson

Member
For Eulerian, HAQ and VAQ are the horizontal and vertical advective tendencies of specific humidity.
Similar terms for T do not exist. And we did not succeed in separating the horizontal and vertical
advective terms in the FV dycore for either state variable.

Jerry O
 

olson

Member
and for code tracking purposes, the string "HAQ" is stored in the variable hadvnam.
"VAQ" is stored in vadvnam
 
Hello,   I got two questions about TAQ.   1). From the longname of TAQ it seems that it's not just advection itself. Could we output the advection of Q alone?    2). In my test ,the sum of  TAQ, DCQ and VD01 is not equal to Q(nt=i)-Q(nt=i-1). What is missing here?Thank you very much.  
 

olson

Member
>  I got two questions about TAQ.
>
>   1). From the longname of TAQ it seems that it's not just advection itself. Could we output the advection of Q alone?

       For the Eulerian dycore, HAQ and VAQ are the horizontal and vertical advective tendencies of specific humidity.
       There is also an extra term, DFQ which is a "fixer" term to conserve specific humidity.

       For the FV dycore, TAQ is not easily defined as a strictly advective term and we don't use it.



>   2). In my test, the sum of  TAQ, DCQ and VD01 is not equal to Q(nt=i)-Q(nt=i-1). What is missing here?

        Strictly speaking, your test should be:  [ Q(nt=i)-Q(nt=i-1) ]/dt = TAQ+DCQ+VD01

        But assuming that's what you meant, here are a couple other possibilities:


         a) For Eulerian, your test should work unless all the terms are "time-averaged" on the history file.  Your test
            will only work if TAQ, DCQ, and VD01 are "time-averaged" on the history file and [ Q(nt=i)-Q(nt=i-1) ]/dt is
            based on "instantaneous" Q OR if you are outputting to history file every timestep (in which case all terms
            are then "instantaneous" by definition).

         b) Your test won't work for FV since TAQ is ill-defined as noted above.  Alse there is an extra term on the physics
            side - "DMEQ" which is an extra term needed for moisture conservation in FV.
 
Thank you very much.Atually, before I got your reply I've added the DMEQ. The dQ/dt  test still dose not work.My simulation is output every timestep (dtime=1800s) with avgflg_pertape=I in usr_nl_cam,with FV core.  I guess the reason is from TAQ? In FV case, how can I quatify the contribution from horizontal and vertical movement?
 
And I assuming that even though [ Q(nt=i)-Q(nt=i-1) ]/dt = TAQ+DCQ+VD01+DMEQ does not work in FV case, the mosistrue conservation is still working in FV dycore simulation. Is that correct? 
 

olson

Member
    Correct. You can use your "test" equation to compute TAQ as a residual: TAQ = [ Q(nt=i)-Q(nt=i-1) ]/dt - (DMEQ + DCQ+VD01)
 
Thank you.But TAQ=[Q(nt=i)-Q(nt=i-1) ]/dt - (DMEQ + DCQ+VD01) also includes all the fixer tendencies,right? It is not equal to the the result directly using U,V,OMEGA and Q.      How much do fixers contribute to TAQ?  
 

olson

Member

   We found fixers contribute at most about 1% to the tendency when we checked
 for the Eulerian dycore.  Not sure for FV but it could be easily checked by
 comparing DMEQ vs the residual "TAQ" computed from reply #9.


> I have been trying to track the variable TAQ (Q horz + vert + fixer advection
> tendency) in the source code for CAM (either FV dyn. core or EUL) to find
> where the variable is being saved (by calling the outfld subroutine) and if
> there is a way to separate this into horz and vert terms in another
> subroutine where it is computed. Am unable to find this in the code although
> I can save it in the output files and it is listed in the master history
> variable list!

  The character string "TAQ" lives in a character variable called "tottnam"
(initialized in "physics/cam/constituents.F90").  So grep on "tottnam" to
 find where it's used in code.  Likewise, "HAQ" and "VAQ" are in the variables
 "hadvnam" and "vadvnam".  For FV, vertical advection is implicit in the
 methodology.  Neither HAQ or VAQ are explicitly available.  Many years
 ago, we attempted to back out these quantities but met with unsatisfactory
 results.
 
If I want to use the output data U,V,OMEGA and Q to calculate the horizontal  and vertical advection, what is your recommended method? I‘ve try velocity *partial derivative (Q) ,but it dose not fit with TAQ = [ Q(nt=i)-Q(nt=i-1) ]/dt - (DMEQ + DCQ+VD01) well.
 

olson

Member
Sorry, I have not used that method and don't have a good recommendation.  Someoneelse may want to pick up on this question.
 
Top