-
Notifications
You must be signed in to change notification settings - Fork 169
New Thompson cloud fraction (updated subroutine cal_cldfra3) #781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
29db559
052145c
8da0705
3787899
f9c785f
4742485
cba377d
30ae919
74cae0c
fe6677f
25d28e7
b4d7ab0
aba5331
24d850d
6f91aea
211a413
0a54eec
1120779
7e119fc
bc8c26d
2b2e3b1
7d0d736
cd00e16
f1dd327
472987f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,8 +34,9 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, & | |
| plvl, plyr, tlvl, tlyr, qlyr, olyr, gasvmr_co2, gasvmr_n2o, gasvmr_ch4,& | ||
| gasvmr_o2, gasvmr_co, gasvmr_cfc11, gasvmr_cfc12, gasvmr_cfc22, & | ||
| gasvmr_ccl4, gasvmr_cfc113, aerodp, clouds6, clouds7, clouds8, & | ||
| clouds9, cldsa, cldfra, faersw1, faersw2, faersw3, faerlw1, faerlw2, & | ||
| faerlw3, alpha, errmsg, errflg) | ||
| clouds9, cldsa, cldfra, cldfra2d, lwp_ex,iwp_ex, lwp_fc,iwp_fc, & | ||
| faersw1, faersw2, faersw3, faerlw1, faerlw2, faerlw3, alpha, & | ||
| errmsg, errflg) | ||
|
|
||
| use machine, only: kind_phys | ||
|
|
||
|
|
@@ -54,6 +55,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, & | |
| & progcld2, & | ||
| & progcld4, progcld5, & | ||
| & progcld6, & | ||
| & progcld_thompson, & | ||
| & progclduni, & | ||
| & cal_cldfra3, & | ||
| & find_cloudLayers, & | ||
|
|
@@ -125,6 +127,8 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, & | |
| real(kind=kind_phys), dimension(:,:), intent(inout) :: clouds1, & | ||
| clouds2, clouds3, & | ||
| clouds4, clouds5 | ||
| real(kind=kind_phys), dimension(:), intent(out) :: lwp_ex,iwp_ex, & | ||
| & lwp_fc,iwp_fc | ||
|
|
||
| integer, intent(out) :: kd, kt, kb | ||
|
|
||
|
|
@@ -158,6 +162,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, & | |
| clouds8, & | ||
| clouds9, & | ||
| cldfra | ||
| real(kind=kind_phys), dimension(:), intent(out) :: cldfra2d | ||
| real(kind=kind_phys), dimension(:,:), intent(out) :: cldsa | ||
|
|
||
| real(kind=kind_phys), dimension(:,:,:), intent(out) :: faersw1,& | ||
|
|
@@ -191,9 +196,10 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, & | |
| real(kind=kind_phys), dimension(im,lm+LTP) :: & | ||
| re_cloud, re_ice, re_snow, qv_mp, qc_mp, & | ||
| qi_mp, qs_mp, nc_mp, ni_mp, nwfa | ||
| real (kind=kind_phys), dimension(lm) :: cldfra1d, qv1d, & | ||
| & qc1d, qi1d, qs1d, dz1d, p1d, t1d | ||
|
|
||
| ! for F-A MP | ||
| real(kind=kind_phys), dimension(im,lm+LTP) :: qc_save, qi_save, qs_save | ||
| real(kind=kind_phys), dimension(im,lm+LTP+1) :: tem2db, hz | ||
|
|
||
| real(kind=kind_phys), dimension(im,lm+LTP,min(4,ncnd)) :: ccnd | ||
|
|
@@ -206,6 +212,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, & | |
| ! for stochastic cloud perturbations | ||
| real(kind=kind_phys), dimension(im) :: cldp1d | ||
| real (kind=kind_phys) :: alpha0,beta0,m,s,cldtmp,tmp_wt,cdfz | ||
| real (kind=kind_phys) :: max_relh | ||
| integer :: iflag | ||
|
|
||
| integer :: ids, ide, jds, jde, kds, kde, & | ||
|
|
@@ -228,6 +235,21 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, & | |
| LP1 = LM + 1 ! num of in/out levels | ||
|
|
||
|
|
||
| gridkm = sqrt(2.0)*sqrt(dx(1)*0.001*dx(1)*0.001) | ||
|
|
||
| if (imp_physics == imp_physics_thompson) then | ||
| max_relh = 1.5 | ||
| else | ||
| max_relh = 1.1 | ||
| endif | ||
|
|
||
| do i = 1, IM | ||
| lwp_ex(i) = 0.0 | ||
| iwp_ex(i) = 0.0 | ||
| lwp_fc(i) = 0.0 | ||
| iwp_fc(i) = 0.0 | ||
| enddo | ||
|
|
||
| ! --- ... set local /level/layer indexes corresponding to in/out | ||
| ! variables | ||
|
|
||
|
|
@@ -854,88 +876,6 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, & | |
| enddo | ||
| endif | ||
|
|
||
| !mz HWRF physics: icloud=3 | ||
| if(icloud == 3) then | ||
|
|
||
| ! Set internal dimensions | ||
| ids = 1 | ||
| ims = 1 | ||
| its = 1 | ||
| ide = size(xlon,1) | ||
| ime = size(xlon,1) | ||
| ite = size(xlon,1) | ||
| jds = 1 | ||
| jms = 1 | ||
| jts = 1 | ||
| jde = 1 | ||
| jme = 1 | ||
| jte = 1 | ||
| kds = 1 | ||
| kms = 1 | ||
| kts = 1 | ||
| kde = lm+LTP ! should this be lmk instead of lm? no, or? | ||
| kme = lm+LTP | ||
| kte = lm+LTP | ||
|
|
||
| do k = 1, LMK | ||
| do i = 1, IM | ||
| rho(i,k)=plyr(i,k)*100./(con_rd*tlyr(i,k)) | ||
| plyrpa(i,k)=plyr(i,k)*100. !hPa->Pa | ||
| end do | ||
| end do | ||
|
|
||
| do i=1,im | ||
| if (slmsk(i)==1. .or. slmsk(i)==2.) then ! sea/land/ice mask (=0/1/2) in FV3 | ||
| xland(i)=1.0 ! but land/water = (1/2) in HWRF | ||
| else | ||
| xland(i)=2.0 | ||
| endif | ||
| enddo | ||
|
|
||
| gridkm = sqrt(2.0)*sqrt(dx(1)*0.001*dx(1)*0.001) | ||
|
|
||
| do i =1, im | ||
| do k =1, lmk | ||
| qc_save(i,k) = ccnd(i,k,1) | ||
| qi_save(i,k) = ccnd(i,k,2) | ||
| qs_save(i,k) = ccnd(i,k,4) | ||
| enddo | ||
| enddo | ||
|
|
||
|
|
||
| call cal_cldfra3(cldcov,qlyr,ccnd(:,:,1),ccnd(:,:,2), & | ||
| ccnd(:,:,4),plyrpa,tlyr,rho,xland,gridkm, & | ||
| ids,ide,jds,jde,kds,kde, & | ||
| ims,ime,jms,jme,kms,kme, & | ||
| its,ite,jts,jte,kts,kte) | ||
|
|
||
| !mz* back to micro-only qc qi,qs | ||
| do i =1, im | ||
| do k =1, lmk | ||
| ccnd(i,k,1) = qc_save(i,k) | ||
| ccnd(i,k,2) = qi_save(i,k) | ||
| ccnd(i,k,4) = qs_save(i,k) | ||
| enddo | ||
| enddo | ||
|
|
||
| endif ! icloud == 3 | ||
|
|
||
| if (lextop) then | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since both of us removed the lines of code above here related to icloud=3, then I think you should remove the next 2 chunks that are handling only the If I am incorrect, then my PR needs changing to put these back. Does something prior to this subroutine already pre-popluate those arrays? |
||
| do i=1,im | ||
| cldcov(i,lyb) = cldcov(i,lya) | ||
| deltaq(i,lyb) = deltaq(i,lya) | ||
| cnvw (i,lyb) = cnvw (i,lya) | ||
| cnvc (i,lyb) = cnvc (i,lya) | ||
| enddo | ||
| if (effr_in) then | ||
| do i=1,im | ||
| effrl(i,lyb) = effrl(i,lya) | ||
| effri(i,lyb) = effri(i,lya) | ||
| effrr(i,lyb) = effrr(i,lya) | ||
| effrs(i,lyb) = effrs(i,lya) | ||
| enddo | ||
| endif | ||
| endif | ||
|
|
||
| if (imp_physics == imp_physics_zhao_carr) then | ||
| ccnd(1:IM,1:LMK,1) = ccnd(1:IM,1:LMK,1) + cnvw(1:IM,1:LMK) | ||
|
|
@@ -1012,6 +952,20 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, & | |
| elseif(imp_physics == imp_physics_thompson) then ! Thompson MP | ||
|
|
||
| if(do_mynnedmf .or. imfdeepcnv == imfdeepcnv_gf ) then ! MYNN PBL or GF conv | ||
|
|
||
| if (icloud == 3) then | ||
| call progcld_thompson (plyr,plvl,tlyr,qlyr,qstl,rhly, & ! --- inputs | ||
| tracer1,xlat,xlon,slmsk,dz,delp, & | ||
| ntrac-1, ntcw-1,ntiw-1,ntrw-1, & | ||
| ntsw-1,ntgl-1, & | ||
| im, lm, lmp, uni_cld, lmfshal, lmfdeep2, & | ||
| cldcov(:,1:LM), effrl_inout, & | ||
| effri_inout, effrs_inout, & | ||
| lwp_ex, iwp_ex, lwp_fc, iwp_fc, & | ||
| dzb, xlat_d, julian, yearlen, gridkm, & | ||
| clouds, cldsa, mtopa ,mbota, de_lgth, alpha) ! --- outputs | ||
| else | ||
|
|
||
| !-- MYNN PBL or convective GF | ||
| !-- use cloud fractions with SGS clouds | ||
| do k=1,lmk | ||
|
|
@@ -1028,18 +982,35 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, & | |
| effrl, effri, effrr, effrs, effr_in , & | ||
| dzb, xlat_d, julian, yearlen, & | ||
| clouds, cldsa, mtopa, mbota, de_lgth, alpha) ! --- outputs | ||
| endif | ||
|
|
||
| else | ||
| ! MYNN PBL or GF convective are not used | ||
| call progcld6 (plyr,plvl,tlyr,qlyr,qstl,rhly,tracer1, & ! --- inputs | ||
| xlat,xlon,slmsk,dz,delp, & | ||
|
|
||
| if (icloud == 3) then | ||
| call progcld_thompson (plyr,plvl,tlyr,qlyr,qstl,rhly, & ! --- inputs | ||
| tracer1,xlat,xlon,slmsk,dz,delp, & | ||
| ntrac-1, ntcw-1,ntiw-1,ntrw-1, & | ||
| ntsw-1,ntgl-1, & | ||
| im, lm, lmp, uni_cld, lmfshal, lmfdeep2, & | ||
|
gthompsnWRF marked this conversation as resolved.
|
||
| cldcov(:,1:LM), effrl_inout, & | ||
| effri_inout, effrs_inout, & | ||
| lwp_ex, iwp_ex, lwp_fc, iwp_fc, & | ||
| dzb, xlat_d, julian, yearlen, gridkm, & | ||
| clouds, cldsa, mtopa ,mbota, de_lgth, alpha) ! --- outputs | ||
|
|
||
| else | ||
| call progcld6 (plyr,plvl,tlyr,qlyr,qstl,rhly, & ! --- inputs | ||
| tracer1,xlat,xlon,slmsk,dz,delp, & | ||
| ntrac-1, ntcw-1,ntiw-1,ntrw-1, & | ||
| ntsw-1,ntgl-1, & | ||
| im, lmk, lmp, uni_cld, lmfshal, lmfdeep2, & | ||
| cldcov(:,1:LMK), effrl_inout(:,:), & | ||
| effri_inout(:,:), effrs_inout(:,:), & | ||
| cldcov(:,1:LMK), effrl_inout, & | ||
| effri_inout, effrs_inout, & | ||
| lwp_ex, iwp_ex, lwp_fc, iwp_fc, & | ||
| dzb, xlat_d, julian, yearlen, & | ||
| clouds, cldsa, mtopa ,mbota, de_lgth, alpha) ! --- outputs | ||
| endif | ||
| endif ! MYNN PBL or GF | ||
|
|
||
| endif ! end if_imp_physics | ||
|
|
@@ -1071,7 +1042,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, & | |
| enddo ! end_do_i_loop | ||
| enddo ! end_do_k_loop | ||
| endif | ||
| do k = 1, LMK | ||
| do k = 1, LM | ||
|
gthompsnWRF marked this conversation as resolved.
|
||
| do i = 1, IM | ||
| clouds1(i,k) = clouds(i,k,1) | ||
| clouds2(i,k) = clouds(i,k,2) | ||
|
|
@@ -1085,6 +1056,12 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, & | |
| cldfra(i,k) = clouds(i,k,1) | ||
| enddo | ||
| enddo | ||
| do i = 1, IM | ||
| cldfra2d(i) = 0.0 | ||
| do k = 1, LM-1 | ||
|
gthompsnWRF marked this conversation as resolved.
|
||
| cldfra2d(i) = max(cldfra2d(i), cldfra(i,k)) | ||
| enddo | ||
| enddo | ||
|
|
||
| ! mg, sfc-perts | ||
| ! --- scale random patterns for surface perturbations with | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.