Index: /trunk/chantiers/commit_importants.log
===================================================================
--- /trunk/chantiers/commit_importants.log	(revision 96)
+++ /trunk/chantiers/commit_importants.log	(revision 97)
@@ -545,2 +545,166 @@
 M               75   mars/libf/phymars/meso_dustlift.F
 NB: correction mineure, de facon a recuperer alpha_lift de initracer
+
+
+********************
+**** commit_v96 ****
+********************
+
+Serie de modifs Sebastien Lebonnois
+
+** Correction bug
+**---------------
+
+* Modif de bilan_dyn.F :
+    - bug à la ligne 915: jjm et non jjp1...
+
+** Modifs de dyn3d
+**---------------
+
+* Modif de leapfrog.F :
+    - ajout test pk monotone
+
+** Sortie des opacites plutot que des aerosols dans phytitan
+**----------------------------------------------------------
+
+* Modif de physiq.F :
+    - ajout de variables et d'un common (pour variables venant de radtitan)
+
+* Modif de ini/write_histmth.h
+    - sorties des opacites (thv* et khv*)
+    - commentaire de la sortie des q*
+
+** Reglage .def
+**---------------
+
+* titan/physiq.def :
+    - ajustement tx
+
+** Sorties IOIPSL
+**-----------------------
+
+* Modif de phy[venus/titan]/physiq.F
+    - suppression des REAL*4 lies aux sorties IOIPSL
+
+* Modif de phy[venus/titan]/[ini/write]_hist*
+    - suppression des variables intermediaires en REAL*4 lies aux sorties IOIPSL
+
+** nqmx remplace par nqtot
+**-----------------------
+
+* Modif de phytitan/
+  calchim.F,optci.F,optcv.F,pg3.F,physiq.F,phytrac.F,
+  radlwsw.F,radtitan.F,rdf.F
+
+* Modif de phyvenus/
+  phytrac.F,testphys1d.F
+
+** nettoyage
+**-----------------------
+
+* Suppression de phytitan/
+  calchim.dbleprec,calchim.spleprec
+
+** calendriers
+**-----------------------
+
+* Modif de dyn3d[par]/gcm.F:
+  - calendriers: il faut une option dans ioconf_calendar pour definir
+  les calendriers titan et venus
+  - pour definition jD_ref et jH_ref: avertissement pour Venus et Titan
+  - avertissement pour separation en annees
+
+* Modif de deftank/[titan/venus]/run.def
+  - ajout de calend => calend=titan ou venus
+  - ajout de anneeref et raz_date
+
+** Possibilite de tourner moins d'une journee
+**-----------------------
+
+* Modif de dyn3d[par]/leapfrog[_p].F
+  - ajout de la possibilite de tourner moins d'1 jour
+
+* Modif de dyn3d[par]/control_mod.F90
+  - ajout de less1day et fractday
+
+* Modif de dyn3d[par]/conf_gcm.F
+  - definition/lecture de less1day et fractday
+
+* Modif de deftank/venus/run.def
+  - ajout de less1day et fractday
+
+** suppression advtrac.h et control.h dans les phy*
+**-----------------------
+
+* Modif de : phy[venus/titan]/physiq.F
+  - remplacement de #include "advtrac.h" par USE infotrac
+  - remplacement de #include "control.h" par USE control_mod
+
+* Modif de : phy[venus/titan]/phytrac.F 
+  - remplacement de #include "advtrac.h" par USE infotrac
+  - remplacement de #include "control.h" par USE control_mod
+
+* Modif de : phy[venus/titan]/phyredem.F
+ - remplacement de #include "control.h" par USE control_mod
+
+** ajustements lecture des .def
+**-----------------------
+
+* Modif de phy[titan/venus]/conf_phys.F90
+  - ajout de tous les parametres transferes de gcm.def dans physiq.def
+  - utilisation de ecritphy: 
+       pour Venus, frequence de sortie dans mth et ins
+       pour Titan, frequence de sortie dans ins
+  - suppression de zzz
+
+* Modif de phy[titan/venus]/clesphys.h
+  - mise a jour des declarations necessaires
+
+** Elimination de clesphy0
+**-----------------------
+
+* Modif de : phy[titan/venus]/phyetat0.F
+  - elimination de clesphy0, longcles
+
+* Modif de : phy[titan/venus]/physiq.F
+  - elimination de clesphy0, longcles
+
+* Modif de dyn3d[par]/
+  calfis.F, ce0l.F90, conf_gcm.F, gcm.F, leapfrog.F
+  - elimination de clesphy0, longcles
+
+** Ajustement format .h
+**-----------------------
+
+* Modif de phy[titan/venus]/clesphys.h (clesphys.inc elimine)
+
+* Modif de phy[titan/venus]/YOMCST.h (YOMCST.inc elimine)
+
+* Elimination de tous les YOETHF dans phy[titan/venus] et nettoyage de suphec.F
+
+* Elimination de tous les FCTTRE dans phy[titan/venus]
+
+* Modif de : phytitan/comorbit.h (comorbit.inc elimine)
+
+** Controle de la remise a zero des varc
+**-----------------------
+
+* Modif de dyn3d[par]/sortvarc.F
+  - ajout firstcal
+  - ajout flag pour controle (resetvarc)
+  - correction pour avoir le moment cinetique total absolu
+
+* Modif de dyn3d[par]/conf_gcm.F
+  - ajout flag pour controle (resetvarc)
+
+* Modif de dyn3d[par]/control_mod.F90
+  - ajout de resetvarc
+
+* Modif de deftank/venus/run.def
+  - ajout de resetvarc
+
+* Modif de dyn3d[par]/sortvarc0.F
+  - correction pour avoir le moment cinetique total absolu
+
+
+
Index: /trunk/deftanks/titan/physiq.def
===================================================================
--- /trunk/deftanks/titan/physiq.def	(revision 96)
+++ /trunk/deftanks/titan/physiq.def	(revision 97)
@@ -90,5 +90,5 @@
 microfi=1
 # facteur pour les aerosols
-tx = 1.
+tx = 3.
 # facteur de correction
 tcorrect=1.
Index: /trunk/deftanks/titan/run.def
===================================================================
--- /trunk/deftanks/titan/run.def	(revision 96)
+++ /trunk/deftanks/titan/run.def	(revision 97)
@@ -4,10 +4,14 @@
 INCLUDEDEF=physiq.def
 INCLUDEDEF=gcm.def
+## Calendrier
+calend=titan
 ## Jour de l'etat initial ( = 350  si 20 Decembre ,par expl. ,comme ici )
 dayref=1
 ##  Annee de l'etat  initial (   avec  4  chiffres   )
-anneeref=1979
+anneeref=1111
 ## Remise a zero de la date initiale
-raz_date=0
+raz_date=1
+## Reinit des variables de controle
+resetvarc=n
 ## Nombre de jours d'integration
 nday=11
Index: /trunk/deftanks/venus/run.def
===================================================================
--- /trunk/deftanks/venus/run.def	(revision 96)
+++ /trunk/deftanks/venus/run.def	(revision 97)
@@ -4,12 +4,20 @@
 INCLUDEDEF=physiq.def
 INCLUDEDEF=gcm.def
+## Calendrier
+calend=venus
 ## Jour de l'etat initial ( = 350  si 20 Decembre ,par expl. ,comme ici )
 dayref=1
 ##  Annee de l'etat  initial (   avec  4  chiffres   )
-anneeref=1979
+anneeref=1111
 ## Remise a zero de la date initiale
-raz_date=0
+raz_date=1
+## Reinit des variables de controle
+resetvarc=n
 ## Nombre de jours d'integration
 nday=2
+## Si on veut moins d'un jour :
+less1day=n
+## si less1day T, fraction de jour du run :
+fractday=0.01
 ## periode de sortie des variables de controle (en pas)
 iconser=500
Index: /trunk/libf/dyn3d/bilan_dyn.F
===================================================================
--- /trunk/libf/dyn3d/bilan_dyn.F	(revision 96)
+++ /trunk/libf/dyn3d/bilan_dyn.F	(revision 97)
@@ -915,5 +915,5 @@
          do itr=2,ntr
            do l=1,llm
-            do j=1,jjp1
+            do j=1,jjm
           zawQ(1,l,itr,iQ)=zawQ(1,l,itr,iQ)+zwQ(j,l,itr,iQ)*zmasse(j,l)
             enddo
Index: /trunk/libf/dyn3d/calfis.F
===================================================================
--- /trunk/libf/dyn3d/calfis.F	(revision 96)
+++ /trunk/libf/dyn3d/calfis.F	(revision 97)
@@ -21,5 +21,4 @@
      $                  pdq,
      $                  flxw,
-     $                  clesphy0,
      $                  pdufi,
      $                  pdvfi,
@@ -131,8 +130,4 @@
       REAL pdqfi(iip1,jjp1,llm,nqtot)
       REAL pdpsfi(iip1,jjp1)
-
-      INTEGER        longcles
-      PARAMETER    ( longcles = 20 )
-      REAL clesphy0( longcles )
 
 
@@ -515,5 +510,4 @@
      .             zphis,
      .             presnivs,
-     .             clesphy0,
      .             zufi,
      .             zvfi,
@@ -546,5 +540,4 @@
      .             zphis,
      .             presnivs,
-     .             clesphy0,
      .             zufi,
      .             zvfi,
Index: /trunk/libf/dyn3d/ce0l.F90
===================================================================
--- /trunk/libf/dyn3d/ce0l.F90	(revision 96)
+++ /trunk/libf/dyn3d/ce0l.F90	(revision 97)
@@ -39,10 +39,8 @@
 #include "temps.h"
 #include "logic.h"
-  INTEGER, PARAMETER            :: longcles=20
-  REAL,    DIMENSION(longcles)  :: clesphy0
   REAL,    DIMENSION(iip1,jjp1) :: masque
   CHARACTER(LEN=15)             :: calnd
 !-------------------------------------------------------------------------------
-  CALL conf_gcm( 99, .TRUE. , clesphy0 )
+  CALL conf_gcm( 99, .TRUE. )
 
   CALL Init_Phys_lmdz(iim,jjp1,llm,1,(/(jjm-1)*iim+2/))
Index: /trunk/libf/dyn3d/conf_gcm.F
===================================================================
--- /trunk/libf/dyn3d/conf_gcm.F	(revision 96)
+++ /trunk/libf/dyn3d/conf_gcm.F	(revision 97)
@@ -4,5 +4,5 @@
 c
 c
-      SUBROUTINE conf_gcm( tapedef, etatinit, clesphy0 )
+      SUBROUTINE conf_gcm( tapedef, etatinit )
 c
       USE control_mod
@@ -22,13 +22,8 @@
 c     etatinit  :     = TRUE   , on ne  compare pas les valeurs des para- 
 c     -metres  du zoom  avec  celles lues sur le fichier start .
-c      clesphy0 :  sortie  .
 c
        LOGICAL etatinit
        INTEGER tapedef
 
-       INTEGER        longcles
-       PARAMETER(     longcles = 20 )
-       REAL clesphy0( longcles )
-c
 c   Declarations :
 c   --------------
@@ -147,4 +142,11 @@
       CALL getin('raz_date', raz_date)
 
+!Config  Key  = resetvarc
+!Config  Desc = Reinit des variables de controle
+!Config  Def  = n
+!Config  Help = Reinit des variables de controle
+      resetvarc = .false.
+      CALL getin('resetvarc',resetvarc)
+
 !Config  Key  = nday
 !Config  Desc = Nombre de jours d'integration
@@ -154,4 +156,18 @@
       nday = 10
       CALL getin('nday',nday)
+
+!Config  Key  = less1day
+!Config  Desc = Possibilite d'integrer moins d'un jour
+!Config  Def  = n
+!Config  Help = Possibilite d'integrer moins d'un jour
+      less1day = .false.
+      CALL getin('less1day',less1day)
+
+!Config  Key  = fractday
+!Config  Desc = integration sur une fraction de jour
+!Config  Def  = 0.01
+!Config  Help = integration sur une fraction de jour
+      fractday = 0.01
+      CALL getin('fractday',fractday)
 
 !Config  Key  = day_step
@@ -360,8 +376,4 @@
        ip_ebil_dyn = 0
        CALL getin('ip_ebil_dyn',ip_ebil_dyn)
-
-      DO i = 1, longcles
-       clesphy0(i) = 0.
-      ENDDO
 
 ccc  ....   P. Le Van , ajout  le 7/03/95 .pour le zoom ...
@@ -611,4 +623,8 @@
       write(lunout,*)' anneeref = ', anneeref
       write(lunout,*)' nday = ', nday
+      if (less1day) then
+      write(lunout,*)' Run only for a fraction of day ! '
+      write(lunout,*)' fractday = ', fractday
+      endif
       write(lunout,*)' day_step = ', day_step
       write(lunout,*)' iperiod = ', iperiod
Index: /trunk/libf/dyn3d/control_mod.F90
===================================================================
--- /trunk/libf/dyn3d/control_mod.F90	(revision 96)
+++ /trunk/libf/dyn3d/control_mod.F90	(revision 97)
@@ -24,4 +24,7 @@
   LOGICAL ok_dyn_ave ! output averaged values of fields in the dynamics
                      ! in NetCDF files dyn_hist*ave.nc
+  LOGICAL :: resetvarc  ! allows to reset the variables in sortvarc
+  LOGICAL :: less1day   ! allows to run less than 1 day (for Venus)
+  REAL    :: fractday   ! fraction of the day to run in this case
 
 END MODULE
Index: /trunk/libf/dyn3d/gcm.F
===================================================================
--- /trunk/libf/dyn3d/gcm.F	(revision 96)
+++ /trunk/libf/dyn3d/gcm.F	(revision 97)
@@ -80,9 +80,4 @@
 #include "indicesol.h"
 #endif
-      INTEGER         longcles
-      PARAMETER     ( longcles = 20 )
-      REAL  clesphy0( longcles )
-      SAVE  clesphy0
-
 
 
@@ -172,5 +167,5 @@
 ! Ehouarn: dump possibility of using defrun
 !#ifdef CPP_IOIPSL
-      CALL conf_gcm( 99, .TRUE. , clesphy0 )
+      CALL conf_gcm( 99, .TRUE. )
 !#else
 !      CALL defrun( 99, .TRUE. , clesphy0 )
@@ -210,4 +205,14 @@
         call ioconf_calendar('gregorian')
         write(lunout,*)'CALENDRIER CHOISI: Terrestre bissextile'
+      else if (calend == 'titan') then
+!        call ioconf_calendar('titan')
+        write(lunout,*)'CALENDRIER CHOISI: Titan'
+        abort_message = 'A FAIRE...'
+        call abort_gcm(modname,abort_message,1)
+      else if (calend == 'venus') then
+!        call ioconf_calendar('venus')
+        write(lunout,*)'CALENDRIER CHOISI: Venus'
+        abort_message = 'A FAIRE...'
+        call abort_gcm(modname,abort_message,1)
       else
         abort_message = 'Mauvais choix de calendrier'
@@ -361,4 +366,6 @@
       mois = 1
       heure = 0.
+! Ce n'est defini pour l'instant que pour la Terre... 
+      if (planet_type.eq.'earth') then
       call ymds2ju(annee_ref, mois, day_ref, heure, jD_ref)
       jH_ref = jD_ref - int(jD_ref)
@@ -373,4 +380,11 @@
       write(lunout,*)'jD_ref+jH_ref,an, mois, jour, heure'
       write(lunout,*)jD_ref+jH_ref,an, mois, jour, heure
+      else
+! A voir pour Titan et Venus
+        jD_ref=0
+        jH_ref=0
+      write(lunout,*)'A VOIR POUR VENUS ET TITAN: jD_ref, jH_ref'
+      write(lunout,*)jD_ref,jH_ref
+      endif ! planet_type
 #else
 ! Ehouarn: we still need to define JD_ref and JH_ref
@@ -460,8 +474,15 @@
 
 #ifdef CPP_IOIPSL
+! Ce n'est defini pour l'instant que pour la Terre... 
+      if (planet_type.eq.'earth') then
       call ju2ymds(jD_ref + day_ini - day_ref, an, mois, jour, heure)
       write (lunout,301)jour, mois, an
       call ju2ymds(jD_ref + day_end - day_ref, an, mois, jour, heure)
       write (lunout,302)jour, mois, an
+      else
+! A voir pour Titan et Venus
+      write(lunout,*)'A VOIR POUR VENUS ET TITAN: separation en annees...'
+      endif ! planet_type
+
  301  FORMAT('1'/,15x,'run du ', i2,'/',i2,'/',i4)
  302  FORMAT('1'/,15x,'    au ', i2,'/',i2,'/',i4)
@@ -519,5 +540,5 @@
 
 
-      CALL leapfrog(ucov,vcov,teta,ps,masse,phis,q,clesphy0,
+      CALL leapfrog(ucov,vcov,teta,ps,masse,phis,q,
      .              time_0)
 
Index: /trunk/libf/dyn3d/leapfrog.F
===================================================================
--- /trunk/libf/dyn3d/leapfrog.F	(revision 96)
+++ /trunk/libf/dyn3d/leapfrog.F	(revision 97)
@@ -4,5 +4,5 @@
 c
 c
-      SUBROUTINE leapfrog(ucov,vcov,teta,ps,masse,phis,q,clesphy0,
+      SUBROUTINE leapfrog(ucov,vcov,teta,ps,masse,phis,q,
      &                    time_0)
 
@@ -66,8 +66,4 @@
 ! FH 2008/05/09 On elimine toutes les clefs physiques dans la dynamique
 ! #include "clesphys.h"
-
-      INTEGER         longcles
-      PARAMETER     ( longcles = 20 )
-      REAL  clesphy0( longcles )
 
       real zqmin,zqmax
@@ -202,4 +198,8 @@
 
       itaufin   = nday*day_step
+      if (less1day) then
+c MODIF VENUS: to run less than one day:
+        itaufin   = int(fractday*day_step)
+      endif
       itaufinp1 = itaufin +1
       modname="leapfrog"
@@ -236,4 +236,21 @@
       CALL pression ( ip1jmp1, ap, bp, ps, p       )
       CALL exner_hyb( ip1jmp1, ps, p,alpha,beta, pks, pk, pkf )
+c------------------
+c TEST PK MONOTONE
+c------------------
+      write(*,*) "Test PK"
+      do ij=1,ip1jmp1
+        do l=2,llm
+          if(pk(ij,l).gt.pk(ij,l-1)) then
+c           write(*,*) ij,l,pk(ij,l)
+            abort_message = 'PK non strictement decroissante'
+            call abort_gcm(modname,abort_message,1)
+c           write(*,*) "ATTENTION, Test PK deconnecté..."
+          endif
+        enddo
+      enddo
+      write(*,*) "Fin Test PK"
+c     stop
+c------------------
 
 c-----------------------------------------------------------------------
@@ -430,5 +447,5 @@
      $               du,dv,dteta,dq,
      $               flxw,
-     $               clesphy0, dufi,dvfi,dtetafi,dqfi,dpfi  )
+     $               dufi,dvfi,dtetafi,dqfi,dpfi  )
 
 c      ajout des tendances physiques:
Index: /trunk/libf/dyn3d/sortvarc.F
===================================================================
--- /trunk/libf/dyn3d/sortvarc.F	(revision 96)
+++ /trunk/libf/dyn3d/sortvarc.F	(revision 97)
@@ -55,4 +55,8 @@
 
       REAL       SSUM
+
+      logical  firstcal
+      data     firstcal/.true./
+      save     firstcal
 
 c-----------------------------------------------------------------------
@@ -115,5 +119,5 @@
      *               cosphi(ij)
           ENDDO
-          angl(l) = radsg *
+          angl(l) = rad *
      s    (SSUM(ip1jm-iip1,ge(iip2),1)-SSUM(jjm-1,ge(iip2),iip1))
       ENDDO
@@ -129,8 +133,6 @@
       ang   = SSUM(     llm,  angl, 1 )
 
