Index: LMDZ5/branches/testing/libf/dyn3dmem/gcm.F
===================================================================
--- LMDZ5/branches/testing/libf/dyn3dmem/gcm.F	(revision 2160)
+++ LMDZ5/branches/testing/libf/dyn3dmem/gcm.F	(revision 2187)
@@ -240,5 +240,5 @@
      $        iphysiq,day_step,nday, 
      $        nbsrf, is_oce,is_sic,
-     $        is_ter,is_lic)
+     $        is_ter,is_lic, calend)
 
          call init_inca_para(
Index: LMDZ5/branches/testing/libf/dyn3dmem/leapfrog_loc.F
===================================================================
--- LMDZ5/branches/testing/libf/dyn3dmem/leapfrog_loc.F	(revision 2160)
+++ LMDZ5/branches/testing/libf/dyn3dmem/leapfrog_loc.F	(revision 2187)
@@ -1397,56 +1397,63 @@
       IF (itau==itaumax) then
 c$OMP MASTER
-            call allgather_timer_average
-      call barrier
-      if (mpi_rank==0) then
-        
-        print *,'*********************************'
-        print *,'******    TIMER CALDYN     ******'
-        do i=0,mpi_size-1
-          print *,'proc',i,' :   Nb Bandes  :',jj_nb_caldyn(i),
-     &            '  : temps moyen :',
-     &             timer_average(jj_nb_caldyn(i),timer_caldyn,i)
-        enddo
-      
-        print *,'*********************************'
-        print *,'******    TIMER VANLEER    ******'
-        do i=0,mpi_size-1
-          print *,'proc',i,' :   Nb Bandes  :',jj_nb_vanleer(i),
-     &            '  : temps moyen :',
-     &             timer_average(jj_nb_vanleer(i),timer_vanleer,i)
-        enddo
-      
-        print *,'*********************************'
-        print *,'******    TIMER DISSIP    ******'
-        do i=0,mpi_size-1
-          print *,'proc',i,' :   Nb Bandes  :',jj_nb_dissip(i),
-     &            '  : temps moyen :',
-     &             timer_average(jj_nb_dissip(i),timer_dissip,i)
-        enddo
-        
-        print *,'*********************************'
-        print *,'******    TIMER PHYSIC    ******'
-        do i=0,mpi_size-1
-          print *,'proc',i,' :   Nb Bandes  :',jj_nb_physic(i),
-     &            '  : temps moyen :',
-     &             timer_average(jj_nb_physic(i),timer_physic,i)
-        enddo
-        
-      endif  
-      CALL barrier
-      print *,'Taille du Buffer MPI (REAL*8)',MaxBufferSize
+         call allgather_timer_average
+         call barrier
+         if (mpi_rank==0) then
+            
+            print *,'*********************************'
+            print *,'******    TIMER CALDYN     ******'
+            do i=0,mpi_size-1
+               print *,'proc',i,' :   Nb Bandes  :',jj_nb_caldyn(i),
+     &              '  : temps moyen :',
+     &              timer_average(jj_nb_caldyn(i),timer_caldyn,i)
+            enddo
+            
+            print *,'*********************************'
+            print *,'******    TIMER VANLEER    ******'
+            do i=0,mpi_size-1
+               print *,'proc',i,' :   Nb Bandes  :',jj_nb_vanleer(i),
+     &              '  : temps moyen :',
+     &              timer_average(jj_nb_vanleer(i),timer_vanleer,i)
+            enddo
+            
+            print *,'*********************************'
+            print *,'******    TIMER DISSIP    ******'
+            do i=0,mpi_size-1
+               print *,'proc',i,' :   Nb Bandes  :',jj_nb_dissip(i),
+     &              '  : temps moyen :',
+     &              timer_average(jj_nb_dissip(i),timer_dissip,i)
+            enddo
+            
+            print *,'*********************************'
+            print *,'******    TIMER PHYSIC    ******'
+            do i=0,mpi_size-1
+               print *,'proc',i,' :   Nb Bandes  :',jj_nb_physic(i),
+     &              '  : temps moyen :',
+     &              timer_average(jj_nb_physic(i),timer_physic,i)
+            enddo
+            
+         endif  
+         CALL barrier
+         print *,'Taille du Buffer MPI (REAL*8)',MaxBufferSize
       print *,'Taille du Buffer MPI utilise (REAL*8)',MaxBufferSize_Used
-      print *, 'Temps total ecoule sur la parallelisation :',DiffTime()
+       print *, 'Temps total ecoule sur la parallelisation :',DiffTime()
       print *, 'Temps CPU ecoule sur la parallelisation :',DiffCpuTime()
-      CALL print_filtre_timer
-c$OMP END MASTER
-      CALL dynredem1_loc("restart.nc",0.0,
-     .                               vcov,ucov,teta,q,masse,ps)
-c$OMP MASTER
-      call fin_getparam
-        call finalize_parallel
-c$OMP END MASTER
-c$OMP BARRIER
-        RETURN
+         CALL print_filtre_timer
+c$OMP END MASTER
+         CALL dynredem1_loc("restart.nc",0.0,
+     .        vcov,ucov,teta,q,masse,ps)
+c$OMP MASTER
+         call fin_getparam
+c$OMP END MASTER
+
+#ifdef INCA
+         call finalize_inca
+#endif
+
+c$OMP MASTER
+         call finalize_parallel
+c$OMP END MASTER
+c$OMP BARRIER
+         RETURN
       ENDIF
       
@@ -1482,4 +1489,11 @@
 c$OMP MASTER
               call fin_getparam
+c$OMP END MASTER
+
+#ifdef INCA
+              call finalize_inca
+#endif
+
+c$OMP MASTER
               call finalize_parallel
 c$OMP END MASTER
@@ -1604,4 +1618,11 @@
 c$OMP MASTER
                  call fin_getparam
+c$OMP END MASTER
+
+#ifdef INCA
+                 call finalize_inca
+#endif
+
+c$OMP MASTER
                  call finalize_parallel
 c$OMP END MASTER
@@ -1668,4 +1689,11 @@
 c$OMP MASTER
       call fin_getparam
+c$OMP END MASTER
+
+#ifdef INCA
+      call finalize_inca
+#endif
+
+c$OMP MASTER
       call finalize_parallel
 c$OMP END MASTER
