<p><b>ringler@lanl.gov</b> 2012-04-27 16:12:22 -0600 (Fri, 27 Apr 2012)</p><p><br>
flip indices to be consistent with MPAS parsing<br>
</p><hr noshade><pre><font color="gray">Modified: branches/ocean_projects/basin/src/basin.F
===================================================================
--- branches/ocean_projects/basin/src/basin.F        2012-04-27 21:56:20 UTC (rev 1835)
+++ branches/ocean_projects/basin/src/basin.F        2012-04-27 22:12:22 UTC (rev 1836)
@@ -664,7 +664,7 @@
   ulat = TAUY_MONTHLY(ix,iy,iMonth)
   call transform_from_lonlat_to_xyz(xin,yin,zin,ulon,ulat,ux,uy,uz)
   if(boundaryEdgeNew(1,iEdge).eq.1) then
-    windStressMonthlyNew(iEdge,iMonth) = 0.0
+    windStressMonthlyNew(iMonth,iEdge) = 0.0
   else
     iCell1 = cellsOnEdgeNew(1,iEdge)
     iCell2 = cellsOnEdgeNew(2,iEdge)
@@ -672,7 +672,7 @@
     q(1) = xCellNew(iCell2); q(2) = yCellNew(iCell2); q(3) = zCellNew(iCell2)
     q = q - p
     call unit_vector_in_3space(q)
-    windStressMonthlyNew(iEdge,iMonth) = ux*q(1) + uy*q(2) + uz*q(3)
+    windStressMonthlyNew(iMonth,iEdge) = ux*q(1) + uy*q(2) + uz*q(3)
   endif
   enddo
 enddo
@@ -814,11 +814,11 @@
      enddo  !i
 
     if(ndata.gt.0) then
-      temperatureRestoreMonthlyNew(iCell,iMonth) = temp_t / float(ndata)
-      salinityRestoreMonthlyNew(iCell,iMonth) = temp_s / float(ndata)
+      temperatureRestoreMonthlyNew(iMonth,iCell) = temp_t / float(ndata)
+      salinityRestoreMonthlyNew(iMonth,iCell) = temp_s / float(ndata)
     else
-      temperatureRestoreMonthlyNew(iCell,iMonth) = temperatureNew(1,1,iCell)
-      salinityRestoreMonthlyNew(iCell,iMonth) = salinityNew(1,1,iCell)
+      temperatureRestoreMonthlyNew(iMonth,iCell) = temperatureNew(1,1,iCell)
+      salinityRestoreMonthlyNew(iMonth,iCell) = salinityNew(1,1,iCell)
     endif
 
   enddo  ! iCell
@@ -829,20 +829,20 @@
 do iCell=1,nCellsNew
   k=1
   ndata=1
-  temp_t = temperatureRestoreMonthlyNew(iCell,iMonth)
-  temp_s = salinityRestoreMonthlyNew(iCell,iMonth)
+  temp_t = temperatureRestoreMonthlyNew(iMonth,iCell)
+  temp_s = salinityRestoreMonthlyNew(iMonth,iCell)
   do j=1,nEdgesOnCellNew(iCell)
     jCell = cellsOnCellNew(j,iCell)
     if(jCell.gt.0) then
     if(maxLevelCellNew(jCell).ge.k) then
-      temp_t = temp_t + temperatureRestoreMonthlyNew(iCell,iMonth)
-      temp_s = temp_s + salinityRestoreMonthlyNew(iCell,iMonth)
+      temp_t = temp_t + temperatureRestoreMonthlyNew(iMonth,iCell)
+      temp_s = temp_s + salinityRestoreMonthlyNew(iMonth,iCell)
       ndata = ndata + 1
     endif
     endif
   enddo  ! j
-  temperatureRestoreMonthlyNew(iCell,iMonth) = temp_t / ndata
-  salinityRestoreMonthlyNew(iCell,iMonth) = temp_s / ndata
+  temperatureRestoreMonthlyNew(iMonth,iCell) = temp_t / ndata
+  salinityRestoreMonthlyNew(iMonth,iCell) = temp_s / ndata
 enddo  ! iCell
 enddo  ! iter
 
@@ -1555,7 +1555,7 @@
 allocate(fVertexNew(nVerticesNew))
 allocate(h_sNew(nCellsNew))
 allocate(u_srcNew(nVertLevelsNew,nEdgesNew))