-c      rday = REAL(INT ( day_ini + time ))
-c
+      IF (firstcal.and.resetvarc) then
        rday = REAL(INT(time-jD_ref-jH_ref))
-      IF(ptot0.eq.0.)  THEN
          PRINT 3500, itau, rday, heure,time
          PRINT*,'WARNING!!! On recalcule les valeurs initiales de :'
@@ -151,4 +153,5 @@
       ang = ang /ang0
 
+      firstcal = .false.
 
       PRINT 3500, itau, rday, heure, time
Index: /trunk/libf/dyn3d/sortvarc0.F
===================================================================
--- /trunk/libf/dyn3d/sortvarc0.F	(revision 96)
+++ /trunk/libf/dyn3d/sortvarc0.F	(revision 97)
@@ -116,5 +116,5 @@
      *               cosphi(ij)
           ENDDO
-          angl(l) = radsg *
+          angl(l) = rad *
      s    (SSUM(ip1jm-iip1,ge(iip2),1)-SSUM(jjm-1,ge(iip2),iip1))
       ENDDO
Index: /trunk/libf/dyn3dpar/calfis_p.F
===================================================================
--- /trunk/libf/dyn3dpar/calfis_p.F	(revision 96)
+++ /trunk/libf/dyn3dpar/calfis_p.F	(revision 97)
@@ -21,5 +21,4 @@
      $                  pdq,
      $                  flxw,
-     $                  clesphy0,
      $                  pdufi,
      $                  pdvfi,
@@ -144,8 +143,4 @@
       REAL pdqfi(iip1,jjp1,llm,nqtot)
       REAL pdpsfi(iip1,jjp1)
-
-      INTEGER        longcles
-      PARAMETER    ( longcles = 20 )
-      REAL clesphy0( longcles )
 
 #ifdef CPP_PHYS
@@ -691,5 +686,4 @@
      .             zphis_omp,
      .             presnivs_omp,
-     .             clesphy0,
      .             zufi_omp,
      .             zvfi_omp,
@@ -720,5 +714,4 @@
      .             zphis_omp,
      .             presnivs_omp,
-     .             clesphy0,
      .             zufi_omp,
      .             zvfi_omp,
Index: /trunk/libf/dyn3dpar/ce0l.F90
===================================================================
--- /trunk/libf/dyn3dpar/ce0l.F90	(revision 96)
+++ /trunk/libf/dyn3dpar/ce0l.F90	(revision 97)
@@ -42,10 +42,8 @@
 #include "temps.h"
 #include "logic.h"
-  INTEGER, PARAMETER            :: longcles=20
-  REAL,    DIMENSION(longcles)  :: clesphy0
   REAL,    DIMENSION(iip1,jjp1) :: masque
   CHARACTER(LEN=15)             :: calnd
 !-------------------------------------------------------------------------------
-  CALL conf_gcm( 99, .TRUE. , clesphy0 )
+  CALL conf_gcm( 99, .TRUE. )
 
   CALL init_mpi
Index: /trunk/libf/dyn3dpar/conf_gcm.F
===================================================================
--- /trunk/libf/dyn3dpar/conf_gcm.F	(revision 96)
+++ /trunk/libf/dyn3dpar/conf_gcm.F	(revision 97)
@@ -4,5 +4,5 @@
 c
 c
-      SUBROUTINE conf_gcm( tapedef, etatinit, clesphy0 )
+      SUBROUTINE conf_gcm( tapedef, etatinit )
 c
 #ifdef CPP_IOIPSL
@@ -26,13 +26,8 @@
 c     etatinit  :     = TRUE   , on ne  compare pas les valeurs des para- 
 c     -metres  du zoom  avec  celles lues sur le fichier start .
-c      clesphy0 :  sortie  .
 c
        LOGICAL etatinit
        INTEGER tapedef
 
-       INTEGER        longcles
-       PARAMETER(     longcles = 20 )
-       REAL clesphy0( longcles )
-c
 c   Declarations :
 c   --------------
@@ -157,4 +152,11 @@
       CALL getin('raz_date', raz_date)
 
+!Config  Key  = resetvarc
+!Config  Desc = Reinit des variables de controle
+!Config  Def  = n
+!Config  Help = Reinit des variables de controle
+      resetvarc = .false.
+      CALL getin('resetvarc',resetvarc)
+
 !Config  Key  = nday
 !Config  Desc = Nombre de jours d'integration
@@ -164,4 +166,18 @@
       nday = 10
       CALL getin('nday',nday)
+
+!Config  Key  = less1day
+!Config  Desc = Possibilite d'integrer moins d'un jour
+!Config  Def  = n
+!Config  Help = Possibilite d'integrer moins d'un jour
+      less1day = .false.
+      CALL getin('less1day',less1day)
+
+!Config  Key  = fractday
+!Config  Desc = integration sur une fraction de jour
+!Config  Def  = 0.01
+!Config  Help = integration sur une fraction de jour
+      fractday = 0.01
+      CALL getin('fractday',fractday)
 
 !Config  Key  = day_step
@@ -628,4 +644,8 @@
       write(lunout,*)' anneeref = ', anneeref
       write(lunout,*)' nday = ', nday
+      if (less1day) then
+      write(lunout,*)' Run only for a fraction of day ! '
+      write(lunout,*)' fractday = ', fractday
+      endif
       write(lunout,*)' day_step = ', day_step
       write(lunout,*)' iperiod = ', iperiod
Index: /trunk/libf/dyn3dpar/control_mod.F90
===================================================================
--- /trunk/libf/dyn3dpar/control_mod.F90	(revision 96)
+++ /trunk/libf/dyn3dpar/control_mod.F90	(revision 97)
@@ -24,4 +24,7 @@
   LOGICAL ok_dyn_ave ! output averaged values of fields in the dynamics
                      ! in NetCDF files dyn_hist*ave.nc
+  LOGICAL :: resetvarc  ! allows to reset the variables in sortvarc
+  LOGICAL :: less1day   ! allows to run less than 1 day (for Venus)
+  REAL    :: fractday   ! fraction of the day to run in this case
 
 END MODULE
Index: /trunk/libf/dyn3dpar/gcm.F
===================================================================
--- /trunk/libf/dyn3dpar/gcm.F	(revision 96)
+++ /trunk/libf/dyn3dpar/gcm.F	(revision 97)
@@ -79,9 +79,4 @@
 #include "indicesol.h"
 #endif
-      INTEGER         longcles
-      PARAMETER     ( longcles = 20 )
-      REAL  clesphy0( longcles )
-      SAVE  clesphy0
-
 
 
@@ -175,5 +170,5 @@
 ! Ehouarn: dump possibility of using defrun
 !#ifdef CPP_IOIPSL
-      CALL conf_gcm( 99, .TRUE. , clesphy0 )
+      CALL conf_gcm( 99, .TRUE. )
 !#else
 !      CALL defrun( 99, .TRUE. , clesphy0 )
@@ -240,4 +235,14 @@
         call ioconf_calendar('gregorian')
         write(lunout,*)'CALENDRIER CHOISI: Terrestre bissextile'
+      else if (calend == 'titan') then
+!        call ioconf_calendar('titan')
+        write(lunout,*)'CALENDRIER CHOISI: Titan'
+        abort_message = 'A FAIRE...'
+        call abort_gcm(modname,abort_message,1)
+      else if (calend == 'venus') then
+!        call ioconf_calendar('venus')
+        write(lunout,*)'CALENDRIER CHOISI: Venus'
+        abort_message = 'A FAIRE...'
+        call abort_gcm(modname,abort_message,1)
       else
         abort_message = 'Mauvais choix de calendrier'
@@ -382,4 +387,6 @@
       mois = 1
       heure = 0.
+! Ce n'est defini pour l'instant que pour la Terre... 
+      if (planet_type.eq.'earth') then
       call ymds2ju(annee_ref, mois, day_ref, heure, jD_ref)
       jH_ref = jD_ref - int(jD_ref)
@@ -394,4 +401,11 @@
       write(lunout,*)'jD_ref+jH_ref,an, mois, jour, heure'
       write(lunout,*)jD_ref+jH_ref,an, mois, jour, heure
+      else
+! A voir pour Titan et Venus
+        jD_ref=0
+        jH_ref=0
+      write(lunout,*)'A VOIR POUR VENUS ET TITAN: jD_ref, jH_ref'
+      write(lunout,*)jD_ref,jH_ref
+      endif ! planet_type
 #else
 ! Ehouarn: we still need to define JD_ref and JH_ref
@@ -491,8 +505,15 @@
 
 #ifdef CPP_IOIPSL
+! Ce n'est defini pour l'instant que pour la Terre... 
+      if (planet_type.eq.'earth') then
       call ju2ymds(jD_ref + day_ini - day_ref, an, mois, jour, heure)
       write (lunout,301)jour, mois, an
       call ju2ymds(jD_ref + day_end - day_ref, an, mois, jour, heure)
       write (lunout,302)jour, mois, an
+      else
+! A voir pour Titan et Venus
+      write(lunout,*)'A VOIR POUR VENUS ET TITAN: separation en annees...'
+      endif ! planet_type
+
  301  FORMAT('1'/,15x,'run du ', i2,'/',i2,'/',i4)
  302  FORMAT('1'/,15x,'    au ', i2,'/',i2,'/',i4)
@@ -554,5 +575,5 @@
 
 c$OMP PARALLEL DEFAULT(SHARED) COPYIN(/temps/,/logic/)
-      CALL leapfrog_p(ucov,vcov,teta,ps,masse,phis,q,clesphy0,
+      CALL leapfrog_p(ucov,vcov,teta,ps,masse,phis,q,
      .              time_0)
 c$OMP END PARALLEL
Index: /trunk/libf/dyn3dpar/leapfrog_p.F
===================================================================
--- /trunk/libf/dyn3dpar/leapfrog_p.F	(revision 96)
+++ /trunk/libf/dyn3dpar/leapfrog_p.F	(revision 97)
@@ -5,5 +5,5 @@
 c
 
-      SUBROUTINE leapfrog_p(ucov,vcov,teta,ps,masse,phis,q,clesphy0,
+      SUBROUTINE leapfrog_p(ucov,vcov,teta,ps,masse,phis,q,
      &                    time_0)
 
@@ -70,8 +70,4 @@
 #include "academic.h"
       
-      INTEGER         longcles
-      PARAMETER     ( longcles = 20 )
-      REAL  clesphy0( longcles )
-
       real zqmin,zqmax
       INTEGER nbetatmoy, nbetatdem,nbetat
@@ -219,4 +215,8 @@
       
       itaufin   = nday*day_step
+      if (less1day) then
+c MODIF VENUS: to run less than one day:
+        itaufin   = int(fractday*day_step)
+      endif
       itaufinp1 = itaufin +1
       modname="leapfrog_p"
@@ -820,5 +820,5 @@
      $               du,dv,dteta,dq,
      $               flxw,
-     $               clesphy0, dufi,dvfi,dtetafi,dqfi,dpfi  )
+     $               dufi,dvfi,dtetafi,dqfi,dpfi  )
 !        CALL FTRACE_REGION_END("calfis")
         ijb=ij_begin
Index: /trunk/libf/dyn3dpar/sortvarc.F
===================================================================
--- /trunk/libf/dyn3dpar/sortvarc.F	(revision 96)
+++ /trunk/libf/dyn3dpar/sortvarc.F	(revision 97)
@@ -55,4 +55,8 @@
 
       REAL       SSUM
+
+      logical  firstcal
+      data     firstcal/.true./
+      save     firstcal
 
 c-----------------------------------------------------------------------
@@ -129,8 +133,6 @@
       ang   = SSUM(     llm,  angl, 1 )
 
-c      rday = REAL(INT ( day_ini + time ))
-c
+      IF (firstcal.and.resetvarc) then
        rday = REAL(INT(time-jD_ref-jH_ref))
-      IF(ptot0.eq.0.)  THEN
          PRINT 3500, itau, rday, heure,time
          PRINT*,'WARNING!!! On recalcule les valeurs initiales de :'
@@ -151,4 +153,5 @@
       ang = ang /ang0
 
+      firstcal = .false.
 
       PRINT 3500, itau, rday, heure, time
Index: /trunk/libf/phytitan/YOMCST.h
===================================================================
--- /trunk/libf/phytitan/YOMCST.h	(revision 96)
+++ /trunk/libf/phytitan/YOMCST.h	(revision 97)
@@ -1,4 +1,7 @@
 !
-! $Header: /home/cvsroot/LMDZ4/libf/phylmd/YOMCST.h,v 1.1.1.1 2004/05/19 12:53:08 lmdzadmin Exp $
+!  ATTENTION!!!!: ce fichier include est compatible format fixe/format libre
+!                 veillez  n'utiliser que des ! pour les commentaires
+!                 et  bien positionner les & des lignes de continuation
+!                 (les placer en colonne 6 et en colonne 73)
 !
 ! A1.0 Fundamental constants
@@ -6,8 +9,10 @@
 ! A1.1 Astronomical constants
       REAL RDAY,REA,REPSM,RSIYEA,RSIDAY,ROMEGA
+! A1.1.bis Constantes concernant l'orbite de la Terre:
+      REAL :: R_ecc, R_peri, R_incl
 ! A1.2 Geoide
       REAL RA,RG,R1SA
 ! A1.3 Radiation
-!     REAL RSIGMA,RI0
+!     REAL :: RSIGMA,RI0
       REAL RSIGMA
 ! A1.4 Thermodynamic gas phase
@@ -25,14 +30,9 @@
       REAL RALPD,RBETD,RGAMD
 !
-!    S      ,RSIGMA,RI0
-      COMMON/YOMCST/RPI   ,RCLUM ,RHPLA ,RKBOL ,RNAVO
-     S      ,RDAY  ,REA   ,REPSM ,RSIYEA,RSIDAY,ROMEGA
-     S      ,RA    ,RG    ,R1SA
-     S      ,RSIGMA
-     S      ,R     ,RMD   ,RMV   ,RD    ,RV    ,RCPD
-     S      ,RCPV  ,RCVD  ,RCVV  ,RKAPPA,RETV
-     S      ,RCW   ,RCS
-     S      ,RLVTT ,RLSTT ,RLMLT ,RTT   ,RATM
-     S      ,RESTT ,RALPW ,RBETW ,RGAMW ,RALPS ,RBETS ,RGAMS
-     S      ,RALPD ,RBETD ,RGAMD
-!    ------------------------------------------------------------------
+      COMMON/YOMCST/RPI ,RCLUM, RHPLA, RKBOL, RNAVO ,RDAY  ,REA         &
+     & ,REPSM ,RSIYEA,RSIDAY,ROMEGA , R_ecc, R_peri, R_incl,            &
+     & ,RA    ,RG ,R1SA                                                 &
+     & ,RSIGMA,R ,RMD   ,RMV   ,RD    ,RV    ,RCPD ,RCPV,RCVD           &
+     & ,RCVV  ,RKAPPA,RETV ,RCW   ,RCS ,RLVTT ,RLSTT ,RLMLT ,RTT ,RATM  &
+     & ,RESTT ,RALPW ,RBETW ,RGAMW ,RALPS ,RBETS ,RGAMS ,RALPD ,RBETD   &
+     & ,RGAMD
Index: /trunk/libf/phytitan/calchim.F
===================================================================
--- /trunk/libf/phytitan/calchim.F	(revision 96)
+++ /trunk/libf/phytitan/calchim.F	(revision 97)
@@ -36,5 +36,5 @@
       REAL         cplev(jjm+1,klev)      ! pression intercouches (Pa)
       
-      REAL         dqyc(jjm+1,klev,nqmx)  ! Tendances especes chimiques (nqmx, mais en fait NC...)
+      REAL         dqyc(jjm+1,klev,nqtot)  ! Tendances especes chimiques (nqtot, mais en fait NC...)
       
 c    Local variables :
Index: /trunk/libf/phytitan/clcdrag.F90
===================================================================
--- /trunk/libf/phytitan/clcdrag.F90	(revision 96)
+++ /trunk/libf/phytitan/clcdrag.F90	(revision 97)
@@ -30,6 +30,6 @@
 ! ================================================================= c
 !
-#include "YOMCST.inc"
-#include "clesphys.inc"
+#include "YOMCST.h"
+#include "clesphys.h"
 !
 ! Quelques constantes et options:
Index: /trunk/libf/phytitan/clesphys.h
===================================================================
--- /trunk/libf/phytitan/clesphys.h	(revision 96)
+++ /trunk/libf/phytitan/clesphys.h	(revision 97)
@@ -1,36 +1,31 @@
 !
-! $Header: /home/cvsroot/LMDZ4/libf/phylmd/clesphys.h,v 1.1.1.1 2004/05/19 12:53:08 lmdzadmin Exp $
+!  ATTENTION!!!!: ce fichier include est compatible format fixe/format libre
+!                 veillez  n'utiliser que des ! pour les commentaires
+!                 et  bien positionner les & des lignes de continuation
+!                 (les placer en colonne 6 et en colonne 73)
 !
-c..include cles_phys.h
-c
-       LOGICAL cycle_diurne,soil_model,new_oliq,ok_orodr,ok_orolf 
-       LOGICAL ok_limitvrai
+!..include cles_phys.h
+!
+       LOGICAL cycle_diurne,soil_model,ok_orodr,ok_orolf 
+       LOGICAL ok_orodr,ok_orolf,ok_gw_nonoro
        INTEGER nbapp_rad, nbapp_chim, iflag_con, iflag_ajs
+       REAL    ecritphy
        REAL    solaire
-
-c Parametres pour PBL:
-       real z0,lmixmin
-       REAL ksta
+       REAL    z0, lmixmin
+       REAL    ksta, inertie
        LOGICAL ok_kzmin
-
-c Parametres Chimie:
+       INTEGER lev_histmth, lev_histday
        logical chimi,ylellouch,hcnrad
        integer vchim,aerprod,htoh2
-       
-c Parametres Microphysique:
        integer microfi,cutoff
-       real tx,tcorrect
-       
-c surface
-       real inertie
+       real    tx,tcorrect
 
-cIM lev_histmth : niveau sorties mensuelles
-cIM lev_histday : niveau sorties journalieres
-       INTEGER lev_histmth, lev_histday
 
-       COMMON/clesphys/cycle_diurne, soil_model, new_oliq,
-     ,     ok_orodr, ok_orolf, ok_limitvrai, nbapp_rad, nbapp_chim
-     ,     , iflag_con, iflag_ajs, solaire, z0, lmixmin, ksta
-     ,     , ok_kzmin, lev_histmth, lev_histday
-     ,     , inertie, chimi,vchim,aerprod,htoh2,ylellouch,hcnrad
-     ,     , microfi,cutoff,tx,tcorrect
+       COMMON/clesphys/cycle_diurne, soil_model,                        &
+     &     ok_orodr, ok_orolf, ok_gw_nonoro, nbapp_rad, nbapp_chim      &
+     &     , ecritphy                                                   &
+     &     , iflag_con, iflag_ajs, solaire, z0, lmixmin, ksta           &
+     &     , ok_kzmin, lev_histmth, lev_histday                         &
+     &     , inertie, chimi,vchim,aerprod,htoh2,ylellouch,hcnrad        &
+     &     , microfi,cutoff,tx,tcorrect
+
Index: /trunk/libf/phytitan/comorbit.h
===================================================================
--- /trunk/libf/phytitan/comorbit.h	(revision 96)
+++ /trunk/libf/phytitan/comorbit.h	(revision 97)
@@ -1,12 +1,16 @@
-c-----------------------------------------------------------------------
-c INCLUDE 'comorbit.h'
+!
+!  ATTENTION!!!!: ce fichier include est compatible format fixe/format libre
+!                 veillez  n'utiliser que des ! pour les commentaires
+!                 et  bien positionner les & des lignes de continuation
+!                 (les placer en colonne 6 et en colonne 73)
+!
+!..include comorbit.h
 
