<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("ocn_equation_of_state_rho")
-
tracers => s % tracers % array
indexT = s % index_temperature
indexS = s % index_salinity
@@ -122,8 +119,6 @@
endif
- call mpas_timer_stop("ocn_equation_of_state_rho")
-
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("equation_of_state_jm")
-
nCells = grid % nCells
maxLevelCell => 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("equation_of_state_jm")
-
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("ocn_equation_of_state_linear")
-
maxLevelCell => grid % maxLevelCell % array
nCells = grid % nCells
@@ -103,8 +100,6 @@
end do
end do
- call mpas_timer_stop("ocn_equation_of_state_linear")
-
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("diagnostic block loop", .false., diagBlockTimer)
do while (associated(block))
state => block % state % time_levs(timeLevel) % state
grid => block % mesh
@@ -316,6 +320,8 @@
block => block % next
end do
+ call mpas_timer_stop("diagnostic block loop", diagBlockTimer)
+ call mpas_timer_start("diagnostics mpi", .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("diagnostics mpi", 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 => 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("global diagnostics")
- ! call ocn_compute_global_diagnostics(domain % dminfo, block % state % time_levs(1) % state, mesh, 0, dt)
- ! call mpas_timer_stop("global diagnostics")
- ! call mpas_output_state_init(output_obj, domain, "OUTPUT")
- ! call write_output_frame(output_obj, domain)
+ if (config_initial_stats) then
+ call mpas_timer_start("global diagnostics", .false., globalDiagTimer)
+ call ocn_compute_global_diagnostics(domain, 1 , 0, dt)
+ call mpas_timer_stop("global diagnostics", globalDiagTimer)
+! call mpas_output_state_init(output_obj, domain, "OUTPUT")
+! 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("diagnostic solve", .false., initDiagSolveTimer)
call ocn_diagnostic_solve(dt, block % state % time_levs(1) % state, mesh)
+ call mpas_timer_stop("diagnostic solve", 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("time integration")
+ call mpas_timer_start("time integration", .false., timeIntTimer)
call mpas_timestep(domain, itimestep, dt, timeStamp)
- call mpas_timer_stop("time integration")
+ call mpas_timer_stop("time integration", 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 > 0) then
if (mod(itimestep, config_stats_interval) == 0) then
- call mpas_timer_start("global diagnostics")
+ call mpas_timer_start("global diagnostics", .false., globalDiagTimer)
call ocn_compute_global_diagnostics(domain, 2, itimestep, dt);
- call mpas_timer_stop("global diagnostics")
+ call mpas_timer_stop("global diagnostics", 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("ocn_tend_h-horiz adv")
-
+ call mpas_timer_start("hadv", .false., thickHadvTimer)
call ocn_thick_hadv_tend(grid, u, h_edge, tend_h, err)
+ call mpas_timer_stop("hadv", thickHadvTimer)
- call mpas_timer_stop("ocn_tend_h-horiz adv")
-
!
! height tendency: vertical advection term -d/dz(hw)
!
! Vertical advection computed for top layer of a z grid only.
- call mpas_timer_start("ocn_tend_h-vert adv")
-
+ call mpas_timer_start("vadv", .false., thickVadvTimer)
call ocn_thick_vadv_tend(grid, wtop, tend_h, err)
+ call mpas_timer_stop("vadv", thickVadvTimer)
- call mpas_timer_stop("ocn_tend_h-vert adv")
call mpas_timer_stop("ocn_tend_h")
end subroutine ocn_tend_h!}}}
@@ -338,66 +340,54 @@
! velocity tendency: nonlinear Coriolis term and grad of kinetic energy
!
- call mpas_timer_start("ocn_tend_u-coriolis")
-
+ call mpas_timer_start("coriolis", .false., velCorTimer)
call ocn_vel_coriolis_tend(grid, pv_edge, h_edge, u, ke, tend_u, err)
+ call mpas_timer_stop("coriolis", velCorTimer)
- call mpas_timer_stop("ocn_tend_u-coriolis")
-
!
! velocity tendency: vertical advection term -w du/dz
!
- call mpas_timer_start("ocn_tend_u-vert adv")
-
+ call mpas_timer_start("vadv", .false., velVadvTimer)
call ocn_vel_vadv_tend(grid, u, wtop, tend_u, err)
+ call mpas_timer_stop("vadv", velVadvTimer)
- call mpas_timer_stop("ocn_tend_u-vert adv")
-
!
! velocity tendency: pressure gradient
!
- call mpas_timer_start("ocn_tend_u-pressure grad")
-
+ call mpas_timer_start("pressure grad", .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("pressure grad", velPgradTimer)
- call mpas_timer_stop("ocn_tend_u-pressure grad")
-
!
! 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("ocn_tend_u-horiz mix")
-
+ call mpas_timer_start("hmix", .false., velHmixTimer)
call ocn_vel_hmix_tend(grid, divergence, vorticity, tend_u, err)
+ call mpas_timer_stop("hmix", velHmixTimer)
- call mpas_timer_stop("ocn_tend_u-horiz mix")
-
!
! 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("ocn_tend_u-forcings")
-
+ call mpas_timer_start("forcings", .false., velForceTimer)
call ocn_vel_forcing_tend(grid, u, u_src, ke_edge, h_edge, tend_u, err)
+ call mpas_timer_stop("forcings", velForceTimer)
- call mpas_timer_stop("ocn_tend_u-forcings")
-
!
! velocity tendency: vertical mixing d/dz( nu_v du/dz))
!
if (.not.config_implicit_vertical_mix) then
- call mpas_timer_start("ocn_tend_u-explicit vert mix")
-
+ call mpas_timer_start("explicit vmix", .false., velExpVmixTimer)
call ocn_vel_vmix_tend_explicit(grid, u, h_edge, vertvisctopofedge, tend_u, err)
-
- call mpas_timer_stop("ocn_tend_u-explicit vert mix")
+ call mpas_timer_stop("explicit vmix", velExpVmixTimer)
endif
call mpas_timer_stop("ocn_tend_u")
@@ -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("ocn_tend_scalar-horiz adv")
-
+ call mpas_timer_start("hadv", .false., tracerHadvTimer)
call ocn_tracer_hadv_tend(grid, u, h_edge, tracers, tend_tr, err)
+ call mpas_timer_stop("hadv", tracerHadvTimer)
- call mpas_timer_stop("ocn_tend_scalar-horiz adv")
-
!
! tracer tendency: vertical advection term -d/dz( h \phi w)
!
- call mpas_timer_start("ocn_tend_scalar-vert adv")
-
+ call mpas_timer_start("vadv", .false., tracerVadvTimer)
call ocn_tracer_vadv_tend(grid, wtop, tracers, tend_tr, err)
+ call mpas_timer_stop("vadv", tracerVadvTimer)
- call mpas_timer_stop("ocn_tend_scalar-vert adv")
-
!
! tracer tendency: del2 horizontal tracer diffusion, div(h \kappa_2 </font>
<font color="gray">abla \phi)
!
- call mpas_timer_start("ocn_tend_scalar-horiz diff")
-
+ call mpas_timer_start("hmix", .false., tracerHmixTimer)
call ocn_tracer_hmix_tend(grid, h_edge, tracers, tend_tr, err)
+ call mpas_timer_stop("hmix", tracerHmixTimer)
- call mpas_timer_stop("ocn_tend_scalar-horiz diff")
-
! mrp 110516 printing
!print *, 'tend_tr 1',minval(tend_tr(3,1,1:nCells)),&
! 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("ocn_tend_scalar-explicit vert diff")
+ call mpas_timer_start("explicit vmix", .false., tracerExpVmixTimer)
call ocn_tracer_vmix_tend_explicit(grid, h, vertdifftopofcell, tracers, tend_tr, err)
- call mpas_timer_stop("ocn_tend_scalar-explicit vert diff")
+ call mpas_timer_stop("explicit vmix", tracerExpVmixTimer)
endif
! mrp 110516 printing
@@ -567,11 +551,11 @@
!
! add restoring to T and S in top model layer
!
- call mpas_timer_start("ocn_tend_scalar-restoring")
+ call mpas_timer_start("restoring", .false., tracerRestoringTimer)
call ocn_restoring_tend(grid, h, s%index_temperature, s%index_salinity, tracers, tend_tr, err)
- call mpas_timer_stop("ocn_tend_scalar-restoring")
+ call mpas_timer_stop("restoring", tracerRestoringTimer)
10 format(2i8,10e20.10)
call mpas_timer_stop("ocn_tend_scalar")
@@ -637,8 +621,6 @@
real (kind=RKIND) :: coef_3rd_order
real (kind=RKIND) :: r, h1, h2
- call mpas_timer_start("ocn_diagnostic_solve")
-
h => s % h % array
u => s % u % array
v => 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("ocn_diagnostic_solve-hEdge")
-
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("ocn_diagnostic_solve-hEdge 2")
-
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("ocn_diagnostic_solve-hEdge 2")
else if (config_thickness_adv_order == 3) then
- call mpas_timer_start("ocn_diagnostic_solve-hEdge 3")
do iEdge=1,nEdges
cell1 = cellsOnEdge(1,iEdge)
@@ -770,9 +746,7 @@
end do ! do k
end do ! do iEdge
- call mpas_timer_stop("ocn_diagnostic_solve-hEdge 3")
else if (config_thickness_adv_order == 4) then
- call mpas_timer_start("ocn_diagnostic_solve-hEdge 4")
do iEdge=1,nEdges
cell1 = cellsOnEdge(1,iEdge)
@@ -810,9 +784,7 @@
end do ! do k
end do ! do iEdge
- call mpas_timer_stop("ocn_diagnostic_solve-hEdge 4")
endif ! if(config_thickness_adv_order == 2)
- call mpas_timer_stop("ocn_diagnostic_solve-hEdge")
!
! 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("equation of state", .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("equation of state", diagEOSTimer)
endif
!
@@ -1070,8 +1044,6 @@
call ocn_wtop(s,grid)
- call mpas_timer_stop("ocn_diagnostic_solve")
-
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("diagnostic solve", .false., diagSolveTimer)
call ocn_diagnostic_solve(dt, provis, block % mesh)
+ call mpas_timer_stop("diagnostic solve", diagSolveTimer)
block => 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("hadv2", .false., hadv2Timer);
call ocn_tracer_hadv2_tend(grid, u, h_edge, tracers, tend, err1)
+ call mpas_timer_stop("hadv2", hadv2Timer);
+ call mpas_timer_start("hadv3", .false., hadv3Timer);
call ocn_tracer_hadv3_tend(grid, u, h_edge, tracers, tend, err2)
+ call mpas_timer_stop("hadv3", hadv3Timer);
+ call mpas_timer_start("hadv4", .false., hadv4Timer);
call ocn_tracer_hadv4_tend(grid, u, h_edge, tracers, tend, err3)
+ call mpas_timer_stop("hadv4", 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("compute_scalar_tend-horiz adv 2")
-
nEdges = grid % nEdges
maxLevelEdgeTop => grid % maxLevelEdgeTop % array
cellsOnEdge => grid % cellsOnEdge % array
@@ -148,8 +145,6 @@
end do
end do
end do
-
- call mpas_timer_stop("compute_scalar_tend-horiz adv 2")
!--------------------------------------------------------------------
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 => grid % areaCell % array
deriv_two => grid % deriv_two % array
- call mpas_timer_start("compute_scalar_tend-horiz adv 3")
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("compute_scalar_tend-horiz adv 3")
-
!--------------------------------------------------------------------
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 => grid % areaCell % array
deriv_two => grid % deriv_two % array
- call mpas_timer_start("compute_scalar_tend-horiz adv 4")
-
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("compute_scalar_tend-horiz adv 4")
-
!--------------------------------------------------------------------
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("del2", .false., del2Timer)
call ocn_tracer_hmix_del2_tend(grid, h_edge, tracers, tend, err1)
+ call mpas_timer_stop("del2", del2Timer)
+ call mpas_timer_start("del4", .false., del4Timer)
call ocn_tracer_hmix_del4_tend(grid, h_edge, tracers, tend, err2)
+ call mpas_timer_stop("del4", 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("compute_scalar_tend-horiz diff 2")
-
nEdges = grid % nEdges
nVertLevels = grid % nVertLevels
num_tracers = size(tracers, dim=1)
@@ -179,8 +176,6 @@
end do
deallocate(boundaryMask)
- call mpas_timer_stop("compute_scalar_tend-horiz diff 2")
-
!--------------------------------------------------------------------
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("compute_scalar_tend-horiz diff 4")
-
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("compute_scalar_tend-horiz diff 4")
!--------------------------------------------------------------------
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("del2", .false., del2Timer)
call ocn_vel_hmix_del2_tend(grid, divergence, vorticity, tend, err1)
+ call mpas_timer_stop("del2", del2Timer)
+ call mpas_timer_start("del4", .false., del4Timer)
call ocn_vel_hmix_del4_tend(grid, divergence, vorticity, tend, err2)
+ call mpas_timer_stop("del4", 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("compute_tend_u-horiz mix-del2")
-
nEdgesSolve = grid % nEdgesSolve
maxLevelEdgeTop => grid % maxLevelEdgeTop % array
cellsOnEdge => grid % cellsOnEdge % array
@@ -165,8 +162,6 @@
end do
end do
- call mpas_timer_stop("compute_tend_u-horiz mix-del2")
-
!--------------------------------------------------------------------
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("compute_tend-horiz mix-del4")
-
nCells = grid % nCells
nEdges = grid % nEdges
nVertices = grid % nVertices
@@ -243,8 +240,6 @@
deallocate(delsq_circulation)
deallocate(delsq_vorticity)
- call mpas_timer_stop("compute_tend-horiz mix-del4")
-
!--------------------------------------------------------------------
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 => s % rhoDisplaced % array
tracers => s % tracers % array
+ call mpas_timer_start("equation of state", .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("equation of state", richEOSTimer)
call ocn_vmix_get_rich_numbers(grid, indexT, indexS, u, h, h_edge, &
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("finalize")
+
!
! Finalize output streams
!
@@ -78,6 +80,7 @@
! Finalize core
!
call mpas_core_finalize(domain)
+ call mpas_timer_stop("finalize")
call mpas_timer_stop("total time")
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 => all_timers%next
nullify(current%next)
- else
+ else
current => 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 => timer_ptr
endif
endif
</font>
</pre>