<p><b>ringler@lanl.gov</b> 2011-10-20 16:17:57 -0600 (Thu, 20 Oct 2011)</p><p><br>
remove isolated, subsurface cells (as per Mark's finding)<br>
<br>
remove odd shift of pi/2 for all fields. this causes problems when trying to find<br>
remapping weights between MPAS-O grids and atmosphere grids.<br>
<br>
remove print statements from module_cullLoops<br>
</p><hr noshade><pre><font color="gray">Modified: branches/ocean_projects/basin/src/basin.F
===================================================================
--- branches/ocean_projects/basin/src/basin.F        2011-10-20 17:21:52 UTC (rev 1110)
+++ branches/ocean_projects/basin/src/basin.F        2011-10-20 22:17:57 UTC (rev 1111)
@@ -498,7 +498,7 @@
   zin = zEdgeNew(iEdge)
   rlon = lonEdgeNew(iEdge)/dtr
   rlat = latEdgeNew(iEdge)/dtr
-  ix = nint(rlon/0.1 - 0.05) + nlon/2 + 1
+  ix = nint(rlon/0.1 - 0.05) + 1
   ix = mod(ix,nlon)+1
   iy = nlat
   do jcount=1,nlat
@@ -507,9 +507,6 @@
     exit
    endif
   enddo
- !stress = -0.1*cos(3.0*latEdgeNew(iEdge))
- !ulon = stress
- !ulat = 0.0
   ulon = TAUX(ix,iy)
   ulat = TAUY(ix,iy)
   write(6,*) rlon, t_lon(ix), rlat, t_lat(iy)
@@ -546,7 +543,7 @@
   if(mod(iCell,100).eq.0) write(6,*) 'l_woce t and s',iCell
   rlon = lonCellNew(iCell)/dtr
   rlat = latCellNew(iCell)/dtr
-  ix = nint(rlon/0.1 - 0.05) + nlon/2 + 1
+  ix = nint(rlon/0.1 - 0.05) + 1
   ix = mod(ix,nlon)+1
   iy = nlat
   do j=1,nlat
@@ -1076,7 +1073,7 @@
 implicit none
 real (kind=4), allocatable, dimension(:) :: x,y, work_kmt
 real (kind=4), allocatable, dimension(:,:) :: ztopo
-integer :: nx, ny, inx, iny, ix, iy
+integer :: nx, ny, inx, iny, ix, iy, kmt_neighbor_max
 real :: pi, dtr, zdata, rlon, rlat, r, ymin, ymax, xmin, xmax
 real :: latmin, latmax, lonmin, lonmax
 logical :: flag, kmt_flag
@@ -1148,7 +1145,7 @@
     do iCell=1,nCells
         rlon = lonCell(iCell) / dtr
         rlat = latCell(iCell) / dtr
-        ix = nint((rlon+180)*30) + nx/2
+        ix = nint(rlon*30)
         ix = mod(ix,nx)+1
         iy = nint((rlat+90 )*30)
         ix = max(1,ix); ix = min(nx,ix)
@@ -1182,6 +1179,17 @@
     deallocate(ztopo)
 endif
 
+! Eliminate isolated ocean cells, and make these isolated deep cells
+! flush with the deepest neighbor.
+do iCell=1,nCells
+   kmt_neighbor_max = 0
+   do j=1,nEdgesOnCell(iCell)
+      iCell1 = cellsOnCell(j,iCell)
+      kmt_neighbor_max = max(kmt_neighbor_max,kmt(iCell1))
+   enddo
+   kmt(iCell) = min(kmt(iCell),kmt_neighbor_max)
+enddo
+
 ! eliminate isolated ocean cells
 do iCell=1,nCells
     flag = .true.

Modified: branches/ocean_projects/basin/src/module_cullLoops.F
===================================================================
--- branches/ocean_projects/basin/src/module_cullLoops.F        2011-10-20 17:21:52 UTC (rev 1110)
+++ branches/ocean_projects/basin/src/module_cullLoops.F        2011-10-20 22:17:57 UTC (rev 1111)
@@ -48,7 +48,7 @@
 
          ! the working cell will be jCell, so set jCell=iCell to start
          jCell = iCell
-         write(6,*) 'setting jCell: ', jCell
+      !  write(6,*) 'setting jCell: ', jCell
 
          atBoundary=.false.   ! are we at a boundary?
          lCell = -1           ! when at a boundary, what is the index of the land cell or our right?
@@ -82,7 +82,7 @@
             jCell = iSave
             endif
 
-            if(moveSouth.and..not.atBoundary) write(6,*) '      pushing on to the south : ', jCell
+      !     if(moveSouth.and..not.atBoundary) write(6,*) '      pushing on to the south : ', jCell
               
          enddo ! .not.atBoundary
 
@@ -113,11 +113,11 @@
            if(KMT(iCellAhead).gt.0) then
                oCell = iCellAhead
                RightTurns = RightTurns + 1
-               write(6,*) '         the cell ahead is ocean, will turn right ', lCell, oCell
+            !  write(6,*) '         the cell ahead is ocean, will turn right ', lCell, oCell
            else
                lCell = iCellAhead
                LeftTurns = LeftTurns + 1
-               write(6,*) '         the cell ahead is land, will turn left ', lCell, oCell
+            !  write(6,*) '         the cell ahead is land, will turn left ', lCell, oCell
            endif
            iSharedEdge = sharedEdge(oCell,lCell,nCells,maxEdges,nEdgesOnCell,edgesOnCell)
         

</font>
</pre>