<p><b>dwj07@fsu.edu</b> 2011-11-30 11:53:19 -0700 (Wed, 30 Nov 2011)</p><p><br>
        -- BRANCH COMMIT --<br>
<br>
        Cleaning up the efficiency flags from split_explicit. Three still remain, need to explore how to fix them.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/ocean_projects/performance/src/core_ocean/mpas_ocn_time_integration_split.F
===================================================================
--- branches/ocean_projects/performance/src/core_ocean/mpas_ocn_time_integration_split.F        2011-11-29 22:53:18 UTC (rev 1219)
+++ branches/ocean_projects/performance/src/core_ocean/mpas_ocn_time_integration_split.F        2011-11-30 18:53:19 UTC (rev 1220)
@@ -87,7 +87,7 @@
       integer :: iCell, i,k,j, iEdge, cell1, cell2, split_explicit_step, split, &amp;
                  eoe, oldBtrSubcycleTime, newBtrSubcycleTime, uPerpTime, BtrCorIter, &amp;
                  n_bcl_iter(config_n_ts_iter), &amp;
-                 vertex1, vertex2, iVertex
+                 vertex1, vertex2, iVertex, sshSwapFlag
       
       type (block_type), pointer :: block
       real (kind=RKIND) :: uhSum, hSum, sshEdge, flux, &amp;
@@ -103,6 +103,8 @@
       real (kind=RKIND), dimension(:), allocatable:: A,C,uTemp, hNew
       real (kind=RKIND), dimension(:,:), allocatable:: tracersTemp
 
+      sshSwapFlag = 1
+
       call mpas_timer_start(&quot;se timestep&quot;, .false., timer_main)
 
       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -374,22 +376,14 @@
                           * block % mesh % fEdge  % array(eoe)
                   end do
       
-                  ! mrp 110606 efficiency note: could make this a 1D integer factor instead of an if statement.
-                  if (block % mesh % boundaryEdge % array(1,iEdge).eq.1) then
-                    block % state % time_levs(newBtrSubcycleTime) % state % uBtrSubcycle % array(iEdge) = 0.0
-                  else
-
-                    ! uBtrNew = uBtrOld + dt*(-f*uBtroldPerp - g*grad(SSH) + G)
-                    block % state % time_levs(newBtrSubcycleTime) % state % uBtrSubcycle % array(iEdge) &amp;
-                        = block % state % time_levs(oldBtrSubcycleTime) % state % uBtrSubcycle % array(iEdge) &amp;
-                        + dt / config_n_btr_subcycles * (uPerp - gravity &amp;
-                        * (block % state % time_levs(oldBtrSubcycleTime) % state % sshSubcycle % array(cell2) &amp;
-                        - block % state % time_levs(oldBtrSubcycleTime) % state % sshSubcycle % array(cell1) ) &amp;
-                        / block % mesh % dcEdge % array(iEdge) &amp;
-                        + block % state % time_levs(1) % state % GBtrForcing % array(iEdge))
-
-                  endif
-
+                  ! uBtrNew = uBtrOld + dt*(-f*uBtroldPerp - g*grad(SSH) + G)
+                  block % state % time_levs(newBtrSubcycleTime) % state % uBtrSubcycle % array(iEdge) &amp;
+                     = (block % state % time_levs(oldBtrSubcycleTime) % state % uBtrSubcycle % array(iEdge) &amp;
+                     + dt / config_n_btr_subcycles * (uPerp - gravity &amp;
+                     * (block % state % time_levs(oldBtrSubcycleTime) % state % sshSubcycle % array(cell2) &amp;
+                     - block % state % time_levs(oldBtrSubcycleTime) % state % sshSubcycle % array(cell1) ) &amp;
+                     / block % mesh % dcEdge % array(iEdge) &amp;
+                     + block % state % time_levs(1) % state % GBtrForcing % array(iEdge))) * block % mesh % edgeMask % array(1, iEdge)
                 end do
 
                 block =&gt; block % next
@@ -496,24 +490,17 @@
                           * block % mesh % fEdge  % array(eoe) 
                   end do
       
