<p><b>dwj07@fsu.edu</b> 2011-10-24 15:49:06 -0600 (Mon, 24 Oct 2011)</p><p><br>
        -- BRANCH COMMIT --<br>
<br>
        Updating some of the timers to make the names shorter when printer.<br>
<br>
        Also fixing a bug in the timer module. Will commit to trunk next.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/ocean_projects/performance/src/core_ocean/Registry
===================================================================
--- branches/ocean_projects/performance/src/core_ocean/Registry        2011-10-24 21:13:17 UTC (rev 1124)
+++ branches/ocean_projects/performance/src/core_ocean/Registry        2011-10-24 21:49:06 UTC (rev 1125)
@@ -10,6 +10,7 @@
 namelist character sw_model config_stop_time           none
 namelist character sw_model config_run_duration        none
 namelist integer   sw_model config_stats_interval      100
+namelist logical   sw_model config_initial_stats       false
 namelist character io       config_input_name          grid.nc
 namelist character io       config_output_name         output.nc
 namelist character io       config_restart_name        restart.nc

Modified: branches/ocean_projects/performance/src/core_ocean/mpas_ocn_advection.F
===================================================================
--- branches/ocean_projects/performance/src/core_ocean/mpas_ocn_advection.F        2011-10-24 21:13:17 UTC (rev 1124)
+++ branches/ocean_projects/performance/src/core_ocean/mpas_ocn_advection.F        2011-10-24 21:49:06 UTC (rev 1125)
@@ -8,7 +8,7 @@
    contains
 
 
-   subroutine ocn_initialize_advection_rk( grid )
+   subroutine ocn_initialize_advection_rk( grid )!{{{
                                       
 !
 ! compute the cell coefficients for the polynomial fit.
@@ -381,7 +381,7 @@
 !      end do
 !      stop
 
-   end subroutine ocn_initialize_advection_rk
+   end subroutine ocn_initialize_advection_rk!}}}
 
 
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -390,7 +390,7 @@
    ! Computes the angle between arcs AB and AC, given points A, B, and C
    ! Equation numbers w.r.t. http://mathworld.wolfram.com/SphericalTrigonometry.html
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   real function sphere_angle(ax, ay, az, bx, by, bz, cx, cy, cz)
+   real function sphere_angle(ax, ay, az, bx, by, bz, cx, cy, cz)!{{{
    
       implicit none
    
@@ -436,7 +436,7 @@
          sphere_angle = -2.0 * asin(max(min(sin_angle,1.0),-1.0))
       end if
    
-   end function sphere_angle
+   end function sphere_angle!}}}
    
 
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -445,7 +445,7 @@
    ! Computes the angle between vectors AB and AC, given points A, B, and C, and
    !   a vector (u,v,w) normal to the plane.
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   real function plane_angle(ax, ay, az, bx, by, bz, cx, cy, cz, u, v, w)
+   real function plane_angle(ax, ay, az, bx, by, bz, cx, cy, cz, u, v, w)!{{{
    
       implicit none
    
@@ -485,7 +485,7 @@
          plane_angle = -acos(max(min(cos_angle,1.0),-1.0))
       end if
    
-   end function plane_angle
+   end function plane_angle!}}}
 
 
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -495,7 +495,7 @@
    !    B=(bx, by, bz). It is assumed that both A and B lie on the surface of the
    !    same sphere centered at the origin.
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   real function arc_length(ax, ay, az, bx, by, bz)
+   real function arc_length(ax, ay, az, bx, by, bz)!{{{
    
       implicit none
    
@@ -518,7 +518,7 @@
 !      arc_length = sqrt(r) * 2.0 * asin(c/(2.0*r))
       arc_length = r * 2.0 * asin(c/(2.0*r))
 
-   end function arc_length
+   end function arc_length!}}}
    
    
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -528,7 +528,7 @@
    !   A=(ax, ay, az) to B=(bx, by, bz). It is assumed that A and B lie on the
    !   surface of a sphere centered at the origin.
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   subroutine ocn_arc_bisect(ax, ay, az, bx, by, bz, cx, cy, cz)
+   subroutine ocn_arc_bisect(ax, ay, az, bx, by, bz, cx, cy, cz)!{{{
    
       implicit none
    
@@ -553,10 +553,10 @@
          cz = r * cz / d
       end if
    
-   end subroutine ocn_arc_bisect
+   end subroutine ocn_arc_bisect!}}}
 
 
-   subroutine ocn_poly_fit_2(a_in,b_out,weights_in,m,n,ne)
+   subroutine ocn_poly_fit_2(a_in,b_out,weights_in,m,n,ne)!{{{
 
       implicit none
 
@@ -611,7 +611,7 @@
 !
 !     write(6,*) ' '
 
-   end subroutine ocn_poly_fit_2
+   end subroutine ocn_poly_fit_2!}}}
 
 
 ! Updated 10/24/2001.
