Skip to content

Commit

Permalink
Update gmake interface for noahmp and add a dev test
Browse files Browse the repository at this point in the history
  • Loading branch information
akashdhruv committed Oct 23, 2024
1 parent 959ffa9 commit 0520002
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 5 deletions.
4 changes: 4 additions & 0 deletions Exec/DevTests/NoahMP/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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})
33 changes: 33 additions & 0 deletions Exec/DevTests/NoahMP/GNUmakefile
Original file line number Diff line number Diff line change
@@ -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
20 changes: 15 additions & 5 deletions Exec/Make.ERF
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 0520002

Please sign in to comment.