-
Notifications
You must be signed in to change notification settings - Fork 54
Add namelist options for Tiedtke CP and introduce wind and PBLH dependent mixing-length limits in GFS PBL #359
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
base: ufs/dev
Are you sure you want to change the base?
Changes from 5 commits
cdabdb6
9f13565
cb19d18
8f8c7a2
e2ff6f5
41cbca7
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 |
|---|---|---|
|
|
@@ -169,8 +169,8 @@ end subroutine cu_ntiedtke_init | |
| !================================================================================================================= | ||
| ! level 1 subroutine 'cu_ntiedkte_run' | ||
| subroutine cu_ntiedtke_run(pu,pv,pt,pqv,tdi,qvdi,pqvf,ptf,clw,poz,pzz,prsl,prsi,pomg, & | ||
| evap,hfx,zprecc,lmask,lq,km,dt,dx,kbot,ktop,kcnv, & | ||
| ktrac,ud_mf,dd_mf,dt_mf,cnvw,cnvc,errmsg,errflg) | ||
| evap,hfx,zprecc,lmask,scale_fac_opt,lq,km,dt,dx,kbot,ktop,kcnv, & | ||
| ktrac,ud_mf,dd_mf,dt_mf,cnvw,cnvc,icu_zoentr,errmsg,errflg) | ||
| !================================================================================================================= | ||
| ! this is the interface between the model and the mass flux convection module | ||
| ! m.tiedtke e.c.m.w.f. 1989 | ||
|
|
@@ -200,6 +200,7 @@ subroutine cu_ntiedtke_run(pu,pv,pt,pqv,tdi,qvdi,pqvf,ptf,clw,poz,pzz,prsl,prsi, | |
| ! | ||
| implicit none | ||
| !--- input arguments: | ||
| integer, intent(in) :: scale_fac_opt,icu_zoentr | ||
| integer, intent(in) :: lq, km, ktrac | ||
| integer, intent(in), dimension(:) :: lmask | ||
|
|
||
|
|
@@ -256,13 +257,23 @@ subroutine cu_ntiedtke_run(pu,pv,pt,pqv,tdi,qvdi,pqvf,ptf,clw,poz,pzz,prsl,prsi, | |
| ! | ||
| dxref = 15000. | ||
| do j=1,lq | ||
| if (dx(j).lt.dxref) then | ||
| scale_fac(j) = (1.06133+log(dxref/dx(j)))**3 | ||
| scale_fac2(j) = scale_fac(j)**0.5 | ||
| else | ||
| scale_fac(j) = 1.+1.33e-5*dx(j) | ||
| scale_fac2(j) = 1. | ||
| end if | ||
| if (scale_fac_opt == 1) then | ||
| if (dx(j).lt.dxref) then | ||
| scale_fac(j) = (1.06133+log(dxref/dx(j)))**2 | ||
| scale_fac2(j) = scale_fac(j) | ||
| else | ||
| scale_fac(j) = 1.+1.33e-5*dx(j) | ||
| scale_fac2(j) = 1. | ||
| end if | ||
| else | ||
| if (dx(j).lt.dxref) then | ||
| scale_fac(j) = (1.06133+log(dxref/dx(j)))**3 | ||
| scale_fac2(j) = scale_fac(j)**0.5 | ||
| else | ||
| scale_fac(j) = 1.+1.33e-5*dx(j) | ||
| scale_fac2(j) = 1. | ||
| end if | ||
| end if | ||
| end do | ||
| ! | ||
| ! masv flux diagnostics. | ||
|
|
@@ -370,7 +381,7 @@ subroutine cu_ntiedtke_run(pu,pv,pt,pqv,tdi,qvdi,pqvf,ptf,clw,poz,pzz,prsl,prsi, | |
| & ktype, icbot, ictop, ztu, zqu, & | ||
| & zlu, zlude, zmfu, zmfd, zrain, & | ||
| & pcte, phhfl, lndj, pgeoh, zmfude_rate, dx, & | ||
| & scale_fac, scale_fac2) | ||
| & scale_fac, scale_fac2, icu_zoentr) | ||
| ! | ||
| ! to include the cloud water and cloud ice detrained from convection | ||
| ! | ||
|
|
@@ -446,7 +457,7 @@ subroutine cumastrn & | |
| & ktype, kcbot, kctop, ptu, pqu, & | ||
| & plu, plude, pmfu, pmfd, prain, & | ||
| & pcte, phhfl, lndj, zgeoh, pmfude_rate, dx, & | ||
| & scale_fac, scale_fac2) | ||
| & scale_fac, scale_fac2, icu_zoentr) | ||
| implicit none | ||
| ! | ||
| !***cumastrn* master routine for cumulus massflux-scheme | ||
|
|
@@ -509,7 +520,7 @@ subroutine cumastrn & | |
|
|
||
| !--- input arguments: | ||
| integer,intent(in):: klev,klon,klevp1,klevm1 | ||
| integer,intent(in):: ktrac | ||
| integer,intent(in):: ktrac,icu_zoentr | ||
| integer,intent(in),dimension(klon):: lndj | ||
|
|
||
| real(kind=kind_phys),intent(in):: ztmst | ||
|
|
@@ -689,7 +700,7 @@ subroutine cumastrn & | |
| & zmfus, zmfuq, zmful, plude, zdmfup, & | ||
| & kcbot, kctop, ictop0, icum, ztmst, & | ||
| & zqsenh, zlglac, lndj, wup, wbase, & | ||
| & kdpl, pmfude_rate) | ||
| & kdpl, pmfude_rate, icu_zoentr) | ||
|
|
||
| !* (b) check cloud depth and change entrainment rate accordingly | ||
| ! calculate precipitation rate (for downdraft calculation) | ||
|
|
@@ -2010,7 +2021,7 @@ subroutine cuascn & | |
| & pmfus, pmfuq, pmful, plude, pdmfup, & | ||
| & kcbot, kctop, kctop0, kcum, ztmst, & | ||
| & pqsenh, plglac, lndj, wup, wbase, & | ||
| & kdpl, pmfude_rate) | ||
| & kdpl, pmfude_rate, icu_zoentr) | ||
|
|
||
| implicit none | ||
| ! this routine does the calculations for cloud ascents | ||
|
|
@@ -2082,9 +2093,10 @@ subroutine cuascn & | |
| ! kctop - cloud top level | ||
| ! kctop0 [ictop0] - estimate of cloud top. (cumastr) | ||
| ! kcum [icum] - flag to control the call | ||
| ! icu_zoentr 1: original entrainment equation, 2: Bechtold 2008 equation | ||
|
|
||
| !--- input arguments: | ||
| integer,intent(in):: klev,klon,klevp1,klevm1 | ||
| integer,intent(in):: klev,klon,klevp1,klevm1,icu_zoentr | ||
| integer,intent(in),dimension(klon):: lndj | ||
| integer,intent(in),dimension(klon):: klwmin | ||
| integer,intent(in),dimension(klon):: kdpl | ||
|
|
@@ -2135,6 +2147,8 @@ subroutine cuascn & | |
| real(kind=kind_phys),dimension(klon):: zph,zdmfen,zdmfde,zmfuu,zmfuv,zpbase,zqold,zluold,zprecip | ||
| real(kind=kind_phys),dimension(klon,klev):: zlrain,zbuo,kup,zodetr,pdmfen | ||
|
|
||
| real(kind=kind_phys),parameter:: c1 = 5.0e-4 !shin | ||
| real(kind=kind_phys),parameter:: d1 = 1.0e-3 !shin | ||
| !-------------------------------- | ||
| !* 1. specify parameters | ||
| !-------------------------------- | ||
|
|
@@ -2271,9 +2285,14 @@ subroutine cuascn & | |
| ! Why is it negative? | ||
| !--------------------------------------- | ||
| if ( jk == kcbot(jl) ) then | ||
|
|
||
| zoentr(jl) = -entorg*(min(1.,pqen(jl,jk)/pqsen(jl,jk)) - & | ||
| 1.)*(pgeoh(jl,jk)-pgeoh(jl,jk+1))*zrg | ||
| if ( icu_zoentr .eq. 1 ) then | ||
| zoentr(jl) = -entorg*(min(1.,pqen(jl,jk)/pqsen(jl,jk)) - & | ||
| 1.)*(pgeoh(jl,jk)-pgeoh(jl,jk+1))*zrg | ||
| end if | ||
| if ( icu_zoentr .eq. 2 ) then | ||
| zoentr(jl) = (c1+d1*(1.0-min(1.,pqen(jl,jk)/pqsen(jl,jk))))* & | ||
| (pgeoh(jl,jk)-pgeoh(jl,jk+1))*zrg | ||
| end if | ||
|
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. There is no catchall guard here for icu_zoentry not in [1,2]. Same for line 2498 below. 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. Thank you for your comments. Regarding the catchall guard for the option icu_zoentr, I could modify the code so that the code can stop with warning message if the icu_zoentr is neither 1 nor 2 as shown in the below example. If you think it would be a good idea to modify the code as shown below, please let me know. If( icu_zoentr .eq. 1) then 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. With CCPP, the correct way is to write the error message to the 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. Ok.. I checked the cu_ntiedtke.F90 code to understand your instruction. Then, do you think the below example satisfies the CCPP standard? If you think this modification looks fine, shall I change to the code as shown below? If( icu_zoentr .eq. 1) then 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. Yes, that looks correct to me. Thanks! 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. Thank you. Then, I will modify and will test the codes. I will push the changes and will come back to you after I complete the tests. 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. I tested cu_ntiedtke.F90 after I changed the code as the example shown above to add the catchall guard for the option icu_zoentr. If I used icu_zoentr=2, which is a supported option, the code worked properly. I also tested the code with the unsupported option icu_zoentr=3, and the forecast job crashed (as expected) with the error message shown below. This error message will tell users that the code doesn't work except for options 1 and 2. An error occurred in ccpp_physics_run for group phys_ts, block/chunk 1 and thread 1 (nt= 1): Log file location: /scratch3/HFIP/hwrfv3/scrub/Junghoon.Shin/hafsv2p2_final_change_test/2024100512/14L/hafs_atm_init.log If you think this looks fine, I will push this change to the feature/hafs_tiedtke_varml branch for the code review. 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. I just pushed the changed cu_ntiedtke.F90 code to the feature/hafs_tiedtke_varml branch. |
||
| zoentr(jl) = min(0.4,zoentr(jl))*pmfu(jl,jk+1) | ||
| end if | ||
| !--------------------------------------- | ||
|
|
@@ -2467,10 +2486,16 @@ subroutine cuascn & | |
| ikb = kcbot(jl) | ||
| ! zoentr is overwritten, but not used until | ||
| ! the next jk level in the loop (ICON comment) | ||
| zoentr(jl) = entorg*(0.3-(min(1.,pqen(jl,jk-1) / & | ||
| pqsen(jl,jk-1))-1.))*(pgeoh(jl,jk-1)-pgeoh(jl,jk)) * & | ||
| zrg*min(1.,pqsen(jl,jk)/pqsen(jl,ikb))**3 | ||
|
|
||
| if ( icu_zoentr .eq. 1 ) then | ||
| zoentr(jl) = entorg*(0.3-(min(1.,pqen(jl,jk-1) / & | ||
| pqsen(jl,jk-1))-1.))*(pgeoh(jl,jk-1)-pgeoh(jl,jk)) * & | ||
| zrg*min(1.,pqsen(jl,jk)/pqsen(jl,ikb))**3 | ||
| end if | ||
| if ( icu_zoentr .eq. 2 ) then | ||
| zoentr(jl) = ( c1*(min(1.,pqsen(jl,jk)/pqsen(jl,ikb))**2) + & | ||
| d1*(1.0-min(1.,pqen(jl,jk-1)/pqsen(jl,jk-1)))*(min(1.,pqsen(jl,jk)/pqsen(jl,ikb))**3))* & | ||
| (pgeoh(jl,jk-1)-pgeoh(jl,jk))*zrg | ||
| end if | ||
| zoentr(jl) = min(0.4,zoentr(jl))*pmfu(jl,jk) | ||
| else | ||
| zoentr(jl) = 0. | ||
|
|
||
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.
I think it might be useful to add links to the two issues that describe the need for these parameters and what they do as comments above line 203.
Uh oh!
There was an error while loading. Please reload this page.
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.
The option scale_fac_opt (alternative scale-awareness method) is related to the issue #357 from AndrewHazelton while the option icu_zoentr is related to the issue #358. I can add these two "links" as comments in the code near line 203.
#357 (scale_fac_opt)
#358 (icu_zoentr)