<p><b>dwj07@fsu.edu</b> 2012-09-06 14:28:27 -0600 (Thu, 06 Sep 2012)</p><p><br>
        -- TRUNK COMMIT --<br>
<br>
        Committing hooks for TAU usage.<br>
        Now (assuming you have TAU built), you can build with something like...<br>
        &quot;make gfortran CORE=ocean TAU=true&quot; and it will link against the tau libraries.<br>
<br>
        This way hardware counters can be used for the timer sections.<br>
</p><hr noshade><pre><font color="gray">Modified: trunk/mpas/Makefile
===================================================================
--- trunk/mpas/Makefile        2012-09-05 14:53:12 UTC (rev 2141)
+++ trunk/mpas/Makefile        2012-09-06 20:28:27 UTC (rev 2142)
@@ -267,6 +267,15 @@
         PAPI_MESSAGE=&quot;Papi libraries are off.&quot;
 endif # USE_PAPI IF
 
+ifeq &quot;$(TAU)&quot; &quot;true&quot;
+        LINKER=tau_f90.sh
+        CPPINCLUDES += -DMPAS_TAU
+        TAU_MESSAGE=&quot;TAU Hooks are on.&quot;
+else
+        LINKER=$(FC)
+        TAU_MESSAGE=&quot;TAU Hooks are off.&quot;
+endif
+
 ifneq ($(wildcard $(NETCDF)/lib/libnetcdff.*), ) # CHECK FOR NETCDF4
         LIBS += -lnetcdff
 endif # CHECK FOR NETCDF4
@@ -291,6 +300,7 @@
                  CC=&quot;$(CC)&quot; \
                  SFC=&quot;$(SFC)&quot; \
                  SCC=&quot;$(SCC)&quot; \
+                 LINKER=&quot;$(LINKER)&quot; \
                  CFLAGS=&quot;$(CFLAGS)&quot; \
                  FFLAGS=&quot;$(FFLAGS)&quot; \
                  LDFLAGS=&quot;$(LDFLAGS)&quot; \
@@ -306,6 +316,7 @@
         @echo $(DEBUG_MESSAGE)
         @echo $(SERIAL_MESSAGE)
         @echo $(PAPI_MESSAGE)
+        @echo $(TAU_MESSAGE)
 clean:
         cd src; $(MAKE) clean RM=&quot;$(RM)&quot; CORE=&quot;$(CORE)&quot;
         $(RM) $(CORE)_model.exe

Modified: trunk/mpas/src/Makefile
===================================================================
--- trunk/mpas/src/Makefile        2012-09-05 14:53:12 UTC (rev 2141)
+++ trunk/mpas/src/Makefile        2012-09-06 20:28:27 UTC (rev 2142)
@@ -3,7 +3,7 @@
 all: mpas
 
 mpas: reg_includes externals frame ops dycore drver
-        $(FC) $(LDFLAGS) -o $(CORE)_model.exe driver/*.o -L. -ldycore -lops -lframework $(LIBS) -I./external/esmf_time_f90 -L./external/esmf_time_f90 -lesmf_time
+        $(LINKER) $(LDFLAGS) -o $(CORE)_model.exe driver/*.o -L. -ldycore -lops -lframework $(LIBS) -I./external/esmf_time_f90 -L./external/esmf_time_f90 -lesmf_time
 
 reg_includes: 
         ( cd registry; $(MAKE) CC=&quot;$(SCC)&quot; )

Modified: trunk/mpas/src/framework/mpas_timer.F
===================================================================
--- trunk/mpas/src/framework/mpas_timer.F        2012-09-05 14:53:12 UTC (rev 2141)
+++ trunk/mpas/src/framework/mpas_timer.F        2012-09-06 20:28:27 UTC (rev 2142)
@@ -46,6 +46,10 @@
 
           integer :: clock, hz, usecs
 
+#ifdef MPAS_TAU 
+          call tau_start(timer_name)
+#endif
+
           timer_added = .false.
           timer_found = .false.
 
@@ -170,6 +174,10 @@
           real (kind=RKIND) :: time_temp
           logical :: timer_found, string_equal, check_flag
           integer :: clock, hz, usecs
+
+#ifdef MPAS_TAU 
+          call tau_stop(timer_name)
+#endif
  
           timer_found = .false.
  

</font>
</pre>