@@ -630,119 +630,119 @@
 !                                                                       !
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !
-SUBROUTine ocn_migs (A,N,X,INDX)
+subroutine ocn_migs (a,n,x,indx)!{{{
 !
-! Subroutine to invert matrix A(N,N) with the inverse stored
-! in X(N,N) in the output.  Copyright (c) Tao Pang 2001.
+! subroutine to invert matrix a(n,n) with the inverse stored
+! in x(n,n) in the output.  copyright (c) tao pang 2001.
 !
-  IMPLICIT NONE
-  INTEGER, INTENT (IN) :: N
-  INTEGER :: I,J,K
-  INTEGER, INTENT (OUT), DIMENSION (N) :: INDX
-  REAL (kind=RKIND), INTENT (INOUT), DIMENSION (N,N):: A
-  REAL (kind=RKIND), INTENT (OUT), DIMENSION (N,N):: X
-  REAL (kind=RKIND), DIMENSION (N,N) :: B
+  implicit none
+  integer, intent (in) :: n
+  integer :: i,j,k
+  integer, intent (out), dimension (n) :: indx
+  real (kind=RKIND), intent (inout), dimension (n,n):: a
+  real (kind=RKIND), intent (out), dimension (n,n):: x
+  real (kind=RKIND), dimension (n,n) :: b
 !
-  DO I = 1, N
-    DO J = 1, N
-      B(I,J) = 0.0
-    END DO
-  END DO
-  DO I = 1, N
-    B(I,I) = 1.0
-  END DO
+  do i = 1, n
+    do j = 1, n
+      b(i,j) = 0.0
+    end do
+  end do
+  do i = 1, n
+    b(i,i) = 1.0
+  end do
 !
-  call ocn_elgs (A,N,INDX)
+  call ocn_elgs (a,n,indx)
 !
-  DO I = 1, N-1
-    DO J = I+1, N
-      DO K = 1, N
-        B(INDX(J),K) = B(INDX(J),K)-A(INDX(J),I)*B(INDX(I),K)
-      END DO
-    END DO
-  END DO
+  do i = 1, n-1
+    do j = i+1, n
+      do k = 1, n
+        b(indx(j),k) = b(indx(j),k)-a(indx(j),i)*b(indx(i),k)
+      end do
+    end do
+  end do
 !
-  DO I = 1, N
-    X(N,I) = B(INDX(N),I)/A(INDX(N),N)
-    DO J = N-1, 1, -1
-      X(J,I) = B(INDX(J),I)
-      DO K = J+1, N
-        X(J,I) = X(J,I)-A(INDX(J),K)*X(K,I)
-      END DO
-      X(J,I) =  X(J,I)/A(INDX(J),J)
-    END DO
-  END DO
-END SUBROUTine ocn_migs
+  do i = 1, n
+    x(n,i) = b(indx(n),i)/a(indx(n),n)
+    do j = n-1, 1, -1
+      x(j,i) = b(indx(j),i)
+      do k = j+1, n
+        x(j,i) = x(j,i)-a(indx(j),k)*x(k,i)
+      end do
+      x(j,i) =  x(j,i)/a(indx(j),j)
+    end do
+  end do
+end subroutine ocn_migs!}}}
 
 
-SUBROUTine ocn_elgs (A,N,INDX)
+subroutine ocn_elgs (a,n,indx)!{{{
 !
-! Subroutine to perform the partial-pivoting Gaussian elimination.
-! A(N,N) is the original matrix in the input and transformed matrix
+! subroutine to perform the partial-pivoting gaussian elimination.
+! a(n,n) is the original matrix in the input and transformed matrix
 ! plus the pivoting element ratios below the diagonal in the output.
-! INDX(N) records the pivoting order.  Copyright (c) Tao Pang 2001.
+! indx(n) records the pivoting order.  copyright (c) tao pang 2001.
 !
-  IMPLICIT NONE
-  INTEGER, INTENT (IN) :: N
-  INTEGER :: I,J,K,ITMP
-  INTEGER, INTENT (OUT), DIMENSION (N) :: INDX
-  REAL (kind=RKIND) :: C1,PI,PI1,PJ
-  REAL (kind=RKIND), INTENT (INOUT), DIMENSION (N,N) :: A
-  REAL (kind=RKIND), DIMENSION (N) :: C
+  implicit none
+  integer, intent (in) :: n
+  integer :: i,j,k,itmp
+  integer, intent (out), dimension (n) :: indx
+  real (kind=RKIND) :: c1,pi,pi1,pj
+  real (kind=RKIND), intent (inout), dimension (n,n) :: a
+  real (kind=RKIND), dimension (n) :: c
 !
-! Initialize the index
+! initialize the index
 !
-  DO I = 1, N
-    INDX(I) = I
-  END DO
+  do i = 1, n
+    indx(i) = i
+  end do
 !
-! Find the rescaling factors, one from each row
+! find the rescaling factors, one from each row
 !
-  DO I = 1, N
-    C1= 0.0
-    DO J = 1, N
-      C1 = MAX(C1,ABS(A(I,J)))
-    END DO
-    C(I) = C1
-  END DO
+  do i = 1, n
+    c1= 0.0
+    do j = 1, n
+      c1 = max(c1,abs(a(i,j)))
+    end do
+    c(i) = c1
+  end do
 !
-! Search the pivoting (largest) element from each column
+! search the pivoting (largest) element from each column
 !
-  DO J = 1, N-1
-    PI1 = 0.0
-    DO I = J, N
-      PI = ABS(A(INDX(I),J))/C(INDX(I))
-      IF (PI.GT.PI1) THEN
-        PI1 = PI
-        K   = I
-      ENDIF
-    END DO
+  do j = 1, n-1
+    pi1 = 0.0
+    do i = j, n
+      pi = abs(a(indx(i),j))/c(indx(i))
+      if (pi.gt.pi1) then
+        pi1 = pi
+        k   = i
+      endif
+    end do
 !
-! Interchange the rows via INDX(N) to record pivoting order
+! interchange the rows via indx(n) to record pivoting order
 !
-    ITMP    = INDX(J)
-    INDX(J) = INDX(K)
-    INDX(K) = ITMP
-    DO I = J+1, N
-      PJ  = A(INDX(I),J)/A(INDX(J),J)
+    itmp    = indx(j)
+    indx(j) = indx(k)
+    indx(k) = itmp
+    do i = j+1, n
+      pj  = a(indx(i),j)/a(indx(j),j)
 !
-! Record pivoting ratios below the diagonal
+! record pivoting ratios below the diagonal
 !
-      A(INDX(I),J) = PJ
+      a(indx(i),j) = pj
 !
-! Modify other elements accordingly
+! modify other elements accordingly
 !
-      DO K = J+1, N
-        A(INDX(I),K) = A(INDX(I),K)-PJ*A(INDX(J),K)
-      END DO
-    END DO
-  END DO
+      do k = j+1, n
+        a(indx(i),k) = a(indx(i),k)-pj*a(indx(j),k)
+      end do
+    end do
+  end do
 !
-END SUBROUTine ocn_elgs
+end subroutine ocn_elgs!}}}
 
 !-------------------------------------------------------------
 
-   subroutine ocn_initialize_deformation_weights( grid )
+   subroutine ocn_initialize_deformation_weights( grid )!{{{
                                       
 !
 ! compute the cell coefficients for the deformation calculations
@@ -929,6 +929,6 @@
 
       if (debug) write(0,*) ' exiting def weight calc '
 
-   end subroutine ocn_initialize_deformation_weights
+   end subroutine ocn_initialize_deformation_weights!}}}
 
 end module ocn_advection

Modified: branches/ocean_projects/performance/src/core_ocean/mpas_ocn_equation_of_state.F
===================================================================
--- branches/ocean_projects/performance/src/core_ocean/mpas_ocn_equation_of_state.F        2011-10-24 21:13:17 UTC (rev 1124)
+++ branches/ocean_projects/performance/src/core_ocean/mpas_ocn_equation_of_state.F        2011-10-24 21:49:06 UTC (rev 1125)
@@ -16,7 +16,6 @@
 
    use mpas_grid_types
    use mpas_configure
-   use mpas_timer
    use ocn_equation_of_state_linear
    use ocn_equation_of_state_jm
 
@@ -99,8 +98,6 @@
 
       if(.not.eosOn) return
 
