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

Add CDEPS component, add CDEPS tests and fix bugs in the datm_bulk_gefs test #471

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
branch = develop
[submodule "NEMS"]
path = NEMS
url = https://github.com/NOAA-EMC/NEMS
branch = develop
url = https://github.com/binli2337/NEMS
branch = feature/new_cdeps
[submodule "FMS"]
path = FMS
url = https://github.com/NOAA-GFDL/FMS
Expand All @@ -24,8 +24,8 @@
branch = develop
[submodule "CMEPS"]
path = CMEPS-interface/CMEPS
url = https://github.com/NOAA-EMC/CMEPS.git
branch = emc/develop
url = https://github.com/DeniseWorthen/CMEPS
branch = feature/updcmeps
[submodule "MOM6"]
path = MOM6-interface/MOM6
url = https://github.com/NOAA-EMC/MOM6
Expand All @@ -34,7 +34,12 @@
path = CICE-interface/CICE
url = https://github.com/NOAA-EMC/CICE
branch = emc/develop
[submodule "CDEPS"]
path = CDEPS
url = https://github.com/binli2337/CDEPS
branch = feature/add_gefs
[submodule "DATM"]
path = DATM
url = https://github.com/NOAA-EMC/NEMSdatm
branch = develop

binli2337 marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions CDEPS
Submodule CDEPS added at 9a79e4
4 changes: 1 addition & 3 deletions CMEPS-interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ endif()
list(APPEND _nems_util_files
CMEPS/util/shr_abort_mod.F90
CMEPS/util/shr_log_mod.F90
CMEPS/util/shr_pio_mod.F90
CMEPS/util/shr_sys_mod.F90
CMEPS/util/shr_flux_mod.F90
CMEPS/util/shr_mpi_mod.F90
Expand Down Expand Up @@ -66,8 +65,7 @@ list(APPEND _mediator_files
CMEPS/mediator/med_phases_post_wav_mod.F90)

list(APPEND _mediator_defs ESMF_VERSION_MAJOR=${ESMF_VERSION_MAJOR}
ESMF_VERSION_MINOR=${ESMF_VERSION_MINOR}
INTERNAL_PIO_INIT)
ESMF_VERSION_MINOR=${ESMF_VERSION_MINOR})

### Create target library and set PUBLIC interfaces on the library
add_library(cmeps STATIC ${_nems_util_files} ${_mediator_files})
Expand Down
36 changes: 31 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ set(WW3 OFF CACHE BOOL "Enable WW3")
set(S2S OFF CACHE BOOL "Enable S2S")
set(JEDI_DRIVER OFF CACHE BOOL "Enable JEDI as top level driver")
set(DATM OFF CACHE BOOL "Enable Data Atmosphere")
set(CDEPS OFF CACHE BOOL "Enable CDEPS")
set(CDPES_DATM OFF CACHE BOOL "Enable CDEPS Data Atmosphere")
binli2337 marked this conversation as resolved.
Show resolved Hide resolved

###############################################################################
### Set CMAKE_BUILD_TYPE for DEBUG mode
Expand Down Expand Up @@ -79,6 +81,8 @@ message("REPRO ............ ${REPRO}")
message("WW3 .............. ${WW3}")
message("S2S .............. ${S2S}")
message("DATM ............. ${DATM}")
message("CDEPS ............ ${CDEPS}")
binli2337 marked this conversation as resolved.
Show resolved Hide resolved
message("CDEPS_DATM ....... ${CDEPS_DATM}")
message("")

get_filename_component (C_COMPILER_NAME ${CMAKE_C_COMPILER} NAME)
Expand All @@ -105,7 +109,7 @@ if(OPENMP)
endif()
find_package(NetCDF REQUIRED C Fortran)
find_package(ESMF MODULE REQUIRED)
if(S2S)
if(S2S OR CDEPS)
binli2337 marked this conversation as resolved.
Show resolved Hide resolved
find_package(PIO REQUIRED COMPONENTS C Fortran STATIC)
endif()

Expand Down Expand Up @@ -136,6 +140,10 @@ if(S2S AND 32BIT)
message(FATAL_ERROR "S2S=ON and 32BIT=ON are incompatible, ABORT!")
endif()

if(DATM AND CDEPS_DATM)
message(FATAL_ERROR "DATM=ON and CDEPS_DATM=ON are incompatible, ABORT!")
endif()

