forked from NCAR/ccpp-physics
-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Introduce prognostic updraft velocity to saSAS and C3 cumulus convection schemes #246
Open
lisa-bengtsson
wants to merge
7
commits into
ufs-community:ufs/dev
Choose a base branch
from
lisa-bengtsson:updraft_velocity
base: ufs/dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 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 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 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
This file contains 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
This file contains 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 |
---|---|---|
|
@@ -5,7 +5,7 @@ module samfshalcnv | |
|
||
use samfcnv_aerosols, only : samfshalcnv_aerosols | ||
use progsigma, only : progsigma_calc | ||
|
||
use progomega, only : progomega_calc | ||
contains | ||
|
||
subroutine samfshalcnv_init(imfshalcnv, imfshalcnv_samf, & | ||
|
@@ -52,12 +52,13 @@ end subroutine samfshalcnv_init | |
subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & | ||
& eps,epsm1,fv,grav,hvap,rd,rv, & | ||
& t0c,delt,ntk,ntr,delp,first_time_step,restart, & | ||
& tmf,qmicro,progsigma, & | ||
& tmf,qmicro,progsigma,progomega, & | ||
& prslp,psp,phil,qtr,prevsq,q,q1,t1,u1,v1,fscav, & | ||
& rn,kbot,ktop,kcnv,islimsk,garea, & | ||
& dot,ncloud,hpbl,ud_mf,dt_mf,cnvw,cnvc, & | ||
& clam,c0s,c1,evef,pgcon,asolfac,hwrf_samfshal, & | ||
& sigmain,sigmaout,betadcu,betamcu,betascu,errmsg,errflg) | ||
& sigmain,sigmaout,omegain,omegaout,betadcu,betamcu,betascu, & | ||
& errmsg,errflg) | ||
! | ||
use machine , only : kind_phys | ||
use funcphys , only : fpvs | ||
|
@@ -75,7 +76,8 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & | |
& tmf(:,:,:), q(:,:) | ||
real(kind=kind_phys), intent(in), optional :: qmicro(:,:), & | ||
& prevsq(:,:) | ||
real(kind=kind_phys), intent(in), optional :: sigmain(:,:) | ||
real(kind=kind_phys), intent(in), optional :: sigmain(:,:), & | ||
& omegain(:,:) | ||
! | ||
real(kind=kind_phys), dimension(:), intent(in) :: fscav | ||
integer, intent(inout) :: kcnv(:) | ||
|
@@ -88,11 +90,11 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & | |
& cnvw(:,:), cnvc(:,:), dt_mf(:,:) | ||
! | ||
real(kind=kind_phys), intent(out), optional :: ud_mf(:,:), & | ||
& sigmaout(:,:) | ||
& sigmaout(:,:), omegaout(:,:) | ||
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. Same comment about initializing intent(out) variables. |
||
real(kind=kind_phys), intent(in) :: clam, c0s, c1, & | ||
& asolfac, evef, pgcon | ||
logical, intent(in) :: hwrf_samfshal,first_time_step, & | ||
& restart,progsigma | ||
& restart,progsigma,progomega | ||
character(len=*), intent(out) :: errmsg | ||
integer, intent(out) :: errflg | ||
! | ||
|
@@ -1478,7 +1480,7 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & | |
! | ||
! compute updraft velocity square(wu2) | ||
!> - Calculate 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_samfshal) then | ||
do i = 1, im | ||
if (cnvflg(i)) then | ||
|
@@ -1493,26 +1495,46 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & | |
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.) | ||
endif | ||
endif | ||
enddo | ||
enddo | ||
! | ||
if(progsigma)then | ||
do k = 2, km1 | ||
if (progomega) then | ||
call progomega_calc(first_time_step,restart,im,km, | ||
& kbcon1,ktcon,omegain,delt,del,zi,cnvflg,omegaout, | ||
& grav,buo,drag,wush,xlamue,bb1,bb2) | ||
do k = 1, km | ||
do i = 1, im | ||
if (cnvflg(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 | ||
enddo | ||
enddo | ||
|
||
else | ||
! diagnostic updraft velocity | ||
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 = 2, km1 | ||
do i = 1, im | ||
if (cnvflg(i)) then | ||
if(k > kbcon1(i) .and. k < ktcon(i)) then | ||
|
@@ -1523,8 +1545,9 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & | |
endif | ||
enddo | ||
enddo | ||
endif | ||
|
||
endif !progomega | ||
|
||
! compute updraft velocity averaged over the whole cumulus | ||
! | ||
!> - Calculate the mean updraft velocity within the cloud (wc). | ||
|
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.
sigmaout and omegaout are intent(out) but are not always give a value if present, which is a CCPP rule. The fact that they're optional maybe makes that rule cloudy, though. I'm thinking that it is probably best to add
if present(sigmaout) sigmaout = 0.0_kind_phys
(same for omegaout). @dustinswales You're more involved with optional arguments, do you think this is necessary?