-      call mpas_timer_start(&quot;ocn_equation_of_state_rho&quot;)
-
       tracers =&gt; s % tracers % array
       indexT = s % index_temperature
       indexS = s % index_salinity
@@ -122,8 +119,6 @@
 
       endif
 
-      call mpas_timer_stop(&quot;ocn_equation_of_state_rho&quot;)
-
    end subroutine ocn_equation_of_state_rho!}}}
 
 !***********************************************************************

Modified: branches/ocean_projects/performance/src/core_ocean/mpas_ocn_equation_of_state_jm.F
===================================================================
--- branches/ocean_projects/performance/src/core_ocean/mpas_ocn_equation_of_state_jm.F        2011-10-24 21:13:17 UTC (rev 1124)
+++ branches/ocean_projects/performance/src/core_ocean/mpas_ocn_equation_of_state_jm.F        2011-10-24 21:49:06 UTC (rev 1125)
@@ -16,7 +16,6 @@
 
    use mpas_grid_types
    use mpas_configure
-   use mpas_timer
 
    implicit none
    private
@@ -194,8 +193,6 @@
 
       err = 0
 
-      call mpas_timer_start(&quot;equation_of_state_jm&quot;)
-
       nCells      = grid % nCells
       maxLevelCell      =&gt; grid % maxLevelCell % array
       nVertLevels = grid % nVertLevels
@@ -305,12 +302,10 @@
       rho(k,iCell) = (unt0 + RHO_S)*BULK_MOD*DENOMK
 
     end do
-  end do
+   end do
 
    deallocate(pRefEOS,p,p2)
 
-   call mpas_timer_stop(&quot;equation_of_state_jm&quot;)
-
    end subroutine ocn_equation_of_state_jm_rho!}}}
 
 !***********************************************************************

Modified: branches/ocean_projects/performance/src/core_ocean/mpas_ocn_equation_of_state_linear.F
===================================================================
--- branches/ocean_projects/performance/src/core_ocean/mpas_ocn_equation_of_state_linear.F        2011-10-24 21:13:17 UTC (rev 1124)
+++ branches/ocean_projects/performance/src/core_ocean/mpas_ocn_equation_of_state_linear.F        2011-10-24 21:49:06 UTC (rev 1125)
@@ -16,7 +16,6 @@
 
    use mpas_grid_types
    use mpas_configure
-   use mpas_timer
 
    implicit none
    private
@@ -87,8 +86,6 @@
       integer :: nCells, iCell, k
       type (dm_info) :: dminfo
 
-      call mpas_timer_start(&quot;ocn_equation_of_state_linear&quot;)
-
       maxLevelCell      =&gt; grid % maxLevelCell % array
       nCells      = grid % nCells
 
@@ -103,8 +100,6 @@
          end do
       end do
 
-      call mpas_timer_stop(&quot;ocn_equation_of_state_linear&quot;)
-
    end subroutine ocn_equation_of_state_linear_rho!}}}
 
 !***********************************************************************

Modified: branches/ocean_projects/performance/src/core_ocean/mpas_ocn_global_diagnostics.F
===================================================================
--- branches/ocean_projects/performance/src/core_ocean/mpas_ocn_global_diagnostics.F        2011-10-24 21:13:17 UTC (rev 1124)
+++ branches/ocean_projects/performance/src/core_ocean/mpas_ocn_global_diagnostics.F        2011-10-24 21:49:06 UTC (rev 1125)
@@ -4,11 +4,14 @@
    use mpas_configure
    use mpas_constants
    use mpas_dmpar
+   use mpas_timer
 
    implicit none
    save
    public
 
