<p><b>mpetersen@lanl.gov</b> 2012-10-19 11:31:56 -0600 (Fri, 19 Oct 2012)</p><p>branch commit: partial_bottom_cells.  Merge trunk to branch.<br>
</p><hr noshade><pre><font color="gray">Index: branches/ocean_projects/partial_bottom_cells
===================================================================
--- branches/ocean_projects/partial_bottom_cells        2012-10-19 17:11:57 UTC (rev 2225)
+++ branches/ocean_projects/partial_bottom_cells        2012-10-19 17:31:56 UTC (rev 2226)

Property changes on: branches/ocean_projects/partial_bottom_cells
___________________________________________________________________
Modified: svn:mergeinfo
## -20,4 +20,4 ##
 /branches/omp_blocks/multiple_blocks:1803-2084
 /branches/source_renaming:1082-1113
 /branches/time_manager:924-962
-/trunk/mpas:2172-2198
+/trunk/mpas:2172-2225
\ No newline at end of property
Modified: branches/ocean_projects/partial_bottom_cells/src/core_init_nhyd_atmos/mpas_init_atm_test_cases.F
===================================================================
--- branches/ocean_projects/partial_bottom_cells/src/core_init_nhyd_atmos/mpas_init_atm_test_cases.F        2012-10-19 17:11:57 UTC (rev 2225)
+++ branches/ocean_projects/partial_bottom_cells/src/core_init_nhyd_atmos/mpas_init_atm_test_cases.F        2012-10-19 17:31:56 UTC (rev 2226)
@@ -6229,10 +6229,12 @@
          nearest_distance = current_distance
          do i = 1, nEdgesOnCell(current_cell)
             iCell = cellsOnCell(i,current_cell)
-            d = sphere_distance(latCell(iCell), lonCell(iCell), target_lat, target_lon, 1.0_RKIND)
-            if (d &lt; nearest_distance) then
-               nearest_cell = iCell
-               nearest_distance = d
+            if (iCell &lt;= nCells) then
+               d = sphere_distance(latCell(iCell), lonCell(iCell), target_lat, target_lon, 1.0_RKIND)
+               if (d &lt; nearest_distance) then
+                  nearest_cell = iCell
+                  nearest_distance = d
+               end if
             end if
          end do
       end do
@@ -6281,10 +6283,12 @@
          end if
          do i = 1, nEdgesOnCell(iCell)
             iEdge = edgesOnCell(i,iCell)
-            d = sphere_distance(latEdge(iEdge), lonEdge(iEdge), target_lat, target_lon, 1.0_RKIND)
-            if (d &lt; nearest_distance) then
-               nearest_edge = iEdge
-               nearest_distance = d
+            if (iEdge &lt;= nEdges) then
+               d = sphere_distance(latEdge(iEdge), lonEdge(iEdge), target_lat, target_lon, 1.0_RKIND)
+               if (d &lt; nearest_distance) then
+                  nearest_edge = iEdge
+                  nearest_distance = d
+               end if
             end if
          end do
       end do

Modified: branches/ocean_projects/partial_bottom_cells/src/registry/gen_inc.c
===================================================================
--- branches/ocean_projects/partial_bottom_cells/src/registry/gen_inc.c        2012-10-19 17:11:57 UTC (rev 2225)
+++ branches/ocean_projects/partial_bottom_cells/src/registry/gen_inc.c        2012-10-19 17:31:56 UTC (rev 2226)
@@ -143,8 +143,8 @@
          fortprintf(fd, &quot;            call mpas_dmpar_abort(dminfo)</font>
<font color="black">&quot;);
          fortprintf(fd, &quot;         else if (ierr &lt; 0) then</font>
<font color="black">&quot;);
          fortprintf(fd, &quot;            write(0,*) \'Namelist record &amp;%s not found; using default values for this namelist\'\'s variables\'</font>
<font color="red">&quot;,nls_ptr-&gt;record);
-         fortprintf(fd, &quot;            rewind(funit)</font>
<font color="black">&quot;);
          fortprintf(fd, &quot;         end if</font>
<font color="blue">&quot;);
+         fortprintf(fd, &quot;         rewind(funit)</font>
<font color="black">&quot;);
 
          dict_insert(dictionary, nls_ptr-&gt;record);
       }

</font>
</pre>