<p><b>duda</b> 2010-06-04 11:41:39 -0600 (Fri, 04 Jun 2010)</p><p>BRANCH COMMIT<br>
<br>
Get zonal and meridional winds from uReconstructZonal and uReconstructMeridional<br>
rather than re-computing them from uReconstruct{XYZ} in CAM-MPAS interface routines.<br>
<br>
M    src/core_hyd_atmos/Registry<br>
M    src/driver_cam_interface/module_mpas_cam_interface.F<br>
</p><hr noshade><pre><font color="gray">Modified: branches/mpas_cam_coupling/src/core_hyd_atmos/Registry
===================================================================
--- branches/mpas_cam_coupling/src/core_hyd_atmos/Registry        2010-06-03 21:19:25 UTC (rev 334)
+++ branches/mpas_cam_coupling/src/core_hyd_atmos/Registry        2010-06-04 17:41:39 UTC (rev 335)
@@ -177,6 +177,3 @@
 # Unit vectors in east and north directions for each cell
 var real    east ( R3 nCells ) - east - -
 var real    north ( R3 nCells ) - north - -
-
-# Unit vectors in the positive normal direction for each edge
-var real    edge_normal ( R3 nEdges ) - edge_normal - -

Modified: branches/mpas_cam_coupling/src/driver_cam_interface/module_mpas_cam_interface.F
===================================================================
--- branches/mpas_cam_coupling/src/driver_cam_interface/module_mpas_cam_interface.F        2010-06-03 21:19:25 UTC (rev 334)
+++ branches/mpas_cam_coupling/src/driver_cam_interface/module_mpas_cam_interface.F        2010-06-04 17:41:39 UTC (rev 335)
@@ -37,12 +37,8 @@
       real (kind=RKIND), intent(in) :: phys_dt
 
       integer :: iCell, iEdge, j
-      real (kind=RKIND) :: angle
-      real (kind=RKIND), dimension(3) :: X1, X2, n_rot_vector
-      integer, dimension(:), pointer :: nEdgesOnCell
-      real (kind=RKIND), dimension(:), pointer :: xCell, yCell, zCell
-      integer, dimension(:,:), pointer :: edgesOnCell, cellsOnEdge
-      real (kind=RKIND), dimension(:,:), pointer :: east, north, edge_normal
+      real (kind=RKIND), dimension(:), pointer :: latCell, lonCell
+      real (kind=RKIND), dimension(:,:), pointer :: east, north
 
       write(0,*) 'Called MPAS_INIT1'
 
@@ -68,71 +64,27 @@
       !       however, with a suitable registry, this shouldn't be a problem
       call input_state_for_domain(domain)
 
-      xCell =&gt; domain % blocklist % mesh % xCell % array
-      yCell =&gt; domain % blocklist % mesh % yCell % array
-      zCell =&gt; domain % blocklist % mesh % zCell % array
-      nEdgesOnCell =&gt; domain % blocklist % mesh % nEdgesOnCell % array
-      edgesOnCell =&gt; domain % blocklist % mesh % edgesOnCell % array
-      cellsOnEdge =&gt; domain % blocklist % mesh % cellsOnEdge % array
+      latCell =&gt; domain % blocklist % mesh % latCell % array
+      lonCell =&gt; domain % blocklist % mesh % lonCell % array
       east =&gt; domain % blocklist % mesh % east % array
       north =&gt; domain % blocklist % mesh % north % array
-      edge_normal =&gt; domain % blocklist % mesh % edge_normal % array
 
-      angle = 0.0003
 
-
       !
       ! Compute unit vectors in east and north directions for each cell
       !
       do iCell = 1,domain % blocklist % mesh % nCellsSolve
-         call rotate_about_vector(xCell(iCell), yCell(iCell), zCell(iCell), &amp;
-                                  angle, &amp;
-                                  0., 0., 0., &amp;
-                                  0., 0., 1., &amp;
-                                  east(1,iCell), east(2,iCell), east(3,iCell))
-         call rotate_about_vector(xCell(iCell), yCell(iCell), zCell(iCell), &amp;
-                                  -angle, &amp;
-                                  0., 0., 0., &amp;
-                                  0., 0., 1., &amp;
-                                  X1(1), X1(2), X1(3))
-         east(1,iCell) = east(1,iCell) - X1(1)
-         east(2,iCell) = east(2,iCell) - X1(2)
-         east(3,iCell) = east(3,iCell) - X1(3)
+
+         east(1,iCell) = -sin(lonCell(iCell))
+         east(2,iCell) =  cos(lonCell(iCell))
+         east(3,iCell) =  0.0
          call r3_normalize(east(1,iCell), east(2,iCell), east(3,iCell))
 
-         call r3_cross(xCell(iCell), yCell(iCell), zCell(iCell), &amp;
-                       0.,           0.,           1.,           &amp;
-                       n_rot_vector(1), n_rot_vector(2), n_rot_vector(3))
-         call rotate_about_vector(xCell(iCell), yCell(iCell), zCell(iCell), &amp;
-                                  angle, &amp;
-                                  0., 0., 0., &amp;
-                                  n_rot_vector(1), n_rot_vector(2), n_rot_vector(3), &amp;
-                                  north(1,iCell), north(2,iCell), north(3,iCell))
-         call rotate_about_vector(xCell(iCell), yCell(iCell), zCell(iCell), &amp;
-                                  -angle, &amp;
-                                  0., 0., 0., &amp;
-                                  n_rot_vector(1), n_rot_vector(2), n_rot_vector(3), &amp;
-                                  X1(1), X1(2), X1(3))
-         north(1,iCell) = north(1,iCell) - X1(1)
-         north(2,iCell) = north(2,iCell) - X1(2)
-         north(3,iCell) = north(3,iCell) - X1(3)
+         north(1,iCell) = -cos(lonCell(iCell))*sin(latCell(iCell))
+         north(2,iCell) = -sin(lonCell(iCell))*sin(latCell(iCell))
+         north(3,iCell) =  cos(latCell(iCell))
          call r3_normalize(north(1,iCell), north(2,iCell), north(3,iCell))
 
-         X1(1) = xCell(iCell)
-         X1(2) = yCell(iCell)
-         X1(3) = zCell(iCell)
-
-         do j=1,nEdgesOnCell(iCell)
-           iEdge = edgesOnCell(j,iCell)
-           if (iCell == cellsOnEdge(1,iEdge)) then
-               X2(1) = xCell(cellsOnEdge(2,iEdge))
-               X2(2) = yCell(cellsOnEdge(2,iEdge))
-               X2(3) = zCell(cellsOnEdge(2,iEdge))
-               edge_normal(:,iEdge) = X2(:) - X1(:)
-               call r3_normalize(edge_normal(1,iEdge), edge_normal(2,iEdge), edge_normal(3,iEdge))
-           endif
-         enddo
-
       end do
    
    end subroutine mpas_init1
@@ -627,7 +579,7 @@
 
       integer :: iCell, k, iScalar
       real (kind=RKIND), dimension(:), pointer :: latCell, lonCell
-      real (kind=RKIND), dimension(:,:), pointer :: theta, pressure, ww, uReconstX, uReconstY, uReconstZ, east, north
+      real (kind=RKIND), dimension(:,:), pointer :: theta, pressure, ww, uReconstZonal, uReconstMeridional, east, north
       real (kind=RKIND), dimension(:,:,:), pointer :: scalars
       type (block_type), pointer :: block
 
@@ -642,9 +594,8 @@
       theta =&gt; block % time_levs(1) % state % theta % array
       pressure =&gt; block % time_levs(1) % state % pressure % array
       ww =&gt; block % time_levs(1) % state % ww % array
-      uReconstX =&gt; block % time_levs(1) % state % uReconstructX % array
-      uReconstY =&gt; block % time_levs(1) % state % uReconstructY % array
-      uReconstZ =&gt; block % time_levs(1) % state % uReconstructZ % array
+      uReconstZonal =&gt; block % time_levs(1) % state % uReconstructZonal % array
+      uReconstMeridional =&gt; block % time_levs(1) % state % uReconstructMeridional % array
       scalars =&gt; block % time_levs(1) % state % scalars % array
 
 
@@ -686,12 +637,8 @@
 
       do iCell=1,block % mesh % nCellsSolve
          do k=1,block % mesh % nVertLevels
-            Ux(iCell,k) =   uReconstX(k,iCell) * east(1,iCell)  &amp;
-                          + uReconstY(k,iCell) * east(2,iCell)  &amp;
-                          + uReconstZ(k,iCell) * east(3,iCell)
-            Uy(iCell,k) =   uReconstX(k,iCell) * north(1,iCell) &amp;
-                          + uReconstY(k,iCell) * north(2,iCell) &amp;
-                          + uReconstZ(k,iCell) * north(3,iCell)
+            Ux(iCell,k) =   uReconstZonal(k,iCell)
+            Uy(iCell,k) =   uReconstMeridional(k,iCell)
          end do
       end do 
 
@@ -738,7 +685,7 @@
       edgesOnCell =&gt; block % mesh % edgesOnCell % array
       east =&gt; block % mesh % east % array
       north =&gt; block % mesh % north % array
-      edge_normal =&gt; block % mesh % edge_normal % array
+      edge_normal =&gt; block % mesh % edgeNormalVectors % array
       pressure =&gt; block % time_levs(1) % state % pressure % array
       scalars =&gt; block % time_levs(1) % state % scalars % array
       scalars_phys_tend =&gt; block % time_levs(1) % state % scalars_phys_tend % array

</font>
</pre>