+   type (timer_node), pointer :: diagBlockTimer, diagMPITimer
+
    contains
 
    subroutine ocn_compute_global_diagnostics(domain, timeLevel, timeIndex, dt)!{{{
@@ -61,6 +64,7 @@
       verticalSumMaxes = 0.0
       reductions = 0.0
 
+      call mpas_timer_start(&quot;diagnostic block loop&quot;, .false., diagBlockTimer)
       do while (associated(block))
          state =&gt; block % state % time_levs(timeLevel) % state
          grid =&gt; block % mesh
@@ -316,6 +320,8 @@
 
          block =&gt; block % next
       end do
+      call mpas_timer_stop(&quot;diagnostic block loop&quot;, diagBlockTimer)
+      call mpas_timer_start(&quot;diagnostics mpi&quot;, .false., diagMPITimer)
 
       ! global reduction of the 5 arrays (packed into 3 to minimize global communication)
       call mpas_dmpar_sum_real_array(dminfo, nSums, sums(1:nSums), reductions(1:nSums))
@@ -406,6 +412,8 @@
         averages(variableIndex) = sums(variableIndex)/volumeCellGlobal
       enddo
 
+      call mpas_timer_stop(&quot;diagnostics mpi&quot;, diagMPITimer)
+
       ! write out the data to files
       if (dminfo % my_proc_id == IO_NODE) then
          fileID = getFreeUnit()

Modified: branches/ocean_projects/performance/src/core_ocean/mpas_ocn_mpas_core.F
===================================================================
--- branches/ocean_projects/performance/src/core_ocean/mpas_ocn_mpas_core.F        2011-10-24 21:13:17 UTC (rev 1124)
+++ branches/ocean_projects/performance/src/core_ocean/mpas_ocn_mpas_core.F        2011-10-24 21:49:06 UTC (rev 1125)
@@ -1,12 +1,14 @@
 module mpas_core
 
+   use mpas_configure
    use mpas_framework
    use mpas_timekeeping
    use mpas_dmpar
+   use mpas_timer
+
+   use ocn_global_diagnostics
    use ocn_test_cases
-
    use ocn_time_integration
-
    use ocn_tendency
 
    use ocn_vel_pressure_grad
@@ -34,11 +36,13 @@
    integer, parameter :: restartAlarmID = 2
    integer, parameter :: statsAlarmID = 3
 
+   type (timer_node), pointer :: globalDiagTimer, timeIntTimer
+   type (timer_node), pointer :: initDiagSolveTimer
+
    contains
 
    subroutine mpas_core_init(domain, startTimeStamp)!{{{
 
-      use mpas_configure
       use mpas_grid_types
 
       implicit none
@@ -118,20 +122,19 @@
          call mpas_init_block(block, block % mesh, dt)
          block % state % time_levs(1) % state % xtime % scalar = startTimeStamp 
          block =&gt; block % next
-
-         !dwj 110919 This allows the restorings to grab the indices for
-         ! temperature and salinity tracers from state.
       end do
 
    ! mrp 100316 In order for this to work, we need to pass domain % dminfo as an 
    ! input arguement into mpas_init.  Ask about that later.  For now, there will be
    ! no initial statistics write.
    
-   !   call mpas_timer_start(&quot;global diagnostics&quot;)
-   !   call ocn_compute_global_diagnostics(domain % dminfo, block % state % time_levs(1) % state, mesh, 0, dt)
-   !   call mpas_timer_stop(&quot;global diagnostics&quot;)
-   !   call mpas_output_state_init(output_obj, domain, &quot;OUTPUT&quot;)
-   !   call write_output_frame(output_obj, domain)
+      if (config_initial_stats) then
+          call mpas_timer_start(&quot;global diagnostics&quot;, .false., globalDiagTimer)
+          call ocn_compute_global_diagnostics(domain, 1 , 0, dt)
+          call mpas_timer_stop(&quot;global diagnostics&quot;, globalDiagTimer)
+!         call mpas_output_state_init(output_obj, domain, &quot;OUTPUT&quot;)
+!         call write_output_frame(output_obj, output_frame, domain)
+      endif
 
       restart_frame = 1
       current_outfile_frames = 0
@@ -210,7 +213,9 @@
       integer :: i, iEdge, iCell, k
    
    
+      call mpas_timer_start(&quot;diagnostic solve&quot;, .false., initDiagSolveTimer)
       call ocn_diagnostic_solve(dt, block % state % time_levs(1) % state, mesh)
+      call mpas_timer_stop(&quot;diagnostic solve&quot;, initDiagSolveTimer)
 
       call compute_mesh_scaling(mesh)
  
@@ -314,9 +319,9 @@
          call mpas_get_time(curr_time=currTime, dateTimeString=timeStamp, ierr=ierr)
          write(0,*) 'Doing timestep ', timeStamp
 
-         call mpas_timer_start(&quot;time integration&quot;)
+         call mpas_timer_start(&quot;time integration&quot;, .false., timeIntTimer)
          call mpas_timestep(domain, itimestep, dt, timeStamp)
-         call mpas_timer_stop(&quot;time integration&quot;)
+         call mpas_timer_stop(&quot;time integration&quot;, timeIntTimer)
    
          ! Move time level 2 fields back into time level 1 for next time step
          call mpas_shift_time_levels_state(domain % blocklist % state)
@@ -405,8 +410,6 @@
    subroutine mpas_timestep(domain, itimestep, dt, timeStamp)!{{{
    
       use mpas_grid_types
-      use mpas_timer
-      use ocn_global_diagnostics
    
       implicit none
    
@@ -422,9 +425,9 @@
 
       if (config_stats_interval &gt; 0) then
           if (mod(itimestep, config_stats_interval) == 0) then
-             call mpas_timer_start(&quot;global diagnostics&quot;)
+             call mpas_timer_start(&quot;global diagnostics&quot;, .false., globalDiagTimer)
              call ocn_compute_global_diagnostics(domain, 2, itimestep, dt);
-             call mpas_timer_stop(&quot;global diagnostics&quot;)
+             call mpas_timer_stop(&quot;global diagnostics&quot;, globalDiagTimer)
           end if
       end if
 

Modified: branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tendency.F
===================================================================
--- branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tendency.F        2011-10-24 21:13:17 UTC (rev 1124)
+++ branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tendency.F        2011-10-24 21:49:06 UTC (rev 1125)
@@ -42,6 +42,11 @@
    private
    save
 
+   type (timer_node), pointer :: diagEOSTimer
+   type (timer_node), pointer :: thickHadvTimer, thickVadvTimer
+   type (timer_node), pointer :: velCorTimer, velVadvTimer, velPgradTimer, velHmixTimer, velForceTimer, velExpVmixTimer
+   type (timer_node), pointer :: tracerHadvTimer, tracerVadvTimer, tracerHmixTimer, tracerExpVmixTimer, tracerRestoringTimer
+
    !--------------------------------------------------------------------
    !
    ! Public parameters
@@ -192,21 +197,18 @@
       !
       ! for z-level, only compute height tendency for top layer.
 
-      call mpas_timer_start(&quot;ocn_tend_h-horiz adv&quot;)
-
+      call mpas_timer_start(&quot;hadv&quot;, .false., thickHadvTimer)
       call ocn_thick_hadv_tend(grid, u, h_edge, tend_h, err)
+      call mpas_timer_stop(&quot;hadv&quot;, thickHadvTimer)
 
-      call mpas_timer_stop(&quot;ocn_tend_h-horiz adv&quot;)
-
       !
       ! height tendency: vertical advection term -d/dz(hw)
       !
       ! Vertical advection computed for top layer of a z grid only.
-      call mpas_timer_start(&quot;ocn_tend_h-vert adv&quot;)
-
+      call mpas_timer_start(&quot;vadv&quot;, .false., thickVadvTimer)
       call ocn_thick_vadv_tend(grid, wtop, tend_h, err)
+      call mpas_timer_stop(&quot;vadv&quot;, thickVadvTimer)
 
-      call mpas_timer_stop(&quot;ocn_tend_h-vert adv&quot;)
       call mpas_timer_stop(&quot;ocn_tend_h&quot;)
    
    end subroutine ocn_tend_h!}}}
@@ -338,66 +340,54 @@
       ! velocity tendency: nonlinear Coriolis term and grad of kinetic energy
       !
 
-      call mpas_timer_start(&quot;ocn_tend_u-coriolis&quot;)
-
+      call mpas_timer_start(&quot;coriolis&quot;, .false., velCorTimer)
       call ocn_vel_coriolis_tend(grid, pv_edge, h_edge, u, ke, tend_u, err)
+      call mpas_timer_stop(&quot;coriolis&quot;, velCorTimer)
 
-      call mpas_timer_stop(&quot;ocn_tend_u-coriolis&quot;)
-
       !
       ! velocity tendency: vertical advection term -w du/dz
       !
-      call mpas_timer_start(&quot;ocn_tend_u-vert adv&quot;)
-
+      call mpas_timer_start(&quot;vadv&quot;, .false., velVadvTimer)
       call ocn_vel_vadv_tend(grid, u, wtop, tend_u, err)
+      call mpas_timer_stop(&quot;vadv&quot;, velVadvTimer)
 
-      call mpas_timer_stop(&quot;ocn_tend_u-vert adv&quot;)
-
       !
       ! velocity tendency: pressure gradient
       !
-      call mpas_timer_start(&quot;ocn_tend_u-pressure grad&quot;)
-
+      call mpas_timer_start(&quot;pressure grad&quot;, .false., velPgradTimer)
       if (config_vert_grid_type.eq.'isopycnal') then
           call ocn_vel_pressure_grad_tend(grid, MontPot, tend_u, err)
       elseif (config_vert_grid_type.eq.'zlevel') then
           call ocn_vel_pressure_grad_tend(grid, pressure, tend_u, err)
       end if
+      call mpas_timer_stop(&quot;pressure grad&quot;, velPgradTimer)
 
-      call mpas_timer_stop(&quot;ocn_tend_u-pressure grad&quot;)
-
       !
       ! velocity tendency: del2 dissipation, </font>
<font color="black">u_2 </font>
<font color="black">abla^2 u
       !   computed as </font>
<font color="black">u( </font>
<font color="black">abla divergence + k \times </font>
<font color="gray">abla vorticity )
       !   strictly only valid for config_h_mom_eddy_visc2 == constant
       !
-      call mpas_timer_start(&quot;ocn_tend_u-horiz mix&quot;)
-
+      call mpas_timer_start(&quot;hmix&quot;, .false., velHmixTimer)
       call ocn_vel_hmix_tend(grid, divergence, vorticity, tend_u, err)
+      call mpas_timer_stop(&quot;hmix&quot;, velHmixTimer)
 
-      call mpas_timer_stop(&quot;ocn_tend_u-horiz mix&quot;)
-
       !
       ! velocity tendency: forcing and bottom drag
       !
       ! mrp 101115 note: in order to include flux boundary conditions, we will need to 
       ! know the bottom edge with nonzero velocity and place the drag there.
 
-      call mpas_timer_start(&quot;ocn_tend_u-forcings&quot;)
-
+      call mpas_timer_start(&quot;forcings&quot;, .false., velForceTimer)
       call ocn_vel_forcing_tend(grid, u, u_src, ke_edge, h_edge, tend_u, err)
+      call mpas_timer_stop(&quot;forcings&quot;, velForceTimer)
 
-      call mpas_timer_stop(&quot;ocn_tend_u-forcings&quot;)
-
       !
       ! velocity tendency: vertical mixing d/dz( nu_v du/dz))
       !
       if (.not.config_implicit_vertical_mix) then
-          call mpas_timer_start(&quot;ocn_tend_u-explicit vert mix&quot;)
-
+          call mpas_timer_start(&quot;explicit vmix&quot;, .false., velExpVmixTimer)
           call ocn_vel_vmix_tend_explicit(grid, u, h_edge, vertvisctopofedge, tend_u, err)
-
-          call mpas_timer_stop(&quot;ocn_tend_u-explicit vert mix&quot;)
+          call mpas_timer_stop(&quot;explicit vmix&quot;, velExpVmixTimer)
       endif
       call mpas_timer_stop(&quot;ocn_tend_u&quot;)
 
@@ -515,32 +505,26 @@
       ! and then change maxLevelEdgeTop to maxLevelEdgeBot in the following section.
       ! tracer_edge at the boundary will also need to be defined for flux boundaries.
 
-      call mpas_timer_start(&quot;ocn_tend_scalar-horiz adv&quot;)
-
+      call mpas_timer_start(&quot;hadv&quot;, .false., tracerHadvTimer)
       call ocn_tracer_hadv_tend(grid, u, h_edge, tracers, tend_tr, err)
+      call mpas_timer_stop(&quot;hadv&quot;, tracerHadvTimer)
 
-      call mpas_timer_stop(&quot;ocn_tend_scalar-horiz adv&quot;)
 
-
       !
       ! tracer tendency: vertical advection term -d/dz( h \phi w)
       !
 
-      call mpas_timer_start(&quot;ocn_tend_scalar-vert adv&quot;)
-
+      call mpas_timer_start(&quot;vadv&quot;, .false., tracerVadvTimer)
       call ocn_tracer_vadv_tend(grid, wtop, tracers, tend_tr, err)
+      call mpas_timer_stop(&quot;vadv&quot;, tracerVadvTimer)
 
-      call mpas_timer_stop(&quot;ocn_tend_scalar-vert adv&quot;)
-
       !
       ! tracer tendency: del2 horizontal tracer diffusion, div(h \kappa_2 </font>
<font color="gray">abla \phi)
       !
-      call mpas_timer_start(&quot;ocn_tend_scalar-horiz diff&quot;)
-
+      call mpas_timer_start(&quot;hmix&quot;, .false., tracerHmixTimer)
       call ocn_tracer_hmix_tend(grid, h_edge, tracers, tend_tr, err)
+      call mpas_timer_stop(&quot;hmix&quot;, tracerHmixTimer)
 
-      call mpas_timer_stop(&quot;ocn_tend_scalar-horiz diff&quot;)
-
 ! mrp 110516 printing
 !print *, 'tend_tr 1',minval(tend_tr(3,1,1:nCells)),&amp;
 !                   maxval(tend_tr(3,1,1:nCells))
@@ -552,11 +536,11 @@
       ! tracer tendency: vertical diffusion h d/dz( \kappa_v d\phi/dz)
       !
       if (.not.config_implicit_vertical_mix) then
-         call mpas_timer_start(&quot;ocn_tend_scalar-explicit vert diff&quot;)
+         call mpas_timer_start(&quot;explicit vmix&quot;, .false., tracerExpVmixTimer)
 
          call ocn_tracer_vmix_tend_explicit(grid, h, vertdifftopofcell, tracers, tend_tr, err)
 
-         call mpas_timer_stop(&quot;ocn_tend_scalar-explicit vert diff&quot;)
+         call mpas_timer_stop(&quot;explicit vmix&quot;, tracerExpVmixTimer)
       endif
 
 ! mrp 110516 printing
@@ -567,11 +551,11 @@
       !
       ! add restoring to T and S in top model layer
       !
-      call mpas_timer_start(&quot;ocn_tend_scalar-restoring&quot;)
+      call mpas_timer_start(&quot;restoring&quot;, .false., tracerRestoringTimer)
 
       call ocn_restoring_tend(grid, h, s%index_temperature, s%index_salinity, tracers, tend_tr, err)
 
-      call mpas_timer_stop(&quot;ocn_tend_scalar-restoring&quot;)
+      call mpas_timer_stop(&quot;restoring&quot;, tracerRestoringTimer)
 
  10   format(2i8,10e20.10)
       call mpas_timer_stop(&quot;ocn_tend_scalar&quot;)
@@ -637,8 +621,6 @@
       real (kind=RKIND) :: coef_3rd_order
       real (kind=RKIND) :: r, h1, h2
 
-      call mpas_timer_start(&quot;ocn_diagnostic_solve&quot;)
-
       h           =&gt; s % h % array
       u           =&gt; s % u % array
       v           =&gt; s % v % array
@@ -703,15 +685,11 @@
       ! mrp 110516 efficiency note: For z-level, only do this on level 1.  h_edge for all
       ! lower levels is defined by hZlevel.
 
-      call mpas_timer_start(&quot;ocn_diagnostic_solve-hEdge&quot;)
-
       coef_3rd_order = 0.
       if (config_thickness_adv_order == 3) coef_3rd_order = 1.0
       if (config_thickness_adv_order == 3 .and. config_monotonic) coef_3rd_order = 0.25
 
       if (config_thickness_adv_order == 2) then
-          call mpas_timer_start(&quot;ocn_diagnostic_solve-hEdge 2&quot;)
-
          do iEdge=1,nEdges
             cell1 = cellsOnEdge(1,iEdge)
             cell2 = cellsOnEdge(2,iEdge)
@@ -719,10 +697,8 @@
                h_edge(k,iEdge) = 0.5 * (h(k,cell1) + h(k,cell2))
             end do
          end do
-          call mpas_timer_stop(&quot;ocn_diagnostic_solve-hEdge 2&quot;)
 
       else if (config_thickness_adv_order == 3) then
-          call mpas_timer_start(&quot;ocn_diagnostic_solve-hEdge 3&quot;)
 
          do iEdge=1,nEdges
             cell1 = cellsOnEdge(1,iEdge)
@@ -770,9 +746,7 @@
             end do   ! do k
          end do         ! do iEdge
 
-          call mpas_timer_stop(&quot;ocn_diagnostic_solve-hEdge 3&quot;)
       else  if (config_thickness_adv_order == 4) then
-          call mpas_timer_start(&quot;ocn_diagnostic_solve-hEdge 4&quot;)
 
          do iEdge=1,nEdges
             cell1 = cellsOnEdge(1,iEdge)
@@ -810,9 +784,7 @@
             end do   ! do k
          end do         ! do iEdge
 
-         call mpas_timer_stop(&quot;ocn_diagnostic_solve-hEdge 4&quot;)
       endif   ! if(config_thickness_adv_order == 2)
-      call mpas_timer_stop(&quot;ocn_diagnostic_solve-hEdge&quot;)
 
       !
       ! set the velocity and height at dummy address
@@ -1008,9 +980,11 @@
       ! For an isopycnal model, density should remain constant.
       ! For zlevel, calculate in-situ density
       if (config_vert_grid_type.eq.'zlevel') then
+         call mpas_timer_start(&quot;equation of state&quot;, .false., diagEOSTimer)
          call ocn_equation_of_state_rho(s, grid, 0, 'relative', err)
       ! mrp 110324 In order to visualize rhoDisplaced, include the following
          call ocn_equation_of_state_rho(s, grid, 1, 'relative', err)
+         call mpas_timer_stop(&quot;equation of state&quot;, diagEOSTimer)
       endif
 
       !
@@ -1070,8 +1044,6 @@
 
       call ocn_wtop(s,grid)
 
-      call mpas_timer_stop(&quot;ocn_diagnostic_solve&quot;)
-
    end subroutine ocn_diagnostic_solve!}}}
 
 !***********************************************************************

Modified: branches/ocean_projects/performance/src/core_ocean/mpas_ocn_time_integration_rk4.F
===================================================================
--- branches/ocean_projects/performance/src/core_ocean/mpas_ocn_time_integration_rk4.F        2011-10-24 21:13:17 UTC (rev 1124)
+++ branches/ocean_projects/performance/src/core_ocean/mpas_ocn_time_integration_rk4.F        2011-10-24 21:49:06 UTC (rev 1125)
@@ -30,6 +30,8 @@
    private
    save
 
+   type (timer_node), pointer :: diagSolveTimer
+
    !--------------------------------------------------------------------
    !
    ! Public parameters
@@ -227,7 +229,9 @@
                  provis % u % array(:,:) = block % state % time_levs(1) % state % u % array(:,:)
               end if
 
+              call mpas_timer_start(&quot;diagnostic solve&quot;, .false., diagSolveTimer)
               call ocn_diagnostic_solve(dt, provis, block % mesh)
+              call mpas_timer_stop(&quot;diagnostic solve&quot;, diagSolveTimer)
 
               block =&gt; block % next
            end do

Modified: branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_hadv.F
===================================================================
--- branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_hadv.F        2011-10-24 21:13:17 UTC (rev 1124)
+++ branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_hadv.F        2011-10-24 21:49:06 UTC (rev 1125)
@@ -16,6 +16,7 @@
 
    use mpas_grid_types
    use mpas_configure
+   use mpas_timer
 
    use ocn_tracer_hadv2
    use ocn_tracer_hadv3
@@ -46,7 +47,9 @@
    !
    !--------------------------------------------------------------------
 
+   type (timer_node), pointer :: hadv2Timer, hadv3Timer, hadv4Timer
 
+
 !***********************************************************************
 
 contains
@@ -122,9 +125,15 @@
       !
       !-----------------------------------------------------------------
 
+      call mpas_timer_start(&quot;hadv2&quot;, .false., hadv2Timer);
       call ocn_tracer_hadv2_tend(grid, u, h_edge, tracers, tend, err1)
+      call mpas_timer_stop(&quot;hadv2&quot;, hadv2Timer);
+      call mpas_timer_start(&quot;hadv3&quot;, .false., hadv3Timer);
       call ocn_tracer_hadv3_tend(grid, u, h_edge, tracers, tend, err2)
+      call mpas_timer_stop(&quot;hadv3&quot;, hadv3Timer);
+      call mpas_timer_start(&quot;hadv4&quot;, .false., hadv4Timer);
       call ocn_tracer_hadv4_tend(grid, u, h_edge, tracers, tend, err3)
+      call mpas_timer_stop(&quot;hadv4&quot;, hadv4Timer);
 
       err = err1 .or. err2 .or. err3
 
@@ -177,4 +186,4 @@
 end module ocn_tracer_hadv
 
 !|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-! vim: foldmetho=marker
+! vim: foldmethod=marker

Modified: branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_hadv2.F
===================================================================
--- branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_hadv2.F        2011-10-24 21:13:17 UTC (rev 1124)
+++ branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_hadv2.F        2011-10-24 21:49:06 UTC (rev 1125)
@@ -16,7 +16,6 @@
 
    use mpas_grid_types
    use mpas_configure
-   use mpas_timer
 
    implicit none
    private
@@ -127,8 +126,6 @@
 
       if(.not.hadv2On) return
 
-      call mpas_timer_start(&quot;compute_scalar_tend-horiz adv 2&quot;)
-
       nEdges = grid % nEdges
       maxLevelEdgeTop =&gt; grid % maxLevelEdgeTop % array
       cellsOnEdge =&gt; grid % cellsOnEdge % array
@@ -148,8 +145,6 @@
             end do
          end do
       end do
-
-      call mpas_timer_stop(&quot;compute_scalar_tend-horiz adv 2&quot;)
    !--------------------------------------------------------------------
 
    end subroutine ocn_tracer_hadv2_tend!}}}

