Index: codes/icosagcm/trunk/src/advect_tracer.f90
===================================================================
--- codes/icosagcm/trunk/src/advect_tracer.f90	(revision 144)
+++ codes/icosagcm/trunk/src/advect_tracer.f90	(revision 145)
@@ -39,6 +39,7 @@
     USE advect_mod
     USE mpipara
+    USE trace
     IMPLICIT NONE
-
+    
     TYPE(t_field),POINTER :: f_hfluxt(:)   ! time-integrated horizontal mass flux
     TYPE(t_field),POINTER :: f_wfluxt(:)   ! time-integrated vertical mass flux
@@ -51,4 +52,6 @@
     REAL(rstd),POINTER :: rhodz(:,:), u(:,:) 
     INTEGER :: ind,k
+
+    CALL trace_start("advect_tracer") 
 
     CALL transfert_request(f_u,req_e1)
@@ -110,4 +113,7 @@
     CALL transfert_request(f_q,req_i1)      ! necessary ?
     CALL transfert_request(f_rhodz,req_i1)  ! necessary ?
+    
+    CALL trace_end("advect_tracer")
+     
 
     ! horizontal transport - split in two to place transfer of gradq3d
Index: codes/icosagcm/trunk/src/caldyn_gcm.f90
===================================================================
--- codes/icosagcm/trunk/src/caldyn_gcm.f90	(revision 144)
+++ codes/icosagcm/trunk/src/caldyn_gcm.f90	(revision 145)
@@ -91,4 +91,5 @@
     USE theta2theta_rhodz_mod
     USE mpipara
+    USE trace
     IMPLICIT NONE
     LOGICAL,INTENT(IN)    :: write_out
@@ -109,4 +110,5 @@
     INTEGER :: ind,ij
     
+    CALL trace_start("caldyn")
     CALL transfert_request(f_phis,req_i1) 
     CALL transfert_request(f_ps,req_i1) 
@@ -188,4 +190,5 @@
     
     !    CALL check_mass_conservation(f_ps,f_dps)
+    CALL trace_end("caldyn")
     
 END SUBROUTINE caldyn
@@ -195,4 +198,5 @@
   USE disvert_mod
   USE exner_mod
+  USE trace
   IMPLICIT NONE
   REAL(rstd),INTENT(IN)  :: u(iim*3*jjm,llm)
@@ -208,5 +212,7 @@
   LOGICAL,SAVE :: first=.TRUE.
   !$OMP THREADPRIVATE(first)
-  
+
+
+  CALL trace_start("compute_pvort")  
   !$OMP BARRIER      
   !$OMP MASTER  
@@ -281,5 +287,7 @@
     DEALLOCATE(qv)       ! potential velocity  
 !!$OMP END MASTER
-!!$OMP BARRIER                                                      
+!!$OMP BARRIER   
+    CALL trace_end("compute_pvort")
+                                                       
   END SUBROUTINE compute_pvort
   
@@ -288,4 +296,5 @@
   USE disvert_mod
   USE exner_mod
+  USE trace
   IMPLICIT NONE
     REAL(rstd),INTENT(IN)  :: phis(iim*jjm)
@@ -315,5 +324,6 @@
     LOGICAL,SAVE :: first=.TRUE.
 !$OMP THREADPRIVATE(first)
-        
+    
+    CALL trace_start("compute_caldyn")
 !$OMP BARRIER      
 !$OMP MASTER  
@@ -644,4 +654,6 @@
 !!$OMP END MASTER
 !!$OMP BARRIER                                                      
+    CALL trace_end("compute_caldyn")
+
   END SUBROUTINE compute_caldyn
 
Index: codes/icosagcm/trunk/src/dissip_gcm.f90
===================================================================
--- codes/icosagcm/trunk/src/dissip_gcm.f90	(revision 144)
+++ codes/icosagcm/trunk/src/dissip_gcm.f90	(revision 145)
@@ -430,4 +430,5 @@
   USE exner_mod
   USE geopotential_mod
+  USE trace
   IMPLICIT NONE
     TYPE(t_field),POINTER :: f_ue(:)
@@ -447,4 +448,5 @@
     INTEGER :: l,i,j,n
     
+    CALL trace_start("dissip")
     CALL gradiv(f_ue,f_due_diss1)
     CALL gradrot(f_ue,f_due_diss2)
@@ -497,4 +499,6 @@
       END IF
    END DO
+
+   CALL trace_end("dissip")
 
     CONTAINS
@@ -532,4 +536,5 @@
   SUBROUTINE gradiv(f_ue,f_due)
   USE icosa
+  USE trace
   IMPLICIT NONE
     TYPE(t_field),POINTER :: f_ue(:)
@@ -540,4 +545,6 @@
     INTEGER :: it
        
+    CALL trace_start("gradiv")
+
     DO ind=1,ndomain
       CALL swap_dimensions(ind)
@@ -560,4 +567,6 @@
     ENDDO
 
