diff --git a/.gitmodules b/.gitmodules index d648fcb8f9..8c87a67a6c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,7 @@ [submodule "FV3"] path = FV3 - url = https://github.com/NOAA-EMC/fv3atm - branch = develop + url = https://github.com/NCAR/fv3atm + branch = feature/mpas-dycore [submodule "WW3"] path = WW3 url = https://github.com/NOAA-EMC/WW3 diff --git a/CMakeLists.txt b/CMakeLists.txt index 042b9cf9ec..d35576af9b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,14 +16,15 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules/Modules) ############################################################################### # Valid applications and choices -list(APPEND VALID_APPS ATM ATMAERO ATMAQ ATMW ATMWM ATML ATMF LND S2S S2SA S2SW S2SWA S2SWAL ATM_DS2S ATM_DS2S-PCICE HAFS HAFSW HAFS-MOM6 HAFS-MOM6W HAFS-ALL NG-GODAS) +list(APPEND VALID_APPS ATM ATMAERO ATMAQ ATMW ATMWM ATML ATMF ATMMPAS LND S2S S2SA S2SW S2SWA S2SWAL ATM_DS2S ATM_DS2S-PCICE HAFS HAFSW HAFS-MOM6 HAFS-MOM6W 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(FV3 OFF CACHE BOOL "Enable FV3 dycore") +set(MPAS OFF CACHE BOOL "Enable MPAS dycore") set(AQM OFF CACHE BOOL "Enable AQM") set(UFS_GOCART OFF CACHE BOOL "Enable GOCART") set(MOM6 OFF CACHE BOOL "Enable MOM6") @@ -42,7 +43,8 @@ include(cmake/configure_apps.cmake) message("") message("FMS .............. ${FMS}") -message("FV3 .............. ${FV3}") +message("FV3_dy ........... ${FV3}") +message("MPAS_dy .......... ${MPAS}") message("AQM .............. ${AQM}") message("GOCART ........... ${UFS_GOCART}") message("MOM6 ............. ${MOM6}") @@ -157,7 +159,7 @@ if(FMS) elseif (APP MATCHES "^(S2S|S2SA|S2SW|S2SWA|S2SWAL|ATM_DS2S|ATM_DS2S-PCICE|NG-GODAS|HAFS-MOM6|HAFS-MOM6W)$") add_library(fms ALIAS FMS::fms_r8) endif() - if(APP MATCHES "^(ATM|ATMAERO|ATMAQ|ATMWM|ATMW|ATML|ATMF|HAFS|HAFS-ALL)$") + if(APP MATCHES "^(ATM|ATMAERO|ATMAQ|ATMWM|ATMW|ATML|ATMF|ATMMPAS|HAFS|HAFS-ALL)$") if(32BIT) add_library(fms ALIAS FMS::fms_r4) else() @@ -174,6 +176,12 @@ find_package(bacio 2.4.0 REQUIRED) find_package(sp 2.3.3 REQUIRED) find_package(w3emc 2.9.2 REQUIRED) +if(MPAS) + find_package(PnetCDF REQUIRED COMPONENTS Fortran) + find_package(PIO REQUIRED COMPONENTS Fortran C) + set(FV3 OFF) +endif() + # Configure Python find_package(Python 3.6 REQUIRED COMPONENTS Interpreter) message("Found Python: ${Python_EXECUTABLE}") @@ -187,10 +195,18 @@ endif() ############################################################################### ### Atmosphere Components [FV3, MPAS?] +### DJS2024: There will be a generalized atmospheric component with multiple +### dycores, not multiple atmospheric components (one for each dycore). +### So, - rename the atmospheric component FV3 to UFSATM or ATM, then +### - if FV3 or MPAS, add_sudirectory(UFSATM or ATM) +### ############################################################################### if(FV3) add_subdirectory(FV3) endif() +if (MPAS) + add_subdirectory(FV3) +endif() ############################################################################### ### AQM @@ -306,9 +322,15 @@ if(STOCH_PHYS) endif() if(FV3) - add_dependencies(ufs fv3atm) + add_dependencies(ufs ufsatm_fv3) list(APPEND _ufs_defs_private FRONT_FV3=fv3atm_cap_mod) - list(APPEND _ufs_libs_public fv3atm) + list(APPEND _ufs_libs_public ufsatm_fv3) +endif() + +if(MPAS) + add_dependencies(ufs ufsatm_mpas) + list(APPEND _ufs_defs_private FRONT_MPAS=mpasatm_cap_mod) + list(APPEND _ufs_libs_public ufsatm_mpas) endif() if(MOM6) diff --git a/FV3 b/FV3 index 1aba87cb30..fe342d0391 160000 --- a/FV3 +++ b/FV3 @@ -1 +1 @@ -Subproject commit 1aba87cb308fb52912e7fe6dd6b53d0ce7077554 +Subproject commit fe342d039198a92138ac5de157f31c23f26b5863 diff --git a/cmake/configure_apps.cmake b/cmake/configure_apps.cmake index a63601f62f..56f95123eb 100644 --- a/cmake/configure_apps.cmake +++ b/cmake/configure_apps.cmake @@ -13,7 +13,7 @@ ############################################################################### ### Configure Application Components ############################################################################### -if(APP MATCHES "^(ATM|ATMW|ATMWM|ATMAQ|ATML|ATMF)$") +if(APP MATCHES "^(ATM|ATMW|ATMWM|ATMAQ|ATML|ATMF|ATMMPAS)$") 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) @@ -31,6 +31,9 @@ if(APP MATCHES "^(ATM|ATMW|ATMWM|ATMAQ|ATML|ATMF)$") set(CMEPS ON CACHE BOOL "Enable CMEPS" FORCE) set(NOAHMP ON CACHE BOOL "Enable NOAHMP" FORCE) message("Configuring UFS app in Atmosphere with Air Quality mode") + elseif(APP MATCHES "ATMMPAS") + set(MPAS ON CACHE BOOL "Enable MPAS dycore" FORCE) + message("Configuring UFS app in Atmosphere with MPAS dycore") elseif(APP MATCHES "ATMF") set(FIRE_BEHAVIOR ON CACHE BOOL "Enable Fire Behavior" FORCE) else() diff --git a/driver/UFSDriver.F90 b/driver/UFSDriver.F90 index 2b07308aa1..54248da75e 100644 --- a/driver/UFSDriver.F90 +++ b/driver/UFSDriver.F90 @@ -48,6 +48,9 @@ MODULE UFSDriver #ifdef FRONT_FV3 use FRONT_FV3, only: FV3_SS => SetServices #endif +#ifdef FRONT_MPAS + use FRONT_MPAS, only: MPAS_SS => SetServices +#endif #ifdef FRONT_CDEPS_DATM use FRONT_CDEPS_DATM, only: DATM_SS => SetServices #endif @@ -367,6 +370,14 @@ subroutine SetModelServices(driver, rc) found_comp = .true. end if #endif +#ifdef FRONT_MPAS +! if (trim(model) == "mpas") then +! call NUOPC_DriverAddComp(driver, trim(prefix), MPAS_SS, & +! info=info, petList=petList, comp=comp, rc=rc) +! if (ChkErr(rc,__LINE__,u_FILE_u)) return +! found_comp = .true. +! end if +#endif #if defined FRONT_CDEPS_DATM if (trim(model) == "datm" ) then !TODO: Remove bail code and pass info and SetVM to DriverAddComp diff --git a/tests/default_vars.sh b/tests/default_vars.sh index 9a8eb118ed..bf6d31588c 100644 --- a/tests/default_vars.sh +++ b/tests/default_vars.sh @@ -499,6 +499,7 @@ export POSTXCONFIG=postxconfig-NT-gfs.txt export POSTXCONFIG_FH00=postxconfig-NT-gfs_FH00.txt export FV3=true +export MPAS=true export S2S=false export HAFS=false export AQM=false @@ -1221,6 +1222,7 @@ export_cmeps() { export_cpl () { export FV3=true +export MPAS=false export S2S=true export HAFS=false export AQM=false @@ -1414,6 +1416,7 @@ export_35d_run () export_datm_cdeps () { export FV3=false + export MPAS=false export S2S=false export HAFS=false export AQM=false @@ -1492,6 +1495,7 @@ export_datm_cdeps () export_hafs_datm_cdeps () { export FV3=false + export MPAS=false export S2S=false export HAFS=true export AQM=false @@ -1512,6 +1516,7 @@ export_hafs_datm_cdeps () export_hafs_docn_cdeps () { export FV3=true + export MPAS=false export S2S=false export HAFS=true export AQM=false @@ -1532,6 +1537,7 @@ export_hafs_docn_cdeps () export_hafs_regional () { export FV3=true + export MPAS=false export S2S=false export HAFS=true export AQM=false @@ -1606,6 +1612,7 @@ export_hafs () { export_fv3_v16 export FV3=true +export MPAS=false export S2S=false export HAFS=true export AQM=false diff --git a/tests/rt.conf b/tests/rt.conf index 407dcde958..c545d0c84c 100644 --- a/tests/rt.conf +++ b/tests/rt.conf @@ -433,3 +433,6 @@ RUN | datm_cdeps_control_cfsr | + hera hercules ### ATM-FBH test ### COMPILE | atm_fbh | intel | -DAPP=ATMF -DCCPP_SUITES=FV3_HRRR -D32BIT=ON | - wcoss2 noaacloud acorn | fv3 | RUN | cpld_regional_atm_fbh | - wcoss2 noaacloud acorn | baseline | + +### UFS with MPAS dynamical core ### +COMPILE | atm_mpas_dyn32 | intel | -DAPP=ATMMPAS -DCCPP_SUITES=FV3_GFS_v16,FV3_GFS_v17_p8_ugwpv1 -D32BIT=ON | | mpas |