<p><b>mhoffman@lanl.gov</b> 2012-04-26 10:13:18 -0600 (Thu, 26 Apr 2012)</p><p>BRANCH COMMIT<br>
Modified Makefiles to allow compiling the land ice core with or without LifeV.<br>
To use lifev, execute make as e.g. 'make gfortran LIFEV=true'<br>
Also, all needed LifeV, Trilinos, etc. libraries and library paths (i.e. -L and -l flags) need to be specified in an environment variable called EXTERNAL_LIBS prior to executing make.<br>
If not using LifeV, compiling remains unchanged.<br>
This modifies the root Makefile so will need to be approved before merging into the trunk.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/land_ice_projects/implement_core/Makefile
===================================================================
--- branches/land_ice_projects/implement_core/Makefile        2012-04-25 19:32:29 UTC (rev 1814)
+++ branches/land_ice_projects/implement_core/Makefile        2012-04-26 16:13:18 UTC (rev 1815)
@@ -190,28 +190,22 @@
         &quot;USE_PAPI = $(USE_PAPI)&quot; \
         &quot;CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
-TRILINOS = /home/mperego/Programs/trilinos/trilinos-10.6.0-parallel-install/
-LIFEV_INSTALL = /home/mperego/workspace/iceSheetProject/lifev-parallel-optnew-install/
-LIFEV = /home/mperego/workspace/iceSheetProject/lifev-parallel-opt/lifev
-CORE_SRC = /home/mperego/workspace/mpas/svn-mpas-model.cgd.ucar.edu/branches/land_ice_projects/implement_core/src/
-#LIFEV_INSTALL = /home/mperego/workspace/iceSheetProject/lifev-debug-install/
-#LIFEV = /home/mperego/workspace/iceSheetProject/lifev-parallel-debug/
-BOOST = /home/mperego/Programs/boost/boost_1_42_0-install
-PARMETIS = /home/mperego/Programs/parMetis/ParMetis-3.1.1/
-
-#LIBS = -L$(CORE_SRC)/framework -lframework  -L$(CORE_SRC)/external/esmf_time_f90 -lesmf_time 
-LIBS = -L$(NETCDF)/lib -lnetcdf -L$(LIFEV)/ice_sheet -llifevicesheetinterface -L$(LIFEV)/core -llifevcore \
-                -L$(TRILINOS)/lib -lpiro -llocathyra -llocaepetra -lloca -lnoxthyra -lnoxepetra -lnox -lanasazitpetra -lModeLaplace -lanasaziepetra -lanasazi -lstratimikos -lstratimikosbelos -lstratimikosaztecoo -lstratimikosamesos -lstratimikosml -lstratimikosifpack -lbelostpetra -lbelosepetra -lbelos -lml -lifpack -lamesos -lgaleri -laztecoo -lisorropia -loptipack -lthyratpetra -lthyraepetraext -lthyraepetra -lthyra -lepetraext -ltpetrainout -ltpetra -ltriutils -lglobipack -lzoltan -lepetra -lkokkoslinalg -lkokkosnodeapi -lkokkos -lrtop -ltpi -lteuchos \
-                -L/usr/lib/ -ldmumps -lmumps_common -L/home/mperego/Programs/hypre-2.7.0b-install/lib/ -lHYPRE -lamd \
-                -L$(BOOST)/lib \
-                -L$(PARMETIS)/ -lparmetis -lmetis -lhdf5 -llapack -lumfpack -lblas  -lmpi_cxx   -lmpi_f90 
-
-
-
 CPPINCLUDES = -I../inc -I$(NETCDF)/include
 FCINCLUDES = -I../inc -I$(NETCDF)/include
-#LIBS = -L$(NETCDF)/lib -lnetcdf
+LIBS = -L$(NETCDF)/lib -lnetcdf
 
+####################################################
+# Section for adding external libraries and includes
+####################################################
+ifdef EXTERNAL_LIBS
+    LIBS += $(EXTERNAL_LIBS)
+endif
+ifdef EXTERNAL_INCLUDES
+    CPPINCLUDES += $(EXTERNAL_INCLUDES)
+    FCINCLUDES += $(EXTERNAL_INCLUDES)
+endif
+####################################################
+
 RM = rm -f
 CPP = cpp -C -P -traditional
 RANLIB = ranlib

Modified: branches/land_ice_projects/implement_core/src/core_land_ice/Makefile
===================================================================
--- branches/land_ice_projects/implement_core/src/core_land_ice/Makefile        2012-04-25 19:32:29 UTC (rev 1814)
+++ branches/land_ice_projects/implement_core/src/core_land_ice/Makefile        2012-04-26 16:13:18 UTC (rev 1815)
@@ -1,3 +1,10 @@
+# Check for LifeV
+ifeq &quot;$(LIFEV)&quot; &quot;true&quot;  
+   LIFEVFLAG = -DUSE_LIFEV
+   override CPPFLAGS += $(LIFEVFLAG)
+endif # LIFEV IF
+
+
 .SUFFIXES: .F .o
 
 OBJS =         mpas_land_ice_mpas_core.o \

Modified: branches/land_ice_projects/implement_core/src/core_land_ice/mpas_land_ice_lifev.F
===================================================================
--- branches/land_ice_projects/implement_core/src/core_land_ice/mpas_land_ice_lifev.F        2012-04-25 19:32:29 UTC (rev 1814)
+++ branches/land_ice_projects/implement_core/src/core_land_ice/mpas_land_ice_lifev.F        2012-04-26 16:13:18 UTC (rev 1815)
@@ -146,6 +146,7 @@
       call array_from_exchange_list(domain % blocklist % parinfo % edgesToSend, sendEdgesArray)
       call array_from_exchange_list(domain % blocklist % parinfo % edgesToRecv, recvEdgesArray)
 
+#ifdef USE_LIFEV
       !call lifeV and set the grid of the velocity solver
       call velocity_solver_init_mpi(domain % dminfo % comm)
 
@@ -154,6 +155,7 @@
       call velocity_solver_set_grid_data(nCells, nEdges, nVertices, nVertLevels, nCellsSolve, nEdgesSolve, nVerticesSolve, &amp;
         cellsOnEdge, cellsOnVertex, verticesOnCell, verticesOnEdge, xCell, yCell, zCell, &amp;
         sendCellsArray, recvCellsArray, sendEdgesArray, recvEdgesArray, sendVerticesArray, recvVerticesArray)
+#endif
 
       !these ca be deallocated because they have been copied on the c++ side
       deallocate(sendCellsArray, &amp;
@@ -212,7 +214,9 @@
 
       err = 0
 
+#ifdef USE_LIFEV
       call velocity_solver_finalize()
+#endif
 
    !--------------------------------------------------------------------
 
@@ -350,6 +354,7 @@
         levelsRatio(i) = 1./real(nVertLevels);
       end do
 
+#ifdef USE_LIFEV
       !&lt;---- calls to be made only when mask changes
       call velocity_solver_compute_2d_grid(verticesMask)
 
@@ -370,6 +375,9 @@
       !call velocity_solver_solve_FO(lowerSurface, thckdata, betadata, temperaturedata, u, v)
       !call velocity_solver_export_FO_velocity();
 
+
+#endif
+
    !--------------------------------------------------------------------
 
    end subroutine land_ice_lifev_solve

</font>
</pre>