-                  ! mrp 110606 efficiency note: could make this a 1D integer factor instead of an if statement.
-                  if (block % mesh % boundaryEdge % array(1,iEdge).eq.1) then
-                    block % state % time_levs(newBtrSubcycleTime) % state % uBtrSubcycle % array(iEdge) = 0.0
-                  else
-                    ! uBtrNew = uBtrOld + dt*(-f*uBtroldPerp - g*grad(SSH) + G)
-                    sshCell1 = (1-config_btr_gam2_SSHWt1)*block % state % time_levs(oldBtrSubcycleTime) % state % sshSubcycle % array(cell1) &amp;
-                             +    config_btr_gam2_SSHWt1 *block % state % time_levs(newBtrSubcycleTime) % state % sshSubcycle % array(cell1)
-      
-                    sshCell2 = (1-config_btr_gam2_SSHWt1)*block % state % time_levs(oldBtrSubcycleTime) % state % sshSubcycle % array(cell2) &amp;
-                             +    config_btr_gam2_SSHWt1 *block % state % time_levs(newBtrSubcycleTime) % state % sshSubcycle % array(cell2)
-      
-                    block % state % time_levs(newBtrSubcycleTime) % state % uBtrSubcycle % array(iEdge) &amp; 
-                        = block % state % time_levs(oldBtrSubcycleTime) % state % uBtrSubcycle % array(iEdge) &amp; 
-                        + dt/config_n_btr_subcycles *(uPerp - gravity *(sshCell2 - sshCell1) /block % mesh % dcEdge % array(iEdge) &amp;
-                        + block % state % time_levs(1) % state % GBtrForcing % array(iEdge) &amp;
-                        + block % state % time_levs(1) % state % u_diffusionBtr % array(iEdge))
-                    ! added del2 diffusion to btr solve
-                  endif
+                  sshCell1 = (1-config_btr_gam2_SSHWt1)*block % state % time_levs(oldBtrSubcycleTime) % state % sshSubcycle % array(cell1) &amp;
+                           +    config_btr_gam2_SSHWt1 *block % state % time_levs(newBtrSubcycleTime) % state % sshSubcycle % array(cell1)
+    
+                  sshCell2 = (1-config_btr_gam2_SSHWt1)*block % state % time_levs(oldBtrSubcycleTime) % state % sshSubcycle % array(cell2) &amp;
+                           +    config_btr_gam2_SSHWt1 *block % state % time_levs(newBtrSubcycleTime) % state % sshSubcycle % array(cell2)
+    
+                  block % state % time_levs(newBtrSubcycleTime) % state % uBtrSubcycle % array(iEdge) &amp; 
+                      = (block % state % time_levs(oldBtrSubcycleTime) % state % uBtrSubcycle % array(iEdge) &amp; 
+                      + dt/config_n_btr_subcycles *(uPerp - gravity *(sshCell2 - sshCell1) /block % mesh % dcEdge % array(iEdge) &amp;
+                      + block % state % time_levs(1) % state % GBtrForcing % array(iEdge) &amp;
+                      + block % state % time_levs(1) % state % u_diffusionBtr % array(iEdge))) * block % mesh % edgeMask % array(1,iEdge)
                 end do
       
                 block =&gt; block % next
@@ -761,7 +748,7 @@
 
               ! mrp 110601 efficiency note: Since h just moves back and forth between pointers,
               ! this is not necessary once initialized.
-              do k=2,block % mesh % nVertLevels
+              do k=2,block % mesh % nVertLevels * sshSwapFlag
                 block % state % time_levs(2) % state % h % array(k,iCell)  = block % mesh % hZLevel % array(k)
               enddo
             enddo ! iCell
@@ -770,6 +757,7 @@
 
             block =&gt; block % next
           end do  ! block
+          sshSwapFlag = 0
         endif ! split_explicit
         call mpas_timer_stop(&quot;se btr vel&quot;, timer_btr_vel)
 
@@ -963,10 +951,6 @@
             block % state % time_levs(2) % state % u % array(k,iEdge) =  block % state % time_levs(2) % state % uBtr % array(iEdge) &amp;
                 + 2*block % state % time_levs(2) % state % uBcl % array(k,iEdge) -  block % state % time_levs(1) % state % uBcl % array(k,iEdge)
           enddo
-          ! mrp 110607 zero out velocity below land edges. efficiency: this may not be required.
-          do k=block % mesh % maxLevelEdgeTop % array(iEdge) + 1, block % mesh % nVertLevels
-            block % state % time_levs(2) % state % u % array(k,iEdge) = 0.0
-          enddo
         enddo ! iEdges
 
         if (trim(config_time_integration) == 'split_explicit') then
@@ -985,11 +969,12 @@
             block % state % time_levs(2) % state % h % array(1,iCell) = block % state % time_levs(2) % state % ssh % array(iCell) + block % mesh % hZLevel % array(1)
 
             ! mrp 110601 efficiency note: Since h just moves back and forth between pointers,
-            ! this is not necessary once initialized.
-            do k=2,block % mesh % nVertLevels
+            ! this is not necessary once initialized. 
+            do k=2,block % mesh % nVertLevels * sshSwapFlag
               block % state % time_levs(2) % state % h % array(k,iCell) = block % mesh % hZLevel % array(k)
             end do
           end do ! iCell
+          sshSwapFlag = 0
         end if ! split_explicit
 
         !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

</font>
</pre>