Modified: branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_hadv3.F
===================================================================
--- branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_hadv3.F        2011-10-24 21:13:17 UTC (rev 1124)
+++ branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_hadv3.F        2011-10-24 21:49:06 UTC (rev 1125)
@@ -16,7 +16,6 @@
 
    use mpas_grid_types
    use mpas_configure
-   use mpas_timer
 
    implicit none
    private
@@ -142,7 +141,6 @@
       areaCell =&gt; grid % areaCell % array
       deriv_two =&gt; grid % deriv_two % array
 
-      call mpas_timer_start(&quot;compute_scalar_tend-horiz adv 3&quot;)
       do iEdge=1,nEdges
          cell1 = cellsOnEdge(1,iEdge)
          cell2 = cellsOnEdge(2,iEdge)
@@ -194,8 +192,6 @@
             enddo
          end do
       end do
-      call mpas_timer_stop(&quot;compute_scalar_tend-horiz adv 3&quot;)
-
    !--------------------------------------------------------------------
 
    end subroutine ocn_tracer_hadv3_tend!}}}

Modified: branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_hadv4.F
===================================================================
--- branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_hadv4.F        2011-10-24 21:13:17 UTC (rev 1124)
+++ branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_hadv4.F        2011-10-24 21:49:06 UTC (rev 1125)
@@ -16,7 +16,6 @@
 
    use mpas_grid_types
    use mpas_configure
