Skip to content

Commit cfc2801

Browse files
authored
Bug fix and rework the scale-aware code (wrf-model#1840)
TYPE: bug fix KEYWORDS: scale-aware ntiedtke SOURCE: internal DESCRIPTION OF CHANGES: Problem: The original PR to add scale-awareness to the new Tiedtke scheme had a bug: the introduction of the namelist control didn't work correctly. Also the introduction of the namelist control made the code look ugly. After discussing with the original developer, we agreed if the changes to scale the cloud to rain conversion coefficient (which helps to reduce very light precip), and saturation check as a condition for triggering mid-level convection (which helps to the number of grid points that are classified as mid-level convection) are removed, the rest of the code can be added without a namelist control. Solution: Removing the namelist introduced in PR#1806, and the changes related to cloud-to-rain conversion coefficient and saturation check for mid-level convection, and only keeping the scale-awareness only for convective adjustment time scale and shallow mass fluxes. LIST OF MODIFIED FILES: M Registry/Registry.EM_COMMON M dyn_em/module_first_rk_step_part1.F M phys/module_cu_ntiedtke.F M phys/module_cumulus_driver.F TESTS CONDUCTED: 1. Works as expected in two cases. 2. The Jenkins tests have passed.
1 parent ece8149 commit cfc2801

File tree

4 files changed

+18
-78
lines changed

4 files changed

+18
-78
lines changed

Registry/Registry.EM_COMMON

-1
Original file line numberDiff line numberDiff line change
@@ -2459,7 +2459,6 @@ rconfig integer cu_diag namelist,physics max_domains 0
24592459
rconfig integer kf_edrates namelist,physics max_domains 0 rh "kf_edrates" "output entrainment/detrainment rates and convective timescale for KF schemes" ""
24602460
rconfig integer kfeta_trigger namelist,physics 1 1 rh "KFETA Trigger function" "" ""
24612461
rconfig integer nsas_dx_factor namelist,physics 1 0 rh "NSAS DX-dependent option" "" ""
2462-
rconfig integer ntiedtke_dx_opt namelist,physics 1 0 rh "nTiedtke DX-dependent option" "" ""
24632462
rconfig real CUDT namelist,physics max_domains 0 h "CUDT" "" ""
24642463
rconfig real GSMDT namelist,physics max_domains 0 h "GSMDT" "" ""
24652464
rconfig integer ISFFLX namelist,physics 1 1 irh "ISFFLX" "" ""

dyn_em/module_first_rk_step_part1.F

-1
Original file line numberDiff line numberDiff line change
@@ -1480,7 +1480,6 @@ SUBROUTINE first_rk_step_part1 ( grid , config_flags &
14801480
!BSINGH -ENDS
14811481
& ,KFETA_TRIGGER=config_flags%kfeta_trigger &
14821482
& ,NSAS_DX_FACTOR=config_flags%nsas_dx_factor &
1483-
& ,NTIEDTKE_DX_OPT=config_flags%ntiedtke_dx_opt &
14841483
! Dimension arguments
14851484
& ,IDS=ids,IDE=ide, JDS=jds,JDE=jde, KDS=kds,KDE=kde &
14861485
& ,IMS=ims,IME=ime, JMS=jms,JME=jme, KMS=kms,KME=kme &

phys/module_cu_ntiedtke.F

+18-67
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ subroutine cu_ntiedtke( &
150150
,u3d,v3d,w,t3d,qv3d,qc3d,qi3d,pi3d,rho3d &
151151
,qvften,thften &
152152
,dz8w,pcps,p8w,xland,cu_act_flag,dx &
153-
,ntiedtke_dx_opt &
154153
,ids,ide, jds,jde, kds,kde &
155154
,ims,ime, jms,jme, kms,kme &
156155
,its,ite, jts,jte, kts,kte &
@@ -192,7 +191,6 @@ subroutine cu_ntiedtke( &
192191
!-- dz8w dz between full levels (m)
193192
!-- qfx upward moisture flux at the surface (kg/m^2/s)
194193
!-- hfx upward heat flux at the surface (w/m^2)
195-
!-- ntiedtke_dx_opt whether the schemem is scale-aware
196194
!-- dt time step (s)
197195
!-- ids start index for i in domain
198196
!-- ide end index for i in domain
@@ -219,8 +217,6 @@ subroutine cu_ntiedtke( &
219217
itimestep, &
220218
stepcu
221219

222-
integer, intent(in) :: ntiedtke_dx_opt
223-
224220
real, intent(in) :: &
225221
dt
226222
real, dimension(ims:ime, jms:jme), intent(in) :: &
@@ -235,7 +231,6 @@ subroutine cu_ntiedtke( &
235231
logical, dimension(ims:ime,jms:jme), intent(inout) :: &
236232
cu_act_flag
237233

238-
239234
real, dimension(ims:ime, kms:kme, jms:jme), intent(in) :: &
240235
dz8w, &
241236
pcps, &
@@ -430,7 +425,7 @@ subroutine cu_ntiedtke( &
430425
!
431426
!########################################################################
432427
call tiecnvn(u1,v1,t1,q1,q2,q3,q1b,t1b,ghtl,ghti,omg,prsl,prsi,evap,heatflux, &
433-
rn,slimsk,im,kx,kx1,delt,dx2d,ntiedtke_dx_opt)
428+
rn,slimsk,im,kx,kx1,delt,dx2d)
434429

435430
do i=its,ite
436431
raincv(i,j)=rn(i)/stepcu
@@ -559,7 +554,7 @@ end subroutine ntiedtkeinit
559554
! level 1 subroutine 'tiecnvn'
560555
!-----------------------------------------------------------------
561556
subroutine tiecnvn(pu,pv,pt,pqv,pqc,pqi,pqvf,ptf,poz,pzz,pomg, &
562-
& pap,paph,evap,hfx,zprecc,lndj,lq,km,km1,dt,dx,ntiedtke_dx_opt)
557+
& pap,paph,evap,hfx,zprecc,lndj,lq,km,km1,dt,dx)
563558
!-----------------------------------------------------------------
564559
! this is the interface between the model and the mass
565560
! flux convection module
@@ -581,7 +576,6 @@ subroutine tiecnvn(pu,pv,pt,pqv,pqc,pqi,pqvf,ptf,poz,pzz,pomg, &
581576
& zqsat(lq,km), pqc(lq,km), pqi(lq,km), zrain(lq)
582577
real pqvf(lq,km), ptf(lq,km)
583578
real dx(lq)
584-
integer ntiedtke_dx_opt
585579

586580
integer icbot(lq), ictop(lq), ktype(lq), lndj(lq)
587581
logical locum(lq)
@@ -590,16 +584,18 @@ subroutine tiecnvn(pu,pv,pt,pqv,pqc,pqi,pqvf,ptf,poz,pzz,pomg, &
590584
integer i,j,k,lq,km,km1
591585
real dt,ztpp1
592586
real zew,zqs,zcor
593-
real scale_fac(lq), dxref
587+
real scale_fac(lq), scale_fac2(lq), dxref
594588
!
595589
! set scale-dependency factor when dx is < 15 km
596590
!
597591
dxref = 15000.
598592
do j=1,lq
599-
if (dx(j).lt.dxref .and. ntiedtke_dx_opt.eq.1) then
600-
scale_fac(j) = (1.+log(dxref/dx(j)))**3
593+
if (dx(j).lt.dxref) then
594+
scale_fac(j) = (1.06133+log(dxref/dx(j)))**3
595+
scale_fac2(j) = scale_fac(j)**0.5
601596
else
602597
scale_fac(j) = 1.+1.33e-5*dx(j)
598+
scale_fac2(j) = 1.
603599
end if
604600
end do
605601
!
@@ -656,7 +652,7 @@ subroutine tiecnvn(pu,pv,pt,pqv,pqc,pqi,pqvf,ptf,poz,pzz,pomg, &
656652
& ktype, icbot, ictop, ztu, zqu, &
657653
& zlu, zlude, zmfu, zmfd, zrain,&
658654
& pcte, phhfl, lndj, pgeoh, dx, &
659-
& scale_fac, ntiedtke_dx_opt )
655+
& scale_fac, scale_fac2)
660656
!
661657
! to include the cloud water and cloud ice detrained from convection
662658
!
@@ -712,7 +708,7 @@ subroutine cumastrn &
712708
& ktype, kcbot, kctop, ptu, pqu,&
713709
& plu, plude, pmfu, pmfd, prain,&
714710
& pcte, phhfl, lndj, zgeoh, dx, &
715-
& scale_fac, ntiedtke_dx_opt )
711+
& scale_fac, scale_fac2)
716712
implicit none
717713
!
718714
!***cumastrn* master routine for cumulus massflux-scheme
@@ -820,8 +816,7 @@ subroutine cumastrn &
820816
& ktype(klon), lndj(klon)
821817
logical ldcum(klon)
822818
logical loddraf(klon), llo1, llo2(klon)
823-
real scale_fac(klon)
824-
integer ntiedtke_dx_opt
819+
real scale_fac(klon), scale_fac2(klon)
825820

826821
! local varaiables
827822
real zcons,zcons2,zqumqe,zdqmin,zdh,zmfmax
@@ -922,8 +917,7 @@ subroutine cumastrn &
922917
& zuu, zvu, pmfu, zmfub,&
923918
& zmfus, zmfuq, zmful, plude, zdmfup,&
924919
& kcbot, kctop, ictop0, icum, ztmst,&
925-
& zqsenh, zlglac, lndj, wup, wbase, kdpl, pmfude_rate,&
926-
& scale_fac, ntiedtke_dx_opt )
920+
& zqsenh, zlglac, lndj, wup, wbase, kdpl, pmfude_rate)
927921

928922
!* (b) check cloud depth and change entrainment rate accordingly
929923
! calculate precipitation rate (for downdraft calculation)
@@ -1039,14 +1033,10 @@ subroutine cumastrn &
10391033
if(ldcum(jl).and.ktype(jl).eq.1) then
10401034
ikb = kcbot(jl)
10411035
ikt = kctop(jl)
1036+
ztauc(jl) = max(ztmst,ztauc(jl))
1037+
ztauc(jl) = max(360.,ztauc(jl))
1038+
ztauc(jl) = min(10800.,ztauc(jl))
10421039
ztau = ztauc(jl) * scale_fac(jl)
1043-
ztau = max(ztmst,ztau)
1044-
ztau = max(360.,ztau)
1045-
if(ntiedtke_dx_opt.eq.1) then
1046-
ztau = min(43200.,ztau)
1047-
else
1048-
ztau = min(10800.,ztau)
1049-
end if
10501040
if(nonequil) then
10511041
zcape2(jl)= max(0.,zcape2(jl))
10521042
zcape(jl) = max(0.,min(zcape1(jl)-zcape2(jl),5000.))
@@ -1085,10 +1075,8 @@ subroutine cumastrn &
10851075
else
10861076
zmfub1(jl) = zmfub(jl)
10871077
end if
1078+
zmfub1(jl) = zmfub1(jl)/scale_fac2(jl)
10881079
zmfub1(jl) = min(zmfub1(jl),zmfmax)
1089-
if(ntiedtke_dx_opt.eq.1) then
1090-
zmfub1(jl) = zmfub1(jl)/(scale_fac(jl))**(.5)
1091-
end if
10921080
end if
10931081

10941082
!* 6.3 mid-level convection - nothing special
@@ -2131,8 +2119,7 @@ subroutine cuascn &
21312119
& puu, pvu, pmfu, pmfub, &
21322120
& pmfus, pmfuq, pmful, plude, pdmfup,&
21332121
& kcbot, kctop, kctop0, kcum, ztmst,&
2134-
& pqsenh, plglac, lndj, wup, wbase, kdpl, pmfude_rate,&
2135-
& scale_fac, ntiedtke_dx_opt )
2122+
& pqsenh, plglac, lndj, wup, wbase, kdpl, pmfude_rate)
21362123
implicit none
21372124
! this routine does the calculations for cloud ascents
21382125
! for cumulus parameterization
@@ -2253,18 +2240,12 @@ subroutine cuascn &
22532240
real zrnew,zz,zdmfeu,zdmfdu,dp
22542241
real zfac,zbuoc,zdkbuo,zdken,zvv,zarg,zchange,zxe,zxs,zdshrd
22552242
real atop1,atop2,abot
2256-
real scale_fac(klon)
2257-
integer ntiedtke_dx_opt
22582243
!--------------------------------
22592244
!* 1. specify parameters
22602245
!--------------------------------
22612246
zcons2=3./(g*ztmst)
22622247
zfacbuo = 0.5/(1.+0.5)
2263-
if(ntiedtke_dx_opt.eq.1) then
2264-
zprcdgw = cprcon*zrg/(scale_fac(jl)**(1./3.))
2265-
else
22662248
zprcdgw = cprcon*zrg
2267-
end if
22682249
z_cldmax = 5.e-3
22692250
z_cwifrac = 0.5
22702251
z_cprc2 = 0.5
@@ -2343,7 +2324,7 @@ subroutine cuascn &
23432324
& pgeo, pgeoh, ldcum, ktype, klab, zlrain,&
23442325
& pmfu, pmfub, kcbot, ptu,&
23452326
& pqu, plu, puu, pvu, pmfus,&
2346-
& pmfuq, pmful, pdmfup, ntiedtke_dx_opt )
2327+
& pmfuq, pmful, pdmfup )
23472328
is = 0
23482329
jlm = 0
23492330
do jl = 1,klon
@@ -3745,7 +3726,7 @@ subroutine cubasmcn &
37453726
& pgeo, pgeoh, ldcum, ktype, klab, plrain,&
37463727
& pmfu, pmfub, kcbot, ptu,&
37473728
& pqu, plu, puu, pvu, pmfus,&
3748-
& pmfuq, pmful, pdmfup, ntiedtke_dx_opt )
3729+
& pmfuq, pmful, pdmfup )
37493730
implicit none
37503731
! m.tiedtke e.c.m.w.f. 12/89
37513732
! c.zhang iprc 05/2012
@@ -3782,38 +3763,9 @@ subroutine cubasmcn &
37823763
! local variabels
37833764
integer jl,kk,klev,klon,klevp1,klevm1
37843765
real zzzmb
3785-
integer ntiedtke_dx_opt
37863766
!--------------------------------------------------------
37873767
!* 1. calculate entrainment and detrainment rates
37883768
! -------------------------------------------------------
3789-
if(ntiedtke_dx_opt.eq.1) then
3790-
do jl=1,klon
3791-
if(.not.ldcum(jl) .and. klab(jl,kk+1).eq.0) then
3792-
if(lmfmid .and. pqen(jl,kk) .gt. 0.80*pqsen(jl,kk).and. &
3793-
! ww (no mid level conv, if the air is saturated)
3794-
pqen(jl,kk) .le. pqsen(jl,kk).and. &
3795-
pgeo(jl,kk)*zrg .gt. 5.0e2 .and. &
3796-
& pgeo(jl,kk)*zrg .lt. 1.0e4 ) then
3797-
ptu(jl,kk+1)=(cpd*pten(jl,kk)+pgeo(jl,kk)-pgeoh(jl,kk+1))&
3798-
& *rcpd
3799-
pqu(jl,kk+1)=pqen(jl,kk)
3800-
plu(jl,kk+1)=0.
3801-
zzzmb=max(cmfcmin,-pverv(jl,kk)*zrg)
3802-
zzzmb=min(zzzmb,cmfcmax)
3803-
pmfub(jl)=zzzmb
3804-
pmfu(jl,kk+1)=pmfub(jl)
3805-
pmfus(jl,kk+1)=pmfub(jl)*(cpd*ptu(jl,kk+1)+pgeoh(jl,kk+1))
3806-
pmfuq(jl,kk+1)=pmfub(jl)*pqu(jl,kk+1)
3807-
pmful(jl,kk+1)=0.
3808-
pdmfup(jl,kk+1)=0.
3809-
kcbot(jl)=kk
3810-
klab(jl,kk+1)=1
3811-
plrain(jl,kk+1)=0.0
3812-
ktype(jl)=3
3813-
end if
3814-
end if
3815-
end do
3816-
else
38173769
do jl=1,klon
38183770
if(.not.ldcum(jl) .and. klab(jl,kk+1).eq.0) then
38193771
if(lmfmid .and. pqen(jl,kk) .gt. 0.80*pqsen(jl,kk).and. &
@@ -3838,7 +3790,6 @@ subroutine cubasmcn &
38383790
end if
38393791
end if
38403792
end do
3841-
end if
38423793
return
38433794
end subroutine cubasmcn
38443795
!---------------------------------------------------------

phys/module_cumulus_driver.F

-9
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ SUBROUTINE cumulus_driver(grid &
125125
! Optional trigger function activation variable
126126
,kfeta_trigger &
127127
,nsas_dx_factor &
128-
,ntiedtke_dx_opt &
129128
#if ( WRF_DFI_RADAR == 1 )
130129
! Optional CAP suppress option --- 3.2 CLEANUP TODO -- THESE SHOULD BE OPTIONAL, NOT #IF/#ENDIF
131130
,do_capsuppress &
@@ -325,7 +324,6 @@ SUBROUTINE cumulus_driver(grid &
325324
!-- W0AVG average vertical velocity, (for KF scheme) (m/s)
326325
!-- kfeta_trigger namelist for KF trigger (=1, default; =2, moisture-advection-dependent trigger)
327326
!-- nsas_dx_factor namelist for NSAS deep scheme to have some dependency on grid sizes
328-
!-- ntiedtke_dx_opt namelist for nTiedtke cu scheme to have some dependency on grid sizes
329327
!-- rho density (kg/m^3)
330328
!-- CONVCLD Convective cloud (for BMJ scheme) (kg/m^2)
331329
!-- CCLDFRA convective cloud fraction (for BMJ scheme)
@@ -527,7 +525,6 @@ SUBROUTINE cumulus_driver(grid &
527525
528526
INTEGER, INTENT(IN ), OPTIONAL :: kfeta_trigger
529527
INTEGER, INTENT(IN ), OPTIONAL :: nsas_dx_factor
530-
INTEGER, INTENT(IN ) :: ntiedtke_dx_opt
531528
532529
REAL, INTENT(IN ) :: DT, DX
533530
REAL, DIMENSION( ims:ime , jms:jme ), OPTIONAL, &
@@ -1416,8 +1413,6 @@ SUBROUTINE cumulus_driver(grid &
14161413
! NEW TIEDTKE SCHEME - ZCX&YQW (U of Hawaii)
14171414
CASE (NTIEDTKESCHEME)
14181415

1419-
IF ( PRESENT ( QFX ) .AND. PRESENT( HFX )) THEN
1420-
14211416
CALL wrf_debug(100,'in cu_ntiedtke')
14221417
CALL CU_NTIEDTKE( &
14231418
DT=dt,ITIMESTEP=itimestep,STEPCU=STEPCU,HFX=hfx &
@@ -1426,7 +1421,6 @@ SUBROUTINE cumulus_driver(grid &
14261421
,QV3D=QV_CURR,QC3D=QC_CURR,QI3D=QI_CURR &
14271422
,DZ8W=dz8w,PCPS=p,P8W=p8w,XLAND=XLAND,DX=dx2d &
14281423
,CU_ACT_FLAG=CU_ACT_FLAG &
1429-
,NTIEDTKE_DX_OPT=NTIEDTKE_DX_OPT &
14301424
,IDS=ids,IDE=ide,JDS=jds,JDE=jde,KDS=kds,KDE=kde &
14311425
,IMS=ims,IME=ime,JMS=jms,JME=jme,KMS=kms,KME=kme &
14321426
,ITS=its,ITE=ite,JTS=jts,JTE=jte,KTS=kts,KTE=kte &
@@ -1438,9 +1432,6 @@ SUBROUTINE cumulus_driver(grid &
14381432
,F_QV=f_qv,F_QC=f_qc,F_QR=f_qr &
14391433
,F_QI=f_qi,F_QS=f_qs &
14401434
)
1441-
ELSE
1442-
CALL wrf_error_fatal('Lacking arguments for CU_NTIEDTKE in cumulus driver')
1443-
ENDIF
14441435

14451436
! New KIM SAS SCHEME - (KIAPS, South Korea)
14461437
CASE (KSASSCHEME)

0 commit comments

Comments
 (0)