-      COMMON/comorbit/aphelie,periheli,year_day,
-     $       peri_day,timeperi,obliquit,
-     $       e_elips,p_elips,unitastr,pi
+      REAL aphelie,periheli,year_day
+      REAL peri_day,timeperi,obliquit
+      REAL e_elips,p_elips,unitastr,pi
 
-      REAL aphelie,periheli,year_day,
-     $  peri_day,timeperi,obliquit,
-     $  e_elips,p_elips,unitastr,pi
+      COMMON/comorbit/aphelie,periheli,year_day,                        &
+     &       peri_day,timeperi,obliquit,                                &
+     &       e_elips,p_elips,unitastr,pi
 
-c-----------------------------------------------------------------------
Index: /trunk/libf/phytitan/conf_phys.F90
===================================================================
--- /trunk/libf/phytitan/conf_phys.F90	(revision 96)
+++ /trunk/libf/phytitan/conf_phys.F90	(revision 97)
@@ -10,8 +10,21 @@
    implicit none
 
-#include "YOMCST.inc"
-#include "clesphys.inc"
+#include "YOMCST.h"
+#include "clesphys.h"
 #include "compbl.h"
-#include "comorbit.inc"
+#include "comorbit.h"
+
+! ok_journe:  sorties journalieres
+! ok_mensuel: sorties mensuelles
+! ok_instan:  sorties instantanees
+
+
+! Sortie:
+  logical              :: ok_journe, ok_mensuel, ok_instan        
+  integer              :: if_ebil
+
+! Local
+  integer              :: numout = 6
+
 !
 ! Configuration de la "physique" de LMDZ a l'aide de la fonction
@@ -22,17 +35,73 @@
 !--- Ca lit le physiq.def ---
 
-!
-! ok_mensuel: sorties mensuelles
-! ok_journe:  sorties journalieres
-! ok_instan:  sorties instantanees
-
-
-! Sortie:
-  logical              :: ok_mensuel, ok_journe, ok_instan
-  integer              :: if_ebil
-
-! Local
-  integer              :: numout = 6
-  real*4               :: zzz
+!******************* parametres anciennement lus dans gcm.def
+
+!Config  Key  = cycle_diurne
+!Config  Desc = Cycle ddiurne
+!Config  Def  = y
+!Config  Help = Cette option permet d'eteidre le cycle diurne.
+!Config         Peut etre util pour accelerer le code !
+       cycle_diurne = .TRUE.
+       CALL getin('cycle_diurne',cycle_diurne)
+
+!Config  Key  = soil_model
+!Config  Desc = Modele de sol
+!Config  Def  = y
+!Config  Help = Choix du modele de sol (Thermique ?)
+!Config         Option qui pourait un string afin de pouvoir
+!Config         plus de choix ! Ou meme une liste d'options !
+       soil_model = .TRUE.
+       CALL getin('soil_model',soil_model)
+
+!Config  Key  = ok_orodr
+!Config  Desc = Oro drag
+!Config  Def  = y
+!Config  Help = GW drag orographie
+!Config         
+       ok_orodr = .TRUE.
+       CALL getin('ok_orodr',ok_orodr)
+
+!Config  Key  =  ok_orolf
+!Config  Desc = Oro lift
+!Config  Def  = n
+!Config  Help = GW lift orographie (pas utilise)
+       ok_orolf = .TRUE.
+       CALL getin('ok_orolf', ok_orolf)
+
+!Config  Key  = ok_gw_nonoro
+!Config  Desc = Gravity waves parameterization
+!Config  Def  = n
+!Config  Help = GW drag non-orographique
+       ok_gw_nonoro = .FALSE.
+       CALL getin('ok_gw_nonoro',ok_gw_nonoro)
+
+!Config  Key  = nbapp_rad
+!Config  Desc = Frequence d'appel au rayonnement
+!Config  Def  = 12
+!Config  Help = Nombre  d'appels des routines de rayonnements
+!Config         par jour.
+       nbapp_rad = 12
+       CALL getin('nbapp_rad',nbapp_rad)
+
+!Config  Key  = nbapp_chim
+!Config  Desc = Frequence d'appel a la chimie
+!Config  Def  = 1
+!Config  Help = Nombre  d'appels des routines de chimie
+!Config         par jour.
+       nbapp_chim = 1
+       CALL getin('nbapp_chim',nbapp_chim)
+
+!Config  Key  = iflag_con
+!Config  Desc = Flag de convection
+!Config  Def  = 0
+!Config  Help = Flag  pour la convection les options suivantes existent :
+!Config         0 : ajsec simple (VENUS, TITAN)
+!Config         1 pour LMD,
+!Config         2 pour Tiedtke,
+!Config         3 pour CCM(NCAR)  
+       iflag_con = 0
+       CALL getin('iflag_con',iflag_con)
+
+!******************* fin parametres anciennement lus dans gcm.def
 
 !Config Key  = OK_mensuel
@@ -64,4 +133,13 @@
 !
 !
+!Config  Key  = ecritphy
+!Config  Desc = Frequence d'ecriture dans histins
+!Config  Def  = 1
+!Config  Help = frequence de l'ecriture du fichier histins
+!Config         en jours.
+!
+       ecritphy = 1.
+       CALL getin('ecritphy', ecritphy)
+!
 !Config Key  = if_ebil
 !Config Desc = Niveau de sortie pour les diags bilan d'energie 
@@ -85,7 +163,6 @@
 !Config Help = 
 !               
-  zzz = 673.
-  call getin('year_day', zzz)
-  year_day = zzz
+  year_day = 673.
+  call getin('year_day', year_day)
 !
 !Config Key  = peri_day
@@ -94,7 +171,6 @@
 !Config Help = 
 !               
-  zzz = 533.
-  call getin('peri_day', zzz)
-  peri_day = zzz
+  peri_day = 533.
+  call getin('peri_day', peri_day)
 !
 !Config Key  = periheli
@@ -103,7 +179,6 @@
 !Config Help = 
 !               
-  zzz = 1354.5
-  call getin('periheli', zzz)
-  periheli = zzz
+  periheli = 1354.5
+  call getin('periheli', periheli)
 !!
 !Config Key  = aphelie
@@ -112,7 +187,6 @@
 !Config Help = 
 !               
-  zzz = 1506.0
-  call getin('aphelie', zzz)
-  aphelie = zzz
+  aphelie = 1506.0
+  call getin('aphelie', aphelie)
 !!
 !Config Key  = obliquit
@@ -121,7 +195,6 @@
 !Config Help = 
 !               
-  zzz = 26.7
-  call getin('obliquit', zzz)
-  obliquit = zzz
+  obliquit = 26.7
+  call getin('obliquit', obliquit)
 !
 !Config Key  = solaire
@@ -131,7 +204,6 @@
 !Config Help = 
 !
-  zzz = 2620.
-    call getin('solaire', zzz)
-  solaire = zzz
+  solaire = 2620.
+    call getin('solaire', solaire)
 !
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -158,7 +230,6 @@
 !Config Help =
 !
-  zzz = 1.0e-7
-  call getin('ksta',zzz)
-  ksta = zzz
+  ksta = 1.0e-7
+  call getin('ksta',ksta)
 
 !
@@ -168,7 +239,6 @@
 !Config Help =
 !
-  zzz = 1.0e-2
-  call getin('z0',zzz)
-  z0 = zzz
+  z0 = 1.0e-2
+  call getin('z0',z0)
 
 !
@@ -178,9 +248,7 @@
 !Config Help =
 !
-  zzz = 35.
-  call getin('lmixmin',zzz)
-  lmixmin = zzz
-
-!
+  lmixmin = 35.
+  call getin('lmixmin',lmixmin)
+
 !
 !Config Key  = ok_kzmin
@@ -204,10 +272,9 @@
 !Config Key  = inertie
 !Config Desc =
-!Config Def  = 2000.
-!Config Help =
-!
-  zzz = 2000.
-  call getin('inertie',zzz)
-  inertie = zzz
+!Config Def  = 340.
+!Config Help =
+!
+  inertie = 340.
+  call getin('inertie',inertie)
 !
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -287,7 +354,6 @@
 !Config Help =
 !
-  zzz = 3.5
-  call getin('tx',zzz)
-  tx = zzz
+  tx = 3.5
+  call getin('tx',tx)
 
 !
@@ -297,7 +363,6 @@
 !Config Help =
 !
-  zzz = 1.
-  call getin('tcorrect',zzz)
-  tcorrect = zzz
+  tcorrect = 1.
+  call getin('tcorrect',tcorrect)
 
 !
@@ -349,7 +414,16 @@
   write(numout,*)' ##############################################'
   write(numout,*)' Configuration des parametres de la physique: '
+  write(numout,*)' cycle_diurne = ', cycle_diurne
+  write(numout,*)' soil_model = ', soil_model
+  write(numout,*)' ok_orodr = ', ok_orodr
+  write(numout,*)' ok_orolf = ', ok_orolf
+  write(numout,*)' ok_gw_nonoro = ', ok_gw_nonoro
+  write(numout,*)' nbapp_rad = ', nbapp_rad
+  write(numout,*)' nbapp_chim = ', nbapp_chim
+  write(numout,*)' iflag_con = ', iflag_con
   write(numout,*)' Sortie mensuelle = ', ok_mensuel
   write(numout,*)' Sortie journaliere = ', ok_journe
   write(numout,*)' Sortie instantanee = ', ok_instan
+  write(numout,*)' frequence sorties = ', ecritphy  
   write(numout,*)' Sortie bilan d energie, if_ebil =', if_ebil
   write(numout,*)' Duree de l annee = ',year_day
Index: /trunk/libf/phytitan/ini_histday.h
===================================================================
--- /trunk/libf/phytitan/ini_histday.h	(revision 96)
+++ /trunk/libf/phytitan/ini_histday.h	(revision 97)
@@ -10,6 +10,5 @@
 c
          idayref = day_ref
-	 z4julian = zjulian
-         CALL ymds2ju(annee_ref, 1, idayref, zero, z4julian)
+         CALL ymds2ju(annee_ref, 1, idayref, zero, zjulian)
 c
          CALL gr_fi_ecrit(1,klon,iim,jjmp1,rlond,zx_lon)
@@ -19,13 +18,10 @@
          ENDDO
          CALL gr_fi_ecrit(1,klon,iim,jjmp1,rlatd,zx_lat)
-	 z4_lon = zx_lon
-	 z4_lat = zx_lat
-	 zpresnivs=presnivs
-         CALL histbeg("histday", iim,z4_lon(:,1), jjmp1,z4_lat(1,:),
-     .                 1,iim,1,jjmp1, itau_phy, z4julian, zsto, 
+         CALL histbeg("histday", iim,zx_lon(:,1), jjmp1,zx_lat(1,:),
+     .                 1,iim,1,jjmp1, itau_phy, zjulian, zsto, 
      .                 nhori, nid_day)
          write(*,*)'Journee ', itau_phy, zjulian
          CALL histvert(nid_day, "presnivs", "Vertical levels", "mb",
-     .                 klev, zpresnivs, nvert)
+     .                 klev, presnivs, nvert)
 
 c-------------------------------------------------------
Index: /trunk/libf/phytitan/ini_histins.h
===================================================================
--- /trunk/libf/phytitan/ini_histins.h	(revision 96)
+++ /trunk/libf/phytitan/ini_histins.h	(revision 97)
@@ -9,6 +9,5 @@
 c
          idayref = day_ref
-	 z4julian = zjulian
-         CALL ymds2ju(annee_ref, 1, idayref, zero, z4julian)
+         CALL ymds2ju(annee_ref, 1, idayref, zero, zjulian)
 c
          CALL gr_fi_ecrit(1,klon,iim,jjmp1,rlond,zx_lon)
@@ -18,13 +17,10 @@
          ENDDO
          CALL gr_fi_ecrit(1,klon,iim,jjmp1,rlatd,zx_lat)
-	 z4_lon = zx_lon
-	 z4_lat = zx_lat
-	 zpresnivs=presnivs
-         CALL histbeg("histins", iim,z4_lon(:,1), jjmp1,z4_lat(1,:),
-     .                 1,iim,1,jjmp1, itau_phy, z4julian, zsto1,
+         CALL histbeg("histins", iim,zx_lon(:,1), jjmp1,zx_lat(1,:),
+     .                 1,iim,1,jjmp1, itau_phy, zjulian, zsto1,
      .                 nhori, nid_ins)
          write(*,*)'Inst ', itau_phy, zjulian
          CALL histvert(nid_ins, "presnivs", "Vertical levels", "mb",
-     .                 klev, zpresnivs, nvert)
+     .                 klev, presnivs, nvert)
 
 c-------------------------------------------------------
Index: /trunk/libf/phytitan/ini_histmth.h
===================================================================
--- /trunk/libf/phytitan/ini_histmth.h	(revision 96)
+++ /trunk/libf/phytitan/ini_histmth.h	(revision 97)
@@ -7,6 +7,5 @@
 c
          idayref = day_ref
-	 z4julian = zjulian
-         CALL ymds2ju(annee_ref, 1, idayref, zero, z4julian)
+         CALL ymds2ju(annee_ref, 1, idayref, zero, zjulian)
 c
          CALL gr_fi_ecrit(1,klon,iim,jjmp1,rlond,zx_lon)
@@ -16,13 +15,10 @@
          ENDDO
          CALL gr_fi_ecrit(1,klon,iim,jjmp1,rlatd,zx_lat)
-	 z4_lon = zx_lon
-	 z4_lat = zx_lat
-	 zpresnivs=presnivs
-         CALL histbeg("histmth", iim,z4_lon(:,1), jjmp1,z4_lat(1,:),
-     .                 1,iim,1,jjmp1, itau_phy, z4julian, zsto, 
+         CALL histbeg("histmth", iim,zx_lon(:,1), jjmp1,zx_lat(1,:),
+     .                 1,iim,1,jjmp1, itau_phy, zjulian, zsto, 
      .                 nhori, nid_mth)
          write(*,*)'Journee ', itau_phy, zjulian
          CALL histvert(nid_mth, "presnivs", "Vertical levels", "mb",
-     .                 klev, zpresnivs, nvert)
+     .                 klev, presnivs, nvert)
 
 c-------------------------------------------------------
@@ -98,12 +94,12 @@
 c
          if (iflag_trac.eq.1) THEN
-          if (microfi.eq.1) then
-           DO iq=1,nmicro
-         CALL histdef(nid_mth, tname(iq), ttext(iq), "n/m2",
-     .                iim,jjmp1,nhori, klev,1,klev,nvert, 32,
-     .                "ave(X)", zsto,zout)
-           ENDDO
-	  endif
-	  if (nmicro.lt.nqmax) then
+c         if (microfi.eq.1) then
+c          DO iq=1,nmicro
+c        CALL histdef(nid_mth, tname(iq), ttext(iq), "n/m2",
+c    .                iim,jjmp1,nhori, klev,1,klev,nvert, 32,
+c    .                "ave(X)", zsto,zout)
+c          ENDDO
+c         endif
+          if (nmicro.lt.nqmax) then
            DO iq=nmicro+1,nqmax
          CALL histdef(nid_mth, tname(iq), ttext(iq), "ppm",
@@ -117,5 +113,5 @@
 c    .                "ave(X)", zsto,zout)
 c          ENDDO
-	  endif
+          endif
          endif
 c
@@ -150,4 +146,18 @@
      .                iim,jjmp1,nhori, klev,1,klev,nvert,
      .                32, "ave(X)", zsto1,zout)
+c
+         DO k=3,nspecv,5
+           write(str1,'(i2.2)') k
+         CALL histdef(nid_mth,"thv"//str1,"Haze Opa Vis",
+     .                "--",iim,jjmp1,nhori,klev,1,klev,nvert,32,
+     .                "ave(X)",zsto1,zout)
+         ENDDO
+c
+         DO k=3,nspecv,5
+           write(str1,'(i2.2)') k
+         CALL histdef(nid_mth,"khv"//str1,"Haze ext Vis ",
+     .                "m-1",iim,jjmp1,nhori,klev,1,klev,nvert,32,
+     .                "ave(X)",zsto1,zout)
+         ENDDO
 c
       ENDIF !lev_histmth.GE.3
Index: /trunk/libf/phytitan/interface_surf.F90
===================================================================
--- /trunk/libf/phytitan/interface_surf.F90	(revision 96)
+++ /trunk/libf/phytitan/interface_surf.F90	(revision 97)
@@ -25,5 +25,5 @@
   END INTERFACE
 
-#include "YOMCST.inc"
+#include "YOMCST.h"
 
   CONTAINS
Index: /trunk/libf/phytitan/optci.F
===================================================================
--- /trunk/libf/phytitan/optci.F	(revision 96)
+++ /trunk/libf/phytitan/optci.F	(revision 97)
@@ -8,5 +8,5 @@
 c   Arguments:
 c   ---------
-      REAL    ykim(klon,klev,nqmx)
+      REAL    ykim(klon,klev,nqtot)
       integer nmicro
 c   ---------
@@ -56,5 +56,5 @@
       DIMENSION PROD(NLEVEL)
 * nrad dans microtab.h
-      real qaer(klon,nlayer,nqmx)
+      real qaer(klon,nlayer,nqtot)
       real v(nrad),rayon(nrad),vrat,dr(nrad),dv(nrad)
       real xv1(klev,nspeci),xv2(klev,nspeci)
@@ -121,5 +121,5 @@
       if (iopti.eq.0) then
 
-c verif pour taille zqaer_1pt, sachant que si microfi=0 et nqmx=1, 
+c verif pour taille zqaer_1pt, sachant que si microfi=0 et nqtot=1, 
 c il faut quand meme qu on lise la look-up table de dim nrad=10
 c et si microfi=1, on doit avoir nmicro=nrad (dans microtab.h)
Index: /trunk/libf/phytitan/optcv.F
===================================================================
--- /trunk/libf/phytitan/optcv.F	(revision 96)
+++ /trunk/libf/phytitan/optcv.F	(revision 97)
@@ -51,5 +51,5 @@
       COMMON /ADJUST/ RHCH4,FH2,FHAZE,FHVIS,FHIR,TAUFAC,RCLOUD,FARGON
       COMMON /CONST/ RGAS,RHOP,PI,SIGMA
-      COMMON /traceurs/qaer(klon,nlayer,nqmx)
+      COMMON /traceurs/qaer(klon,nlayer,nqtot)
       COMMON /part/ v(nrad),rayon(nrad),vrat,dr(nrad),dv(nrad)
 
@@ -93,5 +93,5 @@
 c      do nng=2,klon
 c       do i=1,klev           
-c        do j=1,nqmx
+c        do j=1,nqtot
 c          sum=sum+qaer(nng,i,j)*rayon(j)**3.*1.3333*3.1415*1000.
 c        enddo
@@ -107,5 +107,5 @@
       if (ioptv.eq.0) then
 
-c verif pour taille zqaer_1pt, sachant que si microfi=0 et nqmx=1, 
+c verif pour taille zqaer_1pt, sachant que si microfi=0 et nqtot=1, 
 c il faut quand meme qu'on lise la look-up table de dim nrad=10
 c et si microfi=1, on doit avoir nmicro=nrad (dans microtab.h)
Index: /trunk/libf/phytitan/pg3.F
===================================================================
--- /trunk/libf/phytitan/pg3.F	(revision 96)
+++ /trunk/libf/phytitan/pg3.F	(revision 97)
@@ -86,5 +86,5 @@
 * --------------
 
-c      print*,'Df aerosols /1 a nqmx/'
+c      print*,'Df aerosols /1 a nqtot/'
 c       write(*,*) (df(h),h=1,nrad)
 c       write(*,*) (rayon(h),h=1,nrad)
@@ -173,5 +173,5 @@
 c
 c      print*,'CHECK BEFORE COMPUTATION'
-c      print*,'nrad=',nrad,' nqmx=',nqmx,' ctrl...'
+c      print*,'nrad=',nrad,' nqtot=',nqtot,' ctrl...'
 c      print*,'##############################################'
 c      print*,'1.0 - tableaux de bases:'
