<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 => domain % blocklist % mesh % xCell % array
- yCell => domain % blocklist % mesh % yCell % array
- zCell => domain % blocklist % mesh % zCell % array
- nEdgesOnCell => domain % blocklist % mesh % nEdgesOnCell % array
- edgesOnCell => domain % blocklist % mesh % edgesOnCell % array
- cellsOnEdge => domain % blocklist % mesh % cellsOnEdge % array
+ latCell => domain % blocklist % mesh % latCell % array
+ lonCell => domain % blocklist % mesh % lonCell % array
east => domain % blocklist % mesh % east % array
north => domain % blocklist % mesh % north % array
- edge_normal => 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), &
- angle, &
- 0., 0., 0., &
- 0., 0., 1., &
- east(1,iCell), east(2,iCell), east(3,iCell))
- call rotate_about_vector(xCell(iCell), yCell(iCell), zCell(iCell), &
- -angle, &
- 0., 0., 0., &
- 0., 0., 1., &
- 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), &
- 0., 0., 1., &
- n_rot_vector(1), n_rot_vector(2), n_rot_vector(3))
- call rotate_about_vector(xCell(iCell), yCell(iCell), zCell(iCell), &
- angle, &
- 0., 0., 0., &
- n_rot_vector(1), n_rot_vector(2), n_rot_vector(3), &
- north(1,iCell), north(2,iCell), north(3,iCell))
- call rotate_about_vector(xCell(iCell), yCell(iCell), zCell(iCell), &
- -angle, &
- 0., 0., 0., &
- n_rot_vector(1), n_rot_vector(2), n_rot_vector(3), &
- 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 => block % time_levs(1) % state % theta % array
pressure => block % time_levs(1) % state % pressure % array
ww => block % time_levs(1) % state % ww % array
- uReconstX => block % time_levs(1) % state % uReconstructX % array
- uReconstY => block % time_levs(1) % state % uReconstructY % array
- uReconstZ => block % time_levs(1) % state % uReconstructZ % array
+ uReconstZonal => block % time_levs(1) % state % uReconstructZonal % array
+ uReconstMeridional => block % time_levs(1) % state % uReconstructMeridional % array
scalars => 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) &
- + uReconstY(k,iCell) * east(2,iCell) &
- + uReconstZ(k,iCell) * east(3,iCell)
- Uy(iCell,k) = uReconstX(k,iCell) * north(1,iCell) &
- + uReconstY(k,iCell) * north(2,iCell) &
- + 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 => block % mesh % edgesOnCell % array
east => block % mesh % east % array
north => block % mesh % north % array
- edge_normal => block % mesh % edge_normal % array
+ edge_normal => block % mesh % edgeNormalVectors % array
pressure => block % time_levs(1) % state % pressure % array
scalars => block % time_levs(1) % state % scalars % array
scalars_phys_tend => block % time_levs(1) % state % scalars_phys_tend % array
</font>
</pre>