<p><b>dwj07@fsu.edu</b> 2012-09-11 14:52:37 -0600 (Tue, 11 Sep 2012)</p><p><br>
        -- BRANCH COMMIT --<br>
<br>
        Adding changes to Makefile for building in the CESM.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/ocean_projects/cesm_coupling/src/Makefile
===================================================================
--- branches/ocean_projects/cesm_coupling/src/Makefile        2012-09-11 20:50:14 UTC (rev 2147)
+++ branches/ocean_projects/cesm_coupling/src/Makefile        2012-09-11 20:52:37 UTC (rev 2148)
@@ -1,9 +1,46 @@
 .SUFFIXES: .F .c .o
 
+ifeq &quot;$(CESM)&quot; &quot;true&quot;
+RM = rm -f
+CPP = cpp -C -P -traditional
+NETCDF=$(NETCDF_PATH)
+PNETCDF=$(PNETCDF_PATH)
+PIO=$(CASEROOT)/bld/pio
+FC=$(MPIFC)
+CC=$(MPICC)
+FILE_OFFSET = -DOFFSET64BIT
+CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)
+CPPINCLUDES = -I$(CASEROOT)/bld/ocn/source/inc -I$(NETCDF)/include -I$(PIO) -I$(PNETCDF)/include
+FFLAGS = -qrealsize=8
+FCINCLUDES = -I$(CASEROOT)/bld/ocn/source/inc -I$(NETCDF)/include -I$(PIO) -I$(PNETCDF)/include
+LIBS = -L$(PIO) -L$(PNETCDF)/lib -L$(NETCDF)/lib -lpio -lpnetcdf -lnetcdf
+include $(CASEROOT)/Macros
+
+all:
+        @echo $(CPPINCLUDES)
+        @echo $(FCINCLUDES)
+        ( $(MAKE) mpas RM=&quot;$(RM)&quot; CPP=&quot;$(CPP)&quot; NETCDF=&quot;$(NETCDF)&quot; PNETCDF=&quot;$(PNETCDF)&quot; \
+          PIO=&quot;$(PIO)&quot; FC=&quot;$(FC)&quot; CC=&quot;$(CC)&quot; SFC=&quot;$(SFC)&quot; SCC=&quot;$(SCC)&quot; \
+          CPPFLAGS=&quot;$(CPPFLAGS)&quot; CPPINCLUDES=&quot;$(CPPINCLUDES)&quot; FCINCLUDES=&quot;$(FCINCLUDES)&quot; )
+else
+
 all: mpas
 
+endif
+
 mpas: reg_includes externals frame ops dycore drver
+ifeq &quot;$(CESM)&quot; &quot;true&quot;
+        cp framework/*.o .
+        cp operators/*.o .
+        cp core_$(CORE)/*.o .
+        cp cesm_driver/*.o .
+        ar ru lib$(CORE).a framework/*.o
+        ar ru lib$(CORE).a operators/*.o
+        ar ru lib$(CORE).a core_$(CORE)/*.o
+        ar ru lib$(CORE).a cesm_driver/*.o
+else
         $(LINKER) $(LDFLAGS) -o $(CORE)_model.exe driver/*.o -L. -ldycore -lops -lframework $(LIBS) -I./external/esmf_time_f90 -L./external/esmf_time_f90 -lesmf_time
+endif
 
 reg_includes: 
         ( cd registry; $(MAKE) CC=&quot;$(SCC)&quot; )
@@ -13,22 +50,27 @@
         ( cd external; $(MAKE) FC=&quot;$(FC)&quot; SFC=&quot;$(SFC)&quot; CC=&quot;$(CC)&quot; SCC=&quot;$(SCC)&quot; FFLAGS=&quot;$(FFLAGS)&quot; CFLAGS=&quot;$(CFLAGS)&quot; CPP=&quot;$(CPP)&quot; NETCDF=&quot;$(NETCDF)&quot; CORE=&quot;$(CORE)&quot; )
 
 frame: reg_includes externals
-        ( cd framework; $(MAKE) all ) 
+        ( cd framework; $(MAKE) CPPFLAGS=&quot;$(CPPFLAGS)&quot; CPPINCLUDES=&quot;$(CPPINCLUDES)&quot; all ) 
         ln -sf framework/libframework.a libframework.a
 
 ops: reg_includes externals frame
-        ( cd operators; $(MAKE) all ) 
+        ( cd operators; $(MAKE) CPPFLAGS=&quot;$(CPPFLAGS)&quot; CPPINCLUDES=&quot;$(CPPINCLUDES)&quot; all ) 
         ln -sf operators/libops.a libops.a
 
 dycore: reg_includes externals frame ops
-        ( cd core_$(CORE); $(MAKE) all ) 
+        ( cd core_$(CORE); $(MAKE) CPPFLAGS=&quot;$(CPPFLAGS)&quot; CPPINCLUDES=&quot;$(CPPINCLUDES)&quot; all ) 
         ln -sf core_$(CORE)/libdycore.a libdycore.a
 
+ifeq &quot;$(CESM)&quot; &quot;true&quot;
 drver:  reg_includes externals frame ops dycore
-        ( cd driver; $(MAKE) all ) 
+        ( cd cesm_driver; $(MAKE) CPPFLAGS=&quot;$(CPPFLAGS)&quot; CPPINCLUDES=&quot;$(CPPINCLUDES)&quot; all ) 
+else
+drver:  reg_includes externals frame ops dycore
+        ( cd driver; $(MAKE) CPPFLAGS=&quot;$(CPPFLAGS)&quot; CPPINCLUDES=&quot;$(CPPINCLUDES)&quot; all ) 
+endif
 
 clean:
-        $(RM) $(CORE)_model.exe libframework.a libops.a libdycore.a
+        $(RM) $(CORE)_model.exe libframework.a libops.a libdycore.a lib$(CORE).a *.o
         ( cd registry; $(MAKE) clean )
         ( cd external; $(MAKE) clean )
         ( cd framework; $(MAKE) clean )

</font>
</pre>