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

Frontend for TSMP2 #24

Merged
merged 25 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
57f1643
add model components as git submodules
s-poll Jun 18, 2024
6ace448
add component feature to CmakeLists
s-poll Jul 17, 2024
c68baa6
add modelcounter in CMakeLists
s-poll Jul 17, 2024
970304f
implementation of first version of front end
s-poll Aug 29, 2024
e730e21
Update ReadMe
s-poll Aug 29, 2024
df2259f
tip-o fix, clean-up and change to stg2022
s-poll Aug 29, 2024
1f886f0
bugfixes for setting `PDAF_SRC`
jjokella Aug 30, 2024
4b94069
use `${PDAF}` instead of `PDAF_SRC` for checking PDAF
jjokella Aug 30, 2024
fc89530
clean-up and ICON build
s-poll Sep 2, 2024
4993a6d
update readme quickstart and cmake/BuildICON.cmake
s-poll Sep 2, 2024
1dc5dbf
update ReadMe and build_tsmp2.sh (review)
s-poll Sep 2, 2024
31edba8
take the directory of build_tsmp2.sh for cmake_tsmp2_dir and remove o…
s-poll Sep 3, 2024
1950e09
rename eTSMP to TSMP2 in xxxx_MODEL_VERSIONS
s-poll Sep 3, 2024
8839b4d
add check_build_oasis function
s-poll Sep 3, 2024
2c4a3d5
fix/unify if-clause in build_tsmp2.sh
s-poll Sep 3, 2024
1ef5fff
Cloning of component submodules in build_tsmp2.sh
s-poll Sep 4, 2024
7c39c98
add branches to submodules
s-poll Sep 4, 2024
e34789b
add --init to submodule overwrite and fix ParFlow component name
s-poll Sep 5, 2024
88f5653
add CLM3.5 and COSMO5.01 as submodules
s-poll Sep 5, 2024
ffb75f2
update eCLM submodule
s-poll Sep 12, 2024
33ef15b
remove source_dir option in build_tsmp2.sh, README typ-o
s-poll Sep 12, 2024
d61a0d4
change submodule remote url of COSMO
s-poll Sep 13, 2024
89b1fc3
fix submodule overwrite prompting
s-poll Sep 25, 2024
f2c82f5
update models/pdaf submodule
s-poll Sep 25, 2024
fe704e7
include --force option when overwriting submodule
s-poll Sep 25, 2024
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
7 changes: 0 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
bin/*
bld/*
run/
eCLM/
icon2.6.4_oascoup/
oasis3-mct/
parflow/
CLM3.5/
cosmo5.01_fresh/
pdaf/
15 changes: 15 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[submodule "models/icon"]
path = models/icon
url = https://gitlab.jsc.fz-juelich.de/sdlts/tsmp_components_mirrors/icon2.6.4_oascoup
[submodule "models/parflow"]
path = models/parflow
url = https://github.com/parflow/parflow.git
[submodule "models/parflow_pdaf"]
path = models/parflow_pdaf
url = https://github.com/HPSCTerrSys/parflow
[submodule "models/pdaf"]
path = models/pdaf
url = https://github.com/HPSCTerrSys/pdaf.git
[submodule "models/eCLM"]
path = models/eCLM
url = https://github.com/HPSCTerrSys/eCLM.git
121 changes: 101 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,56 +1,137 @@
cmake_minimum_required (VERSION 3.21.1)
project(eTSMP LANGUAGES C CXX Fortran)
project(TSMP2 LANGUAGES C CXX Fortran)
include(ExternalProject)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
include(Utils)

# Prevent in-source builds
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)

# set default of components to off
option(ICON "Compile ICON within TSMP2 framework" OFF)
option(COSMO "Compile COSMO within TSMP2 framework" OFF)
option(eCLM "Compile eCLM within TSMP2 framework" OFF)
option(CLM3.5 "Compile CLM3.5 within TSMP2 framework" OFF)
option(ParFlow "Compile ParFlow within TSMP2 framework" OFF)
option(PDAF "Compile PDAF within TSMP2 framework" OFF)


if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "RELEASE" CACHE STRING "Choose the type of build." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "DEBUG" "RELEASE")
endif()

find_package(MPIFortran REQUIRED)
if(DEFINED OASIS_SRC)
include(BuildOASIS3MCT)
list(APPEND MODEL_DEPENDENCIES OASIS3_MCT)
endif()
# init CMAKE internal variables
string(TOUPPER $ENV{SYSTEMNAME} SYSTEMNAME)
set(MODELCOUNT 0)
set(MODEL_ID "")

# TODO (for all Build*.cmake scripts):
# - Check validity of compile flags
# - Implement set of compile flags depending on compiler (e.g. GNU, Intel) and
# build configuration (e.g. Debug, Release, Profiling)

if(DEFINED eCLM_SRC)
include(BuildeCLM)
list(APPEND COMPONENT_MODELS "eCLM")
endif()

if(DEFINED CLM35_SRC)
include(BuildCLM3.5)
list(APPEND COMPONENT_MODELS "CLM3.5")
endif()

if(DEFINED ICON_SRC)
# model settings
set(MODEL_ID "")
if (${ICON})
if(NOT DEFINED ICON_SRC)
set(ICON_SRC "${CMAKE_SOURCE_DIR}/models/icon")
endif()
include(BuildICON)
list(APPEND COMPONENT_MODELS "ICON")
if ("${MODEL_ID}" STREQUAL "")
set(MODEL_ID "ICON")
else()
set(MODEL_ID "${MODEL_ID}-ICON")
endif()
MATH(EXPR MODELCOUNT "${MODELCOUNT}+1")
endif()

if(DEFINED COSMO_SRC)
if (${COSMO})
if(DEFINED COSMO_SRC)
set(COSMO_SRC "${CMAKE_SOURCE_DIR}/models/cosmo5.01_fresh")
endif()
include(BuildCOSMO)
list(APPEND COMPONENT_MODELS "COSMO5.1")
set(MODEL_ID "${MODEL_ID}COSMO")
MATH(EXPR MODELCOUNT "${MODELCOUNT}+1")
endif()

if (${eCLM})
if(NOT DEFINED eCLM_SRC)
set(eCLM_SRC "${CMAKE_SOURCE_DIR}/models/eCLM")
endif()
include(BuildeCLM)
list(APPEND COMPONENT_MODELS "eCLM")
if ("${MODEL_ID}" STREQUAL "")
set(MODEL_ID "eCLM")
else()
set(MODEL_ID "${MODEL_ID}-eCLM")
endif()
MATH(EXPR MODELCOUNT "${MODELCOUNT}+1")
endif()
message("eCLMSRC: ${eCLM_SRC}")
message("MODEL_ID: ${MODEL_ID}")
message("MODELCOUNT: ${MODELCOUNT}")

if (${CLM3.5})
if(DEFINED CLM35_SRC)
set(CLM35_SRC "${CMAKE_SOURCE_DIR}/models/CLM3.5")
endif()
include(BuildCLM3.5)
list(APPEND COMPONENT_MODELS "CLM3.5")
set(MODEL_ID "${MODEL_ID}CLM3.5")
MATH(EXPR MODELCOUNT "${MODELCOUNT}+1")
endif()

if(DEFINED PARFLOW_SRC)
if (${ParFlow})
if(NOT DEFINED PARFLOW_SRC AND NOT ${PDAF})
set(PARFLOW_SRC "${CMAKE_SOURCE_DIR}/models/parflow")
elseif (NOT DEFINED PARFLOW_SRC AND ${PDAF})
set(PARFLOW_SRC "${CMAKE_SOURCE_DIR}/models/parflow_pdaf")
endif()
include(BuildParFlow)
list(APPEND COMPONENT_MODELS "ParFlow")
if ("${MODEL_ID}" STREQUAL "")
set(MODEL_ID "ParFlow")
else()
set(MODEL_ID "${MODEL_ID}-ParFlow")
endif()
MATH(EXPR MODELCOUNT "${MODELCOUNT}+1")
endif()

if(DEFINED PDAF_SRC)
if (${PDAF})
if(DEFINED PDAF_SRC)
set(CLM35_SRC "${CMAKE_SOURCE_DIR}/models/pdaf")
endif()
include(BuildPDAF)
include(BuildPDAFMODEL)
include(BuildPDAFFRAMEWORK)
list(APPEND COMPONENT_MODELS "PDAF")
if ("${MODEL_ID}" STREQUAL "")
set(MODEL_ID "PDAF")
else()
set(MODEL_ID "${MODEL_ID}-PDAF")
endif()
endif()

#message("MODEL_ID ${MODEL_ID}")

#find_package(MPIFortran REQUIRED)
if (${MODELCOUNT} GREATER 1)
if(NOT DEFINED OASIS_SRC)
set(OASIS_SRC "${CMAKE_SOURCE_DIR}/models/oasis3-mct")
endif()
include(BuildOASIS3MCT)
list(APPEND MODEL_DEPENDENCIES OASIS3_MCT)
endif()

# set paths
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set (CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/bin/${SYSTEMNAME}_${MODEL_ID}" CACHE PATH "default install path" FORCE)
endif()

print_model_versions("${COMPONENT_MODELS}" "${eTSMP_MODEL_VERSIONS}")

#message(FATAL_ERROR "at the end of script")
Loading