-   use mpas_timer
 
    implicit none
    private
@@ -139,8 +138,6 @@
       areaCell =&gt; grid % areaCell % array
       deriv_two =&gt; grid % deriv_two % array
 
-      call mpas_timer_start(&quot;compute_scalar_tend-horiz adv 4&quot;)
-
       do iEdge=1,nEdges
          cell1 = cellsOnEdge(1,iEdge)
          cell2 = cellsOnEdge(2,iEdge)
@@ -182,8 +179,6 @@
             enddo
          end do
       end do
-      call mpas_timer_stop(&quot;compute_scalar_tend-horiz adv 4&quot;)
-
    !--------------------------------------------------------------------
 
    end subroutine ocn_tracer_hadv4_tend!}}}

Modified: branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_hmix.F
===================================================================
--- branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_hmix.F        2011-10-24 21:13:17 UTC (rev 1124)
+++ branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_hmix.F        2011-10-24 21:49:06 UTC (rev 1125)
@@ -18,6 +18,7 @@
 
    use mpas_grid_types
    use mpas_configure
+   use mpas_timer
    use ocn_tracer_hmix_del2
    use ocn_tracer_hmix_del4
 
@@ -46,7 +47,9 @@
    !
    !--------------------------------------------------------------------
 
+   type (timer_node), pointer :: del2Timer, del4Timer
 
