<p><b>mperego@fsu.edu</b> 2012-05-22 12:29:36 -0600 (Tue, 22 May 2012)</p><p>BRANCH COMMIT<br>
land_ice<br>
Introduce flag USE_PHG for compiling functions of the Stokes Solver that require PHG library<br>
</p><hr noshade><pre><font color="gray">Modified: branches/land_ice_projects/implement_core/src/core_land_ice/Makefile
===================================================================
--- branches/land_ice_projects/implement_core/src/core_land_ice/Makefile        2012-05-22 16:27:19 UTC (rev 1928)
+++ branches/land_ice_projects/implement_core/src/core_land_ice/Makefile        2012-05-22 18:29:36 UTC (rev 1929)
@@ -1,10 +1,14 @@
 # Check for LifeV
-ifeq &quot;$(LIFEV)&quot; &quot;true&quot;  
+ifeq &quot;$(LIFEV)&quot; &quot;true&quot;
    LIFEVFLAG = -DUSE_LIFEV
-   override CPPFLAGS += $(LIFEVFLAG)
 endif # LIFEV IF
 
+ifeq &quot;$(PHG)&quot; &quot;true&quot;
+   LIFEVFLAG += -DUSE_PHG
+endif # PHG IF
 
+override CPPFLAGS += $(LIFEVFLAG)
+
 .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-05-22 16:27:19 UTC (rev 1928)
+++ branches/land_ice_projects/implement_core/src/core_land_ice/mpas_land_ice_lifev.F        2012-05-22 18:29:36 UTC (rev 1929)
@@ -101,7 +101,10 @@
 
       !call lifeV and set the grid of the velocity solver
       call velocity_solver_init_mpi(domain % dminfo % comm)
-
+#else
+      write(*,*) &quot;LifeV needed to run L1L2, FO and Stokes models&quot;
+      err = 1
+      return
 #endif
 
    !--------------------------------------------------------------------
@@ -156,6 +159,10 @@
 #ifdef USE_LIFEV
       ! This call is needed for using any of the LifeV velocity solvers
       call velocity_solver_finalize()
+#else
+      write(*,*) &quot;LifeV needed to run L1L2, FO and Stokes models&quot;
+      err = 1
+      return
 #endif
 
    !--------------------------------------------------------------------
@@ -266,6 +273,10 @@
         cellsOnEdge, cellsOnVertex, verticesOnCell, verticesOnEdge, xCell, yCell, zCell, &amp;
         sendCellsArray, recvCellsArray, sendEdgesArray, recvEdgesArray, sendVerticesArray, recvVerticesArray)
       call mpas_timer_stop(&quot;velocity_solver_set_grid_data&quot;)
+#else
+      write(*,*) &quot;LifeV needed to run L1L2, FO and Stokes models&quot;
+      err = 1
+      return
 #endif
 
       !these can be deallocated because they have been copied on the c++ side
@@ -366,12 +377,18 @@
               call velocity_solver_init_FO(LayerThicknessFractions)
               call mpas_timer_stop(&quot;velocity_solver_init_FO&quot;)
           case ('Stokes')
+#ifdef USE_PHG
               call mpas_timer_start(&quot;velocity_solver_extrude_3d_grid&quot;)
               call velocity_solver_extrude_3d_grid(LayerThicknessFractions, lowerSurface, thickness)
               call mpas_timer_stop(&quot;velocity_solver_extrude_3d_grid&quot;)
               call mpas_timer_start(&quot;velocity_solver_init_stokes&quot;)
               call velocity_solver_init_stokes(LayerThicknessFractions)
               call mpas_timer_stop(&quot;velocity_solver_init_stokes&quot;)
+#else
+        write(*,*) &quot;PHG library needed to run stokes&quot;
+        err = 1
+        return
+#endif
           end select
       endif
 
@@ -395,11 +412,21 @@
           call velocity_solver_export_FO_velocity()
           call mpas_timer_stop(&quot;velocity_solver export&quot;)
       case ('Stokes')
-          call mpas_timer_start(&quot;stokes&quot;)
           ! call stokes
-          call mpas_timer_stop(&quot;stokes&quot;)
+#ifdef USE_PHG
+          call mpas_timer_start(&quot;velocity_solver_solve_stokes&quot;)
+          call velocity_solver_solve_stokes(lowerSurface, thickness, beta, tracers(index_temperature,:,:), normalVelocity)
+          call mpas_timer_stop(&quot;velocity_solver_solve_stokes&quot;)
+#else
+        write(*,*) &quot;PHG library needed to run stokes&quot;
+        err = 1
+        return
+#endif
       end select
-
+#else
+      write(*,*) &quot;LifeV needed to run L1L2, FO and Stokes models&quot;
+      err = 1
+      return
 #endif
 
    !--------------------------------------------------------------------

</font>
</pre>