Skip to content
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

Merged
merged 6 commits into from
Jan 30, 2019
Merged

Conversation

polunma
Copy link
Contributor

@polunma polunma commented Jan 9, 2019

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]

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.
Copy link
Member

@rljacob rljacob left a 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.

components/cam/src/physics/cam/clubb_intr.F90 Outdated Show resolved Hide resolved
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))
Copy link
Member

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.

Copy link
Contributor Author

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).
@rljacob
Copy link
Member

rljacob commented Jan 9, 2019

Will any of the current tests use this new gustiness paramaterization? If not, please add one that does.

@singhbalwinder
Copy link
Contributor

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.

@singhbalwinder singhbalwinder added the BFB PR leaves answers BFB label Jan 10, 2019
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))
Copy link
Contributor

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.

Copy link
Contributor Author

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
Copy link
Contributor

@wlin7 wlin7 Jan 12, 2019

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

@polunma polunma Jan 15, 2019

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)
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@rljacob
Copy link
Member

rljacob commented Jan 14, 2019

How is this related to the gustiness param introduced in PR #1035 ?

@singhbalwinder
Copy link
Contributor

singhbalwinder commented Jan 14, 2019

How is this related to the gustiness param introduced in PR #1035 ?

@polunma : do you know if the old code mods (via PR #1035) are being used by the code in this PR in some way?

@golaz
Copy link
Contributor

golaz commented Jan 16, 2019

@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.

@polunma
Copy link
Contributor Author

polunma commented Jan 16, 2019

@golaz the flag has been renamed!

@polunma
Copy link
Contributor Author

polunma commented Jan 16, 2019

@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.

@rljacob
Copy link
Member

rljacob commented Jan 23, 2019

Should we eventually remove the old gustiness param from the coupler?

@golaz
Copy link
Contributor

golaz commented Jan 23, 2019

@polunma : thanks for making the changes I suggested.
@rljacob : if it's not being used, we could eventually remove the old gustiness.

[BFB] - Bit-For-Bit
[NML] - Namelist Changing

See confluence for a more detailed description about these tags.
@singhbalwinder
Copy link
Contributor

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!

singhbalwinder added a commit that referenced this pull request Jan 28, 2019
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
@singhbalwinder
Copy link
Contributor

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.
singhbalwinder added a commit that referenced this pull request Jan 29, 2019
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]
@singhbalwinder singhbalwinder merged commit 288ee8c into master Jan 30, 2019
singhbalwinder added a commit that referenced this pull request Jan 30, 2019
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]
bartgol pushed a commit that referenced this pull request Mar 27, 2024
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Atmosphere BFB PR leaves answers BFB NML
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants