<p><b>xylar@lanl.gov</b> 2010-05-28 11:55:41 -0600 (Fri, 28 May 2010)</p><p>BRANCH COMMIT<br>
<br>
Added uReconstructZonal and uReconstructMeridional to the registry of each core<br>
<br>
if(on_a_sphere) these are the zonal and meridional velocities computed as follows:<br>
uZonal = -uX*sin(long)+uY*cos(long)<br>
uMeridional = (uX*cos(long)+uY*sin(long))*sin(lat) + uZ*cos(lat)<br>
else these are the same as uReconstructX and uReconstructY, respectively<br>
</p><hr noshade><pre><font color="gray">Modified: branches/ocean_projects/IBinterp/mpas/src/core_hyd_atmos/Registry
===================================================================
--- branches/ocean_projects/IBinterp/mpas/src/core_hyd_atmos/Registry        2010-05-27 21:40:42 UTC (rev 316)
+++ branches/ocean_projects/IBinterp/mpas/src/core_hyd_atmos/Registry        2010-05-28 17:55:41 UTC (rev 317)
@@ -133,6 +133,8 @@
 var real    uReconstructX ( nVertLevels nCells Time ) o uReconstructX - -
 var real    uReconstructY ( nVertLevels nCells Time ) o uReconstructY - -
 var real    uReconstructZ ( nVertLevels nCells Time ) o uReconstructZ - -
+var real    uReconstructZonal ( nVertLevels nCells Time ) o uReconstructZonal - -
+var real    uReconstructMeridional ( nVertLevels nCells Time ) o uReconstructMeridional - -
 
 # Other diagnostic variables: neither read nor written to any files
 var real    vh ( nVertLevels nEdges Time ) - vh - -

Modified: branches/ocean_projects/IBinterp/mpas/src/core_ocean/Registry
===================================================================
--- branches/ocean_projects/IBinterp/mpas/src/core_ocean/Registry        2010-05-27 21:40:42 UTC (rev 316)
+++ branches/ocean_projects/IBinterp/mpas/src/core_ocean/Registry        2010-05-28 17:55:41 UTC (rev 317)
@@ -108,6 +108,8 @@
 var real    uReconstructX ( nVertLevels nCells Time ) o uReconstructX - -
 var real    uReconstructY ( nVertLevels nCells Time ) o uReconstructY - -
 var real    uReconstructZ ( nVertLevels nCells Time ) o uReconstructZ - -
+var real    uReconstructZonal ( nVertLevels nCells Time ) o uReconstructZonal - -
+var real    uReconstructMeridional ( nVertLevels nCells Time ) o uReconstructMeridional - -
 var real    zMid ( nVertLevels nCells Time ) o zMid - -
 var real    zBot ( nVertLevels nCells Time ) o zBot - -
 var real    zSurface ( nCells Time ) o zSurface - -

Modified: branches/ocean_projects/IBinterp/mpas/src/core_sw/Registry
===================================================================
--- branches/ocean_projects/IBinterp/mpas/src/core_sw/Registry        2010-05-27 21:40:42 UTC (rev 316)
+++ branches/ocean_projects/IBinterp/mpas/src/core_sw/Registry        2010-05-28 17:55:41 UTC (rev 317)
@@ -105,6 +105,8 @@
 var real    uReconstructX ( nVertLevels nCells Time ) o uReconstructX - -
 var real    uReconstructY ( nVertLevels nCells Time ) o uReconstructY - -
 var real    uReconstructZ ( nVertLevels nCells Time ) o uReconstructZ - -
+var real    uReconstructZonal ( nVertLevels nCells Time ) o uReconstructZonal - -
+var real    uReconstructMeridional ( nVertLevels nCells Time ) o uReconstructMeridional - -
 
 # Other diagnostic variables: neither read nor written to any files
 var real    vh ( nVertLevels nEdges Time ) - vh - -

Modified: branches/ocean_projects/IBinterp/mpas/src/operators/module_vector_reconstruction.F
===================================================================
--- branches/ocean_projects/IBinterp/mpas/src/operators/module_vector_reconstruction.F        2010-05-27 21:40:42 UTC (rev 316)
+++ branches/ocean_projects/IBinterp/mpas/src/operators/module_vector_reconstruction.F        2010-05-28 17:55:41 UTC (rev 317)
@@ -132,10 +132,17 @@
     integer, dimension(:), pointer :: nEdgesOnCell
     integer :: iCell,iEdge, i
     real (kind=RKIND), dimension(:,:), pointer :: u
+    real(kind=RKIND), dimension(:), pointer :: latCell, lonCell
     real (kind=RKIND), dimension(:,:), pointer :: uReconstructX, uReconstructY, uReconstructZ
+    real (kind=RKIND), dimension(:,:), pointer :: uReconstructZonal, uReconstructMeridional
 
     real (kind=RKIND), dimension(:,:,:), pointer :: coeffs_reconstruct
 
+    logical :: on_a_sphere
+
+    real (kind=RKIND) :: clat, slat, clon, slon
+
+
     ! stored arrays used during compute procedure
     coeffs_reconstruct =&gt; grid % coeffs_reconstruct % array
 
@@ -148,6 +155,12 @@
     uReconstructY =&gt; state % uReconstructY % array
     uReconstructZ =&gt; state % uReconstructZ % array
 
+    latCell       =&gt; grid % latCell % array
+    lonCell       =&gt; grid % lonCell % array
+    uReconstructZonal =&gt; state % uReconstructZonal % array
+    uReconstructMeridional =&gt; state % uReconstructMeridional % array
+    on_a_sphere = grid % on_a_sphere
+
     ! init the intent(out)
     uReconstructX = 0.0
     uReconstructY = 0.0
@@ -165,9 +178,26 @@
           + coeffs_reconstruct(2,i,iCell) * u(:,iEdge)
         uReconstructZ(:,iCell) = uReconstructZ(:,iCell) &amp;
           + coeffs_reconstruct(3,i,iCell) * u(:,iEdge)
+
       enddo
     enddo   ! iCell
 
+    if(on_a_sphere) then
+      do iCell=1,nCellsSolve
+        clat = cos(latCell(iCell))
+        slat = sin(latCell(iCell))
+        clon = cos(lonCell(iCell))
+        slon = sin(lonCell(iCell))
+        uReconstructZonal(iCell,:) = -uReconstructX(iCell,:)*slon + uReconstructY(iCell,:)*clon
+        uReconstructMeridional(iCell,:) = (uReconstructX(iCell,:)*clon &amp;
+          + uReconstructY(iCell,:)*slon)*slat &amp;
+          + uReconstructZ(iCell,:)*clat
+      end do
+    else
+      uReconstructZonal = uReconstructX
+      uReconstructMeridional = uReconstructY
+    end if
+
   end subroutine reconstruct
 
 end module vector_reconstruction

</font>
</pre>