Skip to content

Commit

Permalink
Added options in support for both standalone and coupled compilations…
Browse files Browse the repository at this point in the history
… (e.g. ufs-coastal) (#138)

* updated the PaHM sourcesto their latest version as of 07/19/2022

* fixed bug in CPP projection subroutines so the argument of cos is in radians

* modified the cmake files for ParMETIS to allow the use of externally built ParMETIS libraries if requested

* added the NO_PARMETIS capability to the src/CMakeLists.txt src/Driver/CMakeLists.txt files

* typo fix in the FindParMETIS.cmake file

* Add a deleted cmake def (IMPOSE_NET_FLUX)

* fix read format issue in ReadCsvBestTrackFile subroutine when reading b-deck formatted track files

* fixed CMakeLists.txt

* deleted duplicated fortran statement in parwind.F90

* PAHM: fixed CSV read issue with columns 7 and 8 in the best track files

* temp commit

* another temp commit

* Added new code in PaHM to account for missing of last closed isobar radius (RRP).
The fields are usually missing in forecast track files and occassionaly in best track files.

* added '-mcmodel medium' compiler flag to overcome the 2GB memory limit (orion/hercules)

* removed the AVX flag for orion/hercules compilations

* added options in the cmake module files for orion/hercules to consider compilations w/wo Intel's AVX

* Modified the src/CMakeLists.txt in support of standalone and coupled compilations; added the BUILD_TOOLS option to also build the pschism* and the utilities executables in coupled configurations (e.g ufs-coastal)

* modified slightly the if(BLD_STANDALONE) ... else(BLD_STANDALONE)... conditional block

* reverted changes in cmake/*

---------

Co-authored-by: Joseph Zhang <[email protected]>
  • Loading branch information
pvelissariou1 and josephzhang8 committed Jun 7, 2024
1 parent 4169e76 commit 2824209
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ define_opt(USE_AGE "Enable age tracer module" OFF)
define_opt(ICM_PH "Enable pH module in ICM" OFF)
define_opt(USE_DVD "Enable DVD module" OFF)
define_opt(BLD_STANDALONE "Standalone build mode" ON)
define_opt(BUILD_TOOLS "Build pschism and all the utilities" ON)

if(NOT DEFINED TVD_LIM)
message(WARNING "TVD_LIM must be provided, either in the cache. It must be one of SB, VL, MM or OS for Superbee, Van Leer, Minmod, or Osher. Default is VL")
Expand Down Expand Up @@ -172,17 +173,25 @@ endif()

########### Put each type of output (exe, libraries, modules) in the normal places
### This file is untested for compilers with no output module directory option
message(STATUS "\n### Assigning output directories for binaries (bin), modules (include) and libraries (lib)")
if (BLD_STANDALONE)
message(STATUS "\n### Assigning output directories for binaries (bin), modules (include) and libraries (lib)")
set ( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin
CACHE PATH "Output Directory for executables.")

set ( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib
CACHE PATH "Output Directory for all static libraries.")

set ( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib
CACHE PATH "Output Directory for all shared libraries.")
set ( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
# set ( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin
# CACHE PATH "Output Directory for executables.")

set ( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
# set ( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib
# CACHE PATH "Output Directory for all static libraries.")

set ( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
# set ( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib
# CACHE PATH "Output Directory for all shared libraries.")
else()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
endif()

if( CMAKE_Fortran_MODDIR_FLAG)
SET( CMAKE_Fortran_MODULE_DIRECTORY ${PROJECT_BINARY_DIR}/include
CACHE PATH "Output location for include files and fortran modules")
Expand Down Expand Up @@ -351,14 +360,14 @@ set_property( DIRECTORY ${moddir} APPEND PROPERTY COMPILE_DEFINITIONS ${all_defi
endforeach()

# Set the driver information for BLD_STANDALONE
if (BLD_STANDALONE)
if (BLD_STANDALONE OR BUILD_TOOLS)
message(STATUS "\n### Configuring Driver")
add_subdirectory( Driver )
set_property( DIRECTORY "Driver" APPEND PROPERTY COMPILE_DEFINITIONS ${all_define_options} ${all_use_mod_defs})
endif()

######## Utilities ########
if (BLD_STANDALONE)
if (BLD_STANDALONE OR BUILD_TOOLS)
message(STATUS "\n### Configuring Utilities")
add_subdirectory( Utility )
endif()

0 comments on commit 2824209

Please sign in to comment.