###############################################################################
### FMS
###############################################################################
Expand Down Expand Up @@ -186,7 +194,7 @@ set_target_properties(fms PROPERTIES PUBLIC_HEADER "${fms_headers}" )
###############################################################################
### stochastic_physics
###############################################################################
if(NOT DATM)
if(NOT DATM AND NOT CDEPS_DATM)
add_subdirectory(stochastic_physics)
endif()

Expand All @@ -195,7 +203,7 @@ endif()
###############################################################################
if(DATM)
add_subdirectory(DATM)
else()
elseif(NOT CDEPS_DATM)
add_subdirectory(FV3)
endif()

Expand Down Expand Up @@ -238,6 +246,12 @@ if(S2S)
endif()

###############################################################################
### CDEPS Component
###############################################################################
if(CDEPS)
add_subdirectory(CDEPS)
endif()

### UFS Library [NEMS]
###############################################################################
list(APPEND _nems_srcs NEMS/src/module_NEMS_UTILS.F90
Expand Down Expand Up @@ -271,10 +285,11 @@ add_dependencies(ufs fms)
if(DATM)
list(APPEND _ufs_defs_private FRONT_DATM=datm)
add_dependencies(ufs datatm)
else()
elseif(NOT CDEPS_DATM)
list(APPEND _ufs_defs_private FRONT_FV3=fv3gfs_cap_mod)
add_dependencies(ufs fv3atm)
endif()

if(JEDI_DRIVER)
list(APPEND _ufs_defs_private JEDI_DRIVER=ON)
endif()
Expand All @@ -295,6 +310,12 @@ target_link_libraries(ufs PUBLIC esmf)

if(DATM)
target_link_libraries(ufs PUBLIC datatm)
elseif(CDEPS_DATM)
list(APPEND _ufs_defs_private CDEPS
FRONT_CDEPS_DATM=atm_comp_nuopc)
add_dependencies(ufs datm)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/CDEPS/datm)
binli2337 marked this conversation as resolved.
Show resolved Hide resolved
target_link_libraries(ufs PUBLIC datm)
else()
target_link_libraries(ufs PUBLIC fv3atm)
endif()
Expand All @@ -310,6 +331,11 @@ if(S2S)
cmeps)
endif()

if(CDEPS)
add_dependencies(ufs streams dshr cdeps_share FoX_dom)
target_link_libraries(ufs PUBLIC streams dshr cdeps_share FoX_dom)
endif()

target_compile_definitions(ufs PRIVATE "${_ufs_defs_private}")

###############################################################################
Expand All @@ -331,7 +357,7 @@ endif()

target_compile_definitions(ufs_model PRIVATE "${_ufs_model_defs_private}")

if(DATM)
if(DATM OR CDEPS)
target_link_libraries(ufs_model PUBLIC ufs w3nco::w3nco_d)
endif()
target_link_libraries(ufs_model PRIVATE ufs
Expand Down
2 changes: 1 addition & 1 deletion NEMS
14 changes: 11 additions & 3 deletions tests/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,22 @@ if [[ "${MAKE_OPT}" == *"WW3=Y"* ]]; then
CMAKE_FLAGS="${CMAKE_FLAGS} -DWW3=Y"
fi

if [[ "${MAKE_OPT}" == *"S2S=Y"* ]]; then
CMAKE_FLAGS="${CMAKE_FLAGS} -DS2S=Y"
if [[ "${MAKE_OPT}" == *"CDEPS=Y"* ]]; then
CMAKE_FLAGS="${CMAKE_FLAGS} -DCDEPS=Y"
fi

if [[ "${MAKE_OPT}" == *"CDEPS_DATM=Y"* ]]; then
CMAKE_FLAGS="${CMAKE_FLAGS} -DCDEPS_DATM=Y"
fi

if [[ "${MAKE_OPT}" == *"DATM=Y"* ]]; then
if [[ "${MAKE_OPT}" == *"DATM=Y"* ]] && [[ "${MAKE_OPT}" != *"CDEPS_DATM=Y"* ]]; then
CMAKE_FLAGS="${CMAKE_FLAGS} -DDATM=Y"
fi

if [[ "${MAKE_OPT}" == *"S2S=Y"* ]]; then
CMAKE_FLAGS="${CMAKE_FLAGS} -DS2S=Y"
fi

if [[ "${MAKE_OPT}" == *"S2S=Y"* ]] || [[ ${MAKE_OPT} == *"DATM=Y"* ]]; then
CMAKE_FLAGS="${CMAKE_FLAGS} -DMOM6SOLO=ON"
fi
Expand Down
Loading