[cig-commits] [commit] master: preparing Makefile for parallel netcdf (148075d)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Fri Oct 17 05:28:52 PDT 2014


Repository : https://github.com/geodynamics/axisem

On branch  : master
Link       : https://github.com/geodynamics/axisem/compare/607f803cf074063627513d235f9ed0837fc1dd44...b6457db24acdde4a4e1c08935ae1b22adf87f5bf

>---------------------------------------------------------------

commit 148075dfced48bb9f38896a3b2e234194dcd5427
Author: martinvandriel <martin at vandriel.de>
Date:   Tue Oct 14 15:17:15 2014 +0200

    preparing Makefile for parallel netcdf


>---------------------------------------------------------------

148075dfced48bb9f38896a3b2e234194dcd5427
 SOLVER/Makefile.TEMPLATE    | 18 ++++++++++++++----
 make_axisem.macros.TEMPLATE |  1 +
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/SOLVER/Makefile.TEMPLATE b/SOLVER/Makefile.TEMPLATE
index 9951881..123d519 100644
--- a/SOLVER/Makefile.TEMPLATE
+++ b/SOLVER/Makefile.TEMPLATE
@@ -28,7 +28,12 @@ OBJS =	background_models.o commpi.o commun.o get_model.o \
 	wavefields_io.o ftz.o pthread.o
 
 ifeq ($(strip $(USE_NETCDF)),true)
-   FFLAGS += -Dunc
+   ifeq ($(strip $(USE_PAR_NETCDF)),true)
+   	   FFLAGS += -Dupnc
+   else
+   	   FFLAGS += -Dunc
+   endif
+
    ifdef NETCDF_PATH
        LIBS = -L $(strip $(NETCDF_PATH))/lib -lnetcdff -Wl,-rpath,$(strip $(NETCDF_PATH))/lib
        INCLUDE = -I $(strip $(NETCDF_PATH))/include
@@ -42,8 +47,8 @@ else
 endif
 
 ifeq ($(strip $(SERIAL)),true)
-    FFLAGS += -Dserial
-    LDFLAGS += -pthread
+   FFLAGS += -Dserial
+   LDFLAGS += -pthread
 endif
 
 
@@ -57,7 +62,12 @@ FFLAGS += -Dsolver
 all: $(PROG) utils 
 
 $(PROG): $(OBJS)
-	$(FC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
+    ifeq ($(strip $(SERIAL)),true)
+        ifeq ($(strip $(USE_PAR_NETCDF)),true)
+   	    	$(error SERIAL and USE_PAR_NETCDF cannot be true at the same time)
+        endif
+    endif
+    $(FC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
 
 clean:
 	rm -f $(PROG) $(OBJS) *.M *.mod *.d *.il core 
diff --git a/make_axisem.macros.TEMPLATE b/make_axisem.macros.TEMPLATE
index f7105d2..ab3653c 100644
--- a/make_axisem.macros.TEMPLATE
+++ b/make_axisem.macros.TEMPLATE
@@ -11,6 +11,7 @@ MPIRUN  = mpirun
 
 # Enable NetCDF
 USE_NETCDF = false
+USE_PAR_NETCDF = false
 NETCDF_PATH =       # e.g. $(HOME)/local, uses /usr/include if not defined
 
 # compile without MPI (possible values: 'false', 'true')



More information about the CIG-COMMITS mailing list