+
 !***********************************************************************
 
 contains
@@ -119,8 +122,12 @@
       !
       !-----------------------------------------------------------------
 
+      call mpas_timer_start(&quot;del2&quot;, .false., del2Timer)
       call ocn_tracer_hmix_del2_tend(grid, h_edge, tracers, tend, err1)
+      call mpas_timer_stop(&quot;del2&quot;, del2Timer)
+      call mpas_timer_start(&quot;del4&quot;, .false., del4Timer)
       call ocn_tracer_hmix_del4_tend(grid, h_edge, tracers, tend, err2)
+      call mpas_timer_stop(&quot;del4&quot;, del4Timer)
 
       err = err1 .or. err2
 

Modified: branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_hmix_del2.F
===================================================================
--- branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_hmix_del2.F        2011-10-24 21:13:17 UTC (rev 1124)
+++ branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_hmix_del2.F        2011-10-24 21:49:06 UTC (rev 1125)
@@ -18,7 +18,6 @@
 
    use mpas_grid_types
    use mpas_configure
-   use mpas_timer
 
    implicit none
    private
@@ -134,8 +133,6 @@
 
       if (.not.del2On) return
 
-      call mpas_timer_start(&quot;compute_scalar_tend-horiz diff 2&quot;)
-
       nEdges = grid % nEdges
       nVertLevels = grid % nVertLevels
       num_tracers = size(tracers, dim=1)
@@ -179,8 +176,6 @@
       end do
 
       deallocate(boundaryMask)
-      call mpas_timer_stop(&quot;compute_scalar_tend-horiz diff 2&quot;)
-
    !--------------------------------------------------------------------
 
    end subroutine ocn_tracer_hmix_del2_tend!}}}

Modified: branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_hmix_del4.F
===================================================================
--- branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_hmix_del4.F        2011-10-24 21:13:17 UTC (rev 1124)
+++ branches/ocean_projects/performance/src/core_ocean/mpas_ocn_tracer_hmix_del4.F        2011-10-24 21:49:06 UTC (rev 1125)
@@ -18,7 +18,6 @@
 
    use mpas_grid_types
    use mpas_configure
-   use mpas_timer
 
    implicit none
    private
@@ -135,8 +134,6 @@
 
       if (.not.Del4On) return
 
-      call mpas_timer_start(&quot;compute_scalar_tend-horiz diff 4&quot;)
-
       nEdges = grid % nEdges
       nCells = grid % nCells
       num_tracers = size(tracers, dim=1)
@@ -212,7 +209,6 @@
       end do
 
       deallocate(delsq_tracer)
-      call mpas_timer_stop(&quot;compute_scalar_tend-horiz diff 4&quot;)
    !--------------------------------------------------------------------
 
    end subroutine ocn_tracer_hmix_del4_tend!}}}

Modified: branches/ocean_projects/performance/src/core_ocean/mpas_ocn_vel_hmix.F
===================================================================
--- branches/ocean_projects/performance/src/core_ocean/mpas_ocn_vel_hmix.F        2011-10-24 21:13:17 UTC (rev 1124)
+++ branches/ocean_projects/performance/src/core_ocean/mpas_ocn_vel_hmix.F        2011-10-24 21:49:06 UTC (rev 1125)
@@ -18,6 +18,7 @@
 
    use mpas_grid_types
    use mpas_configure
