<p><b>ringler@lanl.gov</b> 2010-12-09 11:53:09 -0700 (Thu, 09 Dec 2010)</p><p>add branch for profiling ocean model wall clock time<br>
</p><hr noshade><pre><font color="gray">Copied: branches/ocean_projects/profiling (from rev 636, trunk/mpas)

Modified: branches/ocean_projects/profiling/src/core_ocean/Registry
===================================================================
--- trunk/mpas/src/core_ocean/Registry        2010-12-04 19:42:05 UTC (rev 636)
+++ branches/ocean_projects/profiling/src/core_ocean/Registry        2010-12-09 18:53:09 UTC (rev 637)
@@ -7,6 +7,7 @@
 namelist integer   sw_model config_ntimesteps        7500
 namelist integer   sw_model config_output_interval   500
 namelist integer   sw_model config_stats_interval    100
+namelist integer   sw_model config_StdOutDump        1
 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/profiling/src/core_ocean/module_mpas_core.F
===================================================================
--- trunk/mpas/src/core_ocean/module_mpas_core.F        2010-12-04 19:42:05 UTC (rev 636)
+++ branches/ocean_projects/profiling/src/core_ocean/module_mpas_core.F        2010-12-09 18:53:09 UTC (rev 637)
@@ -115,7 +115,10 @@
       ! During integration, time level 1 stores the model state at the beginning of the
       !   time step, and time level 2 stores the state advanced dt in time by timestep(...)
       do itimestep = 1,ntimesteps
-         write(0,*) 'Doing timestep ', itimestep
+         if(mod(itimestep,config_StdOutDump).eq.0) then
+            write(0,*) 'Doing timestep ', itimestep
+            call timer_write()
+         endif
          call timer_start(&quot;time integration&quot;)
          call mpas_timestep(domain, itimestep, dt)
          call timer_stop(&quot;time integration&quot;)

Modified: branches/ocean_projects/profiling/src/core_ocean/module_time_integration.F
===================================================================
--- trunk/mpas/src/core_ocean/module_time_integration.F        2010-12-04 19:42:05 UTC (rev 636)
+++ branches/ocean_projects/profiling/src/core_ocean/module_time_integration.F        2010-12-09 18:53:09 UTC (rev 637)
@@ -5,6 +5,7 @@
    use constants
    use dmpar
    use vector_reconstruction
+   use timer
 
    contains
 
@@ -26,6 +27,7 @@
       type (dm_info) :: dminfo
       type (block_type), pointer :: block
 
+      call timer_start(&quot;timestep_rk4&quot;)
       if (trim(config_time_integration) == 'RK4') then
          call rk4(domain, dt)
       else
@@ -34,7 +36,10 @@
          write(0,*) 'Currently, only ''RK4'' is supported.'
          call dmpar_abort(dminfo)
       end if
+      call timer_stop(&quot;timestep_rk4&quot;)
 
+      
+      call timer_start(&quot;timestep_NaNCheck&quot;)
       block =&gt; domain % blocklist
       do while (associated(block))
          block % state % time_levs(2) % state % xtime % scalar &amp;
@@ -47,6 +52,7 @@
 
          block =&gt; block % next
       end do
+      call timer_stop(&quot;timestep_NaNCheck&quot;)
 
    end subroutine timestep
 
@@ -75,10 +81,12 @@
 
       real (kind=RKIND), dimension(4) :: rk_weights, rk_substep_weights
 
+      call timer_start(&quot;timestep_rk4_allocateState&quot;)
       block =&gt; domain % blocklist
       call allocate_state(provis, &amp;
                           block % mesh % nCells, block % mesh % nEdges, block % mesh % maxEdges, block % mesh % maxEdges2, &amp;
                           block % mesh % nVertices, block % mesh % vertexDegree, block % mesh % nVertLevels )
+      call timer_stop(&quot;timestep_rk4_allocateState&quot;)
 
       !
       ! Initialize time_levs(2) with state at current time
@@ -86,6 +94,7 @@
       ! Couple tracers time_levs(2) with h in time-levels
       ! Initialize RK weights
       !
+      call timer_start(&quot;timestep_rk4_copyState&quot;)
       block =&gt; domain % blocklist
       do while (associated(block))
 
@@ -113,13 +122,17 @@
       rk_substep_weights(3) = dt
       rk_substep_weights(4) = 0.
 
+      call timer_stop(&quot;timestep_rk4_copyState&quot;)
 
+
       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
       ! BEGIN RK loop 
       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+      call timer_start(&quot;timestep_rk4_stage&quot;)
       do rk_step = 1, 4
+
 ! ---  update halos for diagnostic variables
-
+        call timer_start(&quot;timestep_rk4_stage_dmpar1&quot;)
         block =&gt; domain % blocklist
         do while (associated(block))
            call dmpar_exch_halo_field2dReal(domain % dminfo, provis % pv_edge % array(:,:), &amp;
@@ -137,9 +150,11 @@
 
            block =&gt; block % next
         end do
+        call timer_stop(&quot;timestep_rk4_stage_dmpar1&quot;)
 
 ! ---  compute tendencies
 
+        call timer_start(&quot;timestep_rk4_stage_tendencies&quot;)
         block =&gt; domain % blocklist
         do while (associated(block))
            call compute_tend(block % tend, provis, block % mesh)
@@ -147,9 +162,10 @@
            call enforce_boundaryEdge(block % tend, block % mesh)
            block =&gt; block % next
         end do
+        call timer_stop(&quot;timestep_rk4_stage_tendencies&quot;)
 
 ! ---  update halos for prognostic variables
-
+        call timer_start(&quot;timestep_rk4_stage_dmpar2&quot;)
         block =&gt; domain % blocklist
         do while (associated(block))
            call dmpar_exch_halo_field2dReal(domain % dminfo, block % tend % u % array(:,:), &amp;
@@ -163,9 +179,11 @@
                                             block % parinfo % cellsToSend, block % parinfo % cellsToRecv)
            block =&gt; block % next
         end do
+        call timer_stop(&quot;timestep_rk4_stage_dmpar2&quot;)
 
 ! ---  compute next substep state
 
+        call timer_start(&quot;timestep_rk4_stage_provis&quot;)
         if (rk_step &lt; 4) then
            block =&gt; domain % blocklist
            do while (associated(block))
@@ -187,15 +205,17 @@
               if (config_test_case == 1) then    ! For case 1, wind field should be fixed
                  provis % u % array(:,:) = block % state % time_levs(1) % state % u % array(:,:)
               end if
+              call timer_start(&quot;timestep_rk4_stage_provis_diagnostics&quot;)
               call compute_solve_diagnostics(dt, provis, block % mesh)
+              call timer_stop(&quot;timestep_rk4_stage_provis_diagnostics&quot;)
               block =&gt; block % next
            end do
         end if
+        call timer_stop(&quot;timestep_rk4_stage_provis&quot;)
 
 
-
 !--- accumulate update (for RK4)
-
+        call timer_start(&quot;timestep_rk4_stage_accumulate&quot;)
         block =&gt; domain % blocklist
         do while (associated(block))
            block % state % time_levs(2) % state % u % array(:,:) = block % state % time_levs(2) % state % u % array(:,:) &amp;
@@ -213,8 +233,10 @@
 
            block =&gt; block % next
         end do
+        call timer_stop(&quot;timestep_rk4_stage_accumulate&quot;)
 
       end do
+      call timer_stop(&quot;timestep_rk4_stage&quot;)
       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
       ! END RK loop 
       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

</font>
</pre>