+   CALL trace_end("gradiv")
+
   END SUBROUTINE gradiv
   
@@ -565,4 +574,5 @@
   SUBROUTINE gradrot(f_ue,f_due)
   USE icosa
+  USE trace
   IMPLICIT NONE
     TYPE(t_field),POINTER :: f_ue(:)
@@ -573,4 +583,6 @@
     INTEGER :: it
        
+    CALL trace_start("gradrot")
+
     DO ind=1,ndomain
       CALL swap_dimensions(ind)
@@ -594,8 +606,11 @@
     ENDDO
 
+    CALL trace_end("gradrot")
+
   END SUBROUTINE gradrot
   
   SUBROUTINE divgrad(f_theta,f_dtheta)
   USE icosa
+  USE trace
   IMPLICIT NONE
     TYPE(t_field),POINTER :: f_theta(:)
@@ -605,4 +620,6 @@
     INTEGER :: ind
     INTEGER :: it
+
+    CALL trace_start("divgrad")
        
     DO ind=1,ndomain
@@ -626,4 +643,6 @@
 
     ENDDO
+
+    CALL trace_end("divgrad")
 
   END SUBROUTINE divgrad
Index: codes/icosagcm/trunk/src/timeloop_gcm.f90
===================================================================
--- codes/icosagcm/trunk/src/timeloop_gcm.f90	(revision 144)
+++ codes/icosagcm/trunk/src/timeloop_gcm.f90	(revision 145)
@@ -18,5 +18,5 @@
   USE physics_mod
   USE mpipara
-  
+  USE trace
   IMPLICIT NONE
   TYPE(t_field),POINTER :: f_phis(:)
@@ -222,4 +222,7 @@
     LOGICAL :: with_dps
     INTEGER :: ind
+
+    CALL trace_start("Euler_scheme")  
+
     DO ind=1,ndomain
        CALL swap_dimensions(ind)
@@ -238,4 +241,6 @@
     ENDDO
 
+    CALL trace_end("Euler_scheme")  
+
     END SUBROUTINE Euler_scheme
 
@@ -245,4 +250,6 @@
       REAL(rstd), DIMENSION(4), PARAMETER :: coef = (/ .25, 1./3., .5, 1. /)
       REAL(rstd) :: tau
+  
+      CALL trace_start("RK_scheme")  
 
       tau = dt*coef(stage)
@@ -268,4 +275,7 @@
          END IF
       END DO
+      
+      CALL trace_end("RK_scheme")
+      
     END SUBROUTINE RK_scheme
 
@@ -274,4 +284,6 @@
       INTEGER :: ind
 
+      CALL trace_start("leapfrog_scheme")
+        
       DO ind=1,ndomain
         CALL swap_dimensions(ind)
@@ -301,4 +313,7 @@
           
       ENDDO
+
+      CALL trace_end("leapfrog_scheme")
+
     END SUBROUTINE leapfrog_scheme  
  
@@ -307,5 +322,8 @@
     INTEGER :: ind, stage
     REAL :: tau
-    tau = dt/nb_stage
+
+      CALL trace_start("leapfrog_matsuno_scheme")
+    
+      tau = dt/nb_stage
       DO ind=1,ndomain
         CALL swap_dimensions(ind)
@@ -347,4 +365,5 @@
       
       ENDDO
+      CALL trace_end("leapfrog_matsuno_scheme")
       
     END SUBROUTINE leapfrog_matsuno_scheme  
@@ -353,4 +372,6 @@
     IMPLICIT NONE
       INTEGER :: ind
+
+      CALL trace_start("adam_bashforth_scheme")
 
       DO ind=1,ndomain
@@ -375,4 +396,6 @@
 
       ENDDO     
+
+      CALL trace_end("adam_bashforth_scheme")
       
     END SUBROUTINE adam_bashforth_scheme
Index: codes/icosagcm/trunk/src/trace.F90
===================================================================
--- codes/icosagcm/trunk/src/trace.F90	(revision 145)
+++ codes/icosagcm/trunk/src/trace.F90	(revision 145)
@@ -0,0 +1,33 @@
+MODULE trace
+
+
+CONTAINS
+
+  SUBROUTINE trace_start(name)
+  IMPLICIT NONE
+    CHARACTER(LEN=*),INTENT(IN) :: name 
+#ifdef VTRACE
+#include <vt_user.inc>
+#endif 
+
+#ifdef VTRACE
+     VT_USER_START(name)
+#endif
+
+  END SUBROUTINE trace_start    
+
+  SUBROUTINE trace_end(name)
+  IMPLICIT NONE
+#ifdef VTRACE
+#include <vt_user.inc>
+#endif 
+
+    CHARACTER(LEN=*),INTENT(IN) :: name
+
+#ifdef VTRACE
+     VT_USER_END(name)
+#endif
+
+  END SUBROUTINE trace_end    
+
+END MODULE trace