+   use mpas_timer
    use ocn_vel_hmix_del2
    use ocn_vel_hmix_del4
 
@@ -46,7 +47,9 @@
    !
    !--------------------------------------------------------------------
 
+   type (timer_node), pointer :: del2Timer, del4Timer
 
+
 !***********************************************************************
 
 contains
@@ -119,8 +122,12 @@
       !
       !-----------------------------------------------------------------
 
+      call mpas_timer_start(&quot;del2&quot;, .false., del2Timer)
       call ocn_vel_hmix_del2_tend(grid, divergence, vorticity, tend, err1)
+      call mpas_timer_stop(&quot;del2&quot;, del2Timer)
+      call mpas_timer_start(&quot;del4&quot;, .false., del4Timer)
       call ocn_vel_hmix_del4_tend(grid, divergence, vorticity, tend, err2)
+      call mpas_timer_stop(&quot;del4&quot;, del4Timer)
 
       err = err1 .or. err2
 

Modified: branches/ocean_projects/performance/src/core_ocean/mpas_ocn_vel_hmix_del2.F
===================================================================
--- branches/ocean_projects/performance/src/core_ocean/mpas_ocn_vel_hmix_del2.F        2011-10-24 21:13:17 UTC (rev 1124)
+++ branches/ocean_projects/performance/src/core_ocean/mpas_ocn_vel_hmix_del2.F        2011-10-24 21:49:06 UTC (rev 1125)
@@ -16,7 +16,6 @@
 
    use mpas_grid_types
    use mpas_configure
-   use mpas_timer
 
    implicit none
    private
@@ -132,8 +131,6 @@
 
       if(.not.hmixDel2On) return
 
-      call mpas_timer_start(&quot;compute_tend_u-horiz mix-del2&quot;)
-      
       nEdgesSolve = grid % nEdgesSolve
       maxLevelEdgeTop =&gt; grid % maxLevelEdgeTop % array
       cellsOnEdge =&gt; grid % cellsOnEdge % array
@@ -165,8 +162,6 @@
          end do
       end do
 
-      call mpas_timer_stop(&quot;compute_tend_u-horiz mix-del2&quot;)
-
    !--------------------------------------------------------------------
 
    end subroutine ocn_vel_hmix_del2_tend!}}}

Modified: branches/ocean_projects/performance/src/core_ocean/mpas_ocn_vel_hmix_del4.F
===================================================================
--- branches/ocean_projects/performance/src/core_ocean/mpas_ocn_vel_hmix_del4.F        2011-10-24 21:13:17 UTC (rev 1124)
+++ branches/ocean_projects/performance/src/core_ocean/mpas_ocn_vel_hmix_del4.F        2011-10-24 21:49:06 UTC (rev 1125)
@@ -16,7 +16,6 @@
 
    use mpas_grid_types
    use mpas_configure
-   use mpas_timer
 
    implicit none
    private
@@ -134,8 +133,6 @@
 
       if(.not.hmixDel4On) return
 
-      call mpas_timer_start(&quot;compute_tend-horiz mix-del4&quot;)
-
       nCells = grid % nCells
       nEdges = grid % nEdges
       nVertices = grid % nVertices
@@ -243,8 +240,6 @@
       deallocate(delsq_circulation)
       deallocate(delsq_vorticity)
 
-      call mpas_timer_stop(&quot;compute_tend-horiz mix-del4&quot;)
-
    !--------------------------------------------------------------------
 
    end subroutine ocn_vel_hmix_del4_tend!}}}

Modified: branches/ocean_projects/performance/src/core_ocean/mpas_ocn_vmix_coefs_rich.F
===================================================================
--- branches/ocean_projects/performance/src/core_ocean/mpas_ocn_vmix_coefs_rich.F        2011-10-24 21:13:17 UTC (rev 1124)
+++ branches/ocean_projects/performance/src/core_ocean/mpas_ocn_vmix_coefs_rich.F        2011-10-24 21:49:06 UTC (rev 1125)
@@ -26,6 +26,8 @@
    private
    save
 
+   type (timer_node), pointer :: richEOSTimer
+
    !--------------------------------------------------------------------
    !
    ! Public parameters
@@ -139,8 +141,10 @@
       rhoDisplaced =&gt; s % rhoDisplaced % array
       tracers =&gt; s % tracers % array
 
+      call mpas_timer_start(&quot;equation of state&quot;, .false., richEOSTimer)
       call ocn_equation_of_state_rho(s, grid, 0, 'relative', err)
       call ocn_equation_of_state_rho(s, grid, 1, 'relative', err)
+      call mpas_timer_stop(&quot;equation of state&quot;, richEOSTimer)
 
       call ocn_vmix_get_rich_numbers(grid, indexT, indexS, u, h, h_edge, &amp; 
                                   rho, rhoDisplaced, tracers, RiTopOfEdge, RiTopOfCell, err1)

Modified: branches/ocean_projects/performance/src/driver/mpas_subdriver.F
===================================================================
--- branches/ocean_projects/performance/src/driver/mpas_subdriver.F        2011-10-24 21:13:17 UTC (rev 1124)
+++ branches/ocean_projects/performance/src/driver/mpas_subdriver.F        2011-10-24 21:49:06 UTC (rev 1125)
@@ -68,6 +68,8 @@
    
       implicit none
 
+      call mpas_timer_start(&quot;finalize&quot;)
+
       !
       ! Finalize output streams
       !
@@ -78,6 +80,7 @@
       ! Finalize core
       !
       call mpas_core_finalize(domain)
+      call mpas_timer_stop(&quot;finalize&quot;)
 
       call mpas_timer_stop(&quot;total time&quot;)
       call mpas_timer_write()

Modified: branches/ocean_projects/performance/src/framework/mpas_timer.F
===================================================================
--- branches/ocean_projects/performance/src/framework/mpas_timer.F        2011-10-24 21:13:17 UTC (rev 1124)
+++ branches/ocean_projects/performance/src/framework/mpas_timer.F        2011-10-24 21:49:06 UTC (rev 1125)
@@ -52,7 +52,7 @@
             all_timers%timer_name = ''
             current =&gt; all_timers%next
             nullify(current%next)
-          else
+          else 
             current =&gt; all_timers%next
             timer_search: do while ((.not.timer_found) .and. associated(current))
               string_equal = (trim(current%timer_name) == trim(timer_name))
@@ -85,6 +85,8 @@
               current%min_time = 100000000.0
               current%avg_time = 0.0
               current%calls = 0
+            else
+              current =&gt; timer_ptr
             endif
           endif
 

</font>
</pre>