Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
[submodule "models/eCLM"]
path = models/eCLM
url = https://github.com/HPSCTerrSys/eCLM.git
branch = beta-0.4
branch = dev-nvhpc-support
[submodule "models/oasis3-mct"]
path = models/oasis3-mct
url = https://icg4geo.icg.kfa-juelich.de/ExternalReposPublic/oasis3-mct
Expand Down
5 changes: 4 additions & 1 deletion cmake/BuildOASIS3MCT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
file(APPEND ${OASIS_MAKE_INC} "FCBASEFLAGS = ${OPTIM} -I. -ffree-line-length-none -fallow-argument-mismatch ${OpenMP_Fortran_FLAGS}\n")
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel" OR CMAKE_Fortran_COMPILER_ID STREQUAL "IntelLLVM")
file(APPEND ${OASIS_MAKE_INC} "FCBASEFLAGS = ${OPTIM} -I. -xCORE-AVX2 -assume byterecl -mt_mpi ${OpenMP_Fortran_FLAGS}\n")
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC")
# nvfortran doesn't support real(16) / quad precision; hence the __NO_16BYTE_REALS here.
file(APPEND ${OASIS_MAKE_INC} "FCBASEFLAGS = -D__NO_16BYTE_REALS ${OPTIM} -I. ${OpenMP_Fortran_FLAGS}\n")
else()
message(FATAL_ERROR "Fortran compiler '${CMAKE_Fortran_COMPILER_ID}' is not supported.")
endif()
Expand All @@ -68,7 +71,7 @@ ExternalProject_Add(OASIS3_MCT
SOURCE_DIR ${OASIS_SRC}
BUILD_IN_SOURCE FALSE
CONFIGURE_COMMAND ""
BUILD_COMMAND make -f ${OASIS_SRC}/util/make_dir/TopMakefileOasis3 static-libs -C ${OASIS_BLD_DIR}
BUILD_COMMAND make -f ${OASIS_SRC}/util/make_dir/TopMakefileOasis3 realclean static-libs -C ${OASIS_BLD_DIR}
INSTALL_COMMAND ""
)

Expand Down
44 changes: 44 additions & 0 deletions cmake/BuildPDAF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ endif()
# LAPACK is required
# For eCLM-PDAF, this setting has to be consistent with MKL/LAPACK
# loading in `eCLM/src/clm5/CMakelists.txt`
# https://cmake.org/cmake/help/latest/module/FindLAPACK.html
find_package(LAPACK REQUIRED)

# OpenMP is required
Expand Down Expand Up @@ -73,6 +74,12 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
list(APPEND PDAF_LINK_LIBS "-mkl")
list(APPEND PDAF_LINK_LIBS "${LAPACK_LIBRARIES}")
message(WARNING "LAPACK_LIBRARIES: ${LAPACK_LIBRARIES}")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC")
# MKL command
list(APPEND PDAF_LINK_LIBS "${LAPACK_LIBRARIES}")
list(APPEND PDAF_LINK_LIBS "${LAPACK_LINKER_FLAGS}")
message(STATUS "LAPACK_LIBRARIES: ${LAPACK_LIBRARIES}")
message(STATUS "LAPACK_LINKER_FLAGS: ${LAPACK_LINKER_FLAGS}")
else()
message(FATAL_ERROR "Unsupported CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}")
endif()
Expand Down Expand Up @@ -147,6 +154,22 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
list(APPEND PDAF_FOPT "-fallow-argument-mismatch")
list(APPEND PDAF_FOPT "-fcommon")

