Skip to content

Commit

Permalink
Bring AQM model into UFS & Update MOM6 mixed FMS (#1137)
Browse files Browse the repository at this point in the history
* Add AQM submodule to integrate NOAA's Air Quality Model embedding
the U.S. EPA Community Multiscale Air Quality Model (CMAQ).

* MOM6: An alternate fix to class(*) issues with FMS 2022-01

Co-authored-by: Raffaele Montuoro <raffaele.montuoro@noaa.gov>
Co-authored-by: jiandewang <jiande.wang@noaa.gov>
  • Loading branch information
3 people authored Apr 4, 2022
1 parent 7c23151 commit 96dffa1
Show file tree
Hide file tree
Showing 18 changed files with 2,949 additions and 2,897 deletions.
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@
path = GOCART
url = https://github.com/GEOS-ESM/GOCART
branch = develop
[submodule "AQM"]
path = AQM
url = https://github.com/NOAA-EMC/AQM
branch = develop
1 change: 1 addition & 0 deletions AQM
Submodule AQM added at 79ff7a
17 changes: 16 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules/Modules)
###############################################################################

# Valid applications and choices
list(APPEND VALID_APPS ATM ATMAERO ATMW S2S S2SA S2SW S2SWA HAFS HAFSW HAFS-ALL NG-GODAS)
list(APPEND VALID_APPS ATM ATMAERO ATMAQ ATMW S2S S2SA S2SW S2SWA HAFS HAFSW HAFS-ALL NG-GODAS)
set(APP NONE CACHE BOOL "Application Name")
if(NOT (APP IN_LIST VALID_APPS))
message(FATAL_ERROR "${APP} is not a valid application.\nValid Applications are: ${VALID_APPS}")
endif()

set(FMS OFF CACHE BOOL "Enable FMS")
set(FV3 OFF CACHE BOOL "Enable FV3")
set(AQM OFF CACHE BOOL "Enable AQM")
set(UFS_GOCART OFF CACHE BOOL "Enable GOCART")
set(MOM6 OFF CACHE BOOL "Enable MOM6")
set(HYCOM OFF CACHE BOOL "Enable HYCOM")
Expand All @@ -40,6 +41,7 @@ include(cmake/configure_apps.cmake)
message("")
message("FMS .............. ${FMS}")
message("FV3 .............. ${FV3}")
message("AQM .............. ${AQM}")
message("GOCART ........... ${UFS_GOCART}")
message("MOM6 ............. ${MOM6}")
message("HYCOM ............ ${HYCOM}")
Expand Down Expand Up @@ -144,6 +146,13 @@ if(FV3)
add_subdirectory(FV3)
endif()

###############################################################################
### AQM
###############################################################################
if(AQM)
add_subdirectory(AQM)
endif()

###############################################################################
### GOCART
###############################################################################
Expand Down Expand Up @@ -203,6 +212,12 @@ if(JEDI_DRIVER)
list(APPEND _ufs_defs_private JEDI_DRIVER=ON)
endif()

if(AQM)
add_dependencies(ufs aqm)
list(APPEND _ufs_defs_private FRONT_AQM=aqm)
list(APPEND _ufs_libs_public aqm)
endif()

if(UFS_GOCART)
add_dependencies(ufs UFS_Aerosols)
list(APPEND _ufs_defs_private FRONT_GOCART=Aerosol_Cap)
Expand Down
2 changes: 1 addition & 1 deletion FV3
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# ufs-weather-model

This is the UFS weather model source code.
This is the UFS weather model source code

# Where to find information

Expand Down
5 changes: 4 additions & 1 deletion cmake/configure_apps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@
###############################################################################
### Configure Application Components
###############################################################################
if(APP MATCHES "^(ATM|ATMW)$")
if(APP MATCHES "^(ATM|ATMW|ATMAQ)$")
set(FMS ON CACHE BOOL "Enable FMS" FORCE)
set(FV3 ON CACHE BOOL "Enable FV3" FORCE)
set(STOCH_PHYS ON CACHE BOOL "Enable Stochastic Physics" FORCE)
if(APP MATCHES "ATMW")
set(WW3 ON CACHE BOOL "Enable WAVEWATCH III" FORCE)
message("Configuring UFS app in Atmosphere with Waves mode")
elseif(APP MATCHES "ATMAQ")
set(AQM ON CACHE BOOL "Enable AQM" FORCE)
message("Configuring UFS app in Atmosphere with Air Quality mode")
else()
message("Configuring UFS app in Atmosphere Only mode")
endif()
Expand Down
21 changes: 21 additions & 0 deletions driver/EARTH_GRID_COMP.F90
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ MODULE module_EARTH_GRID_COMP
! - Handle build time IPM options:
#ifdef FRONT_IPE
use FRONT_IPE, only: IPE_SS => SetServices
#endif
! - Handle build time AQM options:
#ifdef FRONT_AQM
use FRONT_AQM, only: AQM_SS => SetServices
#endif
! - Handle build time GOCART options:
#ifdef FRONT_GOCART
Expand Down Expand Up @@ -489,6 +493,23 @@ subroutine SetModelServices(driver, rc)
found_comp = .true.
end if
#endif
#ifdef FRONT_AQM
if (trim(model) == "aqm") then
!TODO: Remove bail code and pass info and SetVM to DriverAddComp
!TODO: once component supports threading.
if (ompNumThreads > 1) then
write (msg, *) "ESMF-aware threading NOT implemented for model: "//&
trim(model)
call ESMF_LogSetError(ESMF_RC_NOT_VALID, msg=msg, line=__LINE__, &
file=__FILE__, rcToReturn=rc)
return ! bail out
endif
call NUOPC_DriverAddComp(driver, trim(prefix), AQM_SS, &
petList=petList, comp=comp, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
found_comp = .true.
end if
#endif
#ifdef FRONT_GOCART
if (trim(model) == "gocart") then
!TODO: Remove bail code and pass info and SetVM to DriverAddComp
Expand Down
Loading

0 comments on commit 96dffa1

Please sign in to comment.