<p><b>mperego@fsu.edu</b> 2012-04-25 10:48:21 -0600 (Wed, 25 Apr 2012)</p><p>BRANCH COMMIT<br>
<br>
set up interface to call lifeV.<br>
Makefile now requires lifeV library... it will be fixed soon<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 16:42:54 UTC (rev 1809)
+++ branches/land_ice_projects/implement_core/Makefile        2012-04-25 16:48:21 UTC (rev 1810)
@@ -190,9 +190,27 @@
         &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
 
 RM = rm -f
 CPP = cpp -C -P -traditional

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 16:42:54 UTC (rev 1809)
+++ branches/land_ice_projects/implement_core/src/core_land_ice/mpas_land_ice_lifev.F        2012-04-25 16:48:21 UTC (rev 1810)
@@ -18,7 +18,7 @@
    use mpas_grid_types
    use mpas_configure
    use mpas_dmpar
-   use, intrinsic :: iso_c_binding
+   !use, intrinsic :: iso_c_binding
 
    implicit none
    private
@@ -41,20 +41,6 @@
              land_ice_lifev_block_init, &amp;
              land_ice_lifev_solve
 
-   !--------------------------------------------------------------------
-   !
-   ! Private module variables
-   !
-   !--------------------------------------------------------------------
-
-   ! halo exchange arrays
-   integer, dimension(:), pointer :: sendCellsArray, &amp;
-                                     recvCellsArray, &amp;
-                                     sendVerticesArray, &amp;
-                                     recvVerticesArray, &amp;
-                                     sendEdgesArray, &amp;
-                                     recvEdgesArray
-
 !***********************************************************************
 
 contains
@@ -112,21 +98,14 @@
 
       logical :: keepVertex
 
-      !-----------------------------------------------------------------
-      !
-      ! LifeV C++ interfaces
-      !
-      !-----------------------------------------------------------------
+      ! halo exchange arrays
+      integer, dimension(:), pointer :: sendCellsArray, &amp;
+                                     recvCellsArray, &amp;
+                                     sendVerticesArray, &amp;
+                                     recvVerticesArray, &amp;
+                                     sendEdgesArray, &amp;
+                                     recvEdgesArray
 
-      interface
-        subroutine velocity_solver_init_l1l2(nVertLevels) bind ( c )
-           use iso_c_binding
-           integer ( c_int ), VALUE :: nVertLevels
-        end subroutine velocity_solver_init_l1l2
-      end interface
-
-
-
       err = 0
 
       ! Note: the following code assumes that blocklist contains a single block
@@ -168,15 +147,22 @@
       call array_from_exchange_list(domain % blocklist % parinfo % edgesToRecv, recvEdgesArray)
 
       !call lifeV and set the grid of the velocity solver
+      call velocity_solver_init_mpi(domain % dminfo % comm)
 
-      !call lifev_set_velocity_solver_grid(nCells, nEdges, nVertices, nCellsSolve, nEdgesSolve, nVerticesSolve, &amp;
-      !  cellsOnEdge, cellsOnVertex, verticesOnCell, verticesOnEdge, verticesMask, xCell, yCell, zCell, &amp;
-      !  sendCellsArray, recvCellsArray, sendEdgesArray, recvEdgesArray, sendVerticesArray, recvVerticesArray)
+      !zCell is supposed to be zero for L1L2 and FO solvers
+      !nVertLevels should be equal to nVertLevelsSolve (no split the domain in the vertical direction)
+      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)
 
-      !deallocate(verticesMask)
+      !these ca be deallocated because they have been copied on the c++ side
+      deallocate(sendCellsArray, &amp;
+                 recvCellsArray, &amp;
+                 sendVerticesArray, &amp;
+                 recvVerticesArray, &amp;
+                 sendEdgesArray, &amp;
+                 recvEdgesArray)
 
-      !call velocity_solver_init_l1l2(nVertLevels)  ! LifeV C++ call
-
    !--------------------------------------------------------------------
 
    end subroutine land_ice_lifev_init
@@ -226,12 +212,7 @@
 
       err = 0
 
-      deallocate(sendCellsArray, &amp;
-                 recvCellsArray, &amp;
-                 sendVerticesArray, &amp;
-                 recvVerticesArray, &amp;
-                 sendEdgesArray, &amp;
-                 recvEdgesArray)
+      call velocity_solver_finalize()
 
    !--------------------------------------------------------------------
 
@@ -323,26 +304,72 @@
       !
       !-----------------------------------------------------------------
       real (kind=RKIND), dimension(:), pointer :: &amp;
-         thickness, lowerSurface, beta
+         thickness, lowerSurface, upperSurface, beta, levelsRatio
       real (kind=RKIND), dimension(:,:), pointer :: &amp;
          normalVelocity
       real (kind=RKIND), dimension(:,:,:), pointer :: &amp;
          tracers
 
+      !temporary variables
+      logical, dimension(:), pointer :: verticesMask
+      logical :: keep_vertex
+      integer :: nVertices, i, k, iCell, nVertLevels
+
+
+      
+
       integer :: index_temperature
+      
 
       err = 0
 
       normalVelocity =&gt; state % normalVelocity % array
       thickness =&gt; state % thickness % array
       lowerSurface =&gt; state % lowerSurface % array
+      upperSurface =&gt; state % upperSurface % array
       beta =&gt; state % beta % array
       tracers =&gt; state % tracers % array
 
       index_temperature = state % index_temperature
 
-      ! call lifev_velocity_solver_L1L2(thickness, lowerSurface, beta, tracers(index_temperature,:,:), normalVelocity)
+      nVertices = mesh % nVertices 
+      allocate(verticesMask(nVertices))
+      do i = 1,nVertices
+          keep_vertex = .false.
+          do k = 1, 3
+              iCell = mesh % cellsOnVertex % array(k,i)
+              keep_vertex = keep_vertex.or.(thickness(iCell) &gt; 0.01) 
+          end do 
+          verticesMask(i) = keep_vertex
+      end do       
 
+
+      nVertLevels = mesh % nVertLevels
+      allocate(levelsRatio(nVertLevels))
+      do i = 1,nVertLevels
+        levelsRatio(i) = 1./real(nVertLevels);
+      end do
+
+      !&lt;---- calls to be made only when mask changes
+      call velocity_solver_compute_2d_grid(verticesMask)
+
+
+      call velocity_solver_init_L1L2(levelsRatio)
+      
+      !if FO or Stokes we need this        
+      !call velocity_solver_extrude_3d_grid(levelsRatio, lowerSurface, thickness)
+      !call velocity_solver_init_FO(levelsRatio)
+      !call valocity_solver_init_stokes(levelsRatio)
+
+      !--&gt;
+
+      call velocity_solver_solve_L1L2(lowerSurface, thickness, beta, tracers(index_temperature,:,:), normalVelocity, normalVelocity)
+      !call velocity_solver_solve_FO(lowerSurface, thickness, beta, tracers(index_temperature,:,:), normalVelocity, normalVelocity)
+      call velocity_solver_export_L1L2_velocity();
+      call velocity_solver_export_2d_data(lowerSurface, thickness, beta)
+      !call velocity_solver_solve_FO(lowerSurface, thckdata, betadata, temperaturedata, u, v)
+      !call velocity_solver_export_FO_velocity();
+
    !--------------------------------------------------------------------
 
    end subroutine land_ice_lifev_solve

</font>
</pre>