@@ -221,5 +221,5 @@
 c      print*,'1.2 - Avec les rayons:'
 c      print*,'h	i	j	k(h,i,j)'
-c        do j=1,nqmx
+c        do j=1,nqtot
 c         print*,h,i,j,k(h,i,j)
 c      enddo
@@ -311,5 +311,5 @@
 #include "dimensions.h"
 #include "microtab.h"
-cparameter(nz=200,nrad=nqmx,nztop=135)
+cparameter(nz=200,nrad=nqtot,nztop=135)
         common/con/c
         real c(nz,nrad,2)
@@ -353,5 +353,5 @@
 	integer li,lf
 	real tt,dt
-cparameter(nz=200,nrad=nqmx,nztop=135)
+cparameter(nz=200,nrad=nqtot,nztop=135)
 	real p(nz),t(nz),rho(nz),ach4(nz),aar(nz),an2(nz),pi,nav
 	real pb(nz),tb(nz),rhob(nz)
@@ -419,5 +419,5 @@
         integer li,lf
         real tt,dt
-cparameter(nz=200,nrad=nqmx)
+cparameter(nz=200,nrad=nqtot)
         real p(nz),t(nz),rho(nz),ach4(nz),aar(nz),an2(nz),pi,nav
         real pb(nz),tb(nz),rhob(nz)
@@ -642,5 +642,5 @@
 * ----------------------------------
 
-cparameter(nz=200,nrad=nqmx)
+cparameter(nz=200,nrad=nqtot)
         real p(nz),t(nz),rho(nz),ach4(nz),aar(nz),an2(nz),pb(nz),tb(nz),
      s     rhob(nz)
@@ -692,5 +692,5 @@
 * ----------------------------------
 
-cparameter(nz=200,nrad=nqmx)
+cparameter(nz=200,nrad=nqtot)
         real v(nrad),rayon(nrad),vrat,dr(nrad),dv(nrad)
 
@@ -771,5 +771,5 @@
 * ----------------------------------
 
-cparameter(nz=200,nrad=nqmx)
+cparameter(nz=200,nrad=nqtot)
         real p(nz),t(nz),rho(nz),ach4(nz),aar(nz),an2(nz)
      s  ,pb(nz),tb(nz),rhob(nz)
@@ -851,5 +851,5 @@
 
 
-cparameter(nz=200,nrad=nqmx)
+cparameter(nz=200,nrad=nqtot)
 	real p(nz),t(nz),rho(nz),ach4(nz),aar(nz),an2(nz),pb(nz),tb(nz),
      s   rhob(nz)
@@ -909,5 +909,5 @@
 * ----------------------------------
 
-cparameter(nz=200,nrad=nqmx)
+cparameter(nz=200,nrad=nqtot)
 	integer li,lf
 	real dt,tt
@@ -1070,5 +1070,5 @@
 	integer li,lf
 	real tt,dt
-cparameter(nz=200,nrad=nqmx)
+cparameter(nz=200,nrad=nqtot)
 	real p(nz),t(nz),rho(nz),ach4(nz),aar(nz),an2(nz),pi,nav
 	real pb(nz),tb(nz),rhob(nz)
@@ -1180,5 +1180,5 @@
 
 	integer ndz
-cparameter (nrad=nqmx,nz=200,nztop=135)
+cparameter (nrad=nqtot,nz=200,nztop=135)
 	real zb(nz),z(nz),dz(nz),dzb(nz) 
 	real c(nz,nrad,2)
@@ -1271,5 +1271,5 @@
 
 	integer ndz
-cparameter (nrad=nqmx,nz=200,nztop=135)
+cparameter (nrad=nqtot,nz=200,nztop=135)
 	real zb(nz),z(nz),dz(nz),dzb(nz) 
 	real c(nz,nrad,2)
@@ -1345,5 +1345,5 @@
 * ----------------------------------
 
-cparameter(nz=200,nrad=nqmx,nztop=135)
+cparameter(nz=200,nrad=nqtot,nztop=135)
 	integer li,lf
 	real tt,dt
Index: /trunk/libf/phytitan/phyetat0.F
===================================================================
--- /trunk/libf/phytitan/phyetat0.F	(revision 96)
+++ /trunk/libf/phytitan/phyetat0.F	(revision 97)
@@ -7,5 +7,5 @@
      .            rlat,rlon, tsol,tsoil,
      .           albe, solsw, sollw,
-     .           fder,radsol,clesphy0,
+     .           fder,radsol,
      .           tabcntr0,
      .           t_ancien,ancien_ok)
@@ -40,8 +40,4 @@
       LOGICAL ancien_ok
 
-      INTEGER        longcles
-      PARAMETER    ( longcles = 20 )
-      REAL clesphy0( longcles )
-c
       REAL xmin, xmax
 c
@@ -84,70 +80,8 @@
          ENDDO
 c
-         cycle_diurne   = .FALSE.
-         soil_model     = .FALSE.
-         new_oliq       = .FALSE.
-         ok_orodr       = .FALSE.
-         ok_orolf       = .FALSE.
-         ok_limitvrai   = .FALSE.
-
-
-         IF( clesphy0(1).NE.tab_cntrl( 5 ) )  THEN
-             tab_cntrl( 5 ) = clesphy0(1)
-         ENDIF
-
-         IF( clesphy0(2).NE.tab_cntrl( 6 ) )  THEN
-             tab_cntrl( 6 ) = clesphy0(2)
-         ENDIF
-
-         IF( clesphy0(3).NE.tab_cntrl( 7 ) )  THEN
-             tab_cntrl( 7 ) = clesphy0(3)
-         ENDIF
-
-         IF( clesphy0(4).NE.tab_cntrl( 8 ) )  THEN
-             tab_cntrl( 8 ) = clesphy0(4)
-         ENDIF
-
-         IF( clesphy0(5).NE.tab_cntrl( 9 ) )  THEN
-             tab_cntrl( 9 ) = clesphy0( 5 )
-         ENDIF
-
-         IF( clesphy0(6).NE.tab_cntrl( 10 ) )  THEN
-             tab_cntrl( 10 ) = clesphy0( 6 )
-         ENDIF
-
-         IF( clesphy0(7).NE.tab_cntrl( 11 ) )  THEN
-             tab_cntrl( 11 ) = clesphy0( 7 )
-         ENDIF
-
-         IF( clesphy0(8).NE.tab_cntrl( 12 ) )  THEN
-             tab_cntrl( 12 ) = clesphy0( 8 )
-         ENDIF
-
-         IF( clesphy0(9).NE.tab_cntrl( 16 ) )  THEN
-             tab_cntrl( 16 ) = clesphy0( 9 )
-         ENDIF
-
 
          dtime        = tab_cntrl(1)
          radpas       = tab_cntrl(2)
          chimpas      = tab_cntrl(3)
-         iflag_con    = tab_cntrl(5)
-         nbapp_rad    = tab_cntrl(6)
-         nbapp_chim   = tab_cntrl(16)
-
-
-         cycle_diurne    = .FALSE.
-         soil_model      = .FALSE.
-         new_oliq        = .FALSE.
-         ok_orodr        = .FALSE.
-         ok_orolf        = .FALSE.
-         ok_limitvrai    = .FALSE.
-
-         IF( tab_cntrl( 7) .EQ. 1. )    cycle_diurne  = .TRUE.
-         IF( tab_cntrl( 8) .EQ. 1. )       soil_model = .TRUE.
-         IF( tab_cntrl( 9) .EQ. 1. )         new_oliq = .TRUE.
-         IF( tab_cntrl(10) .EQ. 1. )         ok_orodr = .TRUE.
-         IF( tab_cntrl(11) .EQ. 1. )         ok_orolf = .TRUE.
-         IF( tab_cntrl(12) .EQ. 1. )     ok_limitvrai = .TRUE.
 
       ENDIF
Index: /trunk/libf/phytitan/phyredem.F
===================================================================
--- /trunk/libf/phytitan/phyredem.F	(revision 96)
+++ /trunk/libf/phytitan/phyredem.F	(revision 97)
@@ -9,4 +9,6 @@
      .           radsol,
      .           t_ancien)
+
+      USE control_mod
       IMPLICIT none
 c======================================================================
@@ -19,5 +21,4 @@
 #include "dimsoil.h"
 #include "clesphys.h"
-#include "control.h"
 #include "temps.h"
 c======================================================================
Index: /trunk/libf/phytitan/physiq.F
===================================================================
--- /trunk/libf/phytitan/physiq.F	(revision 96)
+++ /trunk/libf/phytitan/physiq.F	(revision 97)
@@ -5,5 +5,5 @@
       SUBROUTINE physiq (nlon,nlev,nqmax,
      .            debut,lafin,rjourvrai,gmtime,pdtphys,
-     .            paprs,pplay,ppk,pphi,pphis,presnivs,clesphy0,
+     .            paprs,pplay,ppk,pphi,pphis,presnivs,
      .            u,v,t,qx,
      .            omega,
@@ -12,4 +12,6 @@
       USE ioipsl
       USE histcom
+      USE infotrac
+      USE control_mod
       IMPLICIT none
 c======================================================================
@@ -71,8 +73,6 @@
 #include "dimsoil.h"
 #include "clesphys.h"
-#include "control.h"
 #include "temps.h"
 #include "comgeomphy.h"
-#include "advtrac.h"
 #include "iniprint.h"
 #include "raddim.h"
@@ -147,8 +147,4 @@
       SAVE LWdnTOA
 c
-      INTEGER        longcles
-      PARAMETER    ( longcles = 20 )
-      REAL clesphy0( longcles      )
-c
 c Variables propres a la physique
 c
@@ -251,5 +247,5 @@
 cAA
       integer nmicro
-      REAL source(klon,nqmx)
+      REAL source(klon,nqmax)
       save    nmicro,source
 
@@ -259,5 +255,5 @@
       character*8 nom
 * common relatifs aux aerosols 
-      REAL qaer(klon,klev,nqmx)
+      REAL qaer(klon,klev,nqmax)
       common/traceurs/qaer
 
@@ -400,7 +396,4 @@
       REAL zx_tmp_2d(iim,jjmp1),zx_tmp_3d(iim,jjmp1,klev)
       REAL zx_lon(iim,jjmp1), zx_lat(iim,jjmp1)
-      REAL*4 z4_tmp_2d(iim,jjmp1),z4_tmp_3d(iim,jjmp1,klev)
-      REAL*4 z4_lon(iim,jjmp1), z4_lat(iim,jjmp1)
-      REAL*4 zpresnivs(klev)
 
       INTEGER nid_day, nid_mth, nid_ins
@@ -408,5 +401,5 @@
 c
       INTEGER nhori, nvert, idayref
-      REAL*4 zsto, zout, zsto1, zsto2, z4julian, zero
+      REAL zsto, zout, zsto1, zsto2, zero
       parameter (zero=0.0e0)
       real zjulian
@@ -447,4 +440,17 @@
       REAL mangtot            ! moment cinetique total
 
+c Temporaire avant de trouver mieux :
+c Recuperation des TAU du TR
+      CHARACTER*2 str1
+      INTEGER NSPECV,NSPECI,NLAYER
+      PARAMETER (NSPECV=24,NSPECI=46,NLAYER=klev)
+      REAL t_tauhvd(klon,klev),t_khvd(klon,klev)
+      REAL TAUHID(klon,NLAYER,NSPECI)
+     &               ,TAUGID(klon,NLAYER,NSPECI)
+     &               ,TAUHVD(klon,NLAYER,NSPECV)
+     &               ,TAUGVD(klon,NLAYER,NSPECV)
+
+      COMMON /TAUD/   TAUHID,TAUGID,TAUHVD,TAUGVD
+
 c Declaration des constantes et des fonctions thermodynamiques
 c
@@ -498,5 +504,5 @@
      .       rlatd,rlond,ftsol,ftsoil,
      .       falbe, solsw, sollw,
-     .       dlw,radsol,clesphy0,
+     .       dlw,radsol,
 c     .      zmea,zstd,zsig,zgam,zthe,zpic,zval,
      .       tabcntr0,
@@ -624,5 +630,5 @@
      .                   iflag_ajs
 c
-         ecrit_mth = NINT(RDAY/dtime *(nday-1))  ! tous les nday jours
+         ecrit_mth = NINT(RDAY/dtime) *nday  ! tous les nday jours
          IF (ok_mensuel) THEN
          WRITE(lunout,*)'La frequence de sortie mensuelle est de ',
@@ -636,5 +642,5 @@
          ENDIF
 
-         ecrit_ins = NINT(RDAY/dtime/100.)  ! toutes les ~4h Terre
+         ecrit_ins = NINT(RDAY/dtime*ecritphy)  ! Fraction de jour reglable
          IF (ok_instan) THEN
          WRITE(lunout,*)'La frequence de sortie instant. est de ', 
@@ -1089,5 +1095,5 @@
 c------------------
 c test condensation
-c     do i=1,nqmx 
+c     do i=1,nqmax 
 c       if(tname(i).eq."HCN") then
 c          print*,"HCN="
Index: /trunk/libf/phytitan/phytrac.F
===================================================================
--- /trunk/libf/phytitan/phytrac.F	(revision 96)
+++ /trunk/libf/phytitan/phytrac.F	(revision 97)
@@ -3,4 +3,6 @@
      .                   pplev,pplay,delp,ptemp,pmu0,pfract,pdecli,
      .                   lonsol,tr_seri,d_tr_mph,d_tr_kim)
+
+      USE infotrac
 
       IMPLICIT none
@@ -34,5 +36,4 @@
 #include "clesphys.h"
 #include "YOMCST.h"
-#include "advtrac.h"
 
 c======================================================================
@@ -52,5 +53,5 @@
 
 * common relatifs aux aerosols 
-      REAL qaer(klon,klev,nqmx)
+      REAL qaer(klon,klev,nqtot)
       common/traceurs/qaer
 
@@ -63,6 +64,6 @@
       REAL pdqmfi(jjm+1,klev,nqmax)
       REAL ychim(jjm+1,klev,nqmax-nmicro) 
-      REAL qysat(klev,nqmx)        ! dim nqmx, mais en fait nqmax-nmicro (save...)
-      REAL pdyfi(jjm+1,klev,nqmx)  ! dim nqmx, mais en fait nqmax-nmicro (save...)
+      REAL qysat(klev,nqtot)        ! dim nqtot, mais en fait nqmax-nmicro (save...)
+      REAL pdyfi(jjm+1,klev,nqtot)  ! dim nqtot, mais en fait nqmax-nmicro (save...)
       character*10 nomqy(nqmax-nmicro+1)
       integer      i,j,l,iq,ig0
Index: /trunk/libf/phytitan/radlwsw.F
===================================================================
--- /trunk/libf/phytitan/radlwsw.F	(revision 96)
+++ /trunk/libf/phytitan/radlwsw.F	(revision 97)
@@ -68,5 +68,5 @@
       
 * common relatifs aux aerosols 
-      REAL qaer(klon,klev,nqmx)
+      REAL qaer(klon,klev,nqtot)
       common/traceurs/qaer
      
Index: /trunk/libf/phytitan/radtitan.F
===================================================================
--- /trunk/libf/phytitan/radtitan.F	(revision 96)
+++ /trunk/libf/phytitan/radtitan.F	(revision 97)
@@ -199,5 +199,5 @@
 * common relatifs aux aerosols  
 * nrad dans microtab.h
-      REAL qaer(klon,nlayer,nqmx),volume(nrad),rayon(nrad),vrat,
+      REAL qaer(klon,nlayer,nqtot),volume(nrad),rayon(nrad),vrat,
      &      drayon(nrad),dvolume(nrad)
 
Index: /trunk/libf/phytitan/rdf.F
===================================================================
--- /trunk/libf/phytitan/rdf.F	(revision 96)
+++ /trunk/libf/phytitan/rdf.F	(revision 97)
@@ -71,5 +71,5 @@
 
         print*,'tcorrect=',tcorrect,' tx=',tx
-        print*,'Df aerosols /1 a nqmx/'
+        print*,'Df aerosols /1 a nqtot/'
         write(*,*) (rf(h),h=1,nrad)
         write(*,*) (df(h),h=1,nrad)
Index: /trunk/libf/phytitan/suphec.F
===================================================================
--- /trunk/libf/phytitan/suphec.F	(revision 96)
+++ /trunk/libf/phytitan/suphec.F	(revision 97)
@@ -58,5 +58,5 @@
       ROMEGA=2.*RPI/RSIDAY
 c 1/(duree du jour) = 1/(periode rotation) - 1/(periode revolution)
-      RDAY=RSIDAY/(1.-RSIDAY/RSIYEA) ! 116.748 j
+      RDAY=RSIDAY/(1.-RSIDAY/RSIYEA) 
       REA=1.5e12
       REPSM=0.  ! 0. veut dire qu'on commence au point vernal
@@ -157,73 +157,4 @@
       WRITE(UNIT=6,FMT='(''     Rv/Rd-1  = '',e13.7)') RETV
 C
-C     ----------------------------------------------------------------
-C
-C*       6.    DEFINE THERMODYNAMIC CONSTANTS, LIQUID PHASE.
-C              ---------------------------------------------
-C
-      RCW=RCPV
-      WRITE(UNIT=6,FMT='('' *** Thermodynamic, liquid  ***'')')
-      WRITE(UNIT=6,FMT='(''         Cw   = '',E13.7)') RCW
-C
-C     ----------------------------------------------------------------
-C
-C*       7.    DEFINE THERMODYNAMIC CONSTANTS, SOLID PHASE.
-C              --------------------------------------------
-C
-      RCS=RCPV
-      WRITE(UNIT=6,FMT='('' *** thermodynamic, solid   ***'')')
-      WRITE(UNIT=6,FMT='(''         Cs   = '',E13.7)') RCS
-C
-C     ----------------------------------------------------------------
-C
-C*       8.    DEFINE THERMODYNAMIC CONSTANTS, TRANSITION OF PHASE.
-C              ----------------------------------------------------
-C
-c valeurs TERRE
-      RTT=273.16
-      RLVTT=2.5008E+6
-      RLSTT=2.8345E+6
-      RLMLT=RLSTT-RLVTT
-      RATM=100000.
-      WRITE(UNIT=6,FMT='('' *** Thermodynamic, trans.  ***'')')
-      WRITE(UNIT=6,FMT='('' Fusion point  = '',E13.7)') RTT
-      WRITE(UNIT=6,FMT='(''        RLvTt  = '',E13.7)') RLVTT
-      WRITE(UNIT=6,FMT='(''        RLsTt  = '',E13.7)') RLSTT
-      WRITE(UNIT=6,FMT='(''        RLMlt  = '',E13.7)') RLMLT
-      WRITE(UNIT=6,FMT='('' Normal press. = '',E13.7)') RATM
-      WRITE(UNIT=6,FMT='('' Latent heat :  '')')
-C
-C     ----------------------------------------------------------------
-C
-C*       9.    SATURATED VAPOUR PRESSURE.
-C              --------------------------
-C
-c valeurs TERRE
-      RESTT=611.14
-      RGAMW=(RCW-RCPV)/RV
-      RBETW=RLVTT/RV+RGAMW*RTT
-      RALPW=LOG(RESTT)+RBETW/RTT+RGAMW*LOG(RTT)
-      RGAMS=(RCS-RCPV)/RV
-      RBETS=RLSTT/RV+RGAMS*RTT
-      RALPS=LOG(RESTT)+RBETS/RTT+RGAMS*LOG(RTT)
-      RGAMD=RGAMS-RGAMW
-      RBETD=RBETS-RBETW
-      RALPD=RALPS-RALPW
-C
-C     ------------------------------------------------------------------
-c
-c calculer les constantes pour les fonctions thermodynamiques
-c
-c valeurs TERRE
-      RVTMP2=RCPV/RCPD-1.
-      RHOH2O=RATM/100.
-      R2ES=RESTT*RD/RV
-      R3LES=17.269
-      R3IES=21.875
-      R4LES=35.86
-      R4IES=7.66
-      R5LES=R3LES*(RTT-R4LES)
-      R5IES=R3IES*(RTT-R4IES)
-C
       RETURN
       END
