<p><b>duda</b> 2013-02-28 11:20:10 -0700 (Thu, 28 Feb 2013)</p><p>BRANCH COMMIT<br>
<br>
Bug fix for initialization: The maximum terrain height, hm, that is used in <br>
the vertical coordinate smoothing code needs to be the global maximum for <br>
correct parallel results.<br>
<br>
<br>
M    src/core_init_nhyd_atmos/mpas_init_atm_test_cases.F<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        2013-02-28 18:06:57 UTC (rev 2515)
+++ branches/atmos_physics/src/core_init_nhyd_atmos/mpas_init_atm_test_cases.F        2013-02-28 18:20:10 UTC (rev 2516)
@@ -2309,7 +2309,7 @@
       type (field1DReal), target :: tempFieldTarget
 
       real(kind=RKIND), dimension(:), pointer :: hs, hs1
-      real(kind=RKIND) :: hm, zh, dzmin, dzmina, dzmina_global, dzminf, sm
+      real(kind=RKIND) :: hm, hm_global, zh, dzmin, dzmina, dzmina_global, dzminf, sm
       integer :: nsmterrain, kz, sfc_k
       logical :: hybrid, smooth
 
@@ -2535,7 +2535,9 @@
          hx(:,iCell) = ter(iCell)
       end do
 
-      hm = maxval(ter(:))
+      hm = maxval(ter(1:nCellsSolve))
+      call mpas_dmpar_max_real(dminfo, hm, hm_global)
+      hm = hm_global
       write(0,*) &quot;max ter = &quot;, hm
 
 !     Metrics for hybrid coordinate and vertical stretching
@@ -2675,7 +2677,7 @@
                call mpas_dmpar_exch_halo_field(tempField)
 
              !  dzmina = minval(hs(:)-hx(k-1,:))
-               dzmina = minval(zw(k)+ah(k)*hs(1:grid%nCellsSolve)-zw(k-1)-ah(k-1)*hx(k-1,1:grid%nCellsSolve))
+               dzmina = minval(zw(k)+ah(k)*hs(1:nCellsSolve)-zw(k-1)-ah(k-1)*hx(k-1,1:nCellsSolve))
                call mpas_dmpar_min_real(dminfo, dzmina, dzmina_global)
              !  write(0,*) ' k,i, dzmina, dzmin, zw(k)-zw(k-1) ', k,i, dzmina, dzmin, zw(k)-zw(k-1)
                if (dzmina_global &gt;= dzmin*(zw(k)-zw(k-1))) then

</font>
</pre>