<p><b>ringler@lanl.gov</b> 2010-04-30 13:22:23 -0600 (Fri, 30 Apr 2010)</p><p><br>
files changed: pop_to_mpas.F and module_write_netcdf.F<br>
<br>
reasons:<br>
1. add rho to grid.nc file, this can be used as layer density of isopycnal runs or overwritten for z-level runs<br>
2. remove option to rotate cellsOnVertex (having a 0 (zero) in cellsOnVertex(1,:) is now accommated in the lateral_boundary branch)<br>
</p><hr noshade><pre><font color="gray">Modified: branches/ocean_projects/grid_gen_ocean/pop_to_mpas/module_write_netcdf.F
===================================================================
--- branches/ocean_projects/grid_gen_ocean/pop_to_mpas/module_write_netcdf.F        2010-04-30 18:58:39 UTC (rev 228)
+++ branches/ocean_projects/grid_gen_ocean/pop_to_mpas/module_write_netcdf.F        2010-04-30 19:22:23 UTC (rev 229)
@@ -59,6 +59,7 @@
    integer :: wrVarIDcirculation
    integer :: wrVarIDvorticity
    integer :: wrVarIDke
+   integer :: wrVarIDrho
    integer :: wrVarIDtracers
  
    integer :: wrLocalnCells
@@ -248,6 +249,10 @@
       dimlist( 2) = wrDimIDnCells
       dimlist( 3) = wrDimIDTime
       nferr = nf_def_var(wr_ncid, 'ke', NF_DOUBLE,  3, dimlist, wrVarIDke)
+      dimlist( 1) = wrDimIDnVertLevels
+      dimlist( 2) = wrDimIDnCells
+      dimlist( 3) = wrDimIDTime
+      nferr = nf_def_var(wr_ncid, 'rho', NF_DOUBLE,  3, dimlist, wrVarIDrho)
       dimlist( 1) = wrDimIDnTracers
       dimlist( 2) = wrDimIDnVertLevels
       dimlist( 3) = wrDimIDnCells
@@ -309,6 +314,7 @@
                                   circulation, &amp;
                                   vorticity, &amp;
                                   ke, &amp;
+                                  rho, &amp;
                                   tracers &amp;
                                  )
  
@@ -365,6 +371,7 @@
       real (kind=8), dimension(:,:,:), intent(in) :: circulation
       real (kind=8), dimension(:,:,:), intent(in) :: vorticity
       real (kind=8), dimension(:,:,:), intent(in) :: ke
+      real (kind=8), dimension(:,:,:), intent(in) :: rho
       real (kind=8), dimension(:,:,:,:), intent(in) :: tracers
  
       integer :: nferr
@@ -605,6 +612,12 @@
       count3( 2) = wrLocalnCells
       count3( 3) = 1
       nferr = nf_put_vara_double(wr_ncid, wrVarIDke, start3, count3, ke)
+
+      start3(3) = time
+      count3( 1) = wrLocalnVertLevels
+      count3( 2) = wrLocalnCells
+      count3( 3) = 1
+      nferr = nf_put_vara_double(wr_ncid, wrVarIDrho, start3, count3, rho)
  
       start4(4) = time
       count4( 1) = wrLocalnTracers

Modified: branches/ocean_projects/grid_gen_ocean/pop_to_mpas/pop_to_mpas.F
===================================================================
--- branches/ocean_projects/grid_gen_ocean/pop_to_mpas/pop_to_mpas.F        2010-04-30 18:58:39 UTC (rev 228)
+++ branches/ocean_projects/grid_gen_ocean/pop_to_mpas/pop_to_mpas.F        2010-04-30 19:22:23 UTC (rev 229)
@@ -34,7 +34,7 @@
    real (kind=8), allocatable, dimension(:) :: latVertex, lonVertex, xVertex, yVertex, zVertex
    real (kind=8), allocatable, dimension(:,:) :: weightsOnEdge, kiteAreasOnVertex, u_src
    real (kind=8), allocatable, dimension(:) :: fEdge, fVertex, h_s
-   real (kind=8), allocatable, dimension(:,:,:) :: u, v, h, vh, circulation, vorticity, ke
+   real (kind=8), allocatable, dimension(:,:,:) :: u, v, h, vh, circulation, vorticity, ke, rho
    real (kind=8), allocatable, dimension(:,:,:,:) :: tracers
 
    integer :: i, j, np, iCell, iVertex, iEdge, iEdge_s, iVertex_s
@@ -379,6 +379,7 @@
    allocate(circulation(nVertLevels,nVertices,1))
    allocate(vorticity(nVertLevels,nVertices,1))
    allocate(ke(nVertLevels,nCells,1))
+   allocate(rho(nVertLevels,nCells,1))
    allocate(tracers(nTracers,nVertLevels,nCells,1))
 
    latCell = 0.0
@@ -932,6 +933,7 @@
    fEdge(:) = 0.0
    fVertex(:) = 0.0
    h_s(:) = 0.0
+   rho(:,:,:) = 1000.0
    u(:,:,:) = 0.0
    v(:,:,:) = 0.0
    vh(:,:,:) = 0.0
@@ -1042,30 +1044,29 @@
    yEdge = yEdge/xscale
    zEdge = zEdge/xscale
 
-   write(6,*) 'rotating cellsOnVertex'
-   do iVertex=1,nVertices
-     do while (cellsOnVertex(1,iVertex).eq.0)
-       do j=2,nVertexDegree
-         cellsOnVertex(j-1,iVertex) = cellsOnVertex(j,iVertex)
-         kiteAreasOnVertex(j-1,iVertex) = kiteAreasOnVertex(j,iVertex)
-       enddo
-       cellsOnVertex(nVertexDegree,iVertex) = 0
-       kiteAreasOnVertex(nVertexDegree,iVertex) = 0.0
-     end do
-   enddo
+!  write(6,*) 'rotating cellsOnVertex'
+!  do iVertex=1,nVertices
+!    do while (cellsOnVertex(1,iVertex).eq.0)
+!      do j=2,nVertexDegree
+!        cellsOnVertex(j-1,iVertex) = cellsOnVertex(j,iVertex)
+!        kiteAreasOnVertex(j-1,iVertex) = kiteAreasOnVertex(j,iVertex)
+!      enddo
+!      cellsOnVertex(nVertexDegree,iVertex) = 0
+!      kiteAreasOnVertex(nVertexDegree,iVertex) = 0.0
+!    end do
+!  enddo
 
-   do iVertex=1,nVertices
-     if(cellsOnVertex(1,iVertex).eq.0) then
-        write(6,*) cellsOnVertex(:,iVertex)
-        stop
-     endif
-   enddo
+!  do iVertex=1,nVertices
+!    if(cellsOnVertex(1,iVertex).eq.0) then
+!       write(6,*) cellsOnVertex(:,iVertex)
+!       stop
+!    endif
+!  enddo
 
-   write(6,*) minval(cellsOnEdge(1,:)), maxval(cellsOnEdge(1,:))
-   write(6,*) minval(cellsOnEdge(2,:)), maxval(cellsOnEdge(2,:))
+!  write(6,*) minval(cellsOnEdge(1,:)), maxval(cellsOnEdge(1,:))
+!  write(6,*) minval(cellsOnEdge(2,:)), maxval(cellsOnEdge(2,:))
 
 
-
 !
 ! multiply by radius to convert from unit sphere to real earth
 !
@@ -1140,6 +1141,7 @@
                              circulation, &amp;
                              vorticity, &amp;
                              ke, &amp;
+                             rho, &amp;
                              tracers &amp;
                             )
 

</font>
</pre>