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

Development of a new unified cumulus convection scheme #56

Merged
merged 16 commits into from
Apr 17, 2023

Conversation

lisa-bengtsson
Copy link
Collaborator

@lisa-bengtsson lisa-bengtsson commented Mar 21, 2023

This addresses issue: ufs-community/ufs-weather-model#1694

This PR is the first of several to function as a starting point for the unified convection scheme.
The following are the updates are in this PR (Coordinated between Lisa Bengtsson, Georg Grell, Jongil Han and Haiqin Li) :

  1. As a starting point we copied all the GF related routines over from GF to “unified”.
  2. We introduced new imfdeepcnv_unified and imfshalcnv_unified as flags for the new convection scheme, and updated GFS_typedefs and GFS_restart and radiation routines that took imf*conv flags as input.
  3. We created a new suite definition file that can run GFSv17 suite with the unified convection scheme.
  4. We added the Simpson and Wiggert 1969 wu2 and cloud average from saSAS in a new subroutine called subroutine calculate_updraft_velocity, called from both shallow and deep convection. I use the SAS formulation (Han et al. 2017) of drag and buoyancy terms. We also added output for omega_u in Pa/s needed for the prognostic closure.
  5. We added the prognostic area fraction computation from Bengtsson et al. 2022 with a call to progsigma_calc.F90 from both shallow and deep convection.
  6. We added a new closure in the calls cup_forcing_ens_3d and cup_output_ens_3d.
  7. Added (1-sigmab)^2 scaling if prognostic closure is used
  8. Generalized turbulence tendency input to Unified and saSAS schemes (removed specific satedmf dependency)
  9. We saved vertically integrated rain evaporation from the unified scheme to be used for the cellular automata evolution.
  10. We brought in the cellular automata field (Bengtsson et al. 2021) to be used (although not yet hooked up to the convection evolution)

@dustinswales
Copy link
Collaborator

@lisa-bengtsson Along with the new cu_unified_* files, I see that the cu_gf_* files are still in the repository. I think we can remove these? (This will make the deltas that appear in the PR a bit more vivid.)

@lisa-bengtsson
Copy link
Collaborator Author

@lisa-bengtsson Along with the new cu_unified_* files, I see that the cu_gf_* files are still in the repository. I think we can remove these? (This will make the deltas that appear in the PR a bit more vivid.)

@dustinswales no there is no plan on removing the Grell-Freitas convection scheme from CCPP. The unified scheme will greatly diverge from that scheme (we have grand plans!), this is just a starting point.

@yangfanglin
Copy link
Collaborator

Lisa, should the bug-fix for the prognostic closure be first added to saSAS for running HR2 ? This unified convection scheme may take a while to develop and validate.

@lisa-bengtsson
Copy link
Collaborator Author

Lisa, should the bug-fix for the prognostic closure be first added to saSAS for running HR2 ? This unified convection scheme may take a while to develop and validate.

Even though the unified scheme will be developed and tested over time, I think this PR could go in as a starting point so the other developers can add to the scheme, it does not break anything.

@dustinswales
Copy link
Collaborator

@lisa-bengtsson Along with the new cu_unified_* files, I see that the cu_gf_* files are still in the repository. I think we can remove these? (This will make the deltas that appear in the PR a bit more vivid.)

@dustinswales no there is no plan on removing the Grell-Freitas convection scheme from CCPP. The unified scheme will greatly diverge from that scheme (we have grand plans!), this is just a starting point.

