diff --git a/Exec/DevTests/NoahMP/CMakeLists.txt b/Exec/DevTests/NoahMP/CMakeLists.txt new file mode 100644 index 000000000..995474bb5 --- /dev/null +++ b/Exec/DevTests/NoahMP/CMakeLists.txt @@ -0,0 +1,4 @@ +set(erf_exe_name erf_noahmp) +add_executable(${erf_exe_name} "") +include(${CMAKE_SOURCE_DIR}/CMake/BuildERFExe.cmake) +build_erf_exe(${erf_exe_name}) diff --git a/Exec/DevTests/NoahMP/GNUmakefile b/Exec/DevTests/NoahMP/GNUmakefile new file mode 100644 index 000000000..04aafbb6d --- /dev/null +++ b/Exec/DevTests/NoahMP/GNUmakefile @@ -0,0 +1,33 @@ +# AMReX +COMP = gnu +PRECISION = DOUBLE + +# Profiling +PROFILE = FALSE +TINY_PROFILE = FALSE +COMM_PROFILE = FALSE +TRACE_PROFILE = FALSE +MEM_PROFILE = FALSE +USE_GPROF = FALSE + +# Performance +USE_MPI = TRUE +USE_OMP = FALSE + +USE_CUDA = FALSE +USE_HIP = FALSE +USE_SYCL = FALSE + +# Debugging +DEBUG = FALSE + +# Land model +USE_NETCDF = TRUE +USE_NOAH = TRUE + +# GNU Make +Bpack := ./Make.package +Blocs := . +ERF_HOME := ../../.. +ERF_PROBLEM_DIR = $(ERF_HOME)/Exec/ABL +include $(ERF_HOME)/Exec/Make.ERF diff --git a/Exec/Make.ERF b/Exec/Make.ERF index feff3af79..7aca7d619 100644 --- a/Exec/Make.ERF +++ b/Exec/Make.ERF @@ -207,11 +207,21 @@ VPATH_LOCATIONS += $(ERF_LSM_SLM_DIR) INCLUDE_LOCATIONS += $(ERF_LSM_SLM_DIR) # If using NOAH-MP model, then compile relevant source and headers -ifeq ($(ERF_USE_NOAH), TRUE) - ERF_LSM_NOAH_DIR = $(ERF_SOURCE_DIR)/LandSurfaceModel/NOAH - include $(ERF_LSM_NOAH_DIR)/Make.package - VPATH_LOCATIONS += $(ERF_LSM_NOAH_DIR) - INCLUDE_LOCATIONS += $(ERF_LSM_NOAH_DIR) +ifeq ($(USE_NOAH), TRUE) + ifneq ($(USE_NETCDF), TRUE) + $(error USE_NETCDF must be true for using NOAH-MP interface) + else + DEFINES += -DERF_USE_NOAH + includes += $(shell pkg-config --cflags netcdf-fortran) + LIBRARIES += $(shell pkg-config --libs netcdf-fortran) + NOAH_HOME ?= $(ERF_HOME)/Submodules/NOAH-MP + VPATH_LOCATIONS += $(NOAH_HOME)/drivers/hrldas + INCLUDE_LOCATIONS += $(NOAH_HOME)/drivers/hrldas + ERF_LSM_NOAH_DIR = $(ERF_SOURCE_DIR)/LandSurfaceModel/NOAH + include $(ERF_LSM_NOAH_DIR)/Make.package + VPATH_LOCATIONS += $(ERF_LSM_NOAH_DIR) + INCLUDE_LOCATIONS += $(ERF_LSM_NOAH_DIR) + endif endif