<p><b>laura@ucar.edu</b> 2012-05-14 13:42:02 -0600 (Mon, 14 May 2012)</p><p>In the subroutine init_atm_test_case_gfs, added a correction to the calculation of the arrays hs and ter inside the loop that handles the terrain smoothing so that zgrid at the surface does not become negative close to the coasts and islands, in particular, for low resolution grids.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/atmos_physics/src/core_init_nhyd_atmos/mpas_init_atm_test_cases.F
===================================================================
--- branches/atmos_physics/src/core_init_nhyd_atmos/mpas_init_atm_test_cases.F        2012-05-14 19:33:50 UTC (rev 1907)
+++ branches/atmos_physics/src/core_init_nhyd_atmos/mpas_init_atm_test_cases.F        2012-05-14 19:42:02 UTC (rev 1908)
@@ -3039,22 +3039,27 @@
 
          do iCell=1,grid%nCells
             hs(iCell) = 0.
-            do j = 1,nEdgesOnCell(iCell)
-               hs(iCell) = hs(iCell) + dvEdge(edgesOnCell(j,iCell))    &amp;
-                                     / dcEdge(edgesOnCell(j,iCell))    &amp;
-                                     *   (ter(cellsOnCell(j,iCell))-ter(iCell))
-            end do
+            if(ter(iCell) .ne. 0.) then
+               do j = 1,nEdgesOnCell(iCell)
+                  hs(iCell) = hs(iCell) + dvEdge(edgesOnCell(j,iCell))    &amp;
+                                        / dcEdge(edgesOnCell(j,iCell))    &amp;
+                                        * (ter(cellsOnCell(j,iCell))-ter(iCell))
+               end do
+            endif
             hs(iCell) = ter(iCell) + 0.25*hs(iCell)
          end do
 
          do iCell=1,grid %nCells
             ter(iCell) = 0.
-            do j = 1,nEdgesOnCell(iCell)
-               ter(iCell) = ter(iCell) + dvEdge(edgesOnCell(j,iCell))    &amp;
-                                     / dcEdge(edgesOnCell(j,iCell))    &amp;
-                                     *    (hs(cellsOnCell(j,iCell))-hs(iCell))
-            end do
-            ter(iCell) = hs(iCell) - 0.25*ter(iCell)
+            if(hs(iCell) .ne. 0.) then
+               do j = 1,nEdgesOnCell(iCell)
+                  ter(iCell) = ter(iCell) + dvEdge(edgesOnCell(j,iCell))    &amp;
+                                          / dcEdge(edgesOnCell(j,iCell))    &amp;
+                                          * (hs(cellsOnCell(j,iCell))-hs(iCell))
+               end do
+            endif
+!           ter(iCell) = hs(iCell) - 0.25*ter(iCell)
+            ter(iCell) = hs(iCell) - 0.125*ter(iCell)
          end do
 
          ! note that ther variable ter used throughout this section is a pointer to grid % ter % array, here we are passing ter's parent field

</font>
</pre>