<p><b>mpetersen@lanl.gov</b> 2012-03-26 09:20:12 -0600 (Mon, 26 Mar 2012)</p><p>Changed gm_var branch, returned gm_Bolus computation to end of diagnostics.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/ocean_projects/gmvar/src/core_ocean/mpas_ocn_gm.F
===================================================================
--- branches/ocean_projects/gmvar/src/core_ocean/mpas_ocn_gm.F        2012-03-26 15:06:15 UTC (rev 1712)
+++ branches/ocean_projects/gmvar/src/core_ocean/mpas_ocn_gm.F        2012-03-26 15:20:12 UTC (rev 1713)
@@ -50,16 +50,19 @@
 
       call ocn_gm_compute_hEddyFlux(s, grid)
 
-      if (config_vert_grid_type .EQ. 'z-level') then
-         ! Nothing for now
-         uBolusGM(:,:) = 0.0
+      if (config_vert_grid_type .EQ. 'isopycnal') then
 
-      else if (config_vert_grid_type .EQ. 'isopycnal') then
          do iEdge = 1, nEdges
             do k = 1, maxLevelEdgeTop(iEdge)
                uBolusGM(k,iEdge) = hEddyFlux(k,iEdge)/h_edge(k,iEdge)
             end do
          end do
+
+      else
+
+         ! Nothing for now for all other grid types (zlevel, zstar, ztilde)
+         uBolusGM(:,:) = 0.0
+
       end if
 
    end subroutine ocn_gm_compute_uBolus
@@ -87,11 +90,7 @@
 
       hEddyFlux(:,:) = 0.0
 
-      if (config_vert_grid_type .EQ. 'z-level') then
-
-         !Nothing for now
-
-      else if (config_vert_grid_type .EQ. 'isopycnal') then
+      if (config_vert_grid_type .EQ. 'isopycnal') then
             do iEdge = 1,nEdges
                cell1 = cellsOnEdge(1,iEdge)
                cell2 = cellsOnEdge(2,iEdge)
@@ -99,7 +98,11 @@
                   hEddyFlux(k,iEdge) = -config_h_kappa * (h(k,cell2) - h(k,cell1)) / dcEdge(iEdge)
                end do
             end do
-       end if
+      else
+
+         !Nothing for now for all other grid types (zlevel, zstar, ztilde)
+
+      end if
                   
    end subroutine ocn_gm_compute_hEddyFlux
 

Modified: branches/ocean_projects/gmvar/src/core_ocean/mpas_ocn_tendency.F
===================================================================
--- branches/ocean_projects/gmvar/src/core_ocean/mpas_ocn_tendency.F        2012-03-26 15:06:15 UTC (rev 1712)
+++ branches/ocean_projects/gmvar/src/core_ocean/mpas_ocn_tendency.F        2012-03-26 15:20:12 UTC (rev 1713)
@@ -292,7 +292,7 @@
       call mpas_timer_start(&quot;ocn_tend_scalar&quot;)
 
       u           =&gt; s % u % array
-      uTransport           =&gt; s % uTransport % array
+      uTransport  =&gt; s % uTransport % array
       h           =&gt; s % h % array
       wTop        =&gt; s % wTop % array
       tracers     =&gt; s % tracers % array
@@ -307,9 +307,9 @@
       ! QC Comment (3/15/12): need to make sure that uTransport is the right
       ! transport velocity for the tracer.
       do iEdge = 1, grid % nEdges
-        do k = 1, grid % nVertLevels
+         do k = 1, grid % nVertLevels
             uh(k, iEdge) = uTransport(k, iEdge) * h_edge(k, iEdge)
-        end do
+         end do
       end do
 
       !
@@ -426,7 +426,7 @@
       h           =&gt; s % h % array
       u           =&gt; s % u % array
       uTransport  =&gt; s % uTransport % array
-      uBolusGM      =&gt; s % uBolusGM % array
+      uBolusGM    =&gt; s % uBolusGM % array
       v           =&gt; s % v % array
       h_edge      =&gt; s % h_edge % array
       circulation =&gt; s % circulation % array
@@ -851,8 +851,14 @@
 !      end if
 ! mrp 120323 end
 
+      ! Apply the GM closure as a bolus velocity
+      if (config_h_kappa .GE. epsilon(0D0)) then
+         call ocn_gm_compute_uBolus(s,grid)
+      else
+        ! mrp efficiency note: if uBolusGM is guaranteed to be zero, this can be removed.
+        uBolusGM(:,:) = 0.0
+      end if
 
-
    end subroutine ocn_diagnostic_solve!}}}
 
 !***********************************************************************

Modified: branches/ocean_projects/gmvar/src/core_ocean/mpas_ocn_time_integration_rk4.F
===================================================================
--- branches/ocean_projects/gmvar/src/core_ocean/mpas_ocn_time_integration_rk4.F        2012-03-26 15:06:15 UTC (rev 1712)
+++ branches/ocean_projects/gmvar/src/core_ocean/mpas_ocn_time_integration_rk4.F        2012-03-26 15:20:12 UTC (rev 1713)
@@ -25,7 +25,6 @@
 
    use ocn_equation_of_state
    use ocn_vmix
-   use ocn_gm
    use ocn_time_average
 
    implicit none
@@ -243,14 +242,6 @@
               call ocn_diagnostic_solve(dt, provis, block % mesh)
 
 ! mrp 120323 add:
-              ! Apply the GM closure as a bolus velocity
-              if(config_h_kappa .GE. epsilon(0D0)) then
-                 call ocn_gm_compute_uBolus(provis, block % mesh)
-              else
-                 ! mrp efficiency note: if uBolusGM is guaranteed to be zero, this can be removed.
-                 provis % uBolusGM % array(:,:) = 0.0
-              end if
-
               provis % uTransport % array(:,:) = provis % u % array(:,:) + provis % uBolusGM % array(:,:)
 ! mrp 120323 end
 
@@ -357,14 +348,6 @@
          call ocn_diagnostic_solve(dt, block % state % time_levs(2) % state, block % mesh)
 
 ! mrp 120323 add:
-         ! Apply the GM closure as a bolus velocity
-         if (config_h_kappa .GE. epsilon(0D0)) then
-             call ocn_gm_compute_uBolus(block % state % time_levs(2) % state, block % mesh)
-         else
-            ! mrp efficiency note: if uBolusGM is guaranteed to be zero, this can be removed.
-            block % state % time_levs(2) % state % uBolusGM % array(:,:) = 0.0
-         end if
-
             block % state % time_levs(2) % state % uTransport % array(:,:) &amp;
           = block % state % time_levs(2) % state % u % array(:,:) &amp;
           + block % state % time_levs(2) % state % uBolusGM % array(:,:)

</font>
</pre>