<p><b>dwj07@fsu.edu</b> 2012-03-01 11:33:02 -0700 (Thu, 01 Mar 2012)</p><p><br>
        -- BRANCH COMMIT --<br>
<br>
        Actually commiting the new makefile version. The previous commit didn't actually update this file.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/ocean_projects/monotonic_advection/Makefile
===================================================================
--- branches/ocean_projects/monotonic_advection/Makefile        2012-03-01 16:03:03 UTC (rev 1562)
+++ branches/ocean_projects/monotonic_advection/Makefile        2012-03-01 18:33:02 UTC (rev 1563)
@@ -14,234 +14,185 @@
 
 
 dummy:
-        @( echo &quot;try one of:&quot;; \
-        echo &quot;   make xlf&quot;; \
-        echo &quot;   make pgi&quot;; \
-        echo &quot;   make ifort&quot;; \
-        echo &quot;   make gfortran&quot;; \
-        )
+        ( make error )
 
-xlf-serial:
+xlf:
         ( make all \
-        &quot;FC = xlf90&quot; \
-        &quot;CC = xlc&quot; \
-        &quot;SFC = xlf90&quot; \
-        &quot;SCC = xlc&quot; \
-        &quot;FFLAGS = -qrealsize=8 -g -C &quot; \
-        &quot;CFLAGS = -g&quot; \
-        &quot;LDFLAGS = -g -C&quot; \
+        &quot;FC_PARALLEL = mpxlf90&quot; \
+        &quot;CC_PARALLEL = mpcc&quot; \
+        &quot;FC_SERIAL = xlf90&quot; \
+        &quot;CC_SERIAL = xlc&quot; \
+        &quot;FFLAGS_OPT = -O3 -qrealsize=8&quot; \
+        &quot;CFLAGS_OPT = -O3&quot; \
+        &quot;LDFLAGS_OPT = -O3&quot; \
         &quot;CORE = $(CORE)&quot; \
+        &quot;DEBUG = $(DEBUG)&quot; \
+        &quot;SERIAL = $(SERIAL)&quot; \
+        &quot;USE_PAPI = $(USE_PAPI)&quot; \
         &quot;CPPFLAGS = $(MODEL_FORMULATION) $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
-
-xlf:
-        ( make all \
-        &quot;FC = mpxlf90&quot; \
-        &quot;CC = mpcc&quot; \
-        &quot;SFC = xlf90&quot; \
-        &quot;SCC = xlc&quot; \
-        &quot;FFLAGS = -O3 -qrealsize=8&quot; \
-        &quot;CFLAGS = -O3&quot; \
-        &quot;LDFLAGS = -O3&quot; \
-        &quot;CORE = $(CORE)&quot; \
-        &quot;CPPFLAGS = $(MODEL_FORMULATION) -D_MPI $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
  
 ftn:
         ( make all \
-        &quot;FC = ftn&quot; \
-        &quot;CC = cc&quot; \
-        &quot;SFC = ftn&quot; \
-        &quot;SCC = cc&quot; \
-        &quot;FFLAGS = -i4 -r8 -gopt -O2 -Mvect=nosse -Kieee -convert big_endian&quot; \
-        &quot;CFLAGS = -fast&quot; \
-        &quot;LDFLAGS = &quot; \
+        &quot;FC_PARALLEL = ftn&quot; \
+        &quot;CC_PARALLEL = cc&quot; \
+        &quot;FC_SERIAL = ftn&quot; \
+        &quot;CC_SERIAL = cc&quot; \
+        &quot;FFLAGS_OPT = -i4 -r8 -gopt -O2 -Mvect=nosse -Kieee -convert big_endian&quot; \
+        &quot;CFLAGS_OPT = -fast&quot; \
+        &quot;LDFLAGS_OPT = &quot; \
         &quot;CORE = $(CORE)&quot; \
-        &quot;CPPFLAGS = $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+        &quot;DEBUG = $(DEBUG)&quot; \
+        &quot;SERIAL = $(SERIAL)&quot; \
+        &quot;USE_PAPI = $(USE_PAPI)&quot; \
+        &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
 pgi:
         ( make all \
-        &quot;FC = mpif90&quot; \
-        &quot;CC = mpicc&quot; \
-        &quot;SFC = pgf90&quot; \
-        &quot;SCC = pgcc&quot; \
-        &quot;FFLAGS = -r8 -O3 -byteswapio -Mfree&quot; \
-        &quot;CFLAGS = -O3&quot; \
-        &quot;LDFLAGS = -O3&quot; \
+        &quot;FC_PARALLEL = mpif90&quot; \
+        &quot;CC_PARALLEL = mpicc&quot; \
+        &quot;FC_SERIAL = pgf90&quot; \
+        &quot;CC_SERIAL = pgcc&quot; \
+        &quot;FFLAGS_OPT = -r8 -O3 -byteswapio -Mfree&quot; \
+        &quot;CFLAGS_OPT = -O3&quot; \
+        &quot;LDFLAGS_OPT = -O3&quot; \
+        &quot;FFLAGS_DEBUG = -r8 -O0 -g -Mbounds -Mchkptr -byteswapio -Mfree&quot; \
+        &quot;CFLAGS_DEBUG = -O0 -g&quot; \
+        &quot;LDFLAGS_DEBUG = -O0 -g -Mbounds -Mchkptr&quot; \
         &quot;CORE = $(CORE)&quot; \
-        &quot;CPPFLAGS = $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+        &quot;DEBUG = $(DEBUG)&quot; \
+        &quot;SERIAL = $(SERIAL)&quot; \
+        &quot;USE_PAPI = $(USE_PAPI)&quot; \
+        &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
 pgi-nersc:
         ( make all \
-        &quot;FC = ftn&quot; \
-        &quot;CC = cc&quot; \
-        &quot;SFC = ftn&quot; \
-        &quot;SCC = cc&quot; \
-        &quot;FFLAGS = -r8 -O3 -byteswapio -Mfree&quot; \
-        &quot;CFLAGS = -O3&quot; \
-        &quot;LDFLAGS = -O3&quot; \
+        &quot;FC_PARALLEL = ftn&quot; \
+        &quot;CC_PARALLEL = cc&quot; \
+        &quot;FC_SERIAL = ftn&quot; \
+        &quot;CC_SERIAL = cc&quot; \
+        &quot;FFLAGS_OPT = -r8 -O3 -byteswapio -Mfree&quot; \
+        &quot;CFLAGS_OPT = -O3&quot; \
+        &quot;LDFLAGS_OPT = -O3&quot; \
         &quot;CORE = $(CORE)&quot; \
-        &quot;CPPFLAGS = $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+        &quot;DEBUG = $(DEBUG)&quot; \
+        &quot;SERIAL = $(SERIAL)&quot; \
+        &quot;USE_PAPI = $(USE_PAPI)&quot; \
+        &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
 pgi-llnl:
         ( make all \
-        &quot;FC = mpipgf90&quot; \
-        &quot;CC = pgcc&quot; \
-        &quot;SFC = pgf90&quot; \
-        &quot;SCC = pgcc&quot; \
-        &quot;FFLAGS = -i4 -r8 -g -O2 -byteswapio&quot; \
-        &quot;CFLAGS = -fast&quot; \
-        &quot;LDFLAGS = &quot; \
+        &quot;FC_PARALLEL = mpipgf90&quot; \
+        &quot;CC_PARALLEL = pgcc&quot; \
+        &quot;FC_SERIAL = pgf90&quot; \
+        &quot;CC_SERIAL = pgcc&quot; \
+        &quot;FFLAGS_OPT = -i4 -r8 -g -O2 -byteswapio&quot; \
+        &quot;CFLAGS_OPT = -fast&quot; \
+        &quot;LDFLAGS_OPT = &quot; \
         &quot;CORE = $(CORE)&quot; \
-        &quot;CPPFLAGS = $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
-
-pgi-serial:
-        ( make all \
-        &quot;FC = pgf90&quot; \
-        &quot;CC = pgcc&quot; \
-        &quot;SFC = pgf90&quot; \
-        &quot;SCC = pgcc&quot; \
-        &quot;FFLAGS = -r8 -O0 -g -Mbounds -Mchkptr -byteswapio -Mfree&quot; \
-        &quot;CFLAGS = -O0 -g&quot; \
-        &quot;LDFLAGS = -O0 -g -Mbounds -Mchkptr&quot; \
-        &quot;CORE = $(CORE)&quot; \
+        &quot;DEBUG = $(DEBUG)&quot; \
+        &quot;SERIAL = $(SERIAL)&quot; \
+        &quot;USE_PAPI = $(USE_PAPI)&quot; \
         &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
-ifort-serial:
+ifort:
         ( make all \
-        &quot;FC = ifort&quot; \
-        &quot;CC = gcc&quot; \
-        &quot;SFC = ifort&quot; \
-        &quot;SCC = gcc&quot; \
-        &quot;FFLAGS = -real-size 64 -O3 -convert big_endian -FR&quot; \
-        &quot;CFLAGS = -O3 -m64&quot; \
-        &quot;LDFLAGS = -O3&quot; \
+        &quot;FC_PARALLEL = mpif90&quot; \
+        &quot;CC_PARALLEL = gcc&quot; \
+        &quot;FC_SERIAL = ifort&quot; \
+        &quot;CC_SERIAL = gcc&quot; \
+        &quot;FFLAGS_OPT = -real-size 64 -O3 -convert big_endian -FR&quot; \
+        &quot;CFLAGS_OPT = -O3 -m64&quot; \
+        &quot;LDFLAGS_OPT = -O3&quot; \
+        &quot;FFLAGS_DEBUG = -real-size 64 -g -convert big_endian -FR -CU -CB -check all -fpe0 -traceback -debug all&quot; \
+        &quot;CFLAGS_DEBUG = -g -m64&quot; \
+        &quot;LDFLAGS_DEBUG = -g&quot; \
         &quot;CORE = $(CORE)&quot; \
+        &quot;DEBUG = $(DEBUG)&quot; \
+        &quot;SERIAL = $(SERIAL)&quot; \
+        &quot;USE_PAPI = $(USE_PAPI)&quot; \
         &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE -m64 $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
-ifort-papi:
-        ( make all \
-        &quot;FC = mpif90&quot; \
-        &quot;CC = gcc&quot; \
-        &quot;SFC = ifort&quot; \
-        &quot;SCC = gcc&quot; \
-        &quot;FFLAGS = -real-size 64 -O3 -convert big_endian -FR&quot; \
-        &quot;CFLAGS = -O3 -m64&quot; \
-        &quot;LDFLAGS = -O3&quot; \
-        &quot;CORE = $(CORE)&quot; \
-        &quot;CPPFLAGS = $(MODEL_FORMULATION) -D_PAPI -D_MPI -DUNDERSCORE -m64 $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; \
-        &quot;PAPILIBS = -L$(PAPI)/lib -lpapi&quot; )
-
-ifort-papi-serial:
-        ( make all \
-        &quot;FC = ifort&quot; \
-        &quot;CC = gcc&quot; \
-        &quot;SFC = ifort&quot; \
-        &quot;SCC = gcc&quot; \
-        &quot;FFLAGS = -real-size 64 -O3 -convert big_endian -FR&quot; \
-        &quot;CFLAGS = -O3 -m64&quot; \
-        &quot;LDFLAGS = -O3&quot; \
-        &quot;CORE = $(CORE)&quot; \
-        &quot;CPPFLAGS = $(MODEL_FORMULATION) -D_PAPI -DUNDERSCORE -m64 $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; \
-        &quot;PAPILIBS = -L$(PAPI)/lib -lpapi&quot; )
-
-ifort:
-        ( make all \
-        &quot;FC = mpif90&quot; \
-        &quot;CC = gcc&quot; \
-        &quot;SFC = ifort&quot; \
-        &quot;SCC = gcc&quot; \
-        &quot;FFLAGS = -real-size 64 -O3 -convert big_endian -FR&quot; \
-        &quot;CFLAGS = -O3 -m64&quot; \
-        &quot;LDFLAGS = -O3&quot; \
-        &quot;CORE = $(CORE)&quot; \
-        &quot;CPPFLAGS = $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE -m64 $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
-
 gfortran:
         ( make all \
-        &quot;FC = mpif90&quot; \
-        &quot;CC = mpicc&quot; \
-        &quot;SFC = gfortran&quot; \
-        &quot;SCC = gcc&quot; \
-        &quot;FFLAGS = -O3 -m64 -ffree-line-length-none -fdefault-real-8 -fconvert=big-endian -ffree-form&quot; \
-        &quot;CFLAGS = -O3 -m64&quot; \
-        &quot;LDFLAGS = -O3 -m64&quot; \
+        &quot;FC_PARALLEL = mpif90&quot; \
+        &quot;CC_PARALLEL = mpicc&quot; \
+        &quot;FC_SERIAL = gfortran&quot; \
+        &quot;CC_SERIAL = gcc&quot; \
+        &quot;FFLAGS_OPT = -O3 -m64 -ffree-line-length-none -fdefault-real-8 -fconvert=big-endian -ffree-form&quot; \
+        &quot;CFLAGS_OPT = -O3 -m64&quot; \
+        &quot;LDFLAGS_OPT = -O3 -m64&quot; \
+        &quot;FFLAGS_DEBUG = -g -m64 -ffree-line-length-none -fdefault-real-8 -fconvert=big-endian -ffree-form -fbounds-check&quot; \
+        &quot;CFLAGS_DEBUG = -g -m64&quot; \
+        &quot;LDFLAGS_DEBUG = -g -m64&quot; \
         &quot;CORE = $(CORE)&quot; \
-        &quot;CPPFLAGS = $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE -m64 $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
-
-gfortran-serial:
-        ( make all \
-        &quot;FC = gfortran&quot; \
-        &quot;CC = gcc&quot; \
-        &quot;SFC = gfortran&quot; \
-        &quot;SCC = gcc&quot; \
-        &quot;FFLAGS = -O3 -m64 -ffree-line-length-none -fdefault-real-8 -fconvert=big-endian -ffree-form&quot; \
-        &quot;CFLAGS = -O3 -m64&quot; \
-        &quot;LDFLAGS = -O3 -m64&quot; \
-        &quot;CORE = $(CORE)&quot; \
+        &quot;DEBUG = $(DEBUG)&quot; \
+        &quot;SERIAL = $(SERIAL)&quot; \
+        &quot;USE_PAPI = $(USE_PAPI)&quot; \
         &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE -m64 $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
 g95:
         ( make all \
-        &quot;FC = mpif90&quot; \
-        &quot;CC = mpicc&quot; \
-        &quot;SFC = g95&quot; \
-        &quot;SCC = gcc&quot; \
-        &quot;FFLAGS = -O3 -ffree-line-length-huge -r8 -fendian=big&quot; \
-        &quot;CFLAGS = -O3&quot; \
-        &quot;LDFLAGS = -O3&quot; \
+        &quot;FC_PARALLEL = mpif90&quot; \
+        &quot;CC_PARALLEL = mpicc&quot; \
+        &quot;FC_SERIAL = g95&quot; \
+        &quot;CC_SERIAL = gcc&quot; \
+        &quot;FFLAGS_OPT = -O3 -ffree-line-length-huge -r8 -fendian=big&quot; \
+        &quot;CFLAGS_OPT = -O3&quot; \
+        &quot;LDFLAGS_OPT = -O3&quot; \
         &quot;CORE = $(CORE)&quot; \
-        &quot;CPPFLAGS = $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
-
-g95-serial:
-        ( make all \
-        &quot;FC = g95&quot; \
-        &quot;CC = gcc&quot; \
-        &quot;SFC = g95&quot; \
-        &quot;SCC = gcc&quot; \
-        &quot;FFLAGS = -O3 -ffree-line-length-huge -r8 -fendian=big&quot; \
-        &quot;CFLAGS = -O3&quot; \
-        &quot;LDFLAGS = -O3&quot; \
-        &quot;CORE = $(CORE)&quot; \
+        &quot;DEBUG = $(DEBUG)&quot; \
+        &quot;SERIAL = $(SERIAL)&quot; \
+        &quot;USE_PAPI = $(USE_PAPI)&quot; \
         &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
 pathscale-nersc:
         ( make all \
-        &quot;FC = ftn&quot; \
-        &quot;CC = cc&quot; \
-        &quot;SFC = ftn&quot; \
-        &quot;SCC = cc&quot; \
-        &quot;FFLAGS = -r8 -O3 -freeform -extend-source&quot; \
-        &quot;CFLAGS = -O3&quot; \
-        &quot;LDFLAGS = -O3&quot; \
+        &quot;FC_PARALLEL = ftn&quot; \
+        &quot;CC_PARALLEL = cc&quot; \
+        &quot;FC_SERIAL = ftn&quot; \
+        &quot;CC_SERIAL = cc&quot; \
+        &quot;FFLAGS_OPT = -r8 -O3 -freeform -extend-source&quot; \
+        &quot;CFLAGS_OPT = -O3&quot; \
+        &quot;LDFLAGS_OPT = -O3&quot; \
         &quot;CORE = $(CORE)&quot; \
-        &quot;CPPFLAGS = $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+        &quot;DEBUG = $(DEBUG)&quot; \
+        &quot;SERIAL = $(SERIAL)&quot; \
+        &quot;USE_PAPI = $(USE_PAPI)&quot; \
+        &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
 cray-nersc:
         ( make all \
-        &quot;FC = ftn&quot; \
-        &quot;CC = cc&quot; \
-        &quot;SFC = ftn&quot; \
-        &quot;SCC = cc&quot; \
-        &quot;FFLAGS = -default64 -O3 -f free&quot; \
-        &quot;CFLAGS = -O3&quot; \
-        &quot;LDFLAGS = -O3&quot; \
+        &quot;FC_PARALLEL = ftn&quot; \
+        &quot;CC_PARALLEL = cc&quot; \
+        &quot;FC_SERIAL = ftn&quot; \
+        &quot;CC_SERIAL = cc&quot; \
+        &quot;FFLAGS_OPT = -default64 -O3 -f free&quot; \
+        &quot;CFLAGS_OPT = -O3&quot; \
+        &quot;LDFLAGS_OPT = -O3&quot; \
         &quot;CORE = $(CORE)&quot; \
-        &quot;CPPFLAGS = $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+        &quot;DEBUG = $(DEBUG)&quot; \
+        &quot;SERIAL = $(SERIAL)&quot; \
+        &quot;USE_PAPI = $(USE_PAPI)&quot; \
+        &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
 intel-nersc:
         ( make all \
-        &quot;FC = ftn&quot; \
-        &quot;CC = cc&quot; \
-        &quot;SFC = ftn&quot; \
-        &quot;SCC = cc&quot; \
-        &quot;FFLAGS = -real-size 64 -O3 -FR&quot; \
-        &quot;CFLAGS = -O3&quot; \
-        &quot;LDFLAGS = -O3&quot; \
+        &quot;FC_PARALLEL = ftn&quot; \
+        &quot;CC_PARALLEL = cc&quot; \
+        &quot;FC_SERIAL = ftn&quot; \
+        &quot;CC_SERIAL = cc&quot; \
+        &quot;FFLAGS_OPT = -real-size 64 -O3 -FR&quot; \
+        &quot;CFLAGS_OPT = -O3&quot; \
+        &quot;LDFLAGS_OPT = -O3&quot; \
         &quot;CORE = $(CORE)&quot; \
-        &quot;CPPFLAGS = $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+        &quot;DEBUG = $(DEBUG)&quot; \
+        &quot;SERIAL = $(SERIAL)&quot; \
+        &quot;USE_PAPI = $(USE_PAPI)&quot; \
+        &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
-CPPINCLUDES = -I../inc -I$(NETCDF)/include -I$(PAPI)/include
-FCINCLUDES = -I../inc -I$(NETCDF)/include -I$(PAPI)/include
-LIBS = -L$(NETCDF)/lib -lnetcdf $(PAPILIBS)
+CPPINCLUDES = -I../inc -I$(NETCDF)/include
+FCINCLUDES = -I../inc -I$(NETCDF)/include
+LIBS = -L$(NETCDF)/lib -lnetcdf
 
 RM = rm -f
 CPP = cpp -C -P -traditional
@@ -268,34 +219,109 @@
 
 ifdef CORE
 
+ifeq &quot;$(DEBUG)&quot; &quot;true&quot;
+
+ifndef FFLAGS_DEBUG
+        FFLAGS=$(FFLAGS_OPT)
+        CFLAGS=$(CFLAGS_OPT)
+        LDFLAGS=$(LDFLAGS_OPT)
+        DEBUG_MESSAGE=&quot;Debug flags are not defined for this compile group. Defaulting to Optimized flags&quot;
+else # FFLAGS_DEBUG IF
+        FFLAGS=$(FFLAGS_DEBUG)
+        CFLAGS=$(CFLAGS_DEBUG)
+        LDFLAGS=$(LDFLAGS_DEBUG)
+        DEBUG_MESSAGE=&quot;Debugging is on.&quot;
+endif # FFLAGS_DEBUG IF
+
+else # DEBUG IF
+        FFLAGS=$(FFLAGS_OPT)
+        CFLAGS=$(CFLAGS_OPT)
+        LDFLAGS=$(LDFLAGS_OPT)
+        DEBUG_MESSAGE=&quot;Debugging is off.&quot;
+endif # DEBUG IF
+
+ifeq &quot;$(SERIAL)&quot; &quot;true&quot;
+        FC=$(FC_SERIAL)
+        CC=$(CC_SERIAL)
+        SFC=$(FC_SERIAL)
+        SCC=$(CC_SERIAL)
+        SERIAL_MESSAGE=&quot;Serial version is on.&quot;
+else # SERIAL IF
+        FC=$(FC_PARALLEL)
+        CC=$(CC_PARALLEL)
+        SFC=$(FC_SERIAL)
+        SCC=$(CC_SERIAL)
+        override CPPFLAGS += -D_MPI
+        SERIAL_MESSAGE=&quot;Parallel version is on.&quot;
+endif # SERIAL IF
+
+ifeq &quot;$(USE_PAPI)&quot; &quot;true&quot;
+        CPPINCLUDES += -I$(PAPI)/include -D_PAPI
+        FCINCLUDES += -I$(PAPI)/include
+        LIBS += -L$(PAPI)/lib -lpapi
+        PAPI_MESSAGE=&quot;Papi libraries are on.&quot;
+else # USE_PAPI IF
+        PAPI_MESSAGE=&quot;Papi libraries are off.&quot;
+endif # USE_PAPI IF
+
 all: mpas_main
 
 mpas_main: 
         cd src; make FC=&quot;$(FC)&quot; \
-                     CC=&quot;$(CC)&quot; \
-                     CFLAGS=&quot;$(CFLAGS)&quot; \
-                     FFLAGS=&quot;$(FFLAGS)&quot; \
-                     LDFLAGS=&quot;$(LDFLAGS)&quot; \
-                     RM=&quot;$(RM)&quot; \
-                     CPP=&quot;$(CPP)&quot; \
-                     CPPFLAGS=&quot;$(CPPFLAGS)&quot; \
-                     LIBS=&quot;$(LIBS)&quot; \
-                     CPPINCLUDES=&quot;$(CPPINCLUDES)&quot; \
-                     FCINCLUDES=&quot;$(FCINCLUDES)&quot; \
-                     CORE=&quot;$(CORE)&quot;
+                 CC=&quot;$(CC)&quot; \
+                 SFC=&quot;$(SFC)&quot; \
+                 SCC=&quot;$(SCC)&quot; \
+                 CFLAGS=&quot;$(CFLAGS)&quot; \
+                 FFLAGS=&quot;$(FFLAGS)&quot; \
+                 LDFLAGS=&quot;$(LDFLAGS)&quot; \
+                 RM=&quot;$(RM)&quot; \
+                 CPP=&quot;$(CPP)&quot; \
+                 CPPFLAGS=&quot;$(CPPFLAGS)&quot; \
+                 LIBS=&quot;$(LIBS)&quot; \
+                 CPPINCLUDES=&quot;$(CPPINCLUDES)&quot; \
+                 FCINCLUDES=&quot;$(FCINCLUDES)&quot; \
+                 CORE=&quot;$(CORE)&quot;
         if [ ! -e $(CORE)_model.exe ]; then ln -s src/$(CORE)_model.exe .; fi
-
+        @echo &quot;&quot;
+        @echo $(DEBUG_MESSAGE)
+        @echo $(SERIAL_MESSAGE)
+        @echo $(PAPI_MESSAGE)
 clean:
         cd src; make clean RM=&quot;$(RM)&quot; CORE=&quot;$(CORE)&quot;
         $(RM) $(CORE)_model.exe
+error: errmsg
 
-else
+else # CORE IF
 
-all: errmsg
+all: error
 clean: errmsg
-errmsg:
+error: errmsg
         @echo &quot;************ ERROR ************&quot;
         @echo &quot;No CORE specified. Quitting.&quot;
         @echo &quot;************ ERROR ************&quot;
+        @echo &quot;&quot;
 
-endif
+endif # CORE IF
+
+errmsg:
+        @echo &quot;&quot;
+        @echo &quot;Usage: make target CORE=[core] [options]&quot;
+        @echo &quot;&quot;
+        @echo &quot;Example targets:&quot;
+        @echo &quot;    ifort&quot;
+        @echo &quot;    gfortran&quot;
+        @echo &quot;    xlf&quot;
+        @echo &quot;    pgi&quot;
+        @echo &quot;&quot;
+        @echo &quot;Availabe Cores:&quot;
+        @cd src; ls -d core_* | grep &quot;.*&quot; | sed &quot;s/core_/    /g&quot;
+        @echo &quot;&quot;
+        @echo &quot;Available Options:&quot;
+        @echo &quot;    SERIAL=true - builds serial version. Default is parallel version.&quot;
+        @echo &quot;    DEBUG=true  - builds debug version. Default is optimized version.&quot;
+        @echo &quot;    USE_PAPI=true   - builds version using PAPI for timers and hardware counters. Default is off.&quot;
+        @echo &quot;&quot;
+        @echo &quot;Ensure that NETCDF (and PAPI if USE_PAPI=true) are environment variables&quot;
+        @echo &quot;that point to the absolute paths for the libraries.&quot;
+        @echo &quot;&quot;
+

</font>
</pre>