<p><b>qchen3@fsu.edu</b> 2011-12-13 17:30:36 -0700 (Tue, 13 Dec 2011)</p><p>TRUNK COMMIT<br>
<br>
This is to fix a bug in the shallow water code. For the calculations of the visc4 diffusion, vorticity and divergence need to updated on the halos. In the orginal version of the code, the time_level 2 of these variables are updated, which is not necessary, and wrong. This has been corrected, i.e. these two variables of provis are now being updated. <br>
<br>
A test is done on the 10242-cell global quasi-uniform grid, using 8 partitions, and with the config_h_mom_visc4 set to 10000000000000.0 so that the visc4 diffusion is actually turned on. In the result I did not see any anomalies. <br>
<br>
This bug has been confirmed by Mark Petersen, who also pointed out that the correct code should be exactly the same as that in the ocean core. I verified that the codes in questioning are exactly the same in the ocean and sw cores.  <br>
</p><hr noshade><pre><font color="gray">Modified: trunk/mpas/src/core_sw/mpas_sw_time_integration.F
===================================================================
--- trunk/mpas/src/core_sw/mpas_sw_time_integration.F        2011-12-13 23:31:56 UTC (rev 1255)
+++ trunk/mpas/src/core_sw/mpas_sw_time_integration.F        2011-12-14 00:30:36 UTC (rev 1256)
@@ -123,10 +123,10 @@
                                             block % parinfo % edgesToSend, block % parinfo % edgesToRecv)
 
            if (config_h_mom_eddy_visc4 &gt; 0.0) then
-              call mpas_dmpar_exch_halo_field2d_real(domain % dminfo, block % state % time_levs(2) % state % divergence % array(:,:), &amp;
+              call mpas_dmpar_exch_halo_field2d_real(domain % dminfo, provis % divergence % array(:,:), &amp;
                                                block % mesh % nVertLevels, block % mesh % nCells, &amp;
                                                block % parinfo % cellsToSend, block % parinfo % cellsToRecv)
-              call mpas_dmpar_exch_halo_field2d_real(domain % dminfo, block % state % time_levs(2) % state % vorticity % array(:,:), &amp;
+              call mpas_dmpar_exch_halo_field2d_real(domain % dminfo, provis % vorticity % array(:,:), &amp;
                                                block % mesh % nVertLevels, block % mesh % nVertices, &amp;
                                                block % parinfo % verticesToSend, block % parinfo % verticesToRecv)
            end if

</font>
</pre>