@lisa-bengtsson Good to know, but what about the _pre _post routines that are currently identical? (I'm just trying to think of ways to potentially share code across convection schemes, rather than copying code and blazing your own trail for a new scheme)

@lisa-bengtsson
Copy link
Collaborator Author

@lisa-bengtsson Along with the new cu_unified_* files, I see that the cu_gf_* files are still in the repository. I think we can remove these? (This will make the deltas that appear in the PR a bit more vivid.)

@dustinswales no there is no plan on removing the Grell-Freitas convection scheme from CCPP. The unified scheme will greatly diverge from that scheme (we have grand plans!), this is just a starting point.

@lisa-bengtsson Good to know, but what about the _pre _post routines that are currently identical? (I'm just trying to think of ways to potentially share code across convection schemes, rather than copying code and blazing your own trail for a new scheme)

Yes, I didn't know what to do about those, because I had to create a new suite def file and thought it would look strange to have gf_pre and gf_post, while using unifed_deep and unified_shallow. I think ultimately GF, unified convection and the Tiedke scheme could share pre and post under a generic naming. Actually also SAS because the prog closure needs the fields computed in gf_pre and gf_post - and those are instead computed locally inside SAS right now.

@dustinswales
Copy link
Collaborator

@lisa-bengtsson Along with the new cu_unified_* files, I see that the cu_gf_* files are still in the repository. I think we can remove these? (This will make the deltas that appear in the PR a bit more vivid.)

@dustinswales no there is no plan on removing the Grell-Freitas convection scheme from CCPP. The unified scheme will greatly diverge from that scheme (we have grand plans!), this is just a starting point.

@lisa-bengtsson Good to know, but what about the _pre _post routines that are currently identical? (I'm just trying to think of ways to potentially share code across convection schemes, rather than copying code and blazing your own trail for a new scheme)

Yes, I didn't know what to do about those, because I had to create a new suite def file and thought it would look strange to have gf_pre and gf_post, while using unifed_deep and unified_shallow. I think ultimately GF, unified convection and the Tiedke scheme could share pre and post under a generic naming. Actually also SAS because the prog closure needs the fields computed in gf_pre and gf_post - and those are instead computed locally inside SAS right now.

Maybe we chat sometime soon about a way forward to generalize and harmonize all these interstitials for the convection schemes.

@lisa-bengtsson
Copy link
Collaborator Author

lisa-bengtsson commented Mar 21, 2023

@lisa-bengtsson Along with the new cu_unified_* files, I see that the cu_gf_* files are still in the repository. I think we can remove these? (This will make the deltas that appear in the PR a bit more vivid.)

@dustinswales no there is no plan on removing the Grell-Freitas convection scheme from CCPP. The unified scheme will greatly diverge from that scheme (we have grand plans!), this is just a starting point.

@lisa-bengtsson Good to know, but what about the _pre _post routines that are currently identical? (I'm just trying to think of ways to potentially share code across convection schemes, rather than copying code and blazing your own trail for a new scheme)

Yes, I didn't know what to do about those, because I had to create a new suite def file and thought it would look strange to have gf_pre and gf_post, while using unifed_deep and unified_shallow. I think ultimately GF, unified convection and the Tiedke scheme could share pre and post under a generic naming. Actually also SAS because the prog closure needs the fields computed in gf_pre and gf_post - and those are instead computed locally inside SAS right now.

Maybe we chat sometime soon about a way forward to generalize and harmonize all these interstitials for the convection schemes.

Yes, I think it is straightforward, but a lot of places needs to be updated. In particularly in the SDF files since there are so many.
Where we have to be careful is perhaps that GF pre/post carries additional variables (only 2) compared to Tiedke that would need to be allocated under some flag, because they are read in GFS_restart.F90. SAS could use the exact same pre/post as Tiedke pre/post and we could replace the computation of "qadv" which is currently done locally in samfdeepcnv.f and samfshalcnv.f. But just looking in the existing SDF files these are the ones using samfdeep that would need to have an updated call to pre/post before and after:

suite_FV3_GFS_2017_gfdlmp_noahmp.xml: samfdeepcnv
suite_FV3_GFS_2017_gfdlmp_regional_c768.xml: samfdeepcnv
suite_FV3_GFS_2017_gfdlmp_regional.xml: samfdeepcnv
suite_FV3_GFS_2017_gfdlmp.xml: samfdeepcnv
suite_FV3_GFS_2017_h2ophys.xml: samfdeepcnv
suite_FV3_GFS_2017_myj.xml: samfdeepcnv
suite_FV3_GFS_2017_ozphys_2015.xml: samfdeepcnv
suite_FV3_GFS_2017_satmedmfq.xml: samfdeepcnv
suite_FV3_GFS_2017_satmedmf.xml: samfdeepcnv
suite_FV3_GFS_2017_shinhong.xml: samfdeepcnv
suite_FV3_GFS_2017_stretched.xml: samfdeepcnv
suite_FV3_GFS_2017.xml: samfdeepcnv
suite_FV3_GFS_2017_ysu.xml: samfdeepcnv
suite_FV3_GFS_v15_mynn.xml: samfdeepcnv
suite_FV3_GFS_v15p2_no_nsst.xml: samfdeepcnv
suite_FV3_GFS_v15p2.xml: samfdeepcnv
suite_FV3_GFS_v15plus.xml: samfdeepcnv
suite_FV3_GFS_v15_thompson_mynn.xml: samfdeepcnv
suite_FV3_GFS_v15_thompson.xml: samfdeepcnv
suite_FV3_GFS_v15.xml: samfdeepcnv
suite_FV3_GFS_v16_coupled_noahmp.xml: samfdeepcnv
suite_FV3_GFS_v16_coupled_nsstNoahmpUGWPv1.xml: samfdeepcnv
suite_FV3_GFS_v16_coupled_nsstNoahmp.xml: samfdeepcnv
suite_FV3_GFS_v16_couplednsst.xml: samfdeepcnv
suite_FV3_GFS_v16_coupled_p8_sfcocn.xml: samfdeepcnv
suite_FV3_GFS_v16_coupled_p8.xml: samfdeepcnv
suite_FV3_GFS_v16_coupled.xml: samfdeepcnv
suite_FV3_GFS_v16_flake.xml: samfdeepcnv
suite_FV3_GFS_v16_fv3wam.xml: samfdeepcnv
suite_FV3_GFS_v16_noahmp.xml: samfdeepcnv
suite_FV3_GFS_v16_no_nsst.xml: samfdeepcnv
suite_FV3_GFS_v16_nsstNoahmpUGWPv1.xml: samfdeepcnv
suite_FV3_GFS_v16_p8.xml: samfdeepcnv
suite_FV3_GFS_v16_thompson.xml: samfdeepcnv
suite_FV3_GFS_v16_ugwpv1.xml: samfdeepcnv
suite_FV3_GFS_v16.xml: samfdeepcnv
suite_FV3_GFSv17alp_cpldnsstsasugwpnoahmp.xml: samfdeepcnv
suite_FV3_GFSv17alpha_cpldnsstsas_ugwp.xml: samfdeepcnv
suite_FV3_GFSv17alpha_cpldnsstsas.xml: samfdeepcnv
suite_FV3_GFSv17alpha_sas.xml: samfdeepcnv
suite_FV3_GFS_v17_coupled_p8_sfcocn.xml: samfdeepcnv
suite_FV3_GFS_v17_coupled_p8.xml: samfdeepcnv
suite_FV3_GFS_v17_p8_rrtmgp.xml: samfdeepcnv
suite_FV3_GFS_v17_p8.xml: samfdeepcnv
suite_FV3_HAFS_v1_gfdlmp_tedmf_nonsst.xml: samfdeepcnv
suite_FV3_HAFS_v1_gfdlmp_tedmf.xml: samfdeepcnv
suite_FV3_HAFS_v1_thompson_noahmp_nonsst.xml: samfdeepcnv
suite_FV3_HAFS_v1_thompson_noahmp.xml: samfdeepcnv
suite_FV3_HAFS_v1_thompson_nonsst.xml: samfdeepcnv
suite_FV3_HAFS_v1_thompson_tedmf_gfdlsf.xml: samfdeepcnv
suite_FV3_HAFS_v1_thompson.xml: samfdeepcnv

And these are the ones using gf_pre/post:
suite_FV3_GFS_v15_gf_thompson.xml: cu_gf_driver_pre
suite_FV3_GFS_v15_gf.xml: cu_gf_driver_pre
suite_FV3_RAP_cires_ugwp.xml: cu_gf_driver_pre
suite_FV3_RAP_flake.xml: cu_gf_driver_pre
suite_FV3_RAP_noah_sfcdiff_cires_ugwp.xml: cu_gf_driver_pre
suite_FV3_RAP_noah_sfcdiff_ugwpv1.xml: cu_gf_driver_pre
suite_FV3_RAP_noah_sfcdiff_unified_ugwp.xml: cu_gf_driver_pre
suite_FV3_RAP_noah.xml: cu_gf_driver_pre
suite_FV3_RAP_sfcdiff.xml: cu_gf_driver_pre
suite_FV3_RAP_unified_ugwp.xml: cu_gf_driver_pre
suite_FV3_RAP.xml: cu_gf_driver_pre

I would be open to make such changes, but I don't think it would fit in this PR. Perhaps a separate PR. What do you think?

I also don't know about the RAS and CS convection schemes.

@dustinswales
Copy link
Collaborator

@lisa-bengtsson I agree that it's beyond this PR to do the cleanup that is needed, and we'd probably need to reach out to the other convection scheme developers. As you said, it's not a ton of work, but it touches a lot of suites.

But we do now have 6 convection parameterizations, four (GF, Unified, nTiedtke, CS) of which use similiarish _pre _post routines. The other two (SAS and RAS) don't require _pre/_post routines.
(And outside this we have the GFS_DCNV and GFS_SCNV _pre/_post routines.)

@lisa-bengtsson
Copy link
Collaborator Author

@lisa-bengtsson I agree that it's beyond this PR to do the cleanup that is needed, and we'd probably need to reach out to the other convection scheme developers. As you said, it's not a ton of work, but it touches a lot of suites.

But we do now have 6 convection parameterizations, four (GF, Unified, nTiedtke, CS) of which use similiarish _pre _post routines. The other two (SAS and RAS) don't require _pre/_post routines. (And outside this we have the GFS_DCNV and GFS_SCNV _pre/_post routines.)

Yes, although I would say SAS could use the similarish _pre _post as the four you mentioned because what those do is essentially to save and compute the tendency due to dynamics, and SAS requires this input now when using the prognostic closure, but it is currently computed inside the scheme. There is also some magic happening in the interstitial3 which I think could be combined with a more generic _pre _post. We could discuss it in the convection working group meeting if you think that is a good place for it. The developers join those, except Moorthi who retired.

@dustinswales
Copy link
Collaborator

@lisa-bengtsson I agree that it's beyond this PR to do the cleanup that is needed, and we'd probably need to reach out to the other convection scheme developers. As you said, it's not a ton of work, but it touches a lot of suites.
But we do now have 6 convection parameterizations, four (GF, Unified, nTiedtke, CS) of which use similiarish _pre _post routines. The other two (SAS and RAS) don't require _pre/_post routines. (And outside this we have the GFS_DCNV and GFS_SCNV _pre/_post routines.)

Yes, although I would say SAS could use the similarish _pre _post as the four you mentioned because what those do is essentially to save and compute the tendency due to dynamics, and SAS requires this input now when using the prognostic closure, but it is currently computed inside the scheme. There is also some magic happening in the interstitial3 which I think could be combined with a more generic _pre _post. We could discuss it in the convection working group meeting if you think that is a good place for it. The developers join those, except Moorthi who retired.

Gotcha. To me it seems like there are some easy cleanup opportunities here, and if the other developers agree, I say let's do it (As it's own PR)

@lisa-bengtsson
Copy link
Collaborator Author

Sounds good Dustin. Another cleanup opportunity could be to get rid of some legacy SDF's.

@grantfirl
Copy link
Collaborator

@lisa-bengtsson To help us get a sense of priority, how urgent is this PR? I see that it is relevant to HR2, but there is a list of physics developments that need to get merged for RRFS for the HWT spring experiment too. Is it OK to put this behind whatever RRFS physics development PRs come in?

@lisa-bengtsson
Copy link
Collaborator Author

@lisa-bengtsson To help us get a sense of priority, how urgent is this PR? I see that it is relevant to HR2, but there is a list of physics developments that need to get merged for RRFS for the HWT spring experiment too. Is it OK to put this behind whatever RRFS physics development PRs come in?

Looks like we'll have an HR2 meeting tomorrow, let me check what other PR's need to be prepared, and on the final timeline for HR2 and get back to you after that. Thank you for checking.

@lisa-bengtsson
Copy link
Collaborator Author

@grantfirl @dustinswales following today's discussion I will move the parts pertaining to HR2 from this PR to a new PR. It would be nice if that can go after the RRFS PR's. Then this PR can go after the operational targeted PRs.

@Qingfu-Liu
Copy link
Collaborator

Qingfu-Liu commented Apr 7, 2023 via email

@Qingfu-Liu Qingfu-Liu self-requested a review April 7, 2023 14:09
Copy link
Collaborator

@grantfirl grantfirl left a comment

Choose a reason for hiding this comment

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

Looks good. I pointed out some minor things for a future cleanup since you've indicated that this is a starting point.

@lisa-bengtsson
Copy link
Collaborator Author

Looks good. I pointed out some minor things for a future cleanup since you've indicated that this is a starting point.

Hi Grant, thank you for taking a close look. The code you commented on is inherited from either the GF or the SAS scheme, I agree that all of them should be addressed. Is there anything that should be done in this PR, or can we commit a "clean up" PR after @haiqinli has added his updates to this scheme? As you know there is some room for improvement in the pre/post of all convection schemes, and we could combine such cleanup with the suggestions you and others have given here.

@grantfirl
Copy link
Collaborator

Looks good. I pointed out some minor things for a future cleanup since you've indicated that this is a starting point.

Hi Grant, thank you for taking a close look. The code you commented on is inherited from either the GF or the SAS scheme, I agree that all of them should be addressed. Is there anything that should be done in this PR, or can we commit a "clean up" PR after @haiqinli has added his updates to this scheme? As you know there is some room for improvement in the pre/post of all convection schemes, and we could combine such cleanup with the suggestions you and others have given here.

@lisa-bengtsson Ya, I should have been clearer, my comments are for future reference for a cleanup PR. As long as the code is where you all want it for the initial commit, I think it's fine to commit what is here, perhaps simultaneous to adding an official issue to fix some of these things in the future so that they're not forgotten.

@grantfirl
Copy link
Collaborator

@dustinswales @Qingfu-Liu Care to re-review? Don't feel obligated.

Copy link
Collaborator

@dustinswales dustinswales left a comment

Choose a reason for hiding this comment

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

@lisa-bengtsson Looks good.

@lisa-bengtsson
Copy link
Collaborator Author

@grantfirl Thanks, I created a new issue here: #63

@Qingfu-Liu
Copy link
Collaborator

@grantfirl I had reviewed this PR#56 last Friday, and approved the pull request

@grantfirl
Copy link
Collaborator

@lisa-bengtsson Given that #64 was just added, is this where the unified convection and GF schemes will diverge? Or, do you want to pull in the changes from that PR into the new unified scheme?

@lisa-bengtsson
Copy link
Collaborator Author

Thank you for checking @grantfirl

@haiqinli will add the updates also to the unified code. These are the current next steps:

Short-term next steps:

  • Add latest updates from GF (that were not yet merged to the UFS) into the unified scheme.

  • Code cleanup - optimization, use CCPP defined constants, remove goto statements, combine pre/post with other cumulus schemes in CCPP.

  • For the GFS: Run a set of MRW experiments, compare with GFSv17 latest tagged prototype (HR2 or 3). Compare with VSDB verification. Address any inconsistencies in cloud/convection/radiation interaction.

  • For RRFS: Test sensitivity to adding from saSAS into ECMWF’s convective time-scale calculation. Test prognostic closure.

Further development:

  • Introduction of a new mass-flux parameterization to include a prognostic updraft plume model for simulating transition from shallow to deep convection, and associated cold-pool dynamics

  • Add prognostic evolution of downdraft and environment area fraction, consider refining updraft area fraction(?)

  • Refine parameterization of sub-grid scale organization due to cold-pool dynamics

  • Machine learning for closure

  • Test in nested global 13 km, regional 3km UFS simulations

@grantfirl
Copy link
Collaborator

@dustinswales I'm going to be out until about 2 PM ET today, so if this needs to get merged today, please watch for the queue and do so when requested.

@jkbk2004
Copy link

All weather model regression tests are done at ufs-community/ufs-weather-model#1669. @grantfirl can you merge this pr?

@dustinswales dustinswales merged commit b93cf5e into ufs-community:ufs/dev Apr 17, 2023
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.

6 participants