Index: /trunk/libf/phytitan/write_histday.h
===================================================================
--- /trunk/libf/phytitan/write_histday.h	(revision 96)
+++ /trunk/libf/phytitan/write_histday.h	(revision 97)
@@ -7,7 +7,5 @@
       ndex3d = 0
       zx_tmp_2d = 0.
-      z4_tmp_2d = 0.
       zx_tmp_3d = 0.
-      z4_tmp_3d = 0.
       zx_tmp_fi2d=0.
       zx_tmp_fi3d=0.
@@ -24,24 +22,21 @@
 c
       CALL gr_fi_ecrit(1,klon,iim,jjmp1,pphis,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_day,"phis",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_day,"phis",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 C
       CALL gr_fi_ecrit(1,klon,iim,jjmp1,airephy,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_day,"aire",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_day,"aire",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
 ccccccc axe Ls
       do j=1,jjmp1
        do i=1,iim
-        z4_tmp_2d(i,j)=zls*180./RPI      ! zls est en radians !!
+        zx_tmp_2d(i,j)=zls*180./RPI      ! zls est en radians !!
        enddo
       enddo
-      CALL histwrite(nid_day,"ls",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_day,"ls",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
 ccccccccccccc 2D fields, variables
 c
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, ftsol,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_day,"tsol",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_day,"tsol",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       DO i = 1, klon
@@ -49,14 +44,11 @@
       ENDDO
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_day,"psol",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_day,"psol",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
 c     CALL gr_fi_ecrit(1, klon,iim,jjmp1, ue,zx_tmp_2d)
-c     z4_tmp_2d=zx_tmp_2d
-c     CALL histwrite(nid_day,"ue",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+c     CALL histwrite(nid_day,"ue",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
 c     CALL gr_fi_ecrit(1, klon,iim,jjmp1, ve,zx_tmp_2d)
-c     z4_tmp_2d=zx_tmp_2d
-c     CALL histwrite(nid_day,"ve",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+c     CALL histwrite(nid_day,"ve",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       ENDIF !lev_histday.GE.1
@@ -68,45 +60,36 @@
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, t_seri, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"temp",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"temp",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, pplay, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"pres",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"pres",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, zphi, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"geop",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"geop",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, u_seri, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"vitu",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"vitu",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, v_seri, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"vitv",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"vitv",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, omega, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"vitw",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"vitw",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, topsw,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_day,"tops",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_day,"tops",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_u_dyn, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"dudyn",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"dudyn",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_u_vdf, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"duvdf",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"duvdf",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
@@ -115,6 +98,5 @@
            DO iq=1,nmicro
        CALL gr_fi_ecrit(klev,klon,iim,jjmp1, qaer(1,1,iq), zx_tmp_3d)
-       z4_tmp_3d=zx_tmp_3d
-       CALL histwrite(nid_day,tname(iq),itau_w,z4_tmp_3d,
+       CALL histwrite(nid_day,tname(iq),itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
            ENDDO
@@ -123,6 +105,5 @@
            DO iq=nmicro+1,nqmax
        CALL gr_fi_ecrit(klev,klon,iim,jjmp1,tr_seri(1,1,iq),zx_tmp_3d)
-       z4_tmp_3d=zx_tmp_3d
-       CALL histwrite(nid_day,tname(iq),itau_w,z4_tmp_3d,
+       CALL histwrite(nid_day,tname(iq),itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
            ENDDO
@@ -140,14 +121,11 @@
 c
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, toplw,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_day,"topl",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_day,"topl",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, solsw,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_day,"sols",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_day,"sols",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, sollw,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_day,"soll",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_day,"soll",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
 c 3D
@@ -155,12 +133,10 @@
       zx_tmp_fi3d(1:klon,1:klev)=swnet(1:klon,1:klev)
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"SWnet",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"SWnet",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       zx_tmp_fi3d(1:klon,1:klev)=lwnet(1:klon,1:klev)
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"LWnet",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"LWnet",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
@@ -171,17 +147,14 @@
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_t_dyn, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"dtdyn",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"dtdyn",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_t, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"dtphy",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"dtphy",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c K/s
       zx_tmp_fi3d(1:klon,1:klev)=d_t_vdf(1:klon,1:klev)
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"dtvdf",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"dtvdf",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
@@ -189,6 +162,5 @@
       zx_tmp_fi3d(1:klon,1:klev)=d_t_ajs(1:klon,1:klev)
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"dtajs",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"dtajs",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
@@ -196,6 +168,5 @@
       zx_tmp_fi3d(1:klon,1:klev)=heat(1:klon,1:klev)
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"dtswr",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"dtswr",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
@@ -203,12 +174,10 @@
       zx_tmp_fi3d(1:klon,1:klev)=-1.*cool(1:klon,1:klev)
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"dtlwr",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"dtlwr",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c K/s      
       zx_tmp_fi3d(1:klon,1:klev)=d_t_ec(1:klon,1:klev)
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"dtec",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"dtec",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
@@ -220,20 +189,16 @@
 c
 c      CALL gr_fi_ecrit(1, klon,iim,jjmp1, fluxu , zx_tmp_2d)
-c      z4_tmp_2d=zx_tmp_2d
 c      CALL histwrite(nid_day,"taux_",itau_w,
-c    $      z4_tmp_2d,iim*jjmp1,ndex2d) 
+c    $      zx_tmp_2d,iim*jjmp1,ndex2d) 
 c      
 c      CALL gr_fi_ecrit(1, klon,iim,jjmp1, fluxv , zx_tmp_2d)
-c      z4_tmp_2d=zx_tmp_2d
 c      CALL histwrite(nid_day,"tauy_",itau_w,
-c    $      z4_tmp_2d,iim*jjmp1,ndex2d)
+c    $      zx_tmp_2d,iim*jjmp1,ndex2d)
 c
 c     CALL gr_fi_ecrit(1, klon,iim,jjmp1, cdragm,zx_tmp_2d)
-c      z4_tmp_2d=zx_tmp_2d
-c     CALL histwrite(nid_day,"cdrm",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+c     CALL histwrite(nid_day,"cdrm",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
 c     CALL gr_fi_ecrit(1, klon,iim,jjmp1, cdragh,zx_tmp_2d)
-c      z4_tmp_2d=zx_tmp_2d
-c     CALL histwrite(nid_day,"cdrh",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+c     CALL histwrite(nid_day,"cdrh",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       ENDIF !lev_histday.GE.5
Index: /trunk/libf/phytitan/write_histins.h
===================================================================
--- /trunk/libf/phytitan/write_histins.h	(revision 96)
+++ /trunk/libf/phytitan/write_histins.h	(revision 97)
@@ -7,7 +7,5 @@
       ndex3d = 0
       zx_tmp_2d = 0.
-      z4_tmp_2d = 0.
       zx_tmp_3d = 0.
-      z4_tmp_3d = 0.
       zx_tmp_fi2d=0.
       zx_tmp_fi3d=0.
@@ -24,24 +22,21 @@
 c
       CALL gr_fi_ecrit(1,klon,iim,jjmp1,pphis,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_ins,"phis",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_ins,"phis",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 C
       CALL gr_fi_ecrit(1,klon,iim,jjmp1,airephy,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_ins,"aire",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_ins,"aire",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
 ccccccc axe Ls
       do j=1,jjmp1
        do i=1,iim
-        z4_tmp_2d(i,j)=zls*180./RPI      ! zls est en radians !!
+        zx_tmp_2d(i,j)=zls*180./RPI      ! zls est en radians !!
        enddo
       enddo
-      CALL histwrite(nid_ins,"ls",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_ins,"ls",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
 ccccccccccccc 2D fields, variables
 c
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, ftsol,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_ins,"tsol",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_ins,"tsol",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       DO i = 1, klon
@@ -49,14 +44,11 @@
       ENDDO
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_ins,"psol",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_ins,"psol",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
 c     CALL gr_fi_ecrit(1, klon,iim,jjmp1, ue,zx_tmp_2d)
-c     z4_tmp_2d=zx_tmp_2d
-c     CALL histwrite(nid_ins,"ue",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+c     CALL histwrite(nid_ins,"ue",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
 c     CALL gr_fi_ecrit(1, klon,iim,jjmp1, ve,zx_tmp_2d)
-c     z4_tmp_2d=zx_tmp_2d
-c     CALL histwrite(nid_ins,"ve",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+c     CALL histwrite(nid_ins,"ve",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       ENDIF !lev_histday.GE.1
@@ -68,45 +60,36 @@
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, t_seri, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_ins,"temp",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_ins,"temp",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, pplay, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_ins,"pres",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_ins,"pres",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, zphi, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_ins,"geop",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_ins,"geop",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, u_seri, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_ins,"vitu",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_ins,"vitu",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, v_seri, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_ins,"vitv",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_ins,"vitv",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, omega, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_ins,"vitw",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_ins,"vitw",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, topsw,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_ins,"tops",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_ins,"tops",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_u_vdf, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_ins,"duvdf",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_ins,"duvdf",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_u_dyn, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_ins,"dudyn",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_ins,"dudyn",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
@@ -122,6 +105,5 @@
            DO iq=1,nmicro
        CALL gr_fi_ecrit(klev,klon,iim,jjmp1, qaer(1,1,iq), zx_tmp_3d)
-       z4_tmp_3d=zx_tmp_3d
-       CALL histwrite(nid_ins,tname(iq),itau_w,z4_tmp_3d,
+       CALL histwrite(nid_ins,tname(iq),itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
            ENDDO
@@ -130,6 +112,5 @@
            DO iq=nmicro+1,nqmax
        CALL gr_fi_ecrit(klev,klon,iim,jjmp1,tr_seri(1,1,iq),zx_tmp_3d)
-       z4_tmp_3d=zx_tmp_3d
-       CALL histwrite(nid_ins,tname(iq),itau_w,z4_tmp_3d,
+       CALL histwrite(nid_ins,tname(iq),itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
            ENDDO
@@ -142,14 +123,11 @@
 c
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, toplw,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_ins,"topl",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_ins,"topl",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, solsw,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_ins,"sols",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_ins,"sols",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, sollw,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_ins,"soll",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_ins,"soll",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
 c 3D
@@ -157,12 +135,10 @@
       zx_tmp_fi3d(1:klon,1:klev)=swnet(1:klon,1:klev)
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_ins,"SWnet",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_ins,"SWnet",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       zx_tmp_fi3d(1:klon,1:klev)=lwnet(1:klon,1:klev)
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_ins,"LWnet",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_ins,"LWnet",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
@@ -173,17 +149,14 @@
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_t_dyn, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_ins,"dtdyn",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_ins,"dtdyn",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_t, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_ins,"dtphy",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_ins,"dtphy",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c K/s
       zx_tmp_fi3d(1:klon,1:klev)=d_t_vdf(1:klon,1:klev)
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_ins,"dtvdf",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_ins,"dtvdf",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
@@ -191,6 +164,5 @@
       zx_tmp_fi3d(1:klon,1:klev)=d_t_ajs(1:klon,1:klev)
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_ins,"dtajs",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_ins,"dtajs",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
@@ -198,6 +170,5 @@
       zx_tmp_fi3d(1:klon,1:klev)=heat(1:klon,1:klev)
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_ins,"dtswr",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_ins,"dtswr",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
@@ -205,17 +176,14 @@
       zx_tmp_fi3d(1:klon,1:klev)=-1.*cool(1:klon,1:klev)
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_ins,"dtlwr",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_ins,"dtlwr",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c K/s      
       zx_tmp_fi3d(1:klon,1:klev)=d_t_ec(1:klon,1:klev)
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_ins,"dtec",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_ins,"dtec",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
 c     CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_v_vdf, zx_tmp_3d)
-c     z4_tmp_3d=zx_tmp_3d
-c     CALL histwrite(nid_ins,"dvvdf",itau_w,z4_tmp_3d,
+c     CALL histwrite(nid_ins,"dvvdf",itau_w,zx_tmp_3d,
 c    .                                   iim*jjmp1*klev,ndex3d)
 c
@@ -227,20 +195,16 @@
 c
 c      CALL gr_fi_ecrit(1, klon,iim,jjmp1, fluxu , zx_tmp_2d)
-c      z4_tmp_2d=zx_tmp_2d
 c      CALL histwrite(nid_ins,"taux_",itau_w,
-c    $      z4_tmp_2d,iim*jjmp1,ndex2d) 
+c    $      zx_tmp_2d,iim*jjmp1,ndex2d) 
 c      
 c      CALL gr_fi_ecrit(1, klon,iim,jjmp1, fluxv , zx_tmp_2d)
-c      z4_tmp_2d=zx_tmp_2d
 c      CALL histwrite(nid_ins,"tauy_",itau_w,
-c    $      z4_tmp_2d,iim*jjmp1,ndex2d)
+c    $      zx_tmp_2d,iim*jjmp1,ndex2d)
 c
 c     CALL gr_fi_ecrit(1, klon,iim,jjmp1, cdragm,zx_tmp_2d)
-c      z4_tmp_2d=zx_tmp_2d
-c     CALL histwrite(nid_ins,"cdrm",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+c     CALL histwrite(nid_ins,"cdrm",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
 c     CALL gr_fi_ecrit(1, klon,iim,jjmp1, cdragh,zx_tmp_2d)
-c      z4_tmp_2d=zx_tmp_2d
-c     CALL histwrite(nid_ins,"cdrh",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+c     CALL histwrite(nid_ins,"cdrh",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       ENDIF !lev_histday.GE.5
Index: /trunk/libf/phytitan/write_histmth.h
===================================================================
--- /trunk/libf/phytitan/write_histmth.h	(revision 96)
+++ /trunk/libf/phytitan/write_histmth.h	(revision 97)
@@ -4,7 +4,5 @@
       ndex3d = 0
       zx_tmp_2d = 0.
-      z4_tmp_2d = 0.
       zx_tmp_3d = 0.
-      z4_tmp_3d = 0.
       zx_tmp_fi2d=0.
       zx_tmp_fi3d=0.
@@ -20,24 +18,21 @@
 c
       CALL gr_fi_ecrit(1,klon,iim,jjmp1,pphis,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_mth,"phis",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_mth,"phis",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 C
       CALL gr_fi_ecrit(1,klon,iim,jjmp1,airephy,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_mth,"aire",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_mth,"aire",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
 ccccccc axe Ls
       do j=1,jjmp1
        do i=1,iim
-        z4_tmp_2d(i,j)=zls*180./RPI      ! zls est en radians !!
+        zx_tmp_2d(i,j)=zls*180./RPI      ! zls est en radians !!
        enddo
       enddo
-      CALL histwrite(nid_mth,"ls",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_mth,"ls",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
 ccccccccccccc 2D fields, variables
 c
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, ftsol,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_mth,"tsol",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_mth,"tsol",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       DO i = 1, klon
@@ -45,14 +40,11 @@
       ENDDO
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_mth,"psol",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_mth,"psol",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
 c     CALL gr_fi_ecrit(1, klon,iim,jjmp1, ue,zx_tmp_2d)
-c     z4_tmp_2d=zx_tmp_2d
-c     CALL histwrite(nid_mth,"ue",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+c     CALL histwrite(nid_mth,"ue",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
 c     CALL gr_fi_ecrit(1, klon,iim,jjmp1, ve,zx_tmp_2d)
-c     z4_tmp_2d=zx_tmp_2d
-c     CALL histwrite(nid_mth,"ve",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+c     CALL histwrite(nid_mth,"ve",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       ENDIF !lev_histmth.GE.1
@@ -64,51 +56,42 @@
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, t_seri, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"temp",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"temp",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, pplay, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"pres",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"pres",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, zphi, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"geop",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"geop",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, u_seri, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"vitu",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"vitu",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, v_seri, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"vitv",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"vitv",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, omega, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"vitw",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"vitw",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, topsw,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_mth,"tops",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_mth,"tops",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
          if (iflag_trac.eq.1) THEN
           if (microfi.eq.1) then
-           DO iq=1,nmicro
-       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, qaer(1,1,iq), zx_tmp_3d)
-       z4_tmp_3d=zx_tmp_3d
-       CALL histwrite(nid_mth,tname(iq),itau_w,z4_tmp_3d,
-     .                                   iim*jjmp1*klev,ndex3d)
-           ENDDO
-	  endif
-	  if (nmicro.lt.nqmax) then
+c          DO iq=1,nmicro
+c      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, qaer(1,1,iq), zx_tmp_3d)
+c      CALL histwrite(nid_mth,tname(iq),itau_w,zx_tmp_3d,
+c    .                                   iim*jjmp1*klev,ndex3d)
+c          ENDDO
+c         endif
+          if (nmicro.lt.nqmax) then
            DO iq=nmicro+1,nqmax
        CALL gr_fi_ecrit(klev,klon,iim,jjmp1,tr_seri(1,1,iq),zx_tmp_3d)
-       z4_tmp_3d=zx_tmp_3d
-       CALL histwrite(nid_mth,tname(iq),itau_w,z4_tmp_3d,
+       CALL histwrite(nid_mth,tname(iq),itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
            ENDDO
@@ -116,6 +99,5 @@
 c          DO iq=nmicro+1,nqmax
 c      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,d_tr_mph(1,1,iq),zx_tmp_3d)
-c      z4_tmp_3d=zx_tmp_3d
-c      CALL histwrite(nid_mth,"c_"//tname(iq),itau_w,z4_tmp_3d,
+c      CALL histwrite(nid_mth,"c_"//tname(iq),itau_w,zx_tmp_3d,
 c    .                                   iim*jjmp1*klev,ndex3d)
 c          ENDDO
@@ -133,14 +115,11 @@
 c
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, toplw,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_mth,"topl",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_mth,"topl",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, solsw,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_mth,"sols",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_mth,"sols",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, sollw,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_mth,"soll",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_mth,"soll",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
 c 3D
@@ -148,14 +127,47 @@
       zx_tmp_fi3d(1:klon,1:klev)=swnet(1:klon,1:klev)
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"SWnet",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"SWnet",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       zx_tmp_fi3d(1:klon,1:klev)=lwnet(1:klon,1:klev)
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"LWnet",itau_w,z4_tmp_3d,
-     .                                   iim*jjmp1*klev,ndex3d)
-c
+      CALL histwrite(nid_mth,"LWnet",itau_w,zx_tmp_3d,
+     .                                   iim*jjmp1*klev,ndex3d)
+c
+c 3D adding Tau and k  (31/08/10)
+c
+       do k=3,nspecv,5
+         do i=1,klon
+         do l=1,klev
+           t_tauhvd(i,j)=TAUHVD(i,klev-l+1,k)
+         enddo
+         enddo
+         write(str1,'(i2.2)') k
+      zx_tmp_fi3d(1:klon,1:klev)=t_tauhvd(1:klon,1:klev)
+      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
+      CALL histwrite(nid_mth,"thv"//str1,itau_w,zx_tmp_3d,
+     .                                   iim*jjmp1*klev,ndex3d)
+       enddo      ! fin boucle nspecv
+
+       do k=3,nspecv,5
+         do i=1,klon
+         do l=1,klev
+         if(l.ne.klev)
+     s    t_khvd(i,l)=TAUHVD(i,klev-l+1,k)
+     s    -TAUHVD(i,klev-l+1-1,k)
+
+          if(l.eq.klev)
+     s    t_khvd(i,l)=TAUHVD(i,klev-l+1,k)
+
+         t_khvd(i,l)=t_khvd(i,l)/(zzlev(i,l+1)-zzlev(i,l))
+         enddo
+         enddo
+         write(str1,'(i2.2)') k
+      zx_tmp_fi3d(1:klon,1:klev)=t_khvd(1:klon,1:klev)
+      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
+      CALL histwrite(nid_mth,"khv"//str1,itau_w,zx_tmp_3d,
+     .                                   iim*jjmp1*klev,ndex3d)
+       enddo      ! fin boucle nspecv
+
       ENDIF !lev_histmth.GE.3
 c
@@ -164,17 +176,14 @@
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_t_dyn, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"dtdyn",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"dtdyn",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_t, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"dtphy",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"dtphy",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c K/s
       zx_tmp_fi3d(1:klon,1:klev)=d_t_vdf(1:klon,1:klev)
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"dtvdf",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"dtvdf",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
@@ -182,6 +191,5 @@
       zx_tmp_fi3d(1:klon,1:klev)=d_t_ajs(1:klon,1:klev)
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"dtajs",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"dtajs",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
@@ -189,6 +197,5 @@
       zx_tmp_fi3d(1:klon,1:klev)=heat(1:klon,1:klev)
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"dtswr",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"dtswr",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
@@ -196,27 +203,22 @@
       zx_tmp_fi3d(1:klon,1:klev)=-1.*cool(1:klon,1:klev)
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"dtlwr",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"dtlwr",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c K/s      
 c     zx_tmp_fi3d(1:klon,1:klev)=d_t_ec(1:klon,1:klev)
 c     CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-c     z4_tmp_3d=zx_tmp_3d
-c     CALL histwrite(nid_mth,"dtec",itau_w,z4_tmp_3d,
+c     CALL histwrite(nid_mth,"dtec",itau_w,zx_tmp_3d,
 c    .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_u_vdf, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"duvdf",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"duvdf",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_u_dyn, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"dudyn",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"dudyn",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
 c     CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_v_vdf, zx_tmp_3d)
-c     z4_tmp_3d=zx_tmp_3d
-c     CALL histwrite(nid_mth,"dvvdf",itau_w,z4_tmp_3d,
+c     CALL histwrite(nid_mth,"dvvdf",itau_w,zx_tmp_3d,
 c    .                                   iim*jjmp1*klev,ndex3d)
 c
@@ -228,20 +230,16 @@
 c
 c      CALL gr_fi_ecrit(1, klon,iim,jjmp1, fluxu , zx_tmp_2d)
-c      z4_tmp_2d=zx_tmp_2d
 c      CALL histwrite(nid_mth,"taux_",itau_w,
-c    $      z4_tmp_2d,iim*jjmp1,ndex2d) 
+c    $      zx_tmp_2d,iim*jjmp1,ndex2d) 
 c      
 c      CALL gr_fi_ecrit(1, klon,iim,jjmp1, fluxv , zx_tmp_2d)
-c      z4_tmp_2d=zx_tmp_2d
 c      CALL histwrite(nid_mth,"tauy_",itau_w,
-c    $      z4_tmp_2d,iim*jjmp1,ndex2d)
+c    $      zx_tmp_2d,iim*jjmp1,ndex2d)
 c
 c     CALL gr_fi_ecrit(1, klon,iim,jjmp1, cdragm,zx_tmp_2d)
-c      z4_tmp_2d=zx_tmp_2d
-c     CALL histwrite(nid_mth,"cdrm",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+c     CALL histwrite(nid_mth,"cdrm",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
 c     CALL gr_fi_ecrit(1, klon,iim,jjmp1, cdragh,zx_tmp_2d)
-c      z4_tmp_2d=zx_tmp_2d
-c     CALL histwrite(nid_mth,"cdrh",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+c     CALL histwrite(nid_mth,"cdrh",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       ENDIF !lev_histmth.GE.5
Index: /trunk/libf/phyvenus/YOMCST.h
===================================================================
--- /trunk/libf/phyvenus/YOMCST.h	(revision 96)
+++ /trunk/libf/phyvenus/YOMCST.h	(revision 97)
@@ -1,4 +1,7 @@
 !
-! $Header: /home/cvsroot/LMDZ4/libf/phylmd/YOMCST.h,v 1.1.1.1 2004/05/19 12:53:08 lmdzadmin Exp $
+!  ATTENTION!!!!: ce fichier include est compatible format fixe/format libre
+!                 veillez  n'utiliser que des ! pour les commentaires
+!                 et  bien positionner les & des lignes de continuation
+!                 (les placer en colonne 6 et en colonne 73)
 !
 ! A1.0 Fundamental constants
@@ -7,9 +10,9 @@
       REAL RDAY,REA,REPSM,RSIYEA,RSIDAY,ROMEGA
 ! A1.1.bis Constantes concernant l'orbite de la Terre:
-      REAL R_ecc, R_peri, R_incl
+      REAL :: R_ecc, R_peri, R_incl
 ! A1.2 Geoide
       REAL RA,RG,R1SA
 ! A1.3 Radiation
-!     REAL RSIGMA,RI0
+!     REAL :: RSIGMA,RI0
       REAL RSIGMA
 ! A1.4 Thermodynamic gas phase
@@ -27,15 +30,9 @@
       REAL RALPD,RBETD,RGAMD
 !
-!    S      ,RSIGMA,RI0
-      COMMON/YOMCST/RPI   ,RCLUM ,RHPLA ,RKBOL ,RNAVO
-     S      ,RDAY  ,REA   ,REPSM ,RSIYEA,RSIDAY,ROMEGA
-     s      ,R_ecc, R_peri, R_incl
-     S      ,RA    ,RG    ,R1SA
-     S      ,RSIGMA
-     S      ,R     ,RMD   ,RMV   ,RD    ,RV    ,RCPD
-     S      ,RCPV  ,RCVD  ,RCVV  ,RKAPPA,RETV
-     S      ,RCW   ,RCS
-     S      ,RLVTT ,RLSTT ,RLMLT ,RTT   ,RATM
-     S      ,RESTT ,RALPW ,RBETW ,RGAMW ,RALPS ,RBETS ,RGAMS
-     S      ,RALPD ,RBETD ,RGAMD
-!    ------------------------------------------------------------------
+      COMMON/YOMCST/RPI ,RCLUM, RHPLA, RKBOL, RNAVO ,RDAY  ,REA         &
+     & ,REPSM ,RSIYEA,RSIDAY,ROMEGA , R_ecc, R_peri, R_incl,            &
+     & ,RA    ,RG ,R1SA                                                 &
+     & ,RSIGMA,R ,RMD   ,RMV   ,RD    ,RV    ,RCPD ,RCPV,RCVD           &
+     & ,RCVV  ,RKAPPA,RETV ,RCW   ,RCS ,RLVTT ,RLSTT ,RLMLT ,RTT ,RATM  &
+     & ,RESTT ,RALPW ,RBETW ,RGAMW ,RALPS ,RBETS ,RGAMS ,RALPD ,RBETD   &
+     & ,RGAMD
Index: /trunk/libf/phyvenus/clcdrag.F90
===================================================================
--- /trunk/libf/phyvenus/clcdrag.F90	(revision 96)
+++ /trunk/libf/phyvenus/clcdrag.F90	(revision 97)
@@ -30,7 +30,6 @@
 ! ================================================================= c
 !
-#include "YOMCST.inc"
-#include "YOETHF.inc"
-#include "clesphys.inc"
+#include "YOMCST.h"
+#include "clesphys.h"
 !
 ! Quelques constantes et options:
Index: /trunk/libf/phyvenus/clesphys.h
===================================================================
--- /trunk/libf/phyvenus/clesphys.h	(revision 96)
+++ /trunk/libf/phyvenus/clesphys.h	(revision 97)
@@ -1,29 +1,26 @@
 !
-! $Header: /home/cvsroot/LMDZ4/libf/phylmd/clesphys.h,v 1.1.1.1 2004/05/19 12:53:08 lmdzadmin Exp $
+!  ATTENTION!!!!: ce fichier include est compatible format fixe/format libre
+!                 veillez  n'utiliser que des ! pour les commentaires
+!                 et  bien positionner les & des lignes de continuation
+!                 (les placer en colonne 6 et en colonne 73)
 !
-c..include cles_phys.h
-c
-       LOGICAL cycle_diurne,soil_model,new_oliq
+!
+!..include cles_phys.h
+!
+       LOGICAL cycle_diurne,soil_model
        LOGICAL ok_orodr,ok_orolf,ok_gw_nonoro
-       INTEGER nbapp_rad, iflag_con, iflag_ajs
+       INTEGER nbapp_rad, nbapp_chim, iflag_con, iflag_ajs
+       REAL    ecritphy
        REAL    solaire
-
-c Parametres pour PBL:
-       real z0,lmixmin
-       REAL ksta
+       REAL    z0, lmixmin
+       REAL    ksta, inertie
        LOGICAL ok_kzmin
-
-c surface
-       real inertie
-
-cIM lev_histhf  : niveau sorties 6h
-cIM lev_histday : niveau sorties journalieres
-cIM lev_histmth : niveau sorties mensuelles
        INTEGER lev_histhf, lev_histday, lev_histmth
 
-       COMMON/clesphys/cycle_diurne, soil_model, new_oliq,
-     ,     ok_orodr, ok_orolf, ok_gw_nonoro, 
-     ,     nbapp_rad, iflag_con
-     ,     , iflag_ajs, solaire, z0, lmixmin, ksta
-     ,     , ok_kzmin, lev_histhf, lev_histday, lev_histmth
-     ,     , inertie
+       COMMON/clesphys/cycle_diurne, soil_model,                        &
+     &     ok_orodr, ok_orolf, ok_gw_nonoro, nbapp_rad, nbapp_chim      &
+     &     , ecritphy                                                   &
+     &     , iflag_con, iflag_ajs, solaire, z0, lmixmin, ksta           &
+     &     , ok_kzmin, lev_histhf, lev_histday, lev_histmth             &
+     &     , inertie
+
Index: /trunk/libf/phyvenus/clmain.F
===================================================================
--- /trunk/libf/phyvenus/clmain.F	(revision 96)
+++ /trunk/libf/phyvenus/clmain.F	(revision 97)
@@ -134,6 +134,4 @@
 c
 #include "YOMCST.h"
-#include "YOETHF.h"
-#include "FCTTRE.h"
       REAL u1lay(klon), v1lay(klon)
       REAL delp(klon,klev)
@@ -499,6 +497,4 @@
 #include "dimphy.h"
 #include "YOMCST.h"
-#include "YOETHF.h"
-#include "FCTTRE.h"
 #include "dimsoil.h"
 #include "iniprint.h"
@@ -994,6 +990,4 @@
       PARAMETER (zxli=.FALSE.)
 c
-#include "YOETHF.h"
-#include "FCTTRE.h"
       fsta(x) = 1.0 / (1.0+10.0*x*(1+8.0*x))
       fins(x) = SQRT(1.0-18.0*x)
Index: /trunk/libf/phyvenus/clmain.classic
===================================================================
--- /trunk/libf/phyvenus/clmain.classic	(revision 96)
+++ /trunk/libf/phyvenus/clmain.classic	(revision 97)
@@ -134,6 +134,4 @@
 c
 #include "YOMCST.h"
-#include "YOETHF.h"
-#include "FCTTRE.h"
       REAL u1lay(klon), v1lay(klon)
       REAL delp(klon,klev)
@@ -499,6 +497,4 @@
 #include "dimphy.h"
 #include "YOMCST.h"
-#include "YOETHF.h"
-#include "FCTTRE.h"
 #include "dimsoil.h"
 #include "iniprint.h"
@@ -994,6 +990,4 @@
       PARAMETER (zxli=.FALSE.)
 c
-#include "YOETHF.h"
-#include "FCTTRE.h"
       fsta(x) = 1.0 / (1.0+10.0*x*(1+8.0*x))
       fins(x) = SQRT(1.0-18.0*x)
Index: /trunk/libf/phyvenus/clmain.simple
===================================================================
--- /trunk/libf/phyvenus/clmain.simple	(revision 96)
+++ /trunk/libf/phyvenus/clmain.simple	(revision 97)
@@ -128,6 +128,4 @@
 c
 #include "YOMCST.h"
-#include "YOETHF.h"
-#include "FCTTRE.h"
       REAL u1lay(klon), v1lay(klon)
       REAL delp(klon,klev)
@@ -370,6 +368,4 @@
 #include "dimphy.h"
 #include "YOMCST.h"
-#include "YOETHF.h"
-#include "FCTTRE.h"
 #include "dimsoil.h"
 #include "iniprint.h"
@@ -865,6 +861,4 @@
       PARAMETER (zxli=.FALSE.)
 c
-#include "YOETHF.h"
-#include "FCTTRE.h"
       fsta(x) = 1.0 / (1.0+10.0*x*(1+8.0*x))
       fins(x) = SQRT(1.0-18.0*x)
Index: /trunk/libf/phyvenus/conf_phys.F90
===================================================================
--- /trunk/libf/phyvenus/conf_phys.F90	(revision 96)
+++ /trunk/libf/phyvenus/conf_phys.F90	(revision 97)
@@ -11,16 +11,8 @@
    implicit none
 
-#include "YOMCST.inc"
-#include "clesphys.inc"
+#include "YOMCST.h"
+#include "clesphys.h"
 #include "compbl.h"
-!
-! Configuration de la "physique" de LMDZ a l'aide de la fonction
-! GETIN de IOIPSL
-!
-! LF 05/2001
-!
-!--- Ca lit le physiq.def ---
-
-!
+
 ! ok_journe:  sorties journalieres
 ! ok_mensuel: sorties mensuelles
@@ -34,6 +26,82 @@
 ! Local
   integer              :: numout = 6
-  real*4               :: zzz
-! real                 :: zzz
+
+!
+! Configuration de la "physique" de LMDZ a l'aide de la fonction
+! GETIN de IOIPSL
+!
+! LF 05/2001
+!
+!--- Ca lit le physiq.def ---
+
+!******************* parametres anciennement lus dans gcm.def
+
+!Config  Key  = cycle_diurne
+!Config  Desc = Cycle ddiurne
+!Config  Def  = y
+!Config  Help = Cette option permet d'eteidre le cycle diurne.
+!Config         Peut etre util pour accelerer le code !
+       cycle_diurne = .TRUE.
+       CALL getin('cycle_diurne',cycle_diurne)
+
+!Config  Key  = soil_model
+!Config  Desc = Modele de sol
+!Config  Def  = y
+!Config  Help = Choix du modele de sol (Thermique ?)
+!Config         Option qui pourait un string afin de pouvoir
+!Config         plus de choix ! Ou meme une liste d'options !
+       soil_model = .TRUE.
+       CALL getin('soil_model',soil_model)
+
+!Config  Key  = ok_orodr
+!Config  Desc = Oro drag
+!Config  Def  = y
+!Config  Help = GW drag orographie
+!Config         
+       ok_orodr = .TRUE.
+       CALL getin('ok_orodr',ok_orodr)
+
+!Config  Key  =  ok_orolf
+!Config  Desc = Oro lift
+!Config  Def  = n
+!Config  Help = GW lift orographie (pas utilise)
+       ok_orolf = .TRUE.
+       CALL getin('ok_orolf', ok_orolf)
+
+!Config  Key  = ok_gw_nonoro
+!Config  Desc = Gravity waves parameterization
+!Config  Def  = n
+!Config  Help = GW drag non-orographique
+       ok_gw_nonoro = .FALSE.
+       CALL getin('ok_gw_nonoro',ok_gw_nonoro)
+
+!Config  Key  = nbapp_rad
+!Config  Desc = Frequence d'appel au rayonnement
+!Config  Def  = 12
+!Config  Help = Nombre  d'appels des routines de rayonnements
+!Config         par jour.
+       nbapp_rad = 12
+       CALL getin('nbapp_rad',nbapp_rad)
+
+!Config  Key  = nbapp_chim
+!Config  Desc = Frequence d'appel a la chimie
+!Config  Def  = 1
+!Config  Help = Nombre  d'appels des routines de chimie
+!Config         par jour.
+       nbapp_chim = 1
+       CALL getin('nbapp_chim',nbapp_chim)
+
+!Config  Key  = iflag_con
+!Config  Desc = Flag de convection
+!Config  Def  = 0
+!Config  Help = Flag  pour la convection les options suivantes existent :
+!Config         0 : ajsec simple (VENUS, TITAN)
+!Config         1 pour LMD,
+!Config         2 pour Tiedtke,
+!Config         3 pour CCM(NCAR)  
+       iflag_con = 0
+       CALL getin('iflag_con',iflag_con)
+
+!******************* fin parametres anciennement lus dans gcm.def
 
 !Config Key  = OK_journe
@@ -63,4 +131,13 @@
   ok_instan = .false.
   call getin('OK_instan', ok_instan)
+!
+!Config  Key  = ecritphy
+!Config  Desc = Frequence d'ecriture dans histmth et histins
+!Config  Def  = 1
+!Config  Help = frequence de l'ecriture du fichier histmth et histins
+!Config         en jours.
+!
+       ecritphy = 1.
+       CALL getin('ecritphy', ecritphy)
 !
 !
@@ -83,7 +160,6 @@
 ! VENUS
 ! R_ecc = 0.006787
-  zzz   = 0.0
-  call getin('R_ecc', zzz)
-  R_ecc = zzz
+  R_ecc   = 0.0
+  call getin('R_ecc', R_ecc)
 !!
 !Config Key  = R_peri
@@ -93,7 +169,6 @@
 !               
 ! VENUS
-  zzz = 0.
-  call getin('R_peri', zzz)
-  R_peri = zzz
+  R_peri = 0.
+  call getin('R_peri', R_peri)
 !!
 !Config Key  = R_incl
@@ -103,7 +178,6 @@
 !               
 ! VENUS
-  zzz = 0.0
-  call getin('R_incl', zzz)
-  R_incl = zzz
+  R_incl = 0.0
+  call getin('R_incl', R_incl)
 !
 !Config Key  = solaire
@@ -113,7 +187,6 @@
 !Config Help = 
 !
-  zzz = 2620.
-    call getin('solaire', zzz)
-  solaire = zzz
+  solaire = 2620.
+    call getin('solaire', solaire)
 !
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -140,7 +213,6 @@
 !Config Help =
 !
-  zzz = 1.0e-7
-  call getin('ksta',zzz)
-  ksta = zzz
+  ksta = 1.0e-7
+  call getin('ksta',ksta)
 
 !
@@ -150,7 +222,6 @@
 !Config Help =
 !
-  zzz = 1.0e-2
-  call getin('z0',zzz)
-  z0 = zzz
+  z0 = 1.0e-2
+  call getin('z0',z0)
 
 !
@@ -160,9 +231,7 @@
 !Config Help =
 !
-  zzz = 35.
-  call getin('lmixmin',zzz)
-  lmixmin = zzz
-
-!
+  lmixmin = 35.
+  call getin('lmixmin',lmixmin)
+
 !
 !Config Key  = ok_kzmin
@@ -186,10 +255,9 @@
 !Config Key  = inertie
 !Config Desc =
-!Config Def  = 30000.
-!Config Help =
-!
-  zzz = 30000.
-  call getin('inertie',zzz)
-  inertie = zzz
+!Config Def  = 2000.
+!Config Help =
+!
+  inertie = 2000.
+  call getin('inertie',inertie)
 !
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -239,7 +307,16 @@
   write(numout,*)' ##############################################'
   write(numout,*)' Configuration des parametres de la physique: '
+  write(numout,*)' cycle_diurne = ', cycle_diurne
+  write(numout,*)' soil_model = ', soil_model
+  write(numout,*)' ok_orodr = ', ok_orodr
+  write(numout,*)' ok_orolf = ', ok_orolf
+  write(numout,*)' ok_gw_nonoro = ', ok_gw_nonoro
+  write(numout,*)' nbapp_rad = ', nbapp_rad
+  write(numout,*)' nbapp_chim = ', nbapp_chim
+  write(numout,*)' iflag_con = ', iflag_con
   write(numout,*)' Sortie journaliere = ', ok_journe
   write(numout,*)' Sortie mensuelle = ', ok_mensuel
   write(numout,*)' Sortie instantanee = ', ok_instan
+  write(numout,*)' frequence sorties = ', ecritphy  
   write(numout,*)' Sortie bilan d''energie, if_ebil =', if_ebil
   write(numout,*)' Excentricite = ',R_ecc
Index: /trunk/libf/phyvenus/diagphy.F
===================================================================
--- /trunk/libf/phyvenus/diagphy.F	(revision 96)
+++ /trunk/libf/phyvenus/diagphy.F	(revision 97)
@@ -7,4 +7,7 @@
      $    , d_etp_tot, d_qt_tot, d_ec_tot
      $    , fs_bound, fq_bound)
+
+! ATTENTION !! PAS DU TOUT A JOUR POUR VENUS OU TITAN...
+
 C======================================================================
 C
@@ -50,5 +53,4 @@
 #include "dimphy.h"
 #include "YOMCST.h"
-#include "YOETHF.h"
 C
 C     Input variables
@@ -211,5 +213,4 @@
 #include "dimphy.h"
 #include "YOMCST.h"
-#include "YOETHF.h"
 C
 c     Input variables
Index: /trunk/libf/phyvenus/ini_histday.h
===================================================================
--- /trunk/libf/phyvenus/ini_histday.h	(revision 96)
+++ /trunk/libf/phyvenus/ini_histday.h	(revision 97)
@@ -9,6 +9,5 @@
 c
          idayref = day_ref
-	 z4julian = zjulian
-         CALL ymds2ju(annee_ref, 1, idayref, zero, z4julian)
+         CALL ymds2ju(annee_ref, 1, idayref, zero, zjulian)
 c
          CALL gr_fi_ecrit(1,klon,iim,jjmp1,rlond,zx_lon)
@@ -18,13 +17,14 @@
          ENDDO
          CALL gr_fi_ecrit(1,klon,iim,jjmp1,rlatd,zx_lat)
-	 z4_lon = zx_lon
-	 z4_lat = zx_lat
-	 zpresnivs=presnivs
-         CALL histbeg("histday", iim,z4_lon(:,1), jjmp1,z4_lat(1,:),
-     .                 1,iim,1,jjmp1, itau_phy, z4julian, zsto, 
+
+c VENUS: regardee a l'envers!!!!!!!!!!!!!!!
+c    d'ou le -1.* devant zx_lon et zx_lat	 
+         CALL histbeg("histday.nc", iim,-1.*zx_lon(:,1), jjmp1,
+     .                 -1.*zx_lat(1,:),
+     .                 1,iim,1,jjmp1, itau_phy, zjulian, zsto, 
      .                 nhori, nid_day)
          write(*,*)'Journee ', itau_phy, zjulian
          CALL histvert(nid_day, "presnivs", "Vertical levels", "mb",
-     .                 klev, zpresnivs, nvert)
+     .                 klev, presnivs, nvert)
 
 c-------------------------------------------------------
Index: /trunk/libf/phyvenus/ini_histins.h
===================================================================
--- /trunk/libf/phyvenus/ini_histins.h	(revision 96)
+++ /trunk/libf/phyvenus/ini_histins.h	(revision 97)
@@ -9,6 +9,5 @@
 c
          idayref = day_ref
-	 z4julian = zjulian
-         CALL ymds2ju(annee_ref, 1, idayref, zero, z4julian)
+         CALL ymds2ju(annee_ref, 1, idayref, zero, zjulian)
 c
          CALL gr_fi_ecrit(1,klon,iim,jjmp1,rlond,zx_lon)
@@ -18,13 +17,14 @@
          ENDDO
          CALL gr_fi_ecrit(1,klon,iim,jjmp1,rlatd,zx_lat)
-	 z4_lon = zx_lon
-	 z4_lat = zx_lat
-	 zpresnivs=presnivs
-         CALL histbeg("histins", iim,z4_lon(:,1), jjmp1,z4_lat(1,:),
-     .                 1,iim,1,jjmp1, itau_phy, z4julian, zsto1,
+	 
+c VENUS: regardee a l'envers!!!!!!!!!!!!!!!
+c    d'ou le -1.* devant zx_lon et zx_lat	 
+         CALL histbeg("histins.nc", iim,-1.*zx_lon(:,1), jjmp1,
+     .                 -1.*zx_lat(1,:),
+     .                 1,iim,1,jjmp1, itau_phy, zjulian, zsto1,
      .                 nhori, nid_ins)
          write(*,*)'Inst ', itau_phy, zjulian
          CALL histvert(nid_ins, "presnivs", "Vertical levels", "mb",
-     .                 klev, zpresnivs, nvert)
+     .                 klev, presnivs, nvert)
 
 c-------------------------------------------------------
Index: /trunk/libf/phyvenus/ini_histmth.h
===================================================================
--- /trunk/libf/phyvenus/ini_histmth.h	(revision 96)
+++ /trunk/libf/phyvenus/ini_histmth.h	(revision 97)
@@ -14,6 +14,5 @@
 c
          idayref = day_ref
-	 z4julian = zjulian
-         CALL ymds2ju(annee_ref, 1, idayref, zero, z4julian)
+         CALL ymds2ju(annee_ref, 1, idayref, zero, zjulian)
 c
          CALL gr_fi_ecrit(1,klon,iim,jjmp1,rlond,zx_lon)
@@ -25,14 +24,12 @@
 	 
 c VENUS: regardee a l'envers!!!!!!!!!!!!!!!
-	 z4_lon = -1.*zx_lon
-	 z4_lat = -1.*zx_lat
-	 
-	 zpresnivs=presnivs
-         CALL histbeg("histmth.nc", iim,z4_lon(:,1), jjmp1,z4_lat(1,:),
-     .                 1,iim,1,jjmp1, itau_phy, z4julian, zsto, 
+c    d'ou le -1.* devant zx_lon et zx_lat	 
+         CALL histbeg("histmth.nc", iim,-1.*zx_lon(:,1), jjmp1,
+     .                 -1.*zx_lat(1,:),
+     .                 1,iim,1,jjmp1, itau_phy, zjulian, zsto, 
      .                 nhori, nid_mth)
          write(*,*)'Mensuel ', itau_phy, zjulian
          CALL histvert(nid_mth, "presnivs", "Vertical levels", "mb",
-     .                 klev, zpresnivs, nvert)
+     .                 klev, presnivs, nvert)
 
 c-------------------------------------------------------
Index: /trunk/libf/phyvenus/interface_surf.F90
===================================================================
--- /trunk/libf/phyvenus/interface_surf.F90	(revision 96)
+++ /trunk/libf/phyvenus/interface_surf.F90	(revision 97)
@@ -25,5 +25,5 @@
   END INTERFACE
 
-#include "YOMCST.inc"
+#include "YOMCST.h"
 
   CONTAINS
@@ -210,7 +210,4 @@
 !
 
-#include "YOETHF.inc"
-#include "FCTTRE.inc"
-
 ! Parametres d'entree
   integer, intent(IN) :: knon, klon
Index: /trunk/libf/phyvenus/phyetat0.F
===================================================================
--- /trunk/libf/phyvenus/phyetat0.F	(revision 96)
+++ /trunk/libf/phyvenus/phyetat0.F	(revision 97)
@@ -7,5 +7,5 @@
      .            rlat,rlon, tsol,tsoil,
      .           albe, solsw, sollw,
-     .           fder,radsol,clesphy0,
+     .           fder,radsol,
      .    zmea, zstd, zsig, zgam, zthe, zpic, zval,  
      .           tabcntr0,
@@ -44,8 +44,4 @@
       LOGICAL ancien_ok
 
-      INTEGER        longcles
-      PARAMETER    ( longcles = 20 )
-      REAL clesphy0( longcles )
-c
       REAL xmin, xmax
 c
@@ -88,64 +84,7 @@
          ENDDO
 c
-         cycle_diurne   = .FALSE.
-         soil_model     = .FALSE.
-         new_oliq       = .FALSE.
-         ok_orodr       = .FALSE.
-         ok_orolf       = .FALSE.
-         ok_gw_nonoro   = .FALSE.
-
-
-         IF( clesphy0(1).NE.tab_cntrl( 5 ) )  THEN
-             tab_cntrl( 5 ) = clesphy0(1)
-         ENDIF
-
-         IF( clesphy0(2).NE.tab_cntrl( 6 ) )  THEN
-             tab_cntrl( 6 ) = clesphy0(2)
-         ENDIF
-
-         IF( clesphy0(3).NE.tab_cntrl( 7 ) )  THEN
-             tab_cntrl( 7 ) = clesphy0(3)
-         ENDIF
-
-         IF( clesphy0(4).NE.tab_cntrl( 8 ) )  THEN
-             tab_cntrl( 8 ) = clesphy0(4)
-         ENDIF
-
-         IF( clesphy0(5).NE.tab_cntrl( 9 ) )  THEN
-             tab_cntrl( 9 ) = clesphy0( 5 )
-         ENDIF
-
-         IF( clesphy0(6).NE.tab_cntrl( 10 ) )  THEN
-             tab_cntrl( 10 ) = clesphy0( 6 )
-         ENDIF
-
-         IF( clesphy0(7).NE.tab_cntrl( 11 ) )  THEN
-             tab_cntrl( 11 ) = clesphy0( 7 )
-         ENDIF
-
-         IF( clesphy0(8).NE.tab_cntrl( 12 ) )  THEN
-             tab_cntrl( 12 ) = clesphy0( 8 )
-         ENDIF
-
 
          dtime        = tab_cntrl(1)
          radpas       = tab_cntrl(2)
-         iflag_con    = tab_cntrl(5)
-         nbapp_rad    = tab_cntrl(6)
-
-
-         cycle_diurne    = .FALSE.
-         soil_model      = .FALSE.
-         new_oliq        = .FALSE.
-         ok_orodr        = .FALSE.
-         ok_orolf        = .FALSE.
-         ok_gw_nonoro    = .FALSE.
-
-         IF( tab_cntrl( 7) .EQ. 1. )    cycle_diurne  = .TRUE.
-         IF( tab_cntrl( 8) .EQ. 1. )       soil_model = .TRUE.
-         IF( tab_cntrl( 9) .EQ. 1. )         new_oliq = .TRUE.
-         IF( tab_cntrl(10) .EQ. 1. )         ok_orodr = .TRUE.
-         IF( tab_cntrl(11) .EQ. 1. )         ok_orolf = .TRUE.
-         IF( tab_cntrl(12) .EQ. 1. )     ok_gw_nonoro = .TRUE.
 
       ENDIF
Index: /trunk/libf/phyvenus/phyredem.F
===================================================================
--- /trunk/libf/phyvenus/phyredem.F	(revision 96)
+++ /trunk/libf/phyvenus/phyredem.F	(revision 97)
@@ -10,4 +10,6 @@
      .    zmea, zstd, zsig, zgam, zthe, zpic, zval, 
      .           t_ancien)
+
+      USE control_mod
       IMPLICIT none
 c======================================================================
@@ -20,5 +22,4 @@
 #include "dimsoil.h"
 #include "clesphys.h"
-#include "control.h"
 #include "temps.h"
 c======================================================================
Index: /trunk/libf/phyvenus/physiq.F
===================================================================
--- /trunk/libf/phyvenus/physiq.F	(revision 96)
+++ /trunk/libf/phyvenus/physiq.F	(revision 97)
@@ -5,5 +5,5 @@
       SUBROUTINE physiq (nlon,nlev,nqmax,
      .            debut,lafin,rjourvrai,gmtime,pdtphys,
-     .            paprs,pplay,ppk,pphi,pphis,presnivs,clesphy0,
+     .            paprs,pplay,ppk,pphi,pphis,presnivs,
      .            u,v,t,qx,
      .            omega,
@@ -12,4 +12,6 @@
       USE ioipsl
       USE histcom
+      USE infotrac
+      USE control_mod
       IMPLICIT none
 c======================================================================
@@ -71,8 +73,6 @@
 #include "dimsoil.h"
 #include "clesphys.h"
-#include "control.h"
 #include "temps.h"
 #include "comgeomphy.h"
-#include "advtrac.h"
 #include "iniprint.h"
 #include "raddim.h"
@@ -157,8 +157,4 @@
 #endif
 
-      INTEGER        longcles
-      PARAMETER    ( longcles = 20 )
-      REAL clesphy0( longcles      )
-c
 c Variables propres a la physique
 c
@@ -385,10 +381,4 @@
       REAL zx_tmp_2d(iim,jjmp1),zx_tmp_3d(iim,jjmp1,klev)
       REAL zx_lon(iim,jjmp1), zx_lat(iim,jjmp1)
-      REAL*4 z4_tmp_2d(iim,jjmp1),z4_tmp_3d(iim,jjmp1,klev)
-      REAL*4 z4_lon(iim,jjmp1), z4_lat(iim,jjmp1)
-      REAL*4 zpresnivs(klev)
-c     REAL z4_tmp_2d(iim,jjmp1),z4_tmp_3d(iim,jjmp1,klev)
-c     REAL z4_lon(iim,jjmp1), z4_lat(iim,jjmp1)
-c     REAL zpresnivs(klev)
 
       INTEGER nid_day, nid_mth, nid_ins
@@ -396,6 +386,5 @@
 c
       INTEGER nhori, nvert, idayref
-      REAL*4 zsto, zout, zsto1, zsto2, z4julian, zero
-c     REAL zsto, zout, zsto1, zsto2, z4julian, zero
+      REAL zsto, zout, zsto1, zsto2, zero
       parameter (zero=0.0e0)
       real zjulian
@@ -439,6 +428,4 @@
 c
 #include "YOMCST.h"
-#include "YOETHF.h"
-#include "FCTTRE.h"
 
 c======================================================================
@@ -489,5 +476,5 @@
      .       rlatd,rlond,ftsol,ftsoil,
      .       falbe, solsw, sollw,
-     .       dlw,radsol,clesphy0,
+     .       dlw,radsol,
      .      zmea,zstd,zsig,zgam,zthe,zpic,zval,
      .       tabcntr0,
@@ -577,9 +564,10 @@
      .                   iflag_ajs
 c
-         ecrit_mth = NINT(RDAY/dtime *ecritphy)  ! tous les ecritphy jours
+         ecrit_mth = NINT(RDAY/dtime*ecritphy)  ! tous les ecritphy jours
          IF (ok_mensuel) THEN
          WRITE(lunout,*)'La frequence de sortie mensuelle est de ', 
      .                   ecrit_mth
          ENDIF
+
          ecrit_day = NINT(RDAY/dtime *1.0)  ! tous les jours
          IF (ok_journe) THEN
@@ -587,6 +575,6 @@
      .                   ecrit_day
          ENDIF
-         ecrit_ins = NINT(RDAY/dtime/48.)  ! a chaque pas de temps ==> PB. dans time_counter pour 1mois
-         ecrit_ins = NINT(RDAY/dtime/12.)  ! toutes les deux heures
+
+         ecrit_ins = NINT(RDAY/dtime/*ecritphy)  ! Fraction de jour reglable
          IF (ok_instan) THEN
          WRITE(lunout,*)'La frequence de sortie instant. est de ', 
Index: /trunk/libf/phyvenus/phytrac.F
===================================================================
--- /trunk/libf/phyvenus/phytrac.F	(revision 96)
+++ /trunk/libf/phyvenus/phytrac.F	(revision 97)
@@ -26,4 +26,6 @@
 
       USE ioipsl
+      USE infotrac
+      USE control_mod
 
       IMPLICIT none
@@ -42,7 +44,5 @@
 #include "temps.h"
 #include "paramet.h"
-#include "control.h"
 #include "comgeomphy.h"
-#include "advtrac.h"
 c======================================================================
 
@@ -124,11 +124,11 @@
 c   k,i,it,tr_seri(klon,klev,nqmax),pplay(nlon,nlev), 
       integer nqCO_OCS
-      real zprof(klev,nqmx)
+      real zprof(klev,nqtot)
 c      real pzero,gamma
 c      parameter (pzero=85000.)
 c      parameter (gamma=5000.)
       REAL alpha
-      real deltatr(klon,klev,nqmx) ! ecart au profil de ref zprof
-      real tau(klev,nqmx)          ! temps de relaxation vers le profil (s)
+      real deltatr(klon,klev,nqtot) ! ecart au profil de ref zprof
+      real tau(klev,nqtot)          ! temps de relaxation vers le profil (s)
       save zprof,tau
 c======================================================================
Index: /trunk/libf/phyvenus/radlwsw.1mat
===================================================================
--- /trunk/libf/phyvenus/radlwsw.1mat	(revision 96)
+++ /trunk/libf/phyvenus/radlwsw.1mat	(revision 97)
@@ -38,5 +38,4 @@
 #include "dimphy.h"
 #include "raddim.h"
-#include "YOETHF.h"
 c
       real rmu0(klon), fract(klon), dist
Index: /trunk/libf/phyvenus/radlwsw.F
===================================================================
--- /trunk/libf/phyvenus/radlwsw.F	(revision 96)
+++ /trunk/libf/phyvenus/radlwsw.F	(revision 97)
@@ -42,5 +42,4 @@
 #include "dimphy.h"
 #include "raddim.h"
-#include "YOETHF.h"
 #include "YOMCST.h"
 #include "clesphys.h" 
Index: /trunk/libf/phyvenus/radlwsw.NewtonCool
===================================================================
--- /trunk/libf/phyvenus/radlwsw.NewtonCool	(revision 96)
+++ /trunk/libf/phyvenus/radlwsw.NewtonCool	(revision 97)
@@ -41,5 +41,4 @@
 #include "dimphy.h"
 #include "raddim.h"
-#include "YOETHF.h"
 #include "YOMCST.h"
 #include "clesphys.h" 
Index: /trunk/libf/phyvenus/radlwsw.multimat
===================================================================
--- /trunk/libf/phyvenus/radlwsw.multimat	(revision 96)
+++ /trunk/libf/phyvenus/radlwsw.multimat	(revision 97)
@@ -42,5 +42,4 @@
 #include "dimphy.h"
 #include "raddim.h"
-#include "YOETHF.h"
 #include "YOMCST.h"
 #include "clesphys.h" 
Index: /trunk/libf/phyvenus/suphec.F
===================================================================
--- /trunk/libf/phyvenus/suphec.F	(revision 96)
+++ /trunk/libf/phyvenus/suphec.F	(revision 97)
@@ -5,5 +5,4 @@
 C
 #include "YOMCST.h"
-#include "YOETHF.h"
 cIM cf. JLD
        LOGICAL firstcall
@@ -153,70 +152,4 @@
       WRITE(UNIT=6,FMT='(''     Rv/Rd-1  = '',e13.7)') RETV
 C
-C     ----------------------------------------------------------------
-C
-C*       6.    DEFINE THERMODYNAMIC CONSTANTS, LIQUID PHASE.
-C              ---------------------------------------------
-C
-      RCW=RCPV
-      WRITE(UNIT=6,FMT='('' *** Thermodynamic, liquid  ***'')')
-      WRITE(UNIT=6,FMT='(''         Cw   = '',E13.7)') RCW
-C
-C     ----------------------------------------------------------------
-C
-C*       7.    DEFINE THERMODYNAMIC CONSTANTS, SOLID PHASE.
-C              --------------------------------------------
-C
-      RCS=RCPV
-      WRITE(UNIT=6,FMT='('' *** thermodynamic, solid   ***'')')
-      WRITE(UNIT=6,FMT='(''         Cs   = '',E13.7)') RCS
-C
-C     ----------------------------------------------------------------
-C
-C*       8.    DEFINE THERMODYNAMIC CONSTANTS, TRANSITION OF PHASE.
-C              ----------------------------------------------------
-C
-      RTT=273.16
-      RLVTT=2.5008E+6
-      RLSTT=2.8345E+6
-      RLMLT=RLSTT-RLVTT
-      RATM=100000.
-      WRITE(UNIT=6,FMT='('' *** Thermodynamic, trans.  ***'')')
-      WRITE(UNIT=6,FMT='('' Fusion point  = '',E13.7)') RTT
-      WRITE(UNIT=6,FMT='(''        RLvTt  = '',E13.7)') RLVTT
-      WRITE(UNIT=6,FMT='(''        RLsTt  = '',E13.7)') RLSTT
-      WRITE(UNIT=6,FMT='(''        RLMlt  = '',E13.7)') RLMLT
-      WRITE(UNIT=6,FMT='('' Normal press. = '',E13.7)') RATM
-      WRITE(UNIT=6,FMT='('' Latent heat :  '')')
-C
-C     ----------------------------------------------------------------
-C
-C*       9.    SATURATED VAPOUR PRESSURE.
-C              --------------------------
-C
-      RESTT=611.14
-      RGAMW=(RCW-RCPV)/RV
-      RBETW=RLVTT/RV+RGAMW*RTT
-      RALPW=LOG(RESTT)+RBETW/RTT+RGAMW*LOG(RTT)
-      RGAMS=(RCS-RCPV)/RV
-      RBETS=RLSTT/RV+RGAMS*RTT
-      RALPS=LOG(RESTT)+RBETS/RTT+RGAMS*LOG(RTT)
-      RGAMD=RGAMS-RGAMW
-      RBETD=RBETS-RBETW
-      RALPD=RALPS-RALPW
-C
-C     ------------------------------------------------------------------
-c
-c calculer les constantes pour les fonctions thermodynamiques
-c
-      RVTMP2=RCPV/RCPD-1.
-      RHOH2O=RATM/100.
-      R2ES=RESTT*RD/RV
-      R3LES=17.269
-      R3IES=21.875
-      R4LES=35.86
-      R4IES=7.66
-      R5LES=R3LES*(RTT-R4LES)
-      R5IES=R3IES*(RTT-R4IES)
-C
       RETURN
       END
Index: /trunk/libf/phyvenus/testphys1d.F
===================================================================
--- /trunk/libf/phyvenus/testphys1d.F	(revision 96)
+++ /trunk/libf/phyvenus/testphys1d.F	(revision 97)
@@ -54,5 +54,5 @@
       REAL gru,grv   ! prescribed "geostrophic" background wind
       REAL temp(llm)   ! temperature at the middle of the layers
-      REAL q(llm,nqmx) ! tracer mixing ratio (e.g. kg/kg)
+      REAL q(llm,nqtot) ! tracer mixing ratio (e.g. kg/kg)
       REAL tsoil(nsoilmx)   ! subsurface soik temperature (K)
       REAL zlay(llm)   ! altitude estimee dans les couches (km)
@@ -66,6 +66,6 @@
       REAL dudyn(llm),dvdyn(llm),dtempdyn(llm)
       REAL dpsurf    
-      REAL dq(llm,nqmx)
-      REAL dqdyn(llm,nqmx)
+      REAL dq(llm,nqtot)
+      REAL dqdyn(llm,nqtot)
 
 c   Various intermediate variables
@@ -287,5 +287,5 @@
 c    ---------------------------
 
-      DO iq=1,nqmx
+      DO iq=1,nqtot
         DO ilayer=1,nlayer
            q(ilayer,iq) = 0.
@@ -375,5 +375,5 @@
 c       --------------------
 
-      CALL physiq (1,llm,nqmx,
+      CALL physiq (1,llm,nqtot,
      ,     firstcall,lastcall,
      ,     day,time,dtphys,
Index: /trunk/libf/phyvenus/ustarhb.F
===================================================================
--- /trunk/libf/phyvenus/ustarhb.F	(revision 96)
+++ /trunk/libf/phyvenus/ustarhb.F	(revision 97)
@@ -36,6 +36,4 @@
       LOGICAL check(klon)   ! True=>chk if Richardson no.>critcal
 c
-#include "YOETHF.h"
-#include "FCTTRE.h"
       DO i = 1, knon
         zx_alf1 = 1.0
Index: /trunk/libf/phyvenus/write_histday.h
===================================================================
--- /trunk/libf/phyvenus/write_histday.h	(revision 96)
+++ /trunk/libf/phyvenus/write_histday.h	(revision 97)
@@ -7,7 +7,5 @@
       ndex3d = 0
       zx_tmp_2d = 0.
-      z4_tmp_2d = 0.
       zx_tmp_3d = 0.
-      z4_tmp_3d = 0.
       zx_tmp_fi2d=0.
       zx_tmp_fi3d=0.
@@ -26,15 +24,12 @@
       i = NINT(zout/zsto)
       CALL gr_fi_ecrit(1,klon,iim,jjmp1,pphis,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_day,"phis",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_day,"phis",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 C
       i = NINT(zout/zsto)
       CALL gr_fi_ecrit(1,klon,iim,jjmp1,airephy,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_day,"aire",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_day,"aire",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, ftsol,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_day,"tsol",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_day,"tsol",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       DO i = 1, klon
@@ -42,14 +37,11 @@
       ENDDO
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_day,"psol",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_day,"psol",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, ue,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_day,"ue",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_day,"ue",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, ve,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_day,"ve",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_day,"ve",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       ENDIF !lev_histday.GE.1
@@ -61,31 +53,25 @@
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, t_seri, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"temp",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"temp",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, pplay, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"pres",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"pres",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, zphi, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"geop",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"geop",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, u_seri, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"vitu",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"vitu",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, v_seri, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"vitv",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"vitv",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, omega, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"vitw",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"vitw",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
@@ -100,18 +86,14 @@
 c
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, topsw,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_day,"tops",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_day,"tops",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, toplw,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_day,"topl",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_day,"topl",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, solsw,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_day,"sols",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_day,"sols",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, sollw,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_day,"soll",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_day,"soll",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
 c 3D
@@ -119,12 +101,10 @@
       zx_tmp_fi3d(1:klon,1:klev)=swnet(1:klon,1:klev)
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"SWnet",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"SWnet",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       zx_tmp_fi3d(1:klon,1:klev)=lwnet(1:klon,1:klev)
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"LWnet",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"LWnet",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
@@ -136,24 +116,20 @@
 c en K/s      
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_t_dyn, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"dtdyn",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"dtdyn",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
 c en K/s      
 c      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_t, zx_tmp_3d)
-c      z4_tmp_3d=zx_tmp_3d
-c      CALL histwrite(nid_day,"dtphy",itau_w,z4_tmp_3d,
+c      CALL histwrite(nid_day,"dtphy",itau_w,zx_tmp_3d,
 c     .                                   iim*jjmp1*klev,ndex3d)
 c
 c en K/s      
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,d_t_vdf,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"dtvdf",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"dtvdf",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
 c en K/s      
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,d_t_ajs,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"dtajs",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"dtajs",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
@@ -161,6 +137,5 @@
       zx_tmp_fi3d(1:klon,1:klev)=heat(1:klon,1:klev)/RDAY 
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"dtswr",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"dtswr",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
@@ -168,42 +143,35 @@
       zx_tmp_fi3d(1:klon,1:klev)=-1.*cool(1:klon,1:klev)/RDAY
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"dtlwr",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"dtlwr",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c en K/s      
 c     zx_tmp_fi3d(1:klon,1:klev)=d_t_ec(1:klon,1:klev)
 c     CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-c     z4_tmp_3d=zx_tmp_3d
-c     CALL histwrite(nid_day,"dtec",itau_w,z4_tmp_3d,
+c     CALL histwrite(nid_day,"dtec",itau_w,zx_tmp_3d,
 c    .                                   iim*jjmp1*klev,ndex3d)
 c
 c en (m/s)/s      
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_u_dyn, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"dudyn",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"dudyn",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
 c en (m/s)/s      
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_u_vdf, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"duvdf",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"duvdf",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
 c en (m/s)/s      
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_u_ajs, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"duajs",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"duajs",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
 c en (m/s)/s      
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_u_oro, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"dugwo",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"dugwo",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
 c en (m/s)/s      
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_u_hin, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_day,"dugwno",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"dugwno",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
@@ -211,6 +179,6 @@
 c     CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_v_vdf, zx_tmp_3d)
 c VENUS: regardee a l'envers!!!!!!!!!!!!!!!
-c     z4_tmp_3d=-1.*zx_tmp_3d
-c     CALL histwrite(nid_day,"dvvdf",itau_w,z4_tmp_3d,
+c     zx_tmp_3d=-1.*zx_tmp_3d
+c     CALL histwrite(nid_day,"dvvdf",itau_w,zx_tmp_3d,
 c    .                                   iim*jjmp1*klev,ndex3d)
 c
@@ -224,7 +192,6 @@
          IF (iq.LE.99) THEN
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, qx(1,1,iq+2), zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
       WRITE(str2,'(i2.2)') iq
-      CALL histwrite(nid_day,"trac"//str2,itau_w,z4_tmp_3d,
+      CALL histwrite(nid_day,"trac"//str2,itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
          ELSE
@@ -236,20 +203,16 @@
 c
 c      CALL gr_fi_ecrit(1, klon,iim,jjmp1, fluxu , zx_tmp_2d)
-c      z4_tmp_2d=zx_tmp_2d
 c      CALL histwrite(nid_day,"taux_",itau_w,
-c    $      z4_tmp_2d,iim*jjmp1,ndex2d) 
+c    $      zx_tmp_2d,iim*jjmp1,ndex2d) 
 c      
 c      CALL gr_fi_ecrit(1, klon,iim,jjmp1, fluxv , zx_tmp_2d)
-c      z4_tmp_2d=zx_tmp_2d
 c      CALL histwrite(nid_day,"tauy_",itau_w,
-c    $      z4_tmp_2d,iim*jjmp1,ndex2d)
+c    $      zx_tmp_2d,iim*jjmp1,ndex2d)
 c
 c     CALL gr_fi_ecrit(1, klon,iim,jjmp1, cdragm,zx_tmp_2d)
-c      z4_tmp_2d=zx_tmp_2d
-c     CALL histwrite(nid_day,"cdrm",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+c     CALL histwrite(nid_day,"cdrm",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
 c     CALL gr_fi_ecrit(1, klon,iim,jjmp1, cdragh,zx_tmp_2d)
-c      z4_tmp_2d=zx_tmp_2d
-c     CALL histwrite(nid_day,"cdrh",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+c     CALL histwrite(nid_day,"cdrh",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       ENDIF !lev_histday.GE.5
Index: /trunk/libf/phyvenus/write_histins.h
===================================================================
--- /trunk/libf/phyvenus/write_histins.h	(revision 96)
+++ /trunk/libf/phyvenus/write_histins.h	(revision 97)
@@ -7,7 +7,5 @@
       ndex3d = 0
       zx_tmp_2d = 0.
-      z4_tmp_2d = 0.
       zx_tmp_3d = 0.
-      z4_tmp_3d = 0.
       zx_tmp_fi2d=0.
       zx_tmp_fi3d=0.
Index: /trunk/libf/phyvenus/write_histmth.h
===================================================================
--- /trunk/libf/phyvenus/write_histmth.h	(revision 96)
+++ /trunk/libf/phyvenus/write_histmth.h	(revision 97)
@@ -7,7 +7,5 @@
       ndex3d = 0
       zx_tmp_2d = 0.
-      z4_tmp_2d = 0.
       zx_tmp_3d = 0.
-      z4_tmp_3d = 0.
       zx_tmp_fi2d=0.
       zx_tmp_fi3d=0.
@@ -25,15 +23,12 @@
       i = NINT(zout/zsto)
       CALL gr_fi_ecrit(1,klon,iim,jjmp1,pphis,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_mth,"phis",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_mth,"phis",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 C
       i = NINT(zout/zsto)
       CALL gr_fi_ecrit(1,klon,iim,jjmp1,airephy,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_mth,"aire",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_mth,"aire",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, ftsol,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_mth,"tsol",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_mth,"tsol",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       DO i = 1, klon
@@ -41,23 +36,19 @@
       ENDDO
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_mth,"psol",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_mth,"psol",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
 c     CALL gr_fi_ecrit(1, klon,iim,jjmp1, ue,zx_tmp_2d)
-c     z4_tmp_2d=zx_tmp_2d
-c     CALL histwrite(nid_mth,"ue",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+c     CALL histwrite(nid_mth,"ue",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
 c     CALL gr_fi_ecrit(1, klon,iim,jjmp1, ve,zx_tmp_2d)
 c VENUS: regardee a l'envers!!!!!!!!!!!!!!!
-c     z4_tmp_2d=-1.*zx_tmp_2d
-c     CALL histwrite(nid_mth,"ve",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+c     zx_tmp_2d=-1.*zx_tmp_2d
+c     CALL histwrite(nid_mth,"ve",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, cdragh,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_mth,"cdragh",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_mth,"cdragh",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, cdragm,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_mth,"cdragm",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_mth,"cdragm",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       ENDIF !lev_histmth.GE.1
@@ -69,54 +60,45 @@
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, t_seri, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"temp",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"temp",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, pplay, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"pres",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"pres",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, zphi, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"geop",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"geop",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, u_seri, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"vitu",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"vitu",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, v_seri, zx_tmp_3d)
 c VENUS: regardee a l'envers!!!!!!!!!!!!!!!
-      z4_tmp_3d=-1.*zx_tmp_3d
-      CALL histwrite(nid_mth,"vitv",itau_w,z4_tmp_3d,
+      zx_tmp_3d=-1.*zx_tmp_3d
+      CALL histwrite(nid_mth,"vitv",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, omega, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"vitw",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"vitw",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
 c en (m/s)/s      
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_u_dyn, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"dudyn",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"dudyn",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
 c en (m/s)/s      
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_u_vdf, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"duvdf",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"duvdf",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
 c     CALL gr_fi_ecrit(klev,klon,iim,jjmp1, mang, zx_tmp_3d)
-c     z4_tmp_3d=zx_tmp_3d
-c     CALL histwrite(nid_mth,"mang",itau_w,z4_tmp_3d,
+c     CALL histwrite(nid_mth,"mang",itau_w,zx_tmp_3d,
 c    .                                   iim*jjmp1*klev,ndex3d)
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, ycoefh, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"Kz",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"Kz",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
@@ -126,7 +108,6 @@
           IF (iq.LE.99) THEN
        CALL gr_fi_ecrit(klev,klon,iim,jjmp1, qx(1,1,iq), zx_tmp_3d)
-       z4_tmp_3d=zx_tmp_3d
        WRITE(str2,'(i2.2)') iq
-       CALL histwrite(nid_mth,tnom(iq),itau_w,z4_tmp_3d,
+       CALL histwrite(nid_mth,tnom(iq),itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
           ELSE
@@ -138,6 +119,5 @@
 c
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, topsw,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_mth,"tops",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_mth,"tops",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       ENDIF !lev_histmth.GE.2
@@ -151,14 +131,11 @@
 c
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, toplw,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_mth,"topl",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_mth,"topl",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, solsw,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_mth,"sols",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_mth,"sols",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, sollw,zx_tmp_2d)
-      z4_tmp_2d=zx_tmp_2d
-      CALL histwrite(nid_mth,"soll",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+      CALL histwrite(nid_mth,"soll",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
 c 3D
@@ -166,36 +143,30 @@
       zx_tmp_fi3d(1:klon,1:klev)=swnet(1:klon,1:klev)
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"SWnet",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"SWnet",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       zx_tmp_fi3d(1:klon,1:klev)=lwnet(1:klon,1:klev)
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"LWnet",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"LWnet",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       zx_tmp_fi3d(1:klon,1:klev)=fluxt(1:klon,1:klev)
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"fluxvdf",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"fluxvdf",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       zx_tmp_fi3d(1:klon,1:klev)=flux_dyn(1:klon,1:klev)
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"fluxdyn",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"fluxdyn",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
       zx_tmp_fi3d(1:klon,1:klev)=flux_ajs(1:klon,1:klev)
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"fluxajs",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"fluxajs",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
 c     zx_tmp_fi3d(1:klon,1:klev)=flux_ec(1:klon,1:klev)
 c     CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-c     z4_tmp_3d=zx_tmp_3d
-c     CALL histwrite(nid_mth,"fluxec",itau_w,z4_tmp_3d,
+c     CALL histwrite(nid_mth,"fluxec",itau_w,zx_tmp_3d,
 c    .                                   iim*jjmp1*klev,ndex3d)
 c
@@ -207,24 +178,20 @@
 c en K/s      
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_t_dyn, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"dtdyn",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"dtdyn",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
 c en K/s      
 c     CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_t, zx_tmp_3d)
-c     z4_tmp_3d=zx_tmp_3d
-c     CALL histwrite(nid_mth,"dtphy",itau_w,z4_tmp_3d,
+c     CALL histwrite(nid_mth,"dtphy",itau_w,zx_tmp_3d,
 c    .                                   iim*jjmp1*klev,ndex3d)
 c
 c en K/s      
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,d_t_vdf,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"dtvdf",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"dtvdf",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
 c en K/s      
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,d_t_ajs,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"dtajs",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"dtajs",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
@@ -232,6 +199,5 @@
       zx_tmp_fi3d(1:klon,1:klev)=heat(1:klon,1:klev)/RDAY 
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"dtswr",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"dtswr",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
@@ -239,30 +205,25 @@
       zx_tmp_fi3d(1:klon,1:klev)=-1.*cool(1:klon,1:klev)/RDAY
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"dtlwr",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"dtlwr",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c en K/s      
 c     zx_tmp_fi3d(1:klon,1:klev)=d_t_ec(1:klon,1:klev)
 c     CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
-c     z4_tmp_3d=zx_tmp_3d
-c     CALL histwrite(nid_mth,"dtec",itau_w,z4_tmp_3d,
+c     CALL histwrite(nid_mth,"dtec",itau_w,zx_tmp_3d,
 c    .                                   iim*jjmp1*klev,ndex3d)
 c
 c en (m/s)/s      
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_u_ajs, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"duajs",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"duajs",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
 c en (m/s)/s      
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_u_oro, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"dugwo",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"dugwo",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
 c en (m/s)/s      
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_u_hin, zx_tmp_3d)
-      z4_tmp_3d=zx_tmp_3d
-      CALL histwrite(nid_mth,"dugwno",itau_w,z4_tmp_3d,
+      CALL histwrite(nid_mth,"dugwno",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
@@ -270,6 +231,6 @@
 c     CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_v_vdf, zx_tmp_3d)
 c VENUS: regardee a l'envers!!!!!!!!!!!!!!!
-c     z4_tmp_3d=-1.*zx_tmp_3d
-c     CALL histwrite(nid_mth,"dvvdf",itau_w,z4_tmp_3d,
+c     zx_tmp_3d=-1.*zx_tmp_3d
+c     CALL histwrite(nid_mth,"dvvdf",itau_w,zx_tmp_3d,
 c    .                                   iim*jjmp1*klev,ndex3d)
 c
@@ -281,20 +242,16 @@
 c
 c      CALL gr_fi_ecrit(1, klon,iim,jjmp1, fluxu , zx_tmp_2d)
-c      z4_tmp_2d=zx_tmp_2d
 c      CALL histwrite(nid_mth,"taux_",itau_w,
-c    $      z4_tmp_2d,iim*jjmp1,ndex2d) 
+c    $      zx_tmp_2d,iim*jjmp1,ndex2d) 
 c      
 c      CALL gr_fi_ecrit(1, klon,iim,jjmp1, fluxv , zx_tmp_2d)
-c      z4_tmp_2d=zx_tmp_2d
 c      CALL histwrite(nid_mth,"tauy_",itau_w,
-c    $      z4_tmp_2d,iim*jjmp1,ndex2d)
+c    $      zx_tmp_2d,iim*jjmp1,ndex2d)
 c
 c     CALL gr_fi_ecrit(1, klon,iim,jjmp1, cdragm,zx_tmp_2d)
-c      z4_tmp_2d=zx_tmp_2d
-c     CALL histwrite(nid_mth,"cdrm",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+c     CALL histwrite(nid_mth,"cdrm",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
 c     CALL gr_fi_ecrit(1, klon,iim,jjmp1, cdragh,zx_tmp_2d)
-c      z4_tmp_2d=zx_tmp_2d
-c     CALL histwrite(nid_mth,"cdrh",itau_w,z4_tmp_2d,iim*jjmp1,ndex2d)
+c     CALL histwrite(nid_mth,"cdrh",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
       ENDIF !lev_histmth.GE.5
