Index: LMDZ4/branches/LMDZ4V5.0-dev/libf/dyn3dpar/gcm.F
===================================================================
--- LMDZ4/branches/LMDZ4V5.0-dev/libf/dyn3dpar/gcm.F	(revision 1333)
+++ LMDZ4/branches/LMDZ4V5.0-dev/libf/dyn3dpar/gcm.F	(revision 1357)
@@ -70,8 +70,11 @@
 #include "description.h"
 #include "serre.h"
-#include "com_io_dyn.h"
+!#include "com_io_dyn.h"
 #include "iniprint.h"
 #include "tracstoke.h"
+#ifdef INCA
+! Only INCA needs these informations (from the Earth's physics)
 #include "indicesol.h"
+#endif
 
       INTEGER         longcles
@@ -335,32 +338,32 @@
      .  ' restart ne correspondent pas a celles lues dans '
         write(lunout,*)' gcm.def'
-	write(lunout,*)' annee_ref=',annee_ref," anneeref=",anneeref
-	write(lunout,*)' day_ref=',day_ref," dayref=",dayref
-	write(lunout,*)' Pas de remise a zero'
+        write(lunout,*)' annee_ref=',annee_ref," anneeref=",anneeref
+        write(lunout,*)' day_ref=',day_ref," dayref=",dayref
+        write(lunout,*)' Pas de remise a zero'
       ENDIF
-c$$$      if (annee_ref .ne. anneeref .or. day_ref .ne. dayref) then
-c$$$        write(lunout,*)
-c$$$     .  'GCM: Attention les dates initiales lues dans le fichier'
-c$$$        write(lunout,*)
-c$$$     .  ' restart ne correspondent pas a celles lues dans '
-c$$$        write(lunout,*)' gcm.def'
-c$$$	write(lunout,*)' annee_ref=',annee_ref," anneeref=",anneeref
-c$$$	write(lunout,*)' day_ref=',day_ref," dayref=",dayref
-c$$$        if (raz_date .ne. 1) then
-c$$$          write(lunout,*)
-c$$$     .    'GCM: On garde les dates du fichier restart'
-c$$$        else
-c$$$          annee_ref = anneeref
-c$$$          day_ref = dayref
-c$$$          day_ini = dayref
-c$$$          itau_dyn = 0
-c$$$          itau_phy = 0
-c$$$          time_0 = 0.
-c$$$          write(lunout,*)
-c$$$     .   'GCM: On reinitialise a la date lue dans gcm.def'
-c$$$        endif
-c$$$      ELSE
-c$$$        raz_date = 0
-c$$$      endif
+c      if (annee_ref .ne. anneeref .or. day_ref .ne. dayref) then
+c        write(lunout,*)
+c     .  'GCM: Attention les dates initiales lues dans le fichier'
+c        write(lunout,*)
+c     .  ' restart ne correspondent pas a celles lues dans '
+c        write(lunout,*)' gcm.def'
+c        write(lunout,*)' annee_ref=',annee_ref," anneeref=",anneeref
+c        write(lunout,*)' day_ref=',day_ref," dayref=",dayref
+c        if (raz_date .ne. 1) then
+c          write(lunout,*)
+c     .    'GCM: On garde les dates du fichier restart'
+c        else
+c          annee_ref = anneeref
+c          day_ref = dayref
+c          day_ini = dayref
+c          itau_dyn = 0
+c          itau_phy = 0
+c          time_0 = 0.
+c          write(lunout,*)
+c     .   'GCM: On reinitialise a la date lue dans gcm.def'
+c        endif
+c      ELSE
+c        raz_date = 0
+c      endif
 
 #ifdef CPP_IOIPSL
@@ -486,21 +489,27 @@
 
 #ifdef CPP_IOIPSL
-      if ( 1.eq.1) then
       time_step = zdtvr
-      t_ops = iecri * daysec
-      t_wrt = iecri * daysec
+      if (ok_dyn_ins) then
+        ! initialize output file for instantaneous outputs
+        ! t_ops = iecri * daysec ! do operations every t_ops
+        t_ops =((1.0*iecri)/day_step) * daysec  
+        t_wrt = daysec ! iecri * daysec ! write output every t_wrt
+        t_wrt = daysec ! iecri * daysec ! write output every t_wrt
+        CALL inithist(day_ref,annee_ref,time_step,
+     &              t_ops,t_wrt)
 !      CALL inithist_p(dynhist_file,day_ref,annee_ref,time_step,
 !     .              t_ops, t_wrt, histid, histvid)
-
-      IF (ok_dynzon) THEN 
-         t_ops = iperiod * time_step
-         t_wrt = periodav * daysec
+      endif
+
+      IF (ok_dyn_ave) THEN 
+        ! initialize output file for averaged outputs
+        t_ops = iperiod * time_step ! do operations every t_ops
+        t_wrt = periodav * daysec   ! write output every t_wrt
+        CALL initdynav(day_ref,annee_ref,time_step,
+     &       t_ops,t_wrt)
 !         CALL initdynav_p(dynhistave_file,day_ref,annee_ref,time_step,
 !     .        t_ops, t_wrt, histaveid)
       END IF
       dtav = iperiod*dtvr/daysec
-      endif
-
-
 #endif
 ! #endif of #ifdef CPP_IOIPSL
