Commit 5bd99530 authored by Ethan Coon's avatar Ethan Coon
Browse files

tweaks to makefile system to allow building fortran and cc kernels independently

parent 1cb78687
SRCDIR = .
OBJECT = .
.PHONY: cc fortran
default: all
all:
all: cc fortran
cc:
$(MAKE) -C cc all
fortran:
$(MAKE) -C fortran all
clean:
$(MAKE) -C cc clean
$(MAKE) -C fortran clean
allclean:
$(MAKE) -C cc clean
$(MAKE) -C fortran clean
......@@ -7,9 +7,9 @@ include $(OBJECT)config/Makefile.config
# Order is important due to .mod file creation
OBJS =CanopyHydrology_Interception.cc.o \
CanopyHydrology_FracWet.cc.o \
CanopyHydrology_FracH2OSfc.cc.o
OBJS = CanopyHydrology_Interception.cc.o \
CanopyHydrology_FracWet.cc.o \
CanopyHydrology_FracH2OSfc.cc.o
all: $(OBJS)
$(AR) cr libelm.a $(OBJS)
......
# Available from: git clone https://code.ornl.gov/isp/acme_inputdata
ELM_DATA_LOCATION = /home/7hp/Downloads/acme_inputdata
ELM_DATA_LOCATION ?= /home/7hp/Downloads/acme_inputdata
# assumes you have a working NETCDF. This can easily be the version built by
# ATS as a part of an ATS installation.
NETCDF_ROOT = ${AMANZI_TPLS_DIR}
NETCDF_ROOT ?= ${AMANZI_TPLS_DIR}
# assumes you have a working fortran and c++ compilers with libraries
FC = gfortran
......
......@@ -20,7 +20,7 @@ EXEC_TESTS = CanopyHydrology_kern1_single \
default: all
all: links library $(TESTS)
all: library $(TESTS)
test: $(EXEC_TESTS)
python ../compare_to_gold.py $(TESTS)
......@@ -54,4 +54,4 @@ links:
$(MAKE) -C ../links links
library:
$(MAKE) -C $(OBJECT) all
$(MAKE) -C $(OBJECT) fortran
......@@ -93,13 +93,11 @@ program CanopyHydrology_kern1_single
stop
contains
subroutine err_handle( status )
integer :: status
print *, 'error ', status
stop
end subroutine err_handle
subroutine err_handle( status )
use netcdf
integer :: status
print *, 'error ', status, nf90_strerror(status)
stop
end subroutine err_handle
end program
......@@ -166,13 +166,11 @@ program test_CanopyHydrology_module
stop
contains
subroutine err_handle( status )
integer(i4) :: status
print *, 'error ', status
subroutine err_handle( status )
use netcdf
integer :: status
print *, 'error ', status, nf90_strerror(status)
stop
end subroutine err_handle
subroutine get_forcing_data( filename , asurfcell)
......
......@@ -18,7 +18,7 @@ EXEC_TESTS = CanopyHydrology_kern1_single \
default: all
all: links library $(TESTS)
all: library $(TESTS)
test: $(EXEC_TESTS)
python ../compare_to_gold.py $(TESTS)
......@@ -52,4 +52,4 @@ links:
$(MAKE) -C ../links links
library:
$(MAKE) -C $(OBJECT) all
$(MAKE) -C $(OBJECT) fortran
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment