Skip to content

Commit 22662e5

Browse files
authored
Add calculation for accumulated physics tendencies for theta, qv, u and v (#1583)
TYPE: enhancement KEYWORDS: accumulated physics tendencies, diagnostics only SOURCE: internal DESCRIPTION OF CHANGES: Problem: WRF model can output physics tendencies at any output times, but they are instantaneous values. Solution: Add calculation to accumulate physics tendencies in any history output window for theta, qv, u and v fields. In all, 16 new arrays are added for cumulus, microphysics, shallow cumulus, PBL and radiation. The calculation can be turned on by namelist switch acc_phy_tend = 1 in &physics. LIST OF MODIFIED FILES: M Registry/Registry.EM_COMMON M phys/module_diagnostics_driver.F M phys/module_diag_misc.F TESTS CONDUCTED: 1. Tests are conducted, and accumulated tendency output is checked. 2. Jenkins tests are all passing. RELEASE NOTE: Sixteen accumulated physics tendencies fields for potential temperature, water vapor mixing ratio, u and v components of the wind are added, and it can be turned on by namelist option acc_phy_tend = 1 in &physics.
1 parent 23c5db5 commit 22662e5

File tree

3 files changed

+166
-1
lines changed

3 files changed

+166
-1
lines changed

Registry/Registry.EM_COMMON

+21-1
Original file line numberDiff line numberDiff line change
@@ -2124,6 +2124,24 @@ state real brtemp ij dyn_em 1 - i01h "brtem
21242124
state real cldmask ij dyn_em 1 - i01h "cldmask" "Cloud mask" "-"
21252125
state real cldtopz ij dyn_em 1 - i01h "cldtopz" "Cloud top height above sea level" "m asl"
21262126
state real cldbasez ij dyn_em 1 - i01h "cldbasez" "Cloud base height above ground level" "m agl"
2127+
2128+
# Accumulated physics tendencies
2129+
state real ATHMPTEN ikj misc 1 - h "ATHMPTEN" "ACCUMULATED THETA TENDENCY DUE TO MICROPHY SCHEME" "K "
2130+
state real AQVMPTEN ikj misc 1 - h "AQVMPTEN" "ACCUMULATED Q_V TENDENCY DUE TO MICROPHY SCHEME" "kg kg-1 "
2131+
state real ATHCUTEN ikj misc 1 - h "ATHCUTEN" "ACCUMULATED THETA TENDENCY DUE TO CUMULUS SCHEME" "K "
2132+
state real AQVCUTEN ikj misc 1 - h "AQVCUTEN" "ACCUMULATED Q_V TENDENCY DUE TO CUMULUS SCHEME" "kg kg-1 "
2133+
state real AUCUTEN ikj misc 1 - h "AUCUTEN" "ACCUMULATED X WIND TENDENCY DUE TO CUMULUS SCHEME" "m s-1 "
2134+
state real AVCUTEN ikj misc 1 - h "AVCUTEN" "ACCUMULATED Y WIND TENDENCY DUE TO CUMULUS SCHEME" "m s-1 "
2135+
state real ATHSHTEN ikj misc 1 - h "ATHSHTEN" "ACCUMULATED THETA TENDENCY DUE TO SHALLOW SCHEME" "K "
2136+
state real AQVSHTEN ikj misc 1 - h "AQVSHTEN" "ACCUMULATED Q_V TENDENCY DUE TO SHALLOW SCHEME" "kg kg-1 "
2137+
state real AUSHTEN ikj misc 1 - h "AUSHTEN" "ACCUMULATED X WIND TENDENCY DUE TO SHALLOW SCHEME" "m s-1 "
2138+
state real AVSHTEN ikj misc 1 - h "AVSHTEN" "ACCUMULATED Y WIND TENDENCY DUE TO SHALLOW SCHEME" "m s-1 "
2139+
state real ATHBLTEN ikj misc 1 - h "ATHBLTEN" "ACCUMULATED THETA TENDENCY DUE TO PBL SCHEME" "K "
2140+
state real AQVBLTEN ikj misc 1 - h "AQVBLTEN" "ACCUMULATED Q_V TENDENCY DUE TO PBL SCHEME" "kg kg-1 "
2141+
state real AUBLTEN ikj misc 1 - h "AUBLTEN" "ACCUMULATED X WIND TENDENCY DUE TO PBL SCHEME" "m s-1 "
2142+
state real AVBLTEN ikj misc 1 - h "AVBLTEN" "ACCUMULATED Y WIND TENDENCY DUE TO PBL SCHEME" "m s-1 "
2143+
state real ATHRATENLW ikj misc 1 - h "ATHRATENLW" "ACCUMULATED THETA TENDENCY DUE TO LW RADIATION SCHEME" "K "
2144+
state real ATHRATENSW ikj misc 1 - h "ATHRATENSW" "ACCUMULATED THETA TENDENCY DUE TO SW RADIATION SCHEME" "K "
21272145
#
21282146
#---------------------------------------------------------------------------------------------------------------------------------------
21292147
#
@@ -2611,6 +2629,7 @@ rconfig integer morr_rimed_ice namelist,physics 1 1
26112629

26122630
rconfig integer clean_atm_diag namelist,physics 1 0 rh "clean_atm_diag" "option to switch on clean sky diagnostics (for chem)" "flag"
26132631
rconfig integer calc_clean_atm_diag derived 1 0 - "calc_clean_atm_diag" "carries decision on using clean sky diagnostics" "flag"
2632+
rconfig integer acc_phy_tend namelist,physics max_domains 0 rh "acc_phy_tend" "option to output accumulated physics tendencies" "flag"
26142633

26152634
# MAD-WRF
26162635
rconfig integer madwrf_opt namelist,physics 1 0 rh "madwrf_opt" "MAD-WRF model" "0: off, 1: Advect/diffuse hydromets, 2: Nudge advected/diffused hydrometes to model state"
@@ -3319,7 +3338,8 @@ package seabreeze2d_x ideal_case==8 - -
33193338
package les ideal_case==9 - -
33203339
# WRF-Chem specific diagnostics
33213340
package clnatmdiag calc_clean_atm_diag==1 - state:SWUPTCLN,SWDNTCLN,SWUPBCLN,SWDNBCLN,LWUPTCLN,LWDNTCLN,LWUPBCLN,LWDNBCLN
3322-
3341+
#
3342+
package acc_phys_tend acc_phy_tend==1 - state:ATHMPTEN,AQVMPTEN,ATHCUTEN,AQVCUTEN,AUCUTEN,AVCUTEN,ATHSHTEN,AQVSHTEN,AUSHTEN,AVSHTEN,ATHBLTEN,AQVBLTEN,AUBLTEN,AVBLTEN,ATHRATENLW,ATHRATENSW
33233343

33243344
#---------------------------------------------------------------------------------------------------------------------------------------
33253345
## communications

phys/module_diag_misc.F

+126
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,24 @@ SUBROUTINE diagnostic_output_calc( &
2828
,I_ACSWUPB,I_ACSWUPBC,I_ACSWDNB,I_ACSWDNBC & ! Optional
2929
,I_ACLWUPT,I_ACLWUPTC,I_ACLWDNT,I_ACLWDNTC & ! Optional
3030
,I_ACLWUPB,I_ACLWUPBC,I_ACLWDNB,I_ACLWDNBC & ! Optional
31+
,athmp, aqvmp &
32+
,athcu, aqvcu, aucu, avcu &
33+
,athsh, aqvsh, aush, avsh &
34+
,athbl, aqvbl, aubl, avbl &
35+
,athralw, athrasw &
36+
,h_diabatic, qv_diabatic &
37+
,rthcuten, rqvcuten, rucuten, rvcuten &
38+
,rthshten, rqvshten, rushten, rvshten &
39+
,rthblten, rqvblten, rublten, rvblten &
40+
,rthratenlw, rthratensw &
3141
,dt,xtime &
3242
,diag_print &
3343
,bucket_mm, bucket_J &
3444
,prec_acc_c, prec_acc_nc, snow_acc_nc &
3545
,snowncv, prec_acc_dt, curr_secs2 &
3646
,history_interval &
3747
,itimestep &
48+
,cu_used, shcu_used, acc_phy_tend &
3849
)
3950
!----------------------------------------------------------------------
4051

@@ -47,6 +58,38 @@ SUBROUTINE diagnostic_output_calc( &
4758
!-- DIAG_PRINT print control: 0 - no diagnostics; 1 - dmudt only; 2 - all
4859
!-- DT time step (second)
4960
!-- XTIME forecast time
61+
!-- ACSWUPT
62+
!-- ACSWUPTC
63+
!-- ACSWDNT
64+
!-- ACSWDNTC
65+
!-- ACSWUPB
66+
!-- ACSWUPBC
67+
!-- ACSWDNB
68+
!-- ACSWDNBC
69+
!-- ACLWUPT
70+
!-- ACLWUPTC
71+
!-- ACLWDNT
72+
!-- ACLWDNTC
73+
!-- ACLWUPB
74+
!-- ACLWUPBC
75+
!-- ACLWDNB
76+
!-- ACLWDNBC
77+
!-- ATHMPTEN Accumulated theta tendency from microphysics
78+
!-- AQVMPTEN Accumulated qv tendency from microphysics
79+
!-- ATHCUTEN Accumulated theta tendency from cumulus physics
80+
!-- AQVCUTEN Accumulated qv tendency from cumulus physics
81+
!-- AUCUTEN Accumulated u-wind tendency from cumulus physics
82+
!-- AVCUTEN Accumulated v-wind tendency from cumulus physics
83+
!-- ATHSHTEN Accumulated theta tendency from shallow cumulus
84+
!-- AQVSHTEN Accumulated qv tendency from shallow cumulus
85+
!-- AUSHTEN Accumulated u-wind tendency from shallow cumulus
86+
!-- AVSHTEN Accumulated v-wind tendency from shallow cumulus
87+
!-- ATHBLTEN Accumulated theta tendency from pbl physics
88+
!-- AQVBLTEN Accumulated qv tendency from pbl physics
89+
!-- AUBLTEN Accumulated u-wind tendency from pbl physics
90+
!-- AVBLTEN Accumulated v-wind tendency from pbl physics
91+
!-- ATHRATENLW Accumulated theta tendency from longwave radiation
92+
!-- ATHRATENSW Accumulated theta tendency from shortwave radiation
5093
!-- P8W 3D pressure array at full eta levels
5194
!-- MU dry column hydrostatic pressure
5295
!-- RAINC cumulus scheme precipitation since hour 0
@@ -124,6 +167,21 @@ SUBROUTINE diagnostic_output_calc( &
124167
, PK1M
125168

126169
REAL, INTENT(IN ) :: DT, XTIME
170+
INTEGER, INTENT(IN ) :: cu_used, shcu_used, acc_phy_tend
171+
REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(INOUT) ::&
172+
athmp,aqvmp &
173+
,athcu,aqvcu,aucu,avcu &
174+
,athsh,aqvsh,aush,avsh &
175+
,athbl,aqvbl,aubl,avbl &
176+
,athralw,athrasw
177+
178+
REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(IN) :: &
179+
h_diabatic,qv_diabatic &
180+
,rthcuten,rqvcuten,rucuten,rvcuten &
181+
,rthshten,rqvshten,rushten,rvshten &
182+
,rthblten,rqvblten,rublten,rvblten &
183+
,rthratenlw,rthratensw
184+
127185
INTEGER, DIMENSION( ims:ime , jms:jme ), INTENT(INOUT) :: &
128186
I_RAINC, &
129187
I_RAINNC
@@ -159,6 +217,74 @@ SUBROUTINE diagnostic_output_calc( &
159217

160218
INTEGER :: idump
161219

220+
!-----------------------------------------------------------------
221+
! Compute physics tendency accumulations in a given time window
222+
223+
IF ( acc_phy_tend .gt. 0 ) THEN
224+
225+
! !$OMP PARALLEL DO &
226+
! !$OMP PRIVATE ( ij )
227+
DO ij = 1 , num_tiles
228+
229+
IF (mod(curr_secs2, history_interval*60.) == 0.) THEN
230+
WRITE(outstring,*) 'Reseting accumulation to 0'
231+
CALL wrf_debug ( 10, TRIM(outstring) )
232+
DO j=j_start(ij),j_end(ij)
233+
DO k=kps,kpe
234+
DO i=i_start(ij),i_end(ij)
235+
athmp(i,k,j) = 0.
236+
aqvmp(i,k,j) = 0.
237+
IF ( cu_used == 1 ) THEN
238+
athcu(i,k,j) = 0.
239+
aqvcu(i,k,j) = 0.
240+
aucu(i,k,j) = 0.
241+
avcu(i,k,j) = 0.
242+
END IF
243+
IF ( shcu_used == 1 ) THEN
244+
athsh(i,k,j) = 0.
245+
aqvsh(i,k,j) = 0.
246+
aush(i,k,j) = 0.
247+
avsh(i,k,j) = 0.
248+
END IF
249+
athbl(i,k,j) = 0.
250+
aqvbl(i,k,j) = 0.
251+
aubl(i,k,j) = 0.
252+
avbl(i,k,j) = 0.
253+
athralw(i,k,j) = 0.
254+
athrasw(i,k,j) = 0.
255+
ENDDO
256+
ENDDO
257+
ENDDO
258+
ENDIF
259+
DO j=j_start(ij),j_end(ij)
260+
DO k=kps,kpe
261+
DO i=i_start(ij),i_end(ij)
262+
athmp(i,k,j) = athmp(i,k,j) + h_diabatic(i,k,j)*dt
263+
aqvmp(i,k,j) = aqvmp(i,k,j) + qv_diabatic(i,k,j)*dt
264+
IF ( cu_used == 1 ) THEN
265+
athcu(i,k,j) = athcu(i,k,j) + rthcuten(i,k,j)*dt
266+
aqvcu(i,k,j) = aqvcu(i,k,j) + rqvcuten(i,k,j)*dt
267+
aucu(i,k,j) = aucu(i,k,j) + rucuten(i,k,j)*dt
268+
avcu(i,k,j) = avcu(i,k,j) + rvcuten(i,k,j)*dt
269+
END IF
270+
IF ( shcu_used == 1 ) THEN
271+
athsh(i,k,j) = athsh(i,k,j) + rthshten(i,k,j)*dt
272+
aqvsh(i,k,j) = aqvsh(i,k,j) + rqvshten(i,k,j)*dt
273+
aush(i,k,j) = aush(i,k,j) + rushten(i,k,j)*dt
274+
avsh(i,k,j) = avsh(i,k,j) + rvshten(i,k,j)*dt
275+
END IF
276+
athbl(i,k,j) = athbl(i,k,j) + rthblten(i,k,j)*dt
277+
aqvbl(i,k,j) = aqvbl(i,k,j) + rqvblten(i,k,j)*dt
278+
aubl(i,k,j) = aubl(i,k,j) + rublten(i,k,j)*dt
279+
avbl(i,k,j) = avbl(i,k,j) + rvblten(i,k,j)*dt
280+
athralw(i,k,j) = athralw(i,k,j) + rthratenlw(i,k,j)*dt
281+
athrasw(i,k,j) = athrasw(i,k,j) + rthratensw(i,k,j)*dt
282+
ENDDO
283+
ENDDO
284+
ENDDO
285+
ENDDO
286+
ENDIF
287+
162288
!-----------------------------------------------------------------
163289
! Handle accumulations with buckets to prevent round-off truncation in long runs
164290
! This is done every 360 minutes assuming time step fits exactly into 360 minutes

phys/module_diagnostics_driver.F

+19
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,22 @@ SUBROUTINE diagnostics_driver ( grid, config_flags, &
365365
,I_ACLWDNT=grid%i_aclwdnt ,I_ACLWDNTC=grid%i_aclwdntc &
366366
,I_ACLWUPB=grid%i_aclwupb ,I_ACLWUPBC=grid%i_aclwupbc &
367367
,I_ACLWDNB=grid%i_aclwdnb ,I_ACLWDNBC=grid%i_aclwdnbc &
368+
,athmp=grid%athmpten ,aqvmp=grid%aqvmpten &
369+
,athcu=grid%athcuten ,aqvcu=grid%aqvcuten &
370+
,aucu=grid%aucuten ,avcu=grid%avcuten &
371+
,athsh=grid%athshten ,aqvsh=grid%aqvshten &
372+
,aush=grid%aushten ,avsh=grid%avshten &
373+
,athbl=grid%athblten ,aqvbl=grid%aqvblten &
374+
,aubl=grid%aublten ,avbl=grid%avblten &
375+
,athralw=grid%athratenlw ,athrasw=grid%athratensw &
376+
,h_diabatic=grid%h_diabatic ,qv_diabatic=grid%qv_diabatic &
377+
,rthcuten=grid%rthcuten ,rqvcuten=grid%rqvcuten &
378+
,rucuten=grid%rucuten ,rvcuten=grid%rvcuten &
379+
,rthshten=grid%rthshten ,rqvshten=grid%rqvshten &
380+
,rushten=grid%rushten ,rvshten=grid%rvshten &
381+
,rthblten=grid%rthblten ,rqvblten=grid%rqvblten &
382+
,rublten=grid%rublten ,rvblten=grid%rvblten &
383+
,rthratenlw=grid%rthratenlw ,rthratensw=grid%rthratensw &
368384
! Selection flag
369385
,DIAG_PRINT=config_flags%diag_print &
370386
,BUCKET_MM=config_flags%bucket_mm &
@@ -376,6 +392,9 @@ SUBROUTINE diagnostics_driver ( grid, config_flags, &
376392
,CURR_SECS2=curr_secs2 &
377393
,HISTORY_INTERVAL=grid%history_interval &
378394
,ITIMESTEP=grid%itimestep &
395+
,cu_used=grid%cu_used &
396+
,shcu_used=grid%shcu_used &
397+
,acc_phy_tend=grid%acc_phy_tend &
379398
! Dimension arguments
380399
,IDS=ids,IDE=ide, JDS=jds,JDE=jde, KDS=kds,KDE=kde &
381400
,IMS=ims,IME=ime, JMS=jms,JME=jme, KMS=kms,KME=kme &

0 commit comments

Comments
 (0)