Skip to content

Commit b8ba10f

Browse files
committed
Merge branch 'ufs/dev' into tempo_dev
2 parents 857cd40 + 38268cf commit b8ba10f

File tree

199 files changed

+9626
-3622
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

199 files changed

+9626
-3622
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Please see more information about the CCPP at the locations below.
1111
- [CCPP Physics GitHub wiki](https://github.com/NCAR/ccpp-physics/wiki)
1212
- [CCPP Framework GitHub wiki](https://github.com/NCAR/ccpp-framework/wiki)
1313

14-
For the use of CCPP with its Single Column Model, see the [Single Column Model User's Guide](http://dtcenter.org/sites/default/files/paragraph/scm-ccpp-guide-v6.0.0.pdf).
14+
For the use of CCPP with its Single Column Model, see the [Single Column Model User's Guide](https://ccpp-scm.readthedocs.io/en/latest/).
1515

1616
For the use of CCPP with NOAA's Unified Forecast System (UFS), see the [UFS Medium-Range Application User's Guide](https://ufs-mrweather-app.readthedocs.io/en/latest), the [UFS Short-Range Application User's Guide](https://ufs-srweather-app.readthedocs.io/en/latest) and the [UFS Weather Model User's Guide](https://ufs-weather-model.readthedocs.io/en/latest).
1717

physics/CONV/C3/cu_c3_deep.F90

Lines changed: 114 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ subroutine cu_c3_deep_run( &
153153
!! betwee -1 and +1
154154
,do_capsuppress,cap_suppress_j & !
155155
,k22 & !
156-
,jmin,tropics) !
156+
,jmin,mc_thresh) !
157157

158158
implicit none
159159

@@ -198,16 +198,16 @@ subroutine cu_c3_deep_run( &
198198
!$acc declare copy(cnvwt,outu,outv,outt,outq,outqc,cupclw,frh_out,pre,xmb_out)
199199
real(kind=kind_phys), dimension (its:) &
200200
,intent (in ) :: &
201-
hfx,qfx,xmbm_in,xmbs_in
202-
!$acc declare copyin(hfx,qfx,xmbm_in,xmbs_in)
201+
mc_thresh,hfx,qfx,xmbm_in,xmbs_in
202+
!$acc declare copyin(mc_thresh,hfx,qfx,xmbm_in,xmbs_in)
203203
integer, dimension (its:) &
204204
,intent (inout ) :: &
205205
kbcon,ktop
206206
!$acc declare copy(kbcon,ktop)
207207
integer, dimension (its:) &
208208
,intent (in ) :: &
209-
kpbl,tropics
210-
!$acc declare copyin(kpbl,tropics)
209+
kpbl
210+
!$acc declare copyin(kpbl)
211211
!
212212
! basic environmental input includes moisture convergence (mconv)
213213
! omega (omeg), windspeed (us,vs), and a flag (ierr) to turn off
@@ -448,10 +448,19 @@ subroutine cu_c3_deep_run( &
448448
!---meltglac-------------------------------------------------
449449

450450
real(kind=kind_phys), dimension (its:ite,kts:kte) :: p_liq_ice,melting_layer,melting
451-
!$acc declare create(p_liq_ice,melting_layer,melting)
451+
! icoldpool
452+
integer, parameter :: icoldpool=0
453+
real(kind=kind_phys), parameter :: Kfr = 0.9, epsx = 1.e2, alpha_dd=45., pi=3.1416
454+
real(kind=kind_phys), dimension (its:ite) :: beta_x, vcpool, wlpool,umcl,vmcl,slope_pool
455+
real(kind=kind_phys), dimension (its:ite,kts:kte) :: buoysrc,dellat_d
456+
real(kind=kind_phys) :: aux,mcl_speed,total_dz,mx_buoy2,h_env,dpsum
452457

453458
integer :: itemp
459+
!$acc declare create(p_liq_ice,melting_layer,melting,buoysrc,beta_x,vcpool,wlpool,umcl,vmcl)
454460

461+
462+
463+
mx_buoy2 = cp*10.
455464
!---meltglac-------------------------------------------------
456465
!$acc kernels
457466
melting_layer(:,:)=0.
@@ -586,9 +595,8 @@ subroutine cu_c3_deep_run( &
586595
!$acc loop private(radius,frh)
587596
do i=its,ite
588597
c1d(i,:)= 0. !c1 ! 0. ! c1 ! max(.003,c1+float(csum(i))*.0001)
589-
entr_rate(i)=7.e-5 - min(20.,float(csum(i))) * 3.e-6
590-
if(xland1(i) == 0)entr_rate(i)=7.e-5
591-
if(dx(i)<dx_thresh) entr_rate(i)=2.e-4
598+
!entr_rate(i)=7.e-5 !- min(20.,float(csum(i))) * 3.e-6
599+
entr_rate(i)=1.e-4
592600
if(imid.eq.1)entr_rate(i)=3.e-4
593601
radius=.2/entr_rate(i)
594602
frh=min(1.,3.14*radius*radius/dx(i)/dx(i))
@@ -600,7 +608,7 @@ subroutine cu_c3_deep_run( &
600608
sig(i)=(1.-frh)**2
601609
!frh_out(i) = frh
602610
if(forcing(i,7).eq.0.)sig(i)=1.
603-
frh_out(i) = frh*sig(i)
611+
frh_out(i) = frh !*sig(i)
604612
enddo
605613
!$acc end kernels
606614
sig_thresh = (1.-frh_thresh)**2
@@ -645,7 +653,7 @@ subroutine cu_c3_deep_run( &
645653
!--- minimum depth (m), clouds must have
646654
!
647655
depth_min=3000.
648-
if(dx(its)<dx_thresh)depth_min=5000.
656+
!if(dx(its)<dx_thresh)depth_min=5000.
649657
if(imid.eq.1)depth_min=2500.
650658
!
651659
!--- maximum depth (mb) of capping
@@ -1093,14 +1101,14 @@ subroutine cu_c3_deep_run( &
10931101
if(imid.eq.1)then
10941102
call cup_up_moisture('mid',ierr,zo_cup,qco,qrco,pwo,pwavo, &
10951103
p_cup,kbcon,ktop,dbyo,clw_all,xland1, &
1096-
qo,gammao_cup,zuo,qeso_cup,k22,qo_cup,c0, &
1104+
qo,gammao_cup,zuo,qeso_cup,k22,qo_cup,c0,jmin, &
10971105
zqexec,ccn,ccnclean,rho,c1d,tn_cup,autoconv,up_massentr,up_massdetr,psum,psumh, &
10981106
1,itf,ktf, &
10991107
its,ite, kts,kte)
11001108
else
11011109
call cup_up_moisture('deep',ierr,zo_cup,qco,qrco,pwo,pwavo, &
11021110
p_cup,kbcon,ktop,dbyo,clw_all,xland1, &
1103-
qo,gammao_cup,zuo,qeso_cup,k22,qo_cup,c0, &
1111+
qo,gammao_cup,zuo,qeso_cup,k22,qo_cup,c0,jmin, &
11041112
zqexec,ccn,ccnclean,rho,c1d,tn_cup,autoconv,up_massentr,up_massdetr,psum,psumh, &
11051113
1,itf,ktf, &
11061114
its,ite, kts,kte)
@@ -1599,6 +1607,7 @@ subroutine cu_c3_deep_run( &
15991607
dellv (i,k)=0.
16001608
dellah (i,k)=0.
16011609
dellat (i,k)=0.
1610+
dellat_d (i,k)=0.
16021611
dellaq (i,k)=0.
16031612
dellaqc(i,k)=0.
16041613
enddo
@@ -1723,6 +1732,7 @@ subroutine cu_c3_deep_run( &
17231732
g_rain= 0.5*(pwo (i,1)+pwo (i,2))*g/dp
17241733
e_dn = -0.5*(pwdo(i,1)+pwdo(i,2))*g/dp*edto(i) ! pwdo < 0 and e_dn must > 0
17251734
dellaq(i,1) = dellaq(i,1)+ e_dn-g_rain
1735+
dellat_d(i,1)=zdo(i,2)*edto(i)*(hcdo(i,2)-heo_cup(i,2))*g/dp
17261736

17271737
!--- conservation check
17281738
!- water mass balance
@@ -1780,6 +1790,12 @@ subroutine cu_c3_deep_run( &
17801790
! trash= trash+ (dellaq(i,k)+dellaqc(i,k)+ g_rain-e_dn)*dp/g
17811791

17821792
enddo ! k
1793+
do k=2,jmin(i)-1
1794+
dp=100.*(po_cup(i,k)-po_cup(i,k+1))
1795+
dellat_d(i,k)= &
1796+
edto(i)*dd_massdetro(i,k)*(.5*(hcdo(i,k+1)+hcdo(i,k))-heo(i,k))*g/dp
1797+
enddo ! k
1798+
17831799
endif
17841800

17851801
enddo
@@ -1991,6 +2007,7 @@ subroutine cu_c3_deep_run( &
19912007
!$acc atomic update
19922008
mconv(i)=mconv(i)+omeg(i,k)*dq/g
19932009
enddo
2010+
if ((mconv(i) < mc_thresh(i)) .and. (xland1(i) == 0)) ierr(i)=2242
19942011
enddo
19952012

19962013
!> - From Bengtsson et al. (2022) \cite Bengtsson_2022 prognostic closure scheme,
@@ -2016,9 +2033,9 @@ subroutine cu_c3_deep_run( &
20162033
endif
20172034
enddo
20182035
call progsigma_calc(itf,ktf,flag_init,flag_restart,flag_shallow, &
2019-
flag_mid,del,tmf,qmicro,dbyo1,zdqca,omega_u,zeta,xlv,dtime, &
2020-
forceqv_spechum,kbcon,ktop,cnvflg,betascu,betamcu,betadcu, &
2021-
sigmind,sigminm,sigmins,sigmain,sigmaout,sigmab)
2036+
flag_mid,del,tmf,qmicro,dbyo1,zdqca,omega_u,zeta,xlv,dtime, &
2037+
forceqv_spechum,k22,kbcon,ktop,cnvflg,betascu,betamcu,betadcu, &
2038+
sigmind,sigminm,sigmins,sigmain,sigmaout,sigmab)
20222039
endif
20232040

20242041
!$acc end kernels
@@ -2088,6 +2105,34 @@ subroutine cu_c3_deep_run( &
20882105
ichoice,imid,ipr,itf,ktf, &
20892106
its,ite, kts,kte,dx,sigmab, &
20902107
dicycle,xf_dicycle,xf_progsigma)
2108+
!
2109+
!
2110+
if (icoldpool > 0 .and. imid ==0) then
2111+
buoysrc(:,:)=0.
2112+
do i=its,itf
2113+
vcpool(i)=0.
2114+
wlpool(i)=0.
2115+
total_dz=0.
2116+
beta_x(i)=0.
2117+
if(ierr(i).gt.0)cycle ! exit loopI
2118+
do k = kts,jmin(i)-1
2119+
buoysrc(i,k)=beta_x(i)-dellat_d(i,k)*xmb(i)*dtime !/sig(i)*cp
2120+
if(buoysrc(i,k) < epsx .or. total_dz .gt. z_detr ) cycle
2121+
H_env = heo(i,k)
2122+
dz = zo(i,k+1)-zo(i,k)
2123+
total_dz = total_dz + dz
2124+
vcpool(i) = vcpool(i) + (g*dz*min(mx_buoy2,buoysrc(i,k))/H_env)
2125+
wlpool(i) = wlpool(i) + (g*dz*min(mx_buoy2,buoysrc(i,k))/H_env )
2126+
end do
2127+
do k = kts,jmin(i)-1
2128+
buoysrc(i,k)=-dellat_d(i,k)*xmb(i)*dtime
2129+
end do
2130+
vcpool(i) = min(20., Kfr *sqrt(vcpool(i)))
2131+
slope_pool(i) = alpha_dd
2132+
wlpool(i) = min(10., Kfr *sin( slope_pool(i)*pi/180. )* sqrt(wlpool(i)))
2133+
enddo ! i-loop
2134+
endif ! icoldpool
2135+
20912136

20922137
!> - Call rain_evap_below_cloudbase() to calculate evaporation below cloud base
20932138

@@ -2116,6 +2161,48 @@ subroutine cu_c3_deep_run( &
21162161
endif
21172162
enddo
21182163
!$acc end kernels
2164+
if (icoldpool > 0 .and. icoldpool /= 2 .and. imid ==0) then
2165+
! --- adding the gust front horizontal speed to the 2-d MCL wind
2166+
! --- only magnitude is augmented, direction is kept the same
2167+
do i=its,itf
2168+
umcl(i)=0.
2169+
vmcl(i)=0.
2170+
dpsum=0.
2171+
if(ierr(i) > 0 ) cycle
2172+
do k=kts+1,ktop(i)-1
2173+
trash =-(po_cup(i,k)-po_cup(i,kts))
2174+
if(trash.gt.300..and. trash.lt.600.)then
2175+
dp=100.*(po_cup(i,k)-po_cup(i,k+1))
2176+
umcl(i)=umcl(i)+us(i,k)*dp
2177+
vmcl(i)=vmcl(i)+us(i,k)*dp
2178+
dpsum=dpsum+dp
2179+
endif
2180+
enddo
2181+
if(dpsum > 0.) then
2182+
umcl(i)=umcl(i)/dpsum
2183+
vmcl(i)=vmcl(i)/dpsum
2184+
MCL_speed= sqrt( umcl(i)**2 + vmcl(i)**2 )
2185+
aux = (MCL_speed + vcpool(i))/(MCL_speed+1.e-6)
2186+
umcl(i) = aux * umcl(i)
2187+
vmcl(i) = aux * vmcl(i)
2188+
endif
2189+
enddo
2190+
! --- gust front momentum impact
2191+
do i=its,itf
2192+
if(ierr(i) > 0 .or. vcpool(i) .le.0.) cycle
2193+
k=kts
2194+
dp=100.*(po_cup(i,k)-po_cup(i,k+1))
2195+
outu(i,k) = outu(i,k) + edto(i)*zdo(i,k+1)*umcl(i)*g/dp*xmb(i)
2196+
outv(i,k) = outv(i,k) + edto(i)*zdo(i,k+1)*vmcl(i)*g/dp*xmb(i)
2197+
do k=kts+1,kdet(i)
2198+
dp=100.*(po_cup(i,k)-po_cup(i,k+1))
2199+
outu(i,k) = outu(i,k) + edto(i)*dd_massdetro(i,k)*umcl(i)*g/dp*xmb(i)
2200+
outv(i,k) = outv(i,k) + edto(i)*dd_massdetro(i,k)*vmcl(i)*g/dp*xmb(i)
2201+
enddo
2202+
enddo
2203+
endif ! icoldpool
2204+
if(icoldpool == 1)vcpool(:)=0.
2205+
21192206
! rain evaporation as in sas
21202207
!
21212208
if(irainevap.eq.1)then
@@ -2142,6 +2229,8 @@ subroutine cu_c3_deep_run( &
21422229
if(ierr(i).eq.0)then
21432230
evef = edt(i) * evfact * sig(i)**2
21442231
if(xland(i).gt.0.5 .and. xland(i).lt.1.5) evef = edt(i) * evfactl * sig(i)**2
2232+
!evef=.09
2233+
!evef=.9
21452234
!$acc loop seq
21462235
do k = ktop(i), 1, -1
21472236
rain = pwo(i,k) + edto(i) * pwdo(i,k)
@@ -4228,7 +4317,7 @@ end subroutine cup_output_ens_3d
42284317
!> Calculates moisture properties of the updraft.
42294318
subroutine cup_up_moisture(name,ierr,z_cup,qc,qrc,pw,pwav, &
42304319
p_cup,kbcon,ktop,dby,clw_all,xland1, &
4231-
q,gamma_cup,zu,qes_cup,k22,qe_cup,c0, &
4320+
q,gamma_cup,zu,qes_cup,k22,qe_cup,c0,jmin, &
42324321
zqexec,ccn,ccnclean,rho,c1d,t,autoconv, &
42334322
up_massentr,up_massdetr,psum,psumh, &
42344323
itest,itf,ktf, &
@@ -4267,7 +4356,7 @@ subroutine cup_up_moisture(name,ierr,z_cup,qc,qrc,pw,pwav, &
42674356
! entr= entrainment rate
42684357
integer, dimension (its:) &
42694358
,intent (in ) :: &
4270-
kbcon,ktop,k22,xland1
4359+
kbcon,ktop,k22,xland1,jmin
42714360
!$acc declare copyin(p_cup,rho,q,zu,gamma_cup,qe_cup,up_massentr,up_massdetr,dby,qes_cup,z_cup,zqexec,c0,kbcon,ktop,k22,xland1)
42724361
real(kind=kind_phys), intent (in ) :: & ! HCB
42734362
ccnclean
@@ -4490,16 +4579,17 @@ subroutine cup_up_moisture(name,ierr,z_cup,qc,qrc,pw,pwav, &
44904579
clw_allh(i,k)=max(0.,qch(i,k)-qrch)
44914580
qrcb(i,k)=max(0.,(qch(i,k)-qrch)) ! /(1.+c0(i)*dz*zu(i,k))
44924581
if(is_deep)then
4493-
clwdet=0.1 !0.02 ! 05/11/2021
4494-
!if(k.lt.kklev(i)) clwdet=0. ! 05/05/2021
4582+
clwdet=1.2 !0.1 !0.02
44954583
else
4496-
clwdet=0.1 !0.02 ! 05/05/2021
4497-
!if(k.lt.kklev(i)) clwdet=0. ! 05/25/2021
4584+
clwdet=1.2 !0.1 !0.02
4585+
endif
4586+
if (k.gt.jmin(i))then
4587+
clwdet=2.
44984588
endif
44994589
if(k.gt.kbcon(i)+1)c1d(i,k)=clwdet*up_massdetr(i,k-1)
45004590
if(k.gt.kbcon(i)+1)c1d_b(i,k)=clwdet*up_massdetr(i,k-1)
4501-
c1d(i,k)=0.005
4502-
c1d_b(i,k)=0.005
4591+
!c1d(i,k)=0.005
4592+
!c1d_b(i,k)=0.005
45034593

45044594
if(autoconv.eq.2) then
45054595
!

physics/CONV/C3/cu_c3_driver.F90

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,10 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
228228
real(kind=kind_phys), dimension (im,km) :: qcheck,zo,t2d,q2d,po,p2d,rhoi,clw_ten
229229
real(kind=kind_phys), dimension (im,km) :: tn,qo,tshall,qshall,dz8w,omeg
230230
real(kind=kind_phys), dimension (im) :: z1,psur,cuten,cutens,cutenm
231-
real(kind=kind_phys), dimension (im) :: umean,vmean,pmean
231+
real(kind=kind_phys), dimension (im) :: umean,vmean,pmean,mc_thresh
232232
real(kind=kind_phys), dimension (im) :: xmbs,xmbs2,xmb,xmbm,xmb_dumm,mconv
233233
!$acc declare create(qcheck,zo,t2d,q2d,po,p2d,rhoi,clw_ten,tn,qo,tshall,qshall,dz8w,omeg, &
234-
!$acc z1,psur,cuten,cutens,cutenm,umean,vmean,pmean, &
234+
!$acc z1,psur,cuten,cutens,cutenm,umean,vmean,pmean,mc_thresh, &
235235
!$acc xmbs,xmbs2,xmb,xmbm,xmb_dumm,mconv)
236236

237237
integer :: i,j,k,icldck,ipr,jpr,jpr_deep,ipr_deep,uidx,vidx,tidx,qidx
@@ -603,6 +603,7 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
603603
hfx(i)=hfx2(i)*cp*rhoi(i,1)
604604
qfx(i)=qfx2(i)*xlv*rhoi(i,1)
605605
dx(i) = sqrt(garea(i))
606+
mc_thresh(i)=3.25/dx(i)
606607
enddo
607608

608609
do i=its,itf
@@ -788,7 +789,7 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
788789
! betwee -1 and +1
789790
,do_cap_suppress_here,cap_suppress_j &
790791
,k22m &
791-
,jminm,tropics)
792+
,jminm,mc_thresh)
792793
!$acc kernels
793794
do i=its,itf
794795
do k=kts,ktf
@@ -882,7 +883,7 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
882883
! betwee -1 and +1
883884
,do_cap_suppress_here,cap_suppress_j &
884885
,k22 &
885-
,jmin,tropics)
886+
,jmin,mc_thresh)
886887
jpr=0
887888
ipr=0
888889
!$acc kernels

physics/CONV/C3/cu_c3_sh.F90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -983,9 +983,9 @@ subroutine cu_c3_sh_run ( &
983983
endif
984984
enddo
985985
call progsigma_calc(itf,ktf,flag_init,flag_restart,flag_shallow, &
986-
flag_mid,del,tmf,qmicro,dbyo,zdqca,omega_u,zeta,xlv,dtime, &
987-
forceqv_spechum,kbcon,ktop,cnvflg,betascu,betamcu,betadcu, &
988-
sigmind,sigminm,sigmins,sigmain,sigmaout,sigmab)
986+
flag_mid,del,tmf,qmicro,dbyo,zdqca,omega_u,zeta,xlv,dtime, &
987+
forceqv_spechum,k22,kbcon,ktop,cnvflg,betascu,betamcu,betadcu, &
988+
sigmind,sigminm,sigmins,sigmain,sigmaout,sigmab)
989989

990990
endif
991991

0 commit comments

Comments
 (0)