-
Notifications
You must be signed in to change notification settings - Fork 169
Ufs dev pr246 #1121
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
Merged
Merged
Ufs dev pr246 #1121
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
a69aa8b
Introduce prognostic updraft velocity
lisa-bengtsson d333da7
Merge branch 'ufs/dev' of https://github.com/ufs-community/ccpp-physi…
lisa-bengtsson 3629c45
Address review comment from Jongil Han for a more stable solution of …
lisa-bengtsson 177371a
Fix ascii charachter in French name not liked by CCPP
lisa-bengtsson 0f51c08
After review from Jongil Han, update initialization value in case of …
lisa-bengtsson 3b2bedb
Merge branch 'ufs/dev' of https://github.com/ufs-community/ccpp-physi…
lisa-bengtsson 02d73b6
Minor cleanup of white spaces
lisa-bengtsson e920f4a
sync branch upstream with ccpp/physics ufs/dev
lisa-bengtsson 375aa85
update code to address debug mode error
lisa-bengtsson 43807e6
Address review comments from Grant Firl on inten inout
lisa-bengtsson 2c1887d
minor clean up in convection routines
lisa-bengtsson bdd8baf
pull in the latest ufs/dev branch
lisa-bengtsson 38268cf
Merge pull request #256 from AnningCheng-NOAA/mr2_rst
grantfirl b977174
Merge branch 'ufs/dev' of https://github.com/ufs-community/ccpp-physi…
lisa-bengtsson 1ec0940
Merge branch 'updraft_velocity' into ufs-dev-PR246
hertneky 0d4b4b9
fix intent error in GFS_suite_interstitial_3_run
grantfirl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -8,7 +8,8 @@ module samfdeepcnv | |||
|
|
||||
| use samfcnv_aerosols, only : samfdeepcnv_aerosols | ||||
| use progsigma, only : progsigma_calc | ||||
|
|
||||
| use progomega, only : progomega_calc | ||||
|
|
||||
| contains | ||||
|
|
||||
| subroutine samfdeepcnv_init(imfdeepcnv,imfdeepcnv_samf, & | ||||
|
|
@@ -77,14 +78,15 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & | |||
| & eps,epsm1,fv,grav,hvap,rd,rv, & | ||||
| & t0c,delt,ntk,ntr,delp, & | ||||
| & prslp,psp,phil,tkeh,qtr,prevsq,q,q1,t1,u1,v1,fscav, & | ||||
| & hwrf_samfdeep,progsigma,cldwrk,rn,kbot,ktop,kcnv, & | ||||
| & hwrf_samfdeep,progsigma,progomega,cldwrk,rn,kbot,ktop,kcnv, & | ||||
| & islimsk,garea,dot,ncloud,hpbl,ud_mf,dd_mf,dt_mf,cnvw,cnvc, & | ||||
| & QLCN, QICN, w_upi, cf_upi, CNV_MFD, & | ||||
| & CNV_DQLDT,CLCN,CNV_FICE,CNV_NDROP,CNV_NICE,mp_phys,mp_phys_mg,& | ||||
| & clam,c0s,c1,betal,betas,evef,pgcon,asolfac, & | ||||
| & do_ca, ca_closure, ca_entr, ca_trigger, nthresh,ca_deep, & | ||||
| & rainevap,sigmain,sigmaout,betadcu,betamcu,betascu, & | ||||
| & maxMF, do_mynnedmf,sigmab_coldstart,errmsg,errflg) | ||||
| & rainevap,sigmain,sigmaout,omegain,omegaout,betadcu,betamcu, & | ||||
| & betascu,maxMF,do_mynnedmf,sigmab_coldstart,errmsg,errflg) | ||||
|
|
||||
| ! | ||||
| use machine , only : kind_phys | ||||
| use funcphys , only : fpvs | ||||
|
|
@@ -100,16 +102,17 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & | |||
| & prslp(:,:), garea(:), hpbl(:), dot(:,:), phil(:,:) | ||||
| real(kind=kind_phys), dimension(:), intent(in) :: fscav | ||||
| logical, intent(in) :: first_time_step,restart,hwrf_samfdeep, & | ||||
| & progsigma,do_mynnedmf,sigmab_coldstart | ||||
| & progsigma,progomega,do_mynnedmf,sigmab_coldstart | ||||
| real(kind=kind_phys), intent(in) :: nthresh,betadcu,betamcu, & | ||||
| & betascu | ||||
| real(kind=kind_phys), intent(in), optional :: ca_deep(:) | ||||
| real(kind=kind_phys), intent(in), optional :: sigmain(:,:), & | ||||
| & qmicro(:,:), prevsq(:,:) | ||||
| & qmicro(:,:), prevsq(:,:), omegain(:,:) | ||||
| real(kind=kind_phys), intent(in) :: tmf(:,:,:),q(:,:) | ||||
| real(kind=kind_phys), dimension (:), intent(in), optional :: maxMF | ||||
| real(kind=kind_phys), intent(out) :: rainevap(:) | ||||
| real(kind=kind_phys), intent(out), optional :: sigmaout(:,:) | ||||
| real(kind=kind_phys), intent(inout), optional :: sigmaout(:,:), & | ||||
| & omegaout(:,:) | ||||
| logical, intent(in) :: do_ca,ca_closure,ca_entr,ca_trigger | ||||
| integer, intent(inout) :: kcnv(:) | ||||
| ! DH* TODO - check dimensions of qtr, ntr+2 correct? *DH | ||||
|
|
@@ -216,7 +219,7 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & | |||
| ! parameters for prognostic sigma closure | ||||
| real(kind=kind_phys) omega_u(im,km),zdqca(im,km),tmfq(im,km), | ||||
| & omegac(im),zeta(im,km),dbyo1(im,km),sigmab(im),qadv(im,km), | ||||
| & sigmaoutx(im) | ||||
| & sigmaoutx(im),tentr(im,km) | ||||
| real(kind=kind_phys) gravinv,invdelt,sigmind,sigminm,sigmins | ||||
| parameter(sigmind=0.01,sigmins=0.03,sigminm=0.01) | ||||
| logical flag_shallow, flag_mid | ||||
|
|
@@ -333,6 +336,7 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & | |||
| c----------------------------------------------------------------------- | ||||
| !> ## Compute preliminary quantities needed for static, dynamic, and feedback control portions of the algorithm. | ||||
| !> - Convert input pressure terms to centibar units. | ||||
|
|
||||
| !************************************************************************ | ||||
| ! convert input Pa terms to Cb terms -- Moorthi | ||||
| ps = psp * 0.001 | ||||
|
|
@@ -1130,7 +1134,8 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & | |||
| do k = 2, km1 | ||||
| do i=1,im | ||||
| if(cnvflg(i) .and. | ||||
| & (k > kbcon(i) .and. k < kmax(i))) then | ||||
| & (k > kbcon(i) .and. k < kmax(i))) then | ||||
| tentr(i,k)=xlamue(i,k)*fent1(i,k) | ||||
| tem = cxlamet(i) * frh(i,k) * fent2(i,k) | ||||
| xlamue(i,k) = xlamue(i,k)*fent1(i,k) + tem | ||||
| tem1 = cxlamdt(i) * frh(i,k) | ||||
|
|
@@ -1760,43 +1765,64 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & | |||
| enddo | ||||
| ! | ||||
| ! compute updraft velocity square(wu2) | ||||
| !> - Calculate updraft velocity square(wu2) according to Han et al.'s (2017) \cite han_et_al_2017 equation 7. | ||||
| ! | ||||
| !> - Calculate diagnostic updraft velocity square(wu2) according to Han et al.'s (2017) \cite han_et_al_2017 equation 7. | ||||
| !> - if progomega = true, calculate prognostic updraft velocity (Pa/s) according to progomega routine. | ||||
|
|
||||
| if (hwrf_samfdeep) then | ||||
| do i = 1, im | ||||
| if (cnvflg(i)) then | ||||
| k = kbcon1(i) | ||||
| tem = po(i,k) / (rd * to(i,k)) | ||||
| wucb = -0.01 * dot(i,k) / (tem * grav) | ||||
| if(wucb.gt.0.) then | ||||
| wu2(i,k) = wucb * wucb | ||||
| else | ||||
| wu2(i,k) = 0. | ||||
| endif | ||||
| endif | ||||
| enddo | ||||
| endif | ||||
| ! | ||||
| do k = 2, km1 | ||||
| do i = 1, im | ||||
| if (cnvflg(i)) then | ||||
| if(k > kbcon1(i) .and. k < ktcon(i)) then | ||||
| dz = zi(i,k) - zi(i,k-1) | ||||
| tem = 0.25 * bb1 * (drag(i,k-1)+drag(i,k)) * dz | ||||
| tem1 = 0.5 * bb2 * (buo(i,k-1)+buo(i,k)) | ||||
| tem2 = wush(i,k) * sqrt(wu2(i,k-1)) | ||||
| tem2 = (tem1 - tem2) * dz | ||||
| ptem = (1. - tem) * wu2(i,k-1) | ||||
| ptem1 = 1. + tem | ||||
| wu2(i,k) = (ptem + tem2) / ptem1 | ||||
| wu2(i,k) = max(wu2(i,k), 0.) | ||||
| do i = 1, im | ||||
| if (cnvflg(i)) then | ||||
| k = kbcon1(i) | ||||
| tem = po(i,k) / (rd * to(i,k)) | ||||
| wucb = -0.01 * dot(i,k) / (tem * grav) | ||||
| if(wucb.gt.0.) then | ||||
| wu2(i,k) = wucb * wucb | ||||
| else | ||||
| wu2(i,k) = 0. | ||||
| endif | ||||
| endif | ||||
| endif | ||||
| enddo | ||||
| enddo | ||||
|
|
||||
| if(progsigma)then | ||||
| do k = 2, km1 | ||||
| enddo | ||||
| endif | ||||
| ! | ||||
| if (progomega) then | ||||
| call progomega_calc(first_time_step,restart,im,km, | ||||
| & kbcon1,ktcon,omegain,delt,del,zi,cnvflg,omegaout, | ||||
| & grav,buo,drag,wush,tentr,bb1,bb2) | ||||
| do k = 1, km | ||||
| do i = 1, im | ||||
| if (cnvflg(i)) then | ||||
| if(k > kbcon1(i) .and. k < ktcon(i)) then | ||||
| omega_u(i,k)=omegaout(i,k) | ||||
| omega_u(i,k)=MAX(omega_u(i,k),-80.) | ||||
| ! Convert to m/s for use in convective time-scale: | ||||
| rho = po(i,k)*100. / (rd * to(i,k)) | ||||
| tem = (-omega_u(i,k)) / ((rho * grav)) | ||||
| wu2(i,k) = tem**2 | ||||
| wu2(i,k) = max(wu2(i,k), 0.) | ||||
| endif | ||||
| endif | ||||
| enddo | ||||
| enddo | ||||
| else | ||||
| ! diagnostic method: | ||||
| do k = 2, km1 | ||||
| do i = 1, im | ||||
| if (cnvflg(i)) then | ||||
| if(k > kbcon1(i) .and. k < ktcon(i)) then | ||||
| dz = zi(i,k) - zi(i,k-1) | ||||
| tem = 0.25 * bb1 * (drag(i,k-1)+drag(i,k)) * dz | ||||
| tem1 = 0.5 * bb2 * (buo(i,k-1)+buo(i,k)) | ||||
| tem2 = wush(i,k) * sqrt(wu2(i,k-1)) | ||||
| tem2 = (tem1 - tem2) * dz | ||||
| ptem = (1. - tem) * wu2(i,k-1) | ||||
| ptem1 = 1. + tem | ||||
| wu2(i,k) = (ptem + tem2) / ptem1 | ||||
| wu2(i,k) = max(wu2(i,k), 0.) | ||||
| endif | ||||
| endif | ||||
| enddo | ||||
| enddo | ||||
| ! convert to Pa/s for use in closure | ||||
| do k = 1, km | ||||
| do i = 1, im | ||||
| if (cnvflg(i)) then | ||||
| if(k > kbcon1(i) .and. k < ktcon(i)) then | ||||
|
|
@@ -1807,10 +1833,11 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & | |||
| endif | ||||
| enddo | ||||
| enddo | ||||
| endif | ||||
|
|
||||
| endif !progomega | ||||
|
|
||||
| ! | ||||
| ! compute updraft velocity average over the whole cumulus | ||||
| ! | ||||
| !> - Calculate the mean updraft velocity within the cloud (wc). | ||||
| do i = 1, im | ||||
| wc(i) = 0. | ||||
|
|
@@ -1838,11 +1865,10 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & | |||
| val = 1.e-4 | ||||
| if (wc(i) < val) cnvflg(i)=.false. | ||||
| endif | ||||
| enddo | ||||
| enddo | ||||
| c | ||||
|
|
||||
| !> - For progsigma = T, calculate the mean updraft velocity within the cloud (omegac),cast in pressure coordinates. | ||||
| if(progsigma)then | ||||
| if(progsigma)then | ||||
| do i = 1, im | ||||
| omegac(i) = 0. | ||||
| sumx(i) = 0. | ||||
|
|
@@ -2929,10 +2955,9 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & | |||
| advfac(i) = min(advfac(i), 1.) | ||||
| endif | ||||
| enddo | ||||
|
|
||||
|
Collaborator
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.
Suggested change
|
||||
| !> - From Bengtsson et al. (2022) \cite Bengtsson_2022 prognostic closure scheme, equation 8, call progsigma_calc() to compute updraft area fraction based on a moisture budget | ||||
| if(progsigma)then | ||||
|
|
||||
| !Initial computations, dynamic q-tendency | ||||
| if(first_time_step .and. (.not.restart | ||||
| & .or. sigmab_coldstart))then | ||||
|
|
||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.