Skip to content

Commit

Permalink
Merge branch 'master' into stages-2024
Browse files Browse the repository at this point in the history
  • Loading branch information
jjokella committed Oct 30, 2024
2 parents fc9c5fd + 5092918 commit 48172cd
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 11 deletions.
13 changes: 13 additions & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Stefan KOLLET
Paul RIGOR
Stefan POLL
Johannes KELLER
Daniel CAVIEDES-VOULLIEME
Joerg BENKE
Klaus GOERGEN
Carl HARTICK
Lukas STREBEL
Marco VAN HULTEN
Niklas WAGNER
Haojin ZHAO
Ilya ZHUKOV
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright 2023-2024 by the TSMP2 Team (see the CONTRIBUTORS.txt file)

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
16 changes: 8 additions & 8 deletions build_tsmp2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function help_tsmp2() {
echo " --ParFlow_SRC Set ParFlow_SRC directory"
echo " --OASIS_SRC Set OASIS3-MCT directory"
echo " --PDAF_SRC Set PDAF_SRC directory"
echo " --build_config Set build configuration: 'Debug' 'Release'"
echo " --build_type Set build configuration: 'DEBUG' 'RELEASE'"
echo " --compiler Set compiler for building"
echo " --build_dir Set build dir cmake, if not set bld/<SYSTEMNAME>_<model-id> is used. Build artifacts will be generated in this folder."
echo " --install_dir Set install dir cmake, if not set bin/<SYSTEMNAME>_<model-id> is used. Model executables and libraries will be installed here"
Expand Down Expand Up @@ -114,7 +114,7 @@ while [[ "$#" -gt 0 ]]; do
--clm35_src) clm35_src="$2"; shift ;;
--pdaf_src) pdaf_src="$2"; shift ;;
--oasis_src) oasis_src="$2"; shift ;;
--build_config) build_config="$2"; shift ;;
--build_type) build_type="$2"; shift ;;
--compiler) compiler="$2"; shift ;;
--build_dir) build_dir="$2"; shift ;;
--install_dir) install_dir="$2"; shift ;;
Expand Down Expand Up @@ -171,11 +171,11 @@ dwn_compsrc clm35 clm35_src "clm35"
## CMAKE options

message "set CMAKE options"
# build_config
if [ -z "$build_config" ];then
cmake_build_config=""
# build_type
if [ -z "$build_type" ];then
cmake_build_type=""
else
cmake_build_config=" -DCMAKE_BUILD_TYPE=${build_config}"
cmake_build_type=" -DCMAKE_BUILD_TYPE=${build_type^^}"
fi

# set compiler
Expand Down Expand Up @@ -225,11 +225,11 @@ message "TSMP2_ENV: $tsmp2_env"
message "BUILD_DIR: $cmake_build_dir"
message "INSTALL_DIR: $( echo "${cmake_install_dir}" |cut -d\= -f2)"
message "CMAKE command:"
message "cmake -S ${cmake_tsmp2_dir} -B ${cmake_build_dir} ${cmake_build_config} ${cmake_comp_str} ${cmake_compsrc_str} ${cmake_compiler} ${cmake_install_dir} |& tee ${build_log} "
message "cmake -S ${cmake_tsmp2_dir} -B ${cmake_build_dir} ${cmake_build_type} ${cmake_comp_str} ${cmake_compsrc_str} ${cmake_compiler} ${cmake_install_dir} |& tee ${build_log} "
message "== CMAKE GENERATE PROJECT start"

cmake -S ${cmake_tsmp2_dir} -B ${cmake_build_dir} \
${cmake_build_config} \
${cmake_build_type} \
${cmake_comp_str} \
${cmake_compsrc_str} \
${cmake_compiler} ${cmake_install_dir} \
Expand Down
20 changes: 18 additions & 2 deletions cmake/BuildPDAF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel"
endif()

list(APPEND PDAF_OPTIM "-xHost")
list(APPEND PDAF_OPTIM "-r8")

elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")

Expand All @@ -107,7 +106,6 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
message(FATAL_ERROR "Unsupported CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
endif()

list(APPEND PDAF_OPTIM "-fdefault-real-8")
list(APPEND PDAF_OPTIM "-falign-commons")
list(APPEND PDAF_OPTIM "-fno-automatic")
list(APPEND PDAF_OPTIM "-finit-local-zero")
Expand All @@ -120,6 +118,23 @@ endif()
# Join list
list(JOIN PDAF_OPTIM " " PDAF_OPTIM)

# Set PDAF_DOUBLEPRECISION for Makefile header
# --------------------------------------------
if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")

list(APPEND PDAF_DOUBLEPRECISION "-r8")

elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")

list(APPEND PDAF_DOUBLEPRECISION "-fdefault-real-8")

else()
message(FATAL_ERROR "Unsupported CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}")
endif()

# Join list
list(JOIN PDAF_DOUBLEPRECISION " " PDAF_DOUBLEPRECISION)

# Set PDAF_MPI_INC for Makefile header
# ----------------------------------
list(APPEND PDAF_MPI_INC "-I${MPICH_Fortran_INCLUDEDIR}")
Expand All @@ -145,6 +160,7 @@ list(APPEND PDAF_ENV_VARS PDAF_ARCH=${PDAF_ARCH})
list(APPEND PDAF_ENV_VARS PDAF_DIR=${PDAF_DIR})
list(APPEND PDAF_ENV_VARS TSMPPDAFLINK_LIBS=${PDAF_LINK_LIBS})
list(APPEND PDAF_ENV_VARS TSMPPDAFOPTIM=${PDAF_OPTIM})
list(APPEND PDAF_ENV_VARS TSMPPDAFDOUBLEPRECISION=${PDAF_DOUBLEPRECISION})
list(APPEND PDAF_ENV_VARS TSMPPDAFMPI_INC=${PDAF_MPI_INC})
list(APPEND PDAF_ENV_VARS TSMPPDAFCPP_DEFS=${PDAF_CPP_DEFS})

Expand Down

0 comments on commit 48172cd

Please sign in to comment.