Index: codes/icosagcm/devel/Python/src/unstructured.pyx
===================================================================
--- codes/icosagcm/devel/Python/src/unstructured.pyx	(revision 699)
+++ codes/icosagcm/devel/Python/src/unstructured.pyx	(revision 700)
@@ -69,4 +69,5 @@
 kernels.import_funs([
                      ['dynamico_setup_xios',None],
+                     ['dynamico_print_trace',None],
                      ['dynamico_xios_set_timestep',c_double],
                      ['dynamico_xios_update_calendar',c_int],
Index: codes/icosagcm/devel/src/unstructured/data_unstructured.F90
===================================================================
--- codes/icosagcm/devel/src/unstructured/data_unstructured.F90	(revision 699)
+++ codes/icosagcm/devel/src/unstructured/data_unstructured.F90	(revision 700)
@@ -26,4 +26,5 @@
   ! circulation is positive when going from down to up
 
+  TIME, PARAMETER :: print_trace_interval = 1.
   TIME, BIND(C) :: elapsed
   NUM, BIND(C) :: g, ptop, cpp, cppv, Rd, Rv, preff, Treff, pbot, Phi_bot, rho_bot
@@ -38,5 +39,5 @@
   INTEGER, PARAMETER :: id_dev1=1, id_dev2=2, &
        id_pvort_only=3, id_slow_hydro=4, id_fast=5, id_coriolis=6, id_theta=7, id_geopot=8, id_vert=9, &
-       id_solver=10, id_slow_NH=11, id_NH_geopot=12, id_vert_NH=13, id_update=14, nb_routines=14 
+       id_solver=10, id_slow_NH=11, id_NH_geopot=12, id_vert_NH=13, id_update=14, id_halo=15, nb_routines=15 
   TIME, PRIVATE :: start_time, time_spent(nb_routines) ! time spent in each kernel
   INTEGER, PRIVATE :: current_id, nb_calls(nb_routines)
@@ -45,5 +46,5 @@
        (/'dev1      ', 'dev2      ', &
        'pvort_only', 'slow_hydro', 'fast      ', 'coriolis  ', 'theta     ', 'geopot    ', 'vert      ', &
-       'solver    ', 'slow_NH   ', 'NH_geopot ', 'vert_NH   ',  'update    ' /)
+       'solver    ', 'slow_NH   ', 'NH_geopot ', 'vert_NH   ',  'update    ', 'halo_xchg ' /)
 
   INTEGER, PARAMETER ::transfer_primal=1, transfer_edge=2, transfer_dual=3, transfer_max=3
@@ -69,21 +70,25 @@
   END SUBROUTINE init_trace
 
-  SUBROUTINE print_trace()
+  SUBROUTINE print_trace_() BIND(C, name='dynamico_print_trace')
     INTEGER :: id
     TIME :: total_spent
-    !$OMP MASTER
+    total_spent=SUM(time_spent)
     IF(dynamico_mpi_rank==0) THEN
-       total_spent=SUM(time_spent)
-       IF(total_spent>1.) THEN
-          PRINT *, '========================= Performance metrics ========================='
-          PRINT *, 'Total time spent in instrumented code (seconds) :', total_spent
-          PRINT *, 'Name, #calls, %time, microsec/call, MB/sec'    
-          DO id=1,nb_routines
-             IF(nb_calls(id)>0) PRINT *, id_name(id), nb_calls(id), INT(100.*time_spent(id)/total_spent), &
-                  INT(1e6*time_spent(id)/nb_calls(id)), INT(1e-6*bytes(id)/time_spent(id))
-          END DO
+       PRINT *, '========================= Performance metrics ========================='
+       PRINT *, 'Total time spent in instrumented code (seconds) :', total_spent
+       PRINT *, 'Name, #calls, %time, microsec/call, MB/sec'    
+       DO id=1,nb_routines
+          IF(nb_calls(id)>0) PRINT *, id_name(id), nb_calls(id), INT(100.*time_spent(id)/total_spent), &
+               INT(1e6*time_spent(id)/nb_calls(id)), INT(1e-6*bytes(id)/time_spent(id))
+       END DO
+    END IF
+  END SUBROUTINE print_trace_
+
+  SUBROUTINE print_trace()
+    !$OMP MASTER
+       IF(SUM(time_spent)>print_trace_interval) THEN
+          CALL print_trace_
           CALL init_trace()
        END IF
-    END IF
     !$OMP END MASTER
   END SUBROUTINE print_trace
Index: codes/icosagcm/devel/src/unstructured/transfer_unstructured.F90
===================================================================
--- codes/icosagcm/devel/src/unstructured/transfer_unstructured.F90	(revision 699)
+++ codes/icosagcm/devel/src/unstructured/transfer_unstructured.F90	(revision 700)
@@ -76,4 +76,5 @@
     INTEGER :: llbuf, num, i, istart, ireq, ierr
     IF(.NOT. transfer_initialized) RETURN
+    CALL enter_trace(id_halo, 0)
     halo => send_info(index)
     buf => halo%buf2
@@ -109,4 +110,5 @@
 
     CALL copy_out(SIZE(data,1), SIZE(data,2), SIZE(buf,1), SIZE(buf,2), halo%cells, data, buf)
+    CALL enter_trace(id_halo, 0)
   END SUBROUTINE update_halo
 
