-
Notifications
You must be signed in to change notification settings - Fork 334
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
Gustiness, tpert, wsubmin for EAMv2 #2679
Conversation
This includes subgrid wind gustiness (ocean and land; ZM and clubb), subgrid temperature (tpert), lower wsubmin for activation, and theta-v formula fix. These code mods are controled by namelist. EAMv1 is BFB.
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.
Need to replace some magic numbers.
gust_fac(i) = gust_faco | ||
endif | ||
vmag(i) = max(1.e-5_r8,sqrt( umb(i)**2._r8 + vmb(i)**2._r8)) | ||
vmag_gust_dp(i) = ugust(min(prec_gust(i),6.94444e-4_r8),gust_fac(i)) |
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.
6.94444e-4 is another "Magic number". Convert to a variable.
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.
@rljacob It is a coefficient of the equation from the gustiness paper.
Comments are added to state that the numbers are coefficients of the empirical equation in Redelsperger et al. (2000).
Will any of the current tests use this new gustiness paramaterization? If not, please add one that does. |
I will do that in a follow up PR. |
thv(i) = th(i)*(1._r8+zvir*state%q(i,pver,ixq)) ! diagnose virtual potential temperature | ||
if (eamv2) then | ||
thv(i) = th(i)*(1._r8+zvir*state%q(i,pver,ixq) & ! PMA corrects virtual potential temperature formula | ||
- state%q(i,pver,ixcldliq)) |
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.
need to get ixcldliq before using in this subroutine clubb_surface. thv fix in subroutine clubb_tend_cam is fine.
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.
Done! Thanks for catching that! It was in my original code but got lost in this branch!
call infld('vmag_gust', fh_ini, dim1name, dim2name, 1, pcols, begchunk, endchunk, & | ||
tptr(:,:), found, gridname='physgrid') | ||
if(.not. found) then | ||
tptr(:,:) = 0._r8 |
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 wonder how the assignment to tptr after calling infld and not found can take effect in the sequence of calls in this routine. Anyway, just for consistency, should it be set to 1.0 here?
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 tptr is not used here. vmag_gust is initialized to 1.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 wonder if this part of code is necessary, since vmag_gust is always initialized in clubb_tend. There was a time when the code failed to compile, so I added this infld call.
if (masterproc) write(iulog,*) 'vmag_gust initialized to 1.' | ||
end if | ||
vmag_gust_idx = pbuf_get_index( 'vmag_gust') | ||
call pbuf_set_field(pbuf2d, vmag_gust_idx, 1._r8) |
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.
If eamv2=true, and vmag_gust available in ini file, should the input be retained? Here would always initialize vmag_gust to 1.0, regardless of eamv2 flag.
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.
Yes I think the infld call might not be needed, since vmag_gust is initialized to 1 here. There was a time when the code failed to compile, so I added this infld call.
How is this related to the gustiness param introduced in PR #1035 ? |
@polunma and @rljacob : I think it's a bad idea to have new variables named 'clubb_eamv2' and 'eamv2'. This is just going to make things more confusing in the future as we don't know yet what EAMv2 will look like. I would suggest to replace with more meaningful names and possible introduce more than one flag to be able to control new features individually. |
@golaz the flag has been renamed! |
@rljacob and @singhbalwinder , the old gustiness parameterization only has ZM component for ocean. This PR includes (1) ZM component, (2) CLUBB component), for both over land and over ocean. To make ZM component work over land, the code needs to be implemented in a different way. So, the old gustiness parameterization is not turned on, but this PR will handle all gustiness. |
Should we eventually remove the old gustiness param from the coupler? |
[BFB] - Bit-For-Bit [NML] - Namelist Changing See confluence for a more detailed description about these tags.
Hi @polunma : I have made some changes to the code. They are very minor. Would you please take a look to see if they are okay? Thanks! |
Gustiness, tpert, wsubmin for EAMv2 This includes subgrid wind gustiness (ocean and land; ZM and clubb), subgrid temperature (tpert), lower wsubmin for activation, and theta-v formula fix. These code mods are controlled by namelist. EAMv1 is BFB. [BFB] [NML] * polunma/atm/eamv2: Adds some cosmetic changes and removes code which is not required Rename flag to use_sgv Add ixcldliq in clubb_surface Add comments for the numbers in the equation Gustiness, tpert, wsubmin for EAMv2
Merged to next. |
The error was due to gust_fac being declared as an array and used as a scalar: /global/cscratch1/sd/bsingh/delete/tmp/gnu_compile/E3SM/components/cam /src/physics/cam/clubb_intr.F90:1253:30: real(r8) :: gust_fac(pcols) 1 Error: Argument 'gust_fac' of statement function at (1) must be scalar /global/cscratch1/sd/bsingh/delete/tmp/gnu_compile/E3SM/components/cam /src/physics/cam/clubb_intr.F90:1248:20: real(r8) :: ugust ! function: gustiness as a function of convective rainfall 1 Error: Incompatible ranks 0 and 1 in assignment at (1) /global/cscratch1/sd/bsingh/acme_scratch/cori-knl/SMS_Ln1.ne4_ne4. FC5AV1C-L.cori-knl_gnu.gnu_tst_del/Tools/Makefile:934: recipe for target 'clubb_intr.o' failed gmake: *** [clubb_intr.o] Error 1 [BFB] - Bit-For-Bit [NML] - Namelist Changing See confluence for a more detailed description about these tags.
Gustiness, tpert, wsubmin for EAMv2 This includes subgrid wind gustiness (ocean and land; ZM and clubb), subgrid temperature (tpert), lower wsubmin for activation, and theta-v formula fix. These code mods are controlled by namelist. EAMv1 is BFB. [BFB] [NML]
Gustiness, tpert, wsubmin for EAMv2 This includes subgrid wind gustiness (ocean and land; ZM and clubb), subgrid temperature (tpert), lower wsubmin for activation, and theta-v formula fix. These code mods are controlled by namelist. EAMv1 is BFB. [BFB] [NML]
…thod-hang Automatically Merged using E3SM Pull Request AutoTester PR Title: Avoid recomputing min/max gids in grid clones PR Author: bartgol PR LABELS: AT: AUTOMERGE
This includes subgrid wind gustiness (ocean and land; ZM and clubb),
subgrid temperature (tpert), lower wsubmin for activation, and theta-v
formula fix. These code mods are controlled by namelist. EAMv1 is BFB.
[BFB]
[NML]