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

Reorganize code for MPAS dycore. Isolate FV3 and MPAS pieces. #129

Merged

Conversation

dustinswales
Copy link
Collaborator

@dustinswales dustinswales commented Jul 19, 2024

This pull request contains changes to generalize atmospheric component of the UFS Weather Model:

  1. The reorganization of the repository is to achieve the following goals:
  • Move dynamical core specific code into subdirectories.
  • Move common code (e.g. physics) into shareable, cross-dycore, higher-level directories.
    This is outlined in Figure 1 of the "Tiger Team" report.
  1. Refactor the CMakeLists to build an atmospheric component with either an FV3
    or MPAS dynamical core.

  2. Add CMakeLists.txt to build MPAS core_atmosphere component. The CMake recipes from the "MPAS atmospheric core" were adapted to work in the UFS build system.

  3. Modify CCPP physics CmakeLists.txt to build independent MPAS/FV3 couplings to the physics.

  4. Create "stub" mpas infrastructure. This includes stubs for the MPAS atmospheric component driver and overlaying NUOPC cap.

With these changes, the MPAS dynamical core build within UFS.
Next steps, build atmospheric driver for MPAS, which includes creating new typedefs for coupling between the CCPP and MPAS.

@junwang-noaa @DusanJovic-NOAA

dustinswales and others added 7 commits July 19, 2024 17:30
… in the GFS physics suite (NOAA-EMC#851)

* Output updraft value of convective cloud condensate in CCPP

* update xkinv1 to 0.15

* add check if progsigma is true

* address seg fault if progsigma=F

---------

Co-authored-by: Grant Firl <[email protected]>
* Land surface upgrades for HR4
* Update diagnose_cplFields routine to use FieldBundleWrite. Needs esmf v8.6.0

* Fixed bug in aux2d dimensions for GFS meta file.

* Pass return code from diagnose_cplFields back to caller

* Skip 'cpl_scalars' field when dumping export state

* fix fhzero for GEFS

* fix cpl_scalars (NCAR#6)

* fix issues w/ cplscalars

* error out of all 3 spatial indices are not present

* add check for scalar_id = 0

* modify for timeslices and times (NCAR#7)
endif()

if (MPAS)
add_library(${DYCORE_TARGET}
Copy link
Member

Choose a reason for hiding this comment

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

Naming the add_library target ${DYCORE_TARGET} means we can't have both MPAS and FV3 build at the same time. At least my CMake v3.26.3 was complaining. Maybe not a big deal for now since we are just spinning up but might be good to give them unique names for the future?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Great point. Giving them unique names will also keep the hope alive of "piggy backing" the other dycore in a diagnostic mode. I will make this change.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@scrasmussen I added new variables for each dycore target, but didn't go as far as implementing them. I need to think about this a bit more.

@scrasmussen
Copy link
Member

scrasmussen commented Aug 7, 2024

This is a great start and is looking pretty good!

Right now I am mainly just trying to build this PR and am having a build issue. I tried building the feature/mpas-dycore-reorg on Derecho with the instructions from the slides.

$ CMAKE_FLAGS="-DAPP=ATMMPAS -DCCPP_SUITES=FV3_HRRR_gf" 
$ export CMAKE_FLAGS
$ ./build.sh

@dustinswales, I'm getting the following error, did you change the MPAS submodule at all? Thanks!

-- Configuring done (50.5s)
CMake Error at FV3/mpas/MPAS-Model/src/core_atmosphere/CMakeLists.txt:154 (add_library):
  Cannot find source file:

    physics/ccpp_kinds.F

@dustinswales
Copy link
Collaborator Author

This is a great start and is looking pretty good!

Right now I am mainly just trying to build this PR and am having a build issue. I tried building the feature/mpas-dycore-reorg on Derecho with the instructions from the slides.

$ CMAKE_FLAGS="-DAPP=ATMMPAS -DCCPP_SUITES=FV3_HRRR_gf" 
$ export CMAKE_FLAGS
$ ./build.sh

@dustinswales, I'm getting the following error, did you change the MPAS submodule at all? Thanks!

-- Configuring done (50.5s)
CMake Error at FV3/mpas/MPAS-Model/src/core_atmosphere/CMakeLists.txt:154 (add_library):
  Cannot find source file:

    physics/ccpp_kinds.F

Sorry, I forgot to include the changes needed to MPAS..
Should be good to go now.

…ow also includes NOAA-EMC#752) (NOAA-EMC#798)

* Convert GFS_grid DDT: use contiguous arrays instead of blocked data structures
* Add GCC-based CI build

---------

Co-authored-by: Alex Richert <[email protected]>
Co-authored-by: Dustin Swales <[email protected]>
@scrasmussen
Copy link
Member

Sorry, I forgot to include the changes needed to MPAS.. Should be good to go now.

Nice! This builds for me now. Just had to make slight changes to work with the GNU software stack on Derecho.

I changed 0.5 to 0.5_RKIND for lines 4776 and 5153 to fix Error: Type mismatch in argument 'ua' at (1); passed REAL(8) to REAL(4) errors. That is for the FV3/mpas/MPAS-Model/src/core_atmosphere/dynamics/mpas_atm_time_integration.F.

image

*  atmos_cube_sphere: heat_source is allocated when SKEB is true and d_con is zero
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
@dustinswales
Copy link
Collaborator Author

@DusanJovic-NOAA Thanks for the comments. I incorporated your suggestions, and grouped all the FV3 and MPAS pieces together.

CMakeLists.txt Outdated Show resolved Hide resolved
dustinswales and others added 2 commits August 13, 2024 17:50
* send CCPP ebu_smoke to UPP ebb

* upp: remove GSD_NC synonyms and rename GSD_NC fields instead

* update upp hash: g2, g2tmpl, etc.

* upp: correct pressure levels for hafs-ar postxconfig files

* bugfix: fixed_sfc2_type defaults to fixed_sfc1_type

* Add aerosol fix from Li Pan.

---------

Co-authored-by: Wen Meng <[email protected]>
@@ -1,8 +1,49 @@
cmake_minimum_required(VERSION 3.0)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Minor point, can we update this required version to 3.19 since other CMakeLists.txt require it?

DavidNew-NOAA and others added 3 commits August 27, 2024 09:32
…-EMC#837)

* Add namelist parameter, ncrement_file_on_native_grid
…e refactor and C3/SAS/MYNN fix) (NOAA-EMC#865)

* Host side changes for h2o photochemistry scheme

* A fix for the issue to run C3 or SAS convection with the prognostic area fraction closure, and MYNN PBL: tendency_of_vertically_diffused_tracer_concentration from MYNN PBL

---------

Co-authored-by: Dustin Swales <[email protected]>
Co-authored-by: Lisa Bengtsson <[email protected]>
dustinswales and others added 4 commits September 3, 2024 17:19
* add fire_behavior smoke coupling and flags and export variables for fire behavior

* added: inst_pres_levels, inst_geop_levels, inst_zonal_wind_levels, inst_merid_wind_levels, inst_surface_roughness, inst_temp_height2m, inst_spec_humid_height2m, inst_pres_height_surface, mean_prec_rate, inst_rainfall_amount 

* add fire behavior tendencies to physics

* add hflx_fire and evap_fire to FV3 imports

* added surface emissions fire_smoke imports and initialized the variables and fsmoke tracer index

---------

Co-authored-by: masih <[email protected]>
Co-authored-by: Grant Firl <[email protected]>
* Add support for IntelLLVM compiler: only sub modules (atmos_cubed_sphere, ccpp/physics and upp) are updated. 

* Update atmos_cubed_sphere, ccpp/physics and upp
@dustinswales
Copy link
Collaborator Author

@scrasmussen @mkavulich @grantfirl
I'm going to merge this and open a PR into NOAA-EMC:fv3atm from NCAR:feature/mpas-dycore, instead of dustinswales:feature/mpas-dycore-reorg.

@dustinswales dustinswales merged commit f571248 into NCAR:feature/mpas-dycore Oct 2, 2024
endif()
if(MULTI_GASES)
list(APPEND _ufsatm_defs_private MULTI_GASES)
endif()

Choose a reason for hiding this comment

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

I am not sure why these if statements here are under the MOVING_NEST if statement. May need further check when merging in EMC's repo

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@junwang-noaa Thanks. I'm running the UFS RTs now to ensure everything is working before opening PRs into the UFS repositories. (I will make sure to move this statement out of the MOVING_NEST logic.)

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.