<p><b>dwj07@fsu.edu</b> 2012-01-19 13:04:56 -0700 (Thu, 19 Jan 2012)</p><p>        <br>
        -- BRANCH COMMIT --<br>
<br>
        Fixing initialization and allocation of uh variable in mpas_ocn_tendency.F<br>
<br>
        Adding timers to the standard advection scheme<br>
</p><hr noshade><pre><font color="gray">Modified: branches/ocean_projects/advection_routines/src/core_ocean/mpas_ocn_tendency.F
===================================================================
--- branches/ocean_projects/advection_routines/src/core_ocean/mpas_ocn_tendency.F        2012-01-19 19:56:56 UTC (rev 1397)
+++ branches/ocean_projects/advection_routines/src/core_ocean/mpas_ocn_tendency.F        2012-01-19 20:04:56 UTC (rev 1398)
@@ -318,7 +318,7 @@
 
       real (kind=RKIND), dimension(:,:), allocatable :: uh
 
-      integer :: err
+      integer :: err, iEdge, k
 
       call mpas_timer_start(&quot;ocn_tend_scalar&quot;)
 
@@ -335,9 +335,13 @@
 
       tend_tr     =&gt; tend % tracers % array
 
-      allocate(uh(grid % nEdges, grid % nVertLevels))
+      allocate(uh(grid % nVertLevels, grid % nEdges+1))
 
-      uh = u * h_edge
+      do iEdge = 1, grid % nEdges
+        do k = 1, grid % nVertLevels
+            uh(k, iEdge) = u(k, iEdge) * h_edge(k, iEdge)
+        end do
+      end do
                   
       !
       ! initialize tracer tendency (RHS of tracer equation) to zero.
@@ -408,6 +412,8 @@
       call mpas_timer_stop(&quot;restoring&quot;, tracerRestoringTimer)
 
  10   format(2i8,10e20.10)
+
+      deallocate(uh)
       call mpas_timer_stop(&quot;ocn_tend_scalar&quot;)
 
    end subroutine ocn_tend_scalar!}}}

Modified: branches/ocean_projects/advection_routines/src/operators/mpas_tracer_advection.F
===================================================================
--- branches/ocean_projects/advection_routines/src/operators/mpas_tracer_advection.F        2012-01-19 19:56:56 UTC (rev 1397)
+++ branches/ocean_projects/advection_routines/src/operators/mpas_tracer_advection.F        2012-01-19 20:04:56 UTC (rev 1398)
@@ -188,14 +188,20 @@
 !     else
          call mpas_tracer_advection_std_tend(tracers, uh, w, zDistance, zWeightUp, zWeightDown, grid, tend)
 !     endif
-   end subroutine!}}}
+   end subroutine mpas_tracer_advection_tend!}}}
 
    subroutine mpas_tracer_advection_init(err)!{{{
 
       integer, intent(inout) :: err
 
+      integer :: err_tmp
+
       err = 0
 
+      call mpas_tracer_advection_std_init(err_tmp)
+
+      err = ior(err, err_tmp)
+
       monotonicOn = .false.
 
       if(config_monotonic .and. config_positive_definite) then

Modified: branches/ocean_projects/advection_routines/src/operators/mpas_tracer_advection_std.F
===================================================================
--- branches/ocean_projects/advection_routines/src/operators/mpas_tracer_advection_std.F        2012-01-19 19:56:56 UTC (rev 1397)
+++ branches/ocean_projects/advection_routines/src/operators/mpas_tracer_advection_std.F        2012-01-19 20:04:56 UTC (rev 1398)
@@ -4,6 +4,7 @@
    use mpas_grid_types
    use mpas_configure
    use mpas_dmpar
+   use mpas_timer
 
    use mpas_tracer_advection_std_hadv
    use mpas_tracer_advection_std_vadv
@@ -32,8 +33,12 @@
       real (kind=RKIND), dimension(:), intent(in) :: zDistance, zWeightUp, zWeightDown
       type (mesh_type), intent(in) :: grid
 
+      call mpas_timer_start(&quot;tracer-hadv&quot;, .false.)
       call mpas_tracer_advection_std_hadv_tend(tracers, uh, grid, tend)
+      call mpas_timer_stop(&quot;tracer-hadv&quot;)
+      call mpas_timer_start(&quot;tracer-vadv&quot;, .false.)
       call mpas_tracer_advection_std_vadv_tend(tracers, w, zDistance, zWeightUp, zWeightDown, grid, tend)
+      call mpas_timer_stop(&quot;tracer-vadv&quot;)
 
    end subroutine mpas_tracer_advection_std_tend!}}}
 
@@ -44,6 +49,8 @@
 
       err = 0
 
+      write(*,*) 'std init'
+
       call mpas_tracer_advection_std_hadv_init(err_tmp)
       err = ior(err, err_tmp)
       call mpas_tracer_advection_std_vadv_init(err_tmp)

Modified: branches/ocean_projects/advection_routines/src/operators/mpas_tracer_advection_std_hadv.F
===================================================================
--- branches/ocean_projects/advection_routines/src/operators/mpas_tracer_advection_std_hadv.F        2012-01-19 19:56:56 UTC (rev 1397)
+++ branches/ocean_projects/advection_routines/src/operators/mpas_tracer_advection_std_hadv.F        2012-01-19 20:04:56 UTC (rev 1398)
@@ -72,7 +72,11 @@
             do i=1,nAdvCellsForEdge(iEdge)
               iCell = advCellsForEdge(i,iEdge)
               do k=1,grid % nVertLevels
-                tracer_weight = adv_coefs(i,iEdge) + coef_3rd_order*sign(1.,uh(k,iEdge))*adv_coefs_3rd(i,iEdge)
+!               tracer_weight = adv_coefs(i,iEdge) + coef_3rd_order*sign(1.0, uh(k,iEdge))*adv_coefs_3rd(i,iEdge)
+                tracer_weight = sign(1.0, uh(k,iEdge))
+                tracer_weight = adv_coefs_3rd(i,iEdge)*tracer_weight
+                tracer_weight = coef_3rd_order*tracer_weight
+                tracer_weight = adv_coefs(i,iEdge) + tracer_weight
                 do iTracer=1,num_tracers
                   flux_arr(iTracer,k) = flux_arr(iTracer,k) + tracer_weight* tracers(iTracer,k,iCell)
                 end do

</font>
</pre>