-allocate(windStressMonthlyNew(nEdgesNew,12))
+allocate(windStressMonthlyNew(12,nEdgesNew))
 allocate(uNew(1,nVertLevelsNew,nEdgesNew))
 allocate(vNew(1,nVertLevelsNew,nEdgesNew))
 allocate(hNew(1,nVertLevelsNew,nCellsNew))
@@ -1569,8 +1569,8 @@
 allocate(temperatureRestoreNew(nCellsNew))
 allocate(salinityRestoreNew(nCellsNew))
 
-allocate(temperatureRestoreMonthlyNew(nCellsNew,12))
-allocate(salinityRestoreMonthlyNew(nCellsNew,12))
+allocate(temperatureRestoreMonthlyNew(12,nCellsNew))
+allocate(salinityRestoreMonthlyNew(12,nCellsNew))
 
 
 xCellNew=0; yCellNew=0; zCellNew=0; latCellNew=0; lonCellNew=0; meshDensityNew=1.0; meshSpacingNew=0.0

Modified: branches/ocean_projects/basin/src/module_write_netcdf.F
===================================================================
--- branches/ocean_projects/basin/src/module_write_netcdf.F        2012-04-27 21:56:20 UTC (rev 1835)
+++ branches/ocean_projects/basin/src/module_write_netcdf.F        2012-04-27 22:12:22 UTC (rev 1836)
@@ -232,11 +232,11 @@
       dimlist( 1) = wrDimIDnCells
       nferr = nf_def_var(wr_ncid, 'salinityRestore', NF_DOUBLE,  1, dimlist, wrVarIDsalinityRestore)
 
-      dimlist( 1) = wrDimIDnCells
-      dimlist( 2) = wrDimIDnMonths
+      dimlist( 1) = wrDimIDnMonths
+      dimlist( 2) = wrDimIDnCells
       nferr = nf_def_var(wr_ncid, 'temperatureRestoreMonthly', NF_DOUBLE,  2, dimlist, wrVarIDtemperatureRestoreMonthly)
-      dimlist( 1) = wrDimIDnCells
-      dimlist( 2) = wrDimIDnMonths
+      dimlist( 1) = wrDimIDnMonths
+      dimlist( 2) = wrDimIDnCells
       nferr = nf_def_var(wr_ncid, 'salinityRestoreMonthly', NF_DOUBLE,  2, dimlist, wrVarIDsalinityRestoreMonthly)
 
       dimlist( 1) = wrDimIDnVertLevels
@@ -257,8 +257,8 @@
       dimlist( 2) = wrDimIDnEdges
       nferr = nf_def_var(wr_ncid, 'u_src', NF_DOUBLE,  2, dimlist, wrVarIDu_src)
 
-      dimlist( 1) = wrDimIDnEdges
-      dimlist( 2) = wrDimIDnMonths
+      dimlist( 1) = wrDimIDnMonths
+      dimlist( 2) = wrDimIDnEdges
       nferr = nf_def_var(wr_ncid, 'windStressMonthly', NF_DOUBLE,  2, dimlist, wrVarIDwindStressMonthly)
 
       dimlist( 1) = wrDimIDnVertLevels
@@ -628,8 +628,8 @@
 
 
       start2(2) = 1
-      count2( 1) = wrLocalnEdges
-      count2( 2) = wrLocalnMonths
+      count2( 1) = wrLocalnMonths
+      count2( 2) = wrLocalnEdges
       nferr = nf_put_vara_double(wr_ncid, wrVarIDwindStressMonthly, start2, count2, windStressMonthly)
 
 
@@ -645,13 +645,13 @@
 
 
       start2(2) = 1
-      count2( 1) = wrLocalnCells
-      count2( 2) = wrLocalnMonths
+      count2( 1) = wrLocalnMonths
+      count2( 2) = wrLocalnCells
       nferr = nf_put_vara_double(wr_ncid, wrVarIDtemperatureRestoreMonthly, start2, count2, temperatureRestoreMonthly)
 
       start2(2) = 1
-      count2( 1) = wrLocalnCells
-      count2( 2) = wrLocalnMonths
+      count2( 1) = wrLocalnMonths
+      count2( 2) = wrLocalnCells
       nferr = nf_put_vara_double(wr_ncid, wrVarIDsalinityRestoreMonthly, start2, count2, salinityRestoreMonthly)
 
 

</font>
</pre>