Skip to content

Commit c0490d5

Browse files
authored
CI: Add PDAF builds (#82)
Adding CI builds for - eCLM-ParFlow-PDAF - CLM3.5-ParFlow-PDAF Changes in TSMP2 - BuildParflow: Add `-Wno-unused-variable` for PDAF-related builds - BuildPDAFMODEL: More sophisticated library loading for SLURM and HYPRE Update of PDAF - mainly switching of CLM-standalone code in interface for coupled build ### More information on ParFlow-Compiler option `-Wno-unused-variable` for PDAF-builds Error ``` parflow_pdaf/pfsimulator/parflow_lib/solver_richards.c:1817:16: error: unused variable ‘pfl_start’ [-Werror=unused-variable] ``` Background: In `PseudoAdvanceRichards`, there are many unused variables, which make sense for diffing with `AdvanceRichards`.
1 parent ddfa6aa commit c0490d5

4 files changed

Lines changed: 40 additions & 16 deletions

File tree

.github/workflows/CI.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,25 +36,25 @@ jobs:
3636
# - {
3737
# name: "CLM3.5-PDAF",
3838
# use_oasis: "False",
39-
# model_opts: "CLM35 PDAF"
39+
# model_opts: "CLM3.5 PDAF"
4040
# }
4141
- {
4242
name: "eCLM-PDAF",
4343
use_oasis: "False",
4444
model_opts: "eCLM PDAF"
4545
}
46-
# - {
47-
# name: "CLM3.5-ParFlow-PDAF",
48-
# use_oasis: "True",
49-
# parflow_dir: "parflow_pdaf",
50-
# model_opts: "CLM35 ParFlow PDAF"
51-
# }
52-
# - {
53-
# name: "eCLM-ParFlow-PDAF",
54-
# use_oasis: "True",
55-
# parflow_dir: "parflow_pdaf",
56-
# model_opts: "eCLM ParFlow PDAF"
57-
# }
46+
- {
47+
name: "CLM3.5-ParFlow-PDAF",
48+
use_oasis: "True",
49+
parflow_dir: "parflow_pdaf",
50+
model_opts: "CLM3.5 ParFlow PDAF"
51+
}
52+
- {
53+
name: "eCLM-ParFlow-PDAF",
54+
use_oasis: "True",
55+
parflow_dir: "parflow_pdaf",
56+
model_opts: "eCLM ParFlow PDAF"
57+
}
5858
env:
5959
SYSTEMNAME: UBUNTU
6060
STAGE: 24.04

cmake/BuildPDAFMODEL.cmake

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,27 @@ if(DEFINED PARFLOW_SRC)
100100
list(APPEND PDAF_LIBS "-L${CMAKE_INSTALL_PREFIX}/lib -lpfsimulator -lamps -lpfkinsol -lgfortran -lcjson")
101101
# GPU
102102
# list(APPEND PDAF_LIBS "-L${CMAKE_INSTALL_PREFIX}/rmm/lib -lstdc++ -lcudart -lrmm -lnvToolsExt")
103-
list(APPEND PDAF_LIBS "-L${HYPRE_ROOT}/lib -lHYPRE")
104-
list(APPEND PDAF_LIBS "-L/lib64 -lslurm -lstdc++")
103+
104+
# HYPRE lib
105+
find_library(HYPRE_LIB NAMES HYPRE
106+
HINTS
107+
${HYPRE_ROOT}/lib
108+
$ENV{HYPRE_ROOT}/lib
109+
$ENV{EBROOTHYPRE}/lib
110+
)
111+
if(HYPRE_LIB)
112+
list(APPEND PDAF_LIBS "${HYPRE_LIB}")
113+
else()
114+
message(WARNING "BuildPDAFMODEL: HYPRE library not found. Set HYPRE_ROOT or EBROOTHYPRE if needed.")
115+
endif()
116+
117+
# Unconditional loading of stdc++
118+
list(APPEND PDAF_LIBS "-lstdc++")
119+
120+
# SLURM library if enabled (typically on HPC-system)
121+
if(ENABLE_SLURM)
122+
list(APPEND PDAF_LIBS "-lslurm")
123+
endif()
105124
endif()
106125

107126
# Join list of libraries

cmake/BuildParFlow.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if(DEFINED eCLM_SRC)
66
elseif(DEFINED CLM35_SRC)
77
list(APPEND PF_CLM_FLAGS -DPARFLOW_AMPS_LAYER=oas3
88
-DOAS3_ROOT=${OASIS_ROOT}
9+
-DPARFLOW_HAVE_ECLM=OFF
910
-DPARFLOW_HAVE_CLM=OFF)
1011
else()
1112
# use ParFlow's internal CLM
@@ -41,6 +42,10 @@ endif()
4142
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
4243
# Flags were based from https://github.com/parflow/parflow/blob/c8aa8d7140db19153194728b8fa9136b95177b6d/.github/workflows/linux.yml#L486
4344
set(PF_CFLAGS "-Wall -Werror -Wno-unused-result -Wno-unused-function -Wno-stringop-overread")
45+
if(${PDAF})
46+
# parflow-pdaf fork currently ignores unused variables
47+
string(APPEND PF_CFLAGS " -Wno-unused-variable")
48+
endif()
4449
# Silence arch-specific compiler warnings
4550
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm64|aarch64")
4651
string(APPEND PF_CFLAGS " -Wno-maybe-uninitialized")

models/pdaf

Submodule pdaf updated 37 files

0 commit comments

Comments
 (0)