Skip to content

Commit

Permalink
CMAKE for WW3 (#1089)
Browse files Browse the repository at this point in the history
* Use WW3 CMake build

Co-authored-by: kgerheiser <kgerheiser@icloud.com>
  • Loading branch information
JessicaMeixner-NOAA and kgerheiser authored Mar 16, 2022
1 parent 10a616d commit e028578
Show file tree
Hide file tree
Showing 20 changed files with 3,045 additions and 3,240 deletions.
29 changes: 5 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,27 +155,10 @@ endif()
### Wave components [WW3]
###############################################################################
if(WW3)
if(CMAKE_Platform)
if(${CMAKE_Platform} MATCHES "linux*" OR ${CMAKE_Platform} MATCHES "macosx*")
if (CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
set(WW3_COMP "gnu")
elseif (CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
set(WW3_COMP "intel")
endif()
else()
set(WW3_COMP ${CMAKE_Platform})
endif()
endif()
message("Build WW3:")
message(" run: ${CMAKE_BUILD_TOOL} WW3_PARCOMPN=4 WW3_COMP=${WW3_COMP} ww3_nemslibonly")
message(" in: ${CMAKE_CURRENT_SOURCE_DIR}/WW3/model/esmf")
message("")

add_custom_target(ww3_nems
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/WW3/model/esmf
COMMAND ${CMAKE_BUILD_TOOL} WW3_PARCOMPN=4 WW3_COMP=${WW3_COMP} ww3_nemslibonly > ${CMAKE_CURRENT_BINARY_DIR}/ww3_make.log 2>&1)

set(WW3_LIBS ${CMAKE_CURRENT_SOURCE_DIR}/WW3/model/obj/libww3_multi_esmf.a)
# Set options for WW3 build
set(SWITCH "multi_esmf" CACHE STRING "Default to switch_multi_esmf")
set(MULTI_ESMF ON CACHE BOOL "Enable ESMF for WW3")
add_subdirectory(WW3)
endif()

###############################################################################
Expand Down Expand Up @@ -227,10 +210,8 @@ if(UFS_GOCART)
endif()

if(WW3)
add_dependencies(ufs ww3_nems)
list(APPEND _ufs_defs_private FRONT_WW3=WMESMFMD)
target_include_directories(ufs PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/WW3/model/mod)
list(APPEND _ufs_libs_public ${WW3_LIBS})
target_link_libraries(ufs PUBLIC WW3::WW3)
endif()

list(APPEND _ufs_libs_public esmf)
Expand Down
2 changes: 1 addition & 1 deletion WW3
Submodule WW3 updated 168 files
2 changes: 1 addition & 1 deletion modulefiles/ufs_cheyenne.gnu
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ proc ModulesHelp {} {

module-whatis "loads UFS Model prerequisites for Cheyenne/GNU"

module load cmake/3.18.2
module load cmake/3.22.0
module load python/3.7.9

# load programming environment
Expand Down
2 changes: 1 addition & 1 deletion modulefiles/ufs_cheyenne.gnu_debug
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ proc ModulesHelp {} {

module-whatis "loads UFS Model prerequisites for Cheyenne/GNU"

module load cmake/3.18.2
module load cmake/3.22.0
module load python/3.7.9

# load programming environment
Expand Down
2 changes: 1 addition & 1 deletion modulefiles/ufs_cheyenne.intel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ proc ModulesHelp {} {

module-whatis "loads UFS Model prerequisites for Cheyenne/Intel"

module load cmake/3.18.2
module load cmake/3.22.0
module load python/3.7.9

# load programming environment
Expand Down
2 changes: 1 addition & 1 deletion modulefiles/ufs_cheyenne.intel_debug
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ proc ModulesHelp {} {

module-whatis "loads UFS Model prerequisites for Cheyenne/Intel"

module load cmake/3.18.2
module load cmake/3.22.0
module load python/3.7.9

# load programming environment
Expand Down
2 changes: 1 addition & 1 deletion modulefiles/ufs_orion.intel
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module-whatis "loads UFS Model prerequisites for Orion/Intel"

module load contrib noaatools

module load cmake/3.18.1
module load cmake/3.22.1
module load python/3.7.5

module use /apps/contrib/NCEP/libs/hpc-stack/modulefiles/stack
Expand Down
2 changes: 1 addition & 1 deletion modulefiles/ufs_orion.intel_debug
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module-whatis "loads UFS Model prerequisites for Orion/Intel"

module load contrib noaatools

module load cmake/3.18.1
module load cmake/3.22.1
module load python/3.7.5

module use /apps/contrib/NCEP/libs/hpc-stack/modulefiles/stack
Expand Down
Loading

0 comments on commit e028578

Please sign in to comment.