elseif (CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC")

# Using NVHPC
if (CMAKE_BUILD_TYPE STREQUAL "RELEASE")
# Release optimization flags
list(APPEND PDAF_FOPT "-Ofast")
elseif (CMAKE_BUILD_TYPE STREQUAL "DEBUG")
# Debug optimization flags
list(APPEND PDAF_FOPT "-O0")
list(APPEND PDAF_FOPT "-g")
else()
message(FATAL_ERROR "Unsupported CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
endif()

list(APPEND PDAF_FOPT "-fPIC")

else()
message(FATAL_ERROR "Unsupported CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}")
endif()
Expand Down Expand Up @@ -195,6 +218,22 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
list(APPEND PDAF_COPT "-mcmodel=large")
list(APPEND PDAF_COPT "-fcommon")

elseif (CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC")

# Using NVHPC
if (CMAKE_BUILD_TYPE STREQUAL "RELEASE")
# Release optimization flags
list(APPEND PDAF_COPT "-Ofast")
elseif (CMAKE_BUILD_TYPE STREQUAL "DEBUG")
# Debug optimization flags
list(APPEND PDAF_COPT "-O0")
list(APPEND PDAF_COPT "-g")
else()
message(FATAL_ERROR "Unsupported CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
endif()

list(APPEND PDAF_COPT "-fPIC")

else()
message(FATAL_ERROR "Unsupported CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}")
endif()
Expand All @@ -213,6 +252,11 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")

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

elseif (CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC")

# doubleprecision flag!?
list(APPEND PDAF_DOUBLEPRECISION "-r8")

else()
message(FATAL_ERROR "Unsupported CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}")
endif()
Expand Down
8 changes: 6 additions & 2 deletions cmake/BuildParFlow.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ else()
else()
set(PF_ACC_BACKEND "none")
endif()
#TODO: Add support for 'kokkos' backend
endif()

# Set compiler flags
Expand All @@ -48,7 +47,12 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
endif()
set(PF_FFLAGS "-ffree-line-length-none -ffixed-line-length-none")
elseif(CMAKE_C_COMPILER_ID STREQUAL "Intel" OR CMAKE_C_COMPILER_ID STREQUAL "IntelLLVM")
set(PF_CFLAGS "-Wall -Werror -Wno-unused-function -Wno-unused-variable")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks to me like this line was not supposed to be deleted.

elseif(CMAKE_C_COMPILER_ID STREQUAL "NVHPC")
if (NOT ${ParFlowGPU})
# TODO: Perhaps there's a case for using NVHPC to target CPU. This would require
# fiddling with libraries+environment so we don't support it for now.
message(FATAL_ERROR "NVHPC is only valid for ParflowGPU builds.")
endif()
else()
message(FATAL_ERROR "C compiler '${CMAKE_C_COMPILER_ID}' is not supported.")
endif()
Expand Down
2 changes: 2 additions & 0 deletions env/jsc.2025.intel.psmpi
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ else
module load Intel
fi
module load ParaStationMPI
module load ScaLAPACK/2.2.0-fb


# Basic scripting and build tools
module load Python
Expand Down
65 changes: 65 additions & 0 deletions env/jsc.2025.nvhpc.openmpi
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# --------------------------------------------------------------------------
# Loads IntelLLVM+ParaStationMPI build environment for TSMP2.
# This environment is tailored for JURECA [1] and JUWELS [2] supercomputers.
#
# [1] https://apps.fz-juelich.de/jsc/software/jureca/index.xhtml
# [2] https://apps.fz-juelich.de/jsc/software/juwels/index.xhtml
#
# Usage: source jsc.2025.intel.psmpi
# --------------------------------------------------------------------------

# Load Stages/2025
module --force purge
module use $OTHERSTAGES
module load Stages/2025
module load NVHPC/25.5-CUDA-12
module load OpenMPI
module load ScaLAPACK/2.2.0-fb

# Basic scripting and build tools
module load Python
module load CMake
module load git

# Storage libraries
module load HDF5
module load netCDF
module load netCDF-Fortran
module load PnetCDF

# ParFlow additional libraries
module load CUDA
module load UCX-settings/RC-CUDA
module load Hypre/2.31.0

# TODO: Verify these values
if [[ $SYSTEMNAME == "jedi" || $SYSTEMNAME == "jupiter" ]]; then
export CUDAARCHS="90"
else
export CUDAARCHS="80"
fi
export CMAKE_CUDA_RUNTIME_LIBRARY="Shared"


# ICON additional libraries
module load ecCodes

# Set default MPI compilers
export OMPI_CC=nvc
export OMPI_CXX=nvc++
export OMPI_FC=nvfortran
export CC=mpicc
export FC=mpif90
export CXX=mpicxx
export MPI_HOME=$EBROOTOPENMPI

# Display compiler settings
module list
echo "=========================== COMPILER SETTINGS ======================="
echo " Machine: ${SYSTEMNAME} on Stages/$STAGE"
echo " MPI lib: $(mpirun --version | head -n 1)"
echo " C: $($CC --version | head -n 2 | tail -n 1)"
echo " C++: $($CXX --version | head -n 2 | tail -n 1)"
echo " Fortran: $($FC --version | head -n 2 | tail -n 1)"
echo "======================================================================"

61 changes: 61 additions & 0 deletions env/jsc.2025.nvhpc.psmpi
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# --------------------------------------------------------------------------
# Loads IntelLLVM+ParaStationMPI build environment for TSMP2.
# This environment is tailored for JURECA [1] and JUWELS [2] supercomputers.
#
# [1] https://apps.fz-juelich.de/jsc/software/jureca/index.xhtml
# [2] https://apps.fz-juelich.de/jsc/software/juwels/index.xhtml
#
# Usage: source jsc.2025.intel.psmpi
# --------------------------------------------------------------------------

# Load Stages/2025
module --force purge
module use $OTHERSTAGES
module load Stages/2025
module load NVHPC/25.5-CUDA-12
module load ParaStationMPI
module load ScaLAPACK/2.2.0-fb

# Basic scripting and build tools
module load Python
module load CMake
module load git

# Storage libraries
module load HDF5
module load netCDF
module load netCDF-Fortran
module load PnetCDF

# ParFlow additional libraries (TODO)
module load CUDA
module load UCX-settings/RC-CUDA
module load Hypre/2.31.0

# TODO: Verify these values
if [[ $SYSTEMNAME == "jedi" || $SYSTEMNAME == "jupiter" ]]; then
export CUDAARCHS="90"
else
export CUDAARCHS="80"
fi
export CMAKE_CUDA_RUNTIME_LIBRARY="Shared"

# ICON additional libraries
module load ecCodes

# Set default MPI compilers
export CC=mpicc
export FC=mpif90
export CXX=mpicxx
export MPI_HOME=$EBROOTPSMPI

# Display compiler settings
module list
echo "========================= COMPILER SETTINGS =========================="
echo " Machine: ${SYSTEMNAME} on Stages/$STAGE"
echo " MPI lib: $(mpichversion | head -n 1 | tr -d =)"
echo " C: $($CC --version 2>/dev/null | head -n 2 | tail -n 1)"
echo " C++: $($CXX --version 2>/dev/null | head -n 2 | tail -n 1)"
echo " Fortran: $($FC --version 2>/dev/null | head -n 2 | tail -n 1)"
echo "======================================================================"
echo ""
2 changes: 1 addition & 1 deletion models/eCLM
Submodule eCLM updated 42 files
+74 −10 .github/workflows/build_and_run_eCLM.yml
+31 −16 .github/workflows/docs.yml
+33 −0 .github/workflows/style-check.yml
+10 −0 CONTRIBUTORS.txt
+4 −4 LICENSE
+1 −1 README.md
+9 −1 cmake/SetBuildOptions.cmake
+2 −2 docs/INDEX.md
+3 −3 docs/Makefile
+1 −1 docs/_config.yml
+52 −54 docs/_toc.yml
+2 −2 docs/requirements.txt
+0 −3 docs/users_guide/building_eCLM/JSC/README.md
+0 −11 docs/users_guide/building_eCLM/JSC/prerequisites_JSC_users.md
+0 −154 docs/users_guide/building_eCLM/JSC/setting_up_eCLM.md
+0 −5 docs/users_guide/building_eCLM/Levante.md
+0 −61 docs/users_guide/building_eCLM/README.md
+0 −36 docs/users_guide/building_eCLM/Ubuntu.md
+13 −0 docs/users_guide/installation/README.md
+37 −0 docs/users_guide/installation/source_installation.md
+0 −0 docs/users_guide/introduction/introduction.md
+326 −0 docs/users_guide/introduction/perturbation.md
+205 −0 docs/users_guide/introduction/soil_hydraulic_parameters.md
+0 −5 docs/users_guide/introduction_to_eCLM/README.md
+0 −16 docs/users_guide/introduction_to_eCLM/how_to_use_this_document.md
+0 −19 docs/users_guide/introduction_to_eCLM/prerequisites.md
+0 −0 docs/users_guide/running_cases/case_customization.md
+0 −7 docs/users_guide/running_eCLM/README.md
+0 −32 docs/users_guide/running_eCLM/basic_commands.md
+1 −1 src/clm5/CMakeLists.txt
+10 −0 src/clm5/biogeophys/SoilHydrologyType.F90
+141 −5 src/clm5/biogeophys/SoilStateInitTimeConstMod.F90
+94 −0 src/clm5/biogeophys/WaterStateType.F90
+12 −0 src/clm5/main/atm2lndType.F90
+3 −0 src/clm5/main/clm_driver.F90
+8 −0 src/clm5/main/clm_varcon.F90
+198 −0 src/clm5/main/lnd2atmMod.F90
+40 −0 src/csm_share/streams/shr_dmodel_mod.F90
+71 −1 src/csm_share/streams/shr_strdata_mod.F90
+210 −1 src/csm_share/streams/shr_stream_mod.F90
+68 −0 src/datm/datm_comp_mod.F90
+1 −1 src/eclm/cime_comp_mod.F90