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

Updates for ufs/dev PR#30 #1

Merged
merged 5 commits into from
Jan 20, 2023

Conversation

grantfirl
Copy link

Changes:

  • pass in rhowater to GFS_MP_generic_post rather than redefine it
  • add parenthesis in a multi-condition if statement in GFS_MP_generic_post for clarity
  • change standard names of the new variables for consistency with CCPP rules
  • remove redundant frozen precipitation density in RUC LSM for clarity

Copy link
Owner

@ericaligo-NOAA ericaligo-NOAA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the removal of rhosnf. I assume this is part of a different PR from GSL? I just want to understand where those changes come from. I'm okay with all of the other changes.

@grantfirl
Copy link
Author

@ericaligo-NOAA I removed the rhosnf variable because with your changes, it isn't being used anymore in RUC LSM and it isn't being used anywhere else in UFS. So, to save memory and avoid code confusion by having similar variables in the code, I thought it best to remove. We should probably check with @tanyasmirnova if this is OK. @tanyasmiranova What do you think? I can always put it back in if you both prefer, but it seems better to me to remove it.

@ericaligo-NOAA
Copy link
Owner

After looking through the module_sf_ruclsm.f90, rhosnf, which is rhosnfall, is not used. in subroutine SFCTMP, it's commented out. I'm comfortable merging. It can be added back if Tanya believes it should be. What do you think?
!13mar18 rhosnfall = min(500.,max(76.9,(rhonewsn*snowrat + &

@tanyasmirnova
Copy link

@ericaligo-NOAA @grantfirl Eric and Grant, did you run a test before/after change to RUC LSM? The results should be identical, then we could remove computation of rhosnfall from RUC LSM. If they are not identical, we should keep RUC LSM unchanged.

@ericaligo-NOAA
Copy link
Owner

ericaligo-NOAA commented Jan 13, 2023 via email

@tanyasmirnova
Copy link

@ericaligo-NOAA I would prefer no changes in RUC LSM. The computation will be repeated, but it is not a big expense. I will get to this later and test using the rhonewsn1 from GFS_MP_generic_post.F90. As we discussed last week, the result will not actually be identical, because the 1-st level temperature could be different at the next time step when RUC LSM is called, right?

@ericaligo-NOAA
Copy link
Owner

ericaligo-NOAA commented Jan 13, 2023 via email

@tanyasmirnova
Copy link

@ericaligo-NOAA @grantfirl 'rhosnf' is the same as newsnow1, but computed internally in RUC LSM. It would be nice to have both of them: one computed internally - rhosnf, and another computed in GFS_MP_generic_post - rhonewsn1. I would like to see how close they are.

@grantfirl
Copy link
Author

grantfirl commented Jan 17, 2023

@tanyasmirnova @ericaligo-NOAA Eric is correct that my intention was to create CCPP standard names that were consistent with previous ones and the rules, although the rhosnf variable was already using the frozen_precipitiation_density name that was appropriate for Eric's new variable. Upon inspection of the code to discern a difference between rhosnf and rhonewsn1, I concluded that there wasn't any, and, further, that with Eric's changes, the rhosnf variable was only being initialized and not set to anything useful. If @tanyasmirnova would really like to keep the original variable rhosnf (at least temporarily for comparison), it would be easy enough to do that. We could use the same logical flag as in NOAH LSM to control which is used. Please let me know if this is acceptable, and I'll code it and commit to this PR for your review.

@tanyasmirnova
Copy link

@grantfirl Yes, it is acceptable and desirable. it would like to keep two options within RUC LSM. Thank you very much.

Copy link

@tanyasmirnova tanyasmirnova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@grantfirl @ericaligo-NOAA Thank you for putting the internal RUC LSM formulation back in. I have just one comment, otherwise, all changes look good to me.

@@ -747,6 +748,7 @@ subroutine lsm_ruc_run & ! inputs
acrunoff(i,j) = 0.0
snfallac_lnd(i,j) = 0.0
snfallac_ice(i,j) = 0.0
rhosnfr(i,j) = 0.0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@grantfirl could you please initialize rhosnfr as a flag rhosnfr(i,j) = -1.e3?

@grantfirl
Copy link
Author

@tanyasmirnova I changed the initialization of rhosnfr in lsm_ruc_run as you suggested. Thanks for the review. This should be ready to merge if @ericaligo-NOAA is OK with it. I did run RTs on Hera/Intel and it compiles/runs at least. There seemed to be an issue with the regional_atmaq tests, however. I don't know if they're related to the winterwx changes, but it was complaining about an invalid namelist parameter.

@grantfirl
Copy link
Author

Speaking of namelist parameters, this is a reminder that with the latest changes, when using RUC LSM, one will also need to set the vrbliceden_noah namelist parameter to use Eric's new variable ice density calculated in GFS_MP_generic_post. Perhaps this should be changed to just vrbliceden in GFS_typedefs since it is used for both NOAH and RUC LSMs?

@ericaligo-NOAA
Copy link
Owner

@grantfirl, vrbliceden_noah is only needed when running with the NOAH LSM with the new variable precip ice density. If it's not specified in the namelist, the default is the original precip ice density specified in the NOAH LSM.

@tanyasmirnova
Copy link

@grantfirl @ericaligo-NOAA I agree, we have to change vrbliceden_noah to simply vrbliceden or vrbliceden_mp (because it is computed directly after call to MP scheme).

@ericaligo-NOAA
Copy link
Owner

ericaligo-NOAA commented Jan 19, 2023 via email

@grantfirl
Copy link
Author

@ericaligo-NOAA From @tanyasmirnova suggestion, the latest commits of my changes added back the RUC LSM internally calculated value of frozen precip density and the SAME flag that you used for NOAH LSM is now used to control whether RUC LSM uses the frozen precip density calculated in GFS_MP_generic or the original internal algorithm. So, the flag is no longer specific to NOAH and is applicable for both NOAA LSM and RUC LSM.

@ericaligo-NOAA
Copy link
Owner

ericaligo-NOAA commented Jan 19, 2023

One issue is that regardless of where the variable precip ice density is computed, it's always the variable precip ice density. Using vrbliceden = F with the RUC LSM suggests that it's not a variable precip ice density. That parameter was solely meant for NOAH LSM and if the user wanted to use the original approach vs the new variable precip ice density.

I understand the desire to allow the RUC LSM to do both, but perhaps a totally different name then needs to be used.
Also, the line below needs to be reworked from:

if ( lsm == lsm_ruc .or. (lsm == lsm_noahmp .and. iopt_snf == 5) .or. vrbliceden_noah == .true.) then

to
if ( (lsm == lsm_noahmp .and. iopt_snf == 5) .or. vrbliceden == .true.) then

Eric

@grantfirl
Copy link
Author

@ericaligo-NOAA Excellent points. So, it seems that there are two choices:
-- change vrbliceden_noah to something like exticeden to better capture what the flag means (for "external" ice density with respect to LSM)
-- add an additional flag, e.g. exticeden_ruc, to go along with vrbliceden_noah.

My preference, for simplicity's sake, is the first one. It seems a bit overkill to have two different flags controlling this for different LSMs (in addition to the integer option for NoahMP). For the first one, the IF statement would be:
if ((lsm == lsm_noahmp .and. iopt_snf == 5) .or. exticeden == .true.) then
For the second option, the IF statement would be:
if ( (lsm == lsm_ruc .and. exticeden) .or. (lsm == lsm_noahmp .and. iopt_snf == 5) .or. (lsm == lsm_noah .and. vrbliceden_noah == .true.)) then.

Yet another option is to have the newly proposed exticeden flag be a "master" control for this functionality for all LSMs. E.g., we can set/override iopt_snf to 5 if exticeden == T for NOAHMP. Then, the IF statement only needs to check for if (exticeden) then. Thoughts?

@ericaligo-NOAA
Copy link
Owner

ericaligo-NOAA commented Jan 19, 2023 via email

@tanyasmirnova
Copy link

@grantfirl @ericaligo-NOAA Opinion 3 where "exticeden flag is a "master" control for this functionality for all LSMs" makes the most sense to me.

@ericaligo-NOAA
Copy link
Owner

I'm copying @barlage because we talked about using the opt_snf = 5 flag in order to avoid passing an additional parameter into the NOAH MP driver and module_sf_noahmplsm.f90, which we would have to do if we go with option 3, that is, using the parameter exticeden instead of iopt_snf to determine if NOAH MP uses the original density formulation or the new one.

@grantfirl
Copy link
Author

@ericaligo-NOAA We could continue to use opt_snf = 5 with NoahMP and option 3. In GFS_typedefs.F90/control_initialize(), we could add a statement like:
if (lsm == lsm_noahmp .and. iopt_snf == 4 .and. exticeden) then
iopt_snf = 5

and make sure to print this out when writing out NOAHMP options in GFS_typedefs.F90/control_print(). This avoids passing in a new flag to NOAHMP.

@ericaligo-NOAA
Copy link
Owner

ericaligo-NOAA commented Jan 19, 2023 via email

@tanyasmirnova
Copy link

@grantfirl very good solution, Grant! Thank you.

@grantfirl
Copy link
Author

OK, the solution that we discussed is coded up and pushed here.

@ericaligo-NOAA ericaligo-NOAA merged commit 9691f35 into ericaligo-NOAA:winterwx Jan 20, 2023
ericaligo-NOAA pushed a commit that referenced this pull request Nov 2, 2023
Remove MYNN SFC logic from noahmpdrv.F90 and fix CMakeLists.txt authors
ericaligo-NOAA pushed a commit that referenced this pull request Nov 2, 2023
update CODEOWNERS to replace Chunxi with Qingfu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants