Index: LMDZ4/branches/LMDZ4_V3_patches/libf/dyn3d/create_etat0_limit.F
===================================================================
--- LMDZ4/branches/LMDZ4_V3_patches/libf/dyn3d/create_etat0_limit.F	(revision 844)
+++ LMDZ4/branches/LMDZ4_V3_patches/libf/dyn3d/create_etat0_limit.F	(revision 845)
@@ -28,7 +28,23 @@
 #include "paramet.h"
 #include "indicesol.h"
+#include "advtrac.h"
 cym#include "dimphy.h" 
       REAL :: masque(iip1,jjp1)
       REAL :: pctsrf(iim*(jjm-1)+2, nbsrf)
+
+c initialisation traceurs
+      hadv_flg(:) = 0.
+      vadv_flg(:) = 0.
+      conv_flg(:) = 0.
+      pbl_flg(:)  = 0. 
+      tracnam(:)  = '        ' 
+      nprath = 1
+      nbtrac = 0
+      mmt_adj(:,:,:,:) = 1
+
+#ifdef INCA
+      call init_const_lmdz(nbtrac,anneeref,dayref,iphysiq,day_step,nday)
+      print *, 'nbtrac =' , nbtrac 
+#endif
 
       CALL Init_Phys_lmdz(iim,jjp1,llm,nqmx-2,1,(jjm-1)*iim+2)
Index: LMDZ4/branches/LMDZ4_V3_patches/libf/dyn3d/dynredem.F
===================================================================
--- LMDZ4/branches/LMDZ4_V3_patches/libf/dyn3d/dynredem.F	(revision 844)
+++ LMDZ4/branches/LMDZ4_V3_patches/libf/dyn3d/dynredem.F	(revision 845)
@@ -530,6 +530,7 @@
      
       REAL time
-      INTEGER nid, nvarid
-      INTEGER ierr
+      INTEGER nid, nvarid, nid_trac, nvarid_trac
+      REAL trac_tmp(ip1jmp1,llm)      
+      INTEGER ierr, ierr_file 
       INTEGER iq
       INTEGER length
@@ -622,6 +623,73 @@
 #endif
 
+#ifdef INCA
+! Ajout Anne pour lecture valeurs traceurs dans un fichier start_trac.nc
+      ierr_file = NF_OPEN ("start_trac.nc", NF_NOWRITE,nid_trac)
+      IF (ierr_file .NE.NF_NOERR) THEN
+        write(6,*)' Pb d''ouverture du fichier start_trac.nc'
+        write(6,*)' ierr = ', ierr_file 
+      ENDIF
+#endif
+
       IF(nq.GE.1) THEN
-       do iq=1,nq   
+       do iq=1,nq 
+#ifdef INCA
+! lecture de la valeur du traceur dans start_trac.nc
+         if (ierr_file .ne. 2) then 
+            ierr = NF_INQ_VARID (nid_trac, tname(iq), nvarid_trac)
+            IF (ierr .NE. NF_NOERR) THEN
+               PRINT*, tname(iq),"est absent de start_trac.nc"
+               ierr = NF_INQ_VARID(nid, tname(iq), nvarid)
+               IF (ierr .NE. NF_NOERR) THEN
+                  PRINT*, "Variable ", tname(iq)," n est pas definie"
+                  CALL abort
+               ENDIF
+#ifdef NC_DOUBLE
+               ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,q(1,1,iq))
+#else
+               ierr = NF_PUT_VAR_REAL (nid,nvarid,q(1,1,iq))
+#endif
+
+            ELSE
+               PRINT*, tname(iq), "est present dans start_trac.nc"
+#ifdef NC_DOUBLE
+               ierr = NF_GET_VAR_DOUBLE(nid_trac, nvarid_trac, trac_tmp)
+#else
+               ierr = NF_GET_VAR_REAL(nid_trac, nvarid_trac, trac_tmp)
+#endif
+               IF (ierr .NE. NF_NOERR) THEN
+                  PRINT*, "Lecture echouee pour", tname(iq)
+                  CALL abort
+               ENDIF
+               ierr = NF_INQ_VARID(nid, tname(iq), nvarid)
+               IF (ierr .NE. NF_NOERR) THEN
+                  PRINT*, "Variable ", tname(iq)," n est pas definie"
+                  CALL abort
+               ENDIF
+#ifdef NC_DOUBLE
+               ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,trac_tmp)
+#else
+               ierr = NF_PUT_VAR_REAL (nid,nvarid,trac_tmp)
+#endif
+
+          ENDIF
+! fin lecture du traceur
+          ELSE  ! si il n'y a pas de fichier start_trac.nc
+!             print *, 'il n y a pas de fichier start_trac'
+             ierr = NF_INQ_VARID(nid, tname(iq), nvarid)
+             IF (ierr .NE. NF_NOERR) THEN
+                PRINT*, "Variable  tname(iq) n est pas definie"
+                CALL abort
+             ENDIF
+#ifdef NC_DOUBLE
+             ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,q(1,1,iq))
+#else
+             ierr = NF_PUT_VAR_REAL (nid,nvarid,q(1,1,iq))
+#endif
+          ENDIF
+! endif ifdef INCA
+#endif
+          
+#ifndef INCA
         ierr = NF_INQ_VARID(nid, tname(iq), nvarid)
         IF (ierr .NE. NF_NOERR) THEN
@@ -634,4 +702,6 @@
           ierr = NF_PUT_VAR_REAL (nid,nvarid,q(1,1,iq))
 #endif
+! endif ifndef INCA
+#endif
       ENDDO
       ENDIF
Index: LMDZ4/branches/LMDZ4_V3_patches/libf/dyn3d/leapfrog.F
===================================================================
--- LMDZ4/branches/LMDZ4_V3_patches/libf/dyn3d/leapfrog.F	(revision 844)
+++ LMDZ4/branches/LMDZ4_V3_patches/libf/dyn3d/leapfrog.F	(revision 845)
@@ -185,4 +185,7 @@
       PARAMETER (testita = 9)
 
+      integer itau_w   ! pas de temps ecriture = itap + itau_phy
+
+
       itaufin   = nday*day_step
       itaufinp1 = itaufin +1
Index: LMDZ4/branches/LMDZ4_V3_patches/libf/dyn3d/write_paramLMDZ_dyn.h
===================================================================
--- LMDZ4/branches/LMDZ4_V3_patches/libf/dyn3d/write_paramLMDZ_dyn.h	(revision 844)
+++ LMDZ4/branches/LMDZ4_V3_patches/libf/dyn3d/write_paramLMDZ_dyn.h	(revision 845)
@@ -1,52 +1,52 @@
 c
       ndex2d = 0
-      itau_dyn=itau_dyn+itau
+      itau_w=itau_dyn+itau
 c
       zx_tmp_2d(1:iip1,1:jjp1)=FLOAT(prt_level) 
-      CALL histwrite(nid_ctesGCM, "prt_level", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "prt_level", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=FLOAT(dayref)
-      CALL histwrite(nid_ctesGCM, "dayref", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "dayref", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=FLOAT(anneeref)
-      CALL histwrite(nid_ctesGCM, "anneeref", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "anneeref", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=FLOAT(raz_date)
-      CALL histwrite(nid_ctesGCM, "raz_date", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "raz_date", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=FLOAT(nday)
-      CALL histwrite(nid_ctesGCM, "nday", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "nday", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=FLOAT(day_step)
-      CALL histwrite(nid_ctesGCM, "day_step", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "day_step", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=FLOAT(iperiod)
-      CALL histwrite(nid_ctesGCM, "iperiod", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "iperiod", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=FLOAT(iapp_tracvl)
-      CALL histwrite(nid_ctesGCM, "iapp_tracvl", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "iapp_tracvl", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=FLOAT(iconser)
-      CALL histwrite(nid_ctesGCM, "iconser", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "iconser", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=FLOAT(iecri)
-      CALL histwrite(nid_ctesGCM, "iecri", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "iecri", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=periodav
-      CALL histwrite(nid_ctesGCM, "periodav", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "periodav", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=FLOAT(idissip)
-      CALL histwrite(nid_ctesGCM, "idissip", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "idissip", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
@@ -56,33 +56,33 @@
        zx_tmp_2d(1:iip1,1:jjp1)=0.
       ENDIF
-      CALL histwrite(nid_ctesGCM, "lstardis", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "lstardis", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=FLOAT(nitergdiv)
-      CALL histwrite(nid_ctesGCM, "nitergdiv", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "nitergdiv", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=FLOAT(nitergrot)
-      CALL histwrite(nid_ctesGCM, "nitergrot", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "nitergrot", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=FLOAT(niterh) 
-      CALL histwrite(nid_ctesGCM, "niterh", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "niterh", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=tetagdiv
-      CALL histwrite(nid_ctesGCM, "tetagdiv", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "tetagdiv", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=tetagrot
-      CALL histwrite(nid_ctesGCM, "tetagrot", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "tetagrot", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=tetatemp
-      CALL histwrite(nid_ctesGCM, "tetatemp", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "tetatemp", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=coefdis
-      CALL histwrite(nid_ctesGCM, "coefdis", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "coefdis", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
@@ -92,5 +92,5 @@
        zx_tmp_2d(1:iip1,1:jjp1)=0.
       ENDIF
-      CALL histwrite(nid_ctesGCM, "purmats", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "purmats", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
@@ -100,5 +100,5 @@
        zx_tmp_2d(1:iip1,1:jjp1)=0.
       ENDIF
-      CALL histwrite(nid_ctesGCM, "ok_guide", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "ok_guide", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
@@ -108,17 +108,17 @@
        zx_tmp_2d(1:iip1,1:jjp1)=0.
       ENDIF
-      CALL histwrite(nid_ctesGCM, "true_calendar", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "true_calendar", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=FLOAT(iflag_phys)
-      CALL histwrite(nid_ctesGCM, "iflag_phys", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "iflag_phys", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=FLOAT(iphysiq)
-      CALL histwrite(nid_ctesGCM, "iphysiq", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "iphysiq", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=ecritphy
-      CALL histwrite(nid_ctesGCM, "ecritphy", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "ecritphy", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
@@ -128,5 +128,5 @@
        zx_tmp_2d(1:iip1,1:jjp1)=0.
       ENDIF
-      CALL histwrite(nid_ctesGCM, "cycle_diurne", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "cycle_diurne", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
@@ -136,5 +136,5 @@
        zx_tmp_2d(1:iip1,1:jjp1)=0.
       ENDIF
-      CALL histwrite(nid_ctesGCM, "soil_model", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "soil_model", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
@@ -144,5 +144,5 @@
        zx_tmp_2d(1:iip1,1:jjp1)=0.
       ENDIF
-      CALL histwrite(nid_ctesGCM, "new_oliq", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "new_oliq", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
@@ -152,5 +152,5 @@
        zx_tmp_2d(1:iip1,1:jjp1)=0.
       ENDIF
-      CALL histwrite(nid_ctesGCM, "ok_orodr", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "ok_orodr", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
@@ -160,5 +160,5 @@
        zx_tmp_2d(1:iip1,1:jjp1)=0.
       ENDIF
-      CALL histwrite(nid_ctesGCM, "ok_orolf", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "ok_orolf", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
@@ -168,29 +168,29 @@
        zx_tmp_2d(1:iip1,1:jjp1)=0.
       ENDIF
-      CALL histwrite(nid_ctesGCM, "ok_limitvrai", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "ok_limitvrai", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=nbapp_rad
-      CALL histwrite(nid_ctesGCM, "nbapp_rad", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "nbapp_rad", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=iflag_con
-      CALL histwrite(nid_ctesGCM, "iflag_con", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "iflag_con", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=clon
-      CALL histwrite(nid_ctesGCM, "clon", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "clon", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=clat
-      CALL histwrite(nid_ctesGCM, "clat", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "clat", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=grossismx
-      CALL histwrite(nid_ctesGCM, "grossismx", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "grossismx", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=grossismy
-      CALL histwrite(nid_ctesGCM, "grossismy", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "grossismy", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
@@ -200,21 +200,21 @@
        zx_tmp_2d(1:iip1,1:jjp1)=0.
       ENDIF
-      CALL histwrite(nid_ctesGCM, "fxyhypb", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "fxyhypb", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=dzoomx
-      CALL histwrite(nid_ctesGCM, "dzoomx", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "dzoomx", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=dzoomy
-      CALL histwrite(nid_ctesGCM, "dzoomy", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "dzoomy", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=taux
-      CALL histwrite(nid_ctesGCM, "taux", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "taux", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=tauy
-      CALL histwrite(nid_ctesGCM, "tauy", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "tauy", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
@@ -224,9 +224,9 @@
        zx_tmp_2d(1:iip1,1:jjp1)=0.
       ENDIF
-      CALL histwrite(nid_ctesGCM, "ysinus", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "ysinus", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
       zx_tmp_2d(1:iip1,1:jjp1)=ip_ebil_dyn
-      CALL histwrite(nid_ctesGCM, "ip_ebil_dyn", itau_dyn,
+      CALL histwrite(nid_ctesGCM, "ip_ebil_dyn", itau_w,
      .               zx_tmp_2d,iip1*jjp1,ndex2d)
 c
Index: LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/albedo.F
===================================================================
--- LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/albedo.F	(revision 844)
+++ LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/albedo.F	(revision 845)
@@ -21,10 +21,12 @@
 cym#include "dimphy.h"
 #include "YOMCST.h"
+#include "clesphys.h"
 c
-      REAL fmagic ! un facteur magique pour regler l'albedo
+c fmagic -> clesphys.h/.inc
+c     REAL fmagic ! un facteur magique pour regler l'albedo
 ccc      PARAMETER (fmagic=0.7)
 cccIM => a remplacer  
 c       PARAMETER (fmagic=1.32)
-        PARAMETER (fmagic=1.0)
+c       PARAMETER (fmagic=1.0)
 c       PARAMETER (fmagic=0.7)
       INTEGER npts ! il controle la precision de l'integration
@@ -144,11 +146,12 @@
 cym#include "dimensions.h"
 cym#include "dimphy.h"
+#include "clesphys.h"
       REAL rmu0(klon), albedo(klon)
 c
-      REAL fmagic ! un facteur magique pour regler l'albedo
+c     REAL fmagic ! un facteur magique pour regler l'albedo
 ccc      PARAMETER (fmagic=0.7)
 cccIM => a remplacer  
 c       PARAMETER (fmagic=1.32)
-        PARAMETER (fmagic=1.0)
+c       PARAMETER (fmagic=1.0)
 c       PARAMETER (fmagic=0.7) 
 c
Index: LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/calcul_simulISCCP.h
===================================================================
--- LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/calcul_simulISCCP.h	(revision 844)
+++ LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/calcul_simulISCCP.h	(revision 845)
@@ -10,5 +10,5 @@
 c
       nbapp_isccp=30 !appel toutes les 15h
-      isccppas=NINT((itap*dtime)/3600.) !Nb. d'heures de la physique
+cIM 170107      isccppas=NINT((itap*dtime)/3600.) !Nb. d'heures de la physique
       freqin_pdt(n)=ifreq_isccp(n)
 c
Index: LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/clesphys.h
===================================================================
--- LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/clesphys.h	(revision 844)
+++ LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/clesphys.h	(revision 845)
@@ -31,4 +31,6 @@
 !IM ok_kzmin : clef calcul Kzmin dans la CL de surface cf FH
        LOGICAL ok_kzmin
+!IM fmagic : parametre pour regler l albedo sur ocean
+       REAL fmagic
 !IM lev_histhf  : niveau sorties 6h
 !IM lev_histday : niveau sorties journalieres
@@ -40,5 +42,5 @@
        REAL ecrit_ins, ecrit_hf, ecrit_hf2mth, ecrit_day
        REAL ecrit_mth, ecrit_tra, ecrit_reg 
-       REAL freqin_isccp, freqout_isccp
+       REAL freq_ISCCP, ecrit_ISCCP
        INTEGER :: ip_ebil_phy
        LOGICAL ok_slab_sicOBS
@@ -49,10 +51,10 @@
      &     , CH4_ppb, N2O_ppb, CFC11_ppt, CFC12_ppt                     &
      &     , top_height, overlap, cdmmax, cdhmax, ksta, ksta_ter        &
-     &     , ok_kzmin, lev_histhf, lev_histday, lev_histmth             &
+     &     , ok_kzmin, fmagic, lev_histhf, lev_histday, lev_histmth     &
      &     , type_run, ok_isccp, ok_regdyn                              &
      &     , lonmin_ins, lonmax_ins, latmin_ins, latmax_ins             &
      &     , ecrit_ins, ecrit_hf, ecrit_hf2mth, ecrit_day               &
      &     , ecrit_mth, ecrit_tra, ecrit_reg                            &
-     &     , freqin_isccp, freqout_isccp, ip_ebil_phy                   &
+     &     , freq_ISCCP, ecrit_ISCCP, ip_ebil_phy                       &
      &     , ok_slab_sicOBS, ok_lic_melt, cvl_corr
      
Index: LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/conf_phys.F90
===================================================================
--- LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/conf_phys.F90	(revision 844)
+++ LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/conf_phys.F90	(revision 845)
@@ -5,5 +5,5 @@
 !
 
-  subroutine conf_phys(ocean, ok_veget, ok_journe, ok_mensuel, ok_instan, &
+  subroutine conf_phys(ocean, ok_veget, ok_journe, ok_mensuel, ok_instan, ok_hf, &
  &                     fact_cldcon, facttemps,ok_newmicro,iflag_cldcon, &
 !IM&                   ratqsbas,ratqshaut,ip_ebil_phy, &
@@ -19,5 +19,5 @@
  include "fisrtilp.h"
  include "nuage.h"
-   include "YOMCST.h"
+ include "YOMCST.h"
 !IM : on inclut/initialise les taux de CH4, N2O, CFC11 et CFC12
 include "clesphys.h"
@@ -35,4 +35,5 @@
 ! ok_veget:   type de modele de vegetation
 ! ok_journe:  sorties journalieres
+! ok_hf:  sorties haute frequence
 ! ok_mensuel: sorties mensuelles
 ! ok_instan:  sorties instantanees
@@ -45,5 +46,5 @@
   character (len = 6)  :: ocean
   logical              :: ok_veget, ok_newmicro
-  logical              :: ok_journe, ok_mensuel, ok_instan        
+  logical              :: ok_journe, ok_mensuel, ok_instan, ok_hf
   LOGICAL              :: ok_ade, ok_aie
   REAL                 :: bl95_b0, bl95_b1
@@ -53,7 +54,8 @@
   character (len = 6),SAVE  :: ocean_omp
   logical,SAVE              :: ok_veget_omp, ok_newmicro_omp
-  logical,SAVE        :: ok_journe_omp, ok_mensuel_omp, ok_instan_omp        
+  logical,SAVE        :: ok_journe_omp, ok_mensuel_omp, ok_instan_omp, ok_hf_omp        
   LOGICAL,SAVE        :: ok_ade_omp, ok_aie_omp
   REAL,SAVE           :: bl95_b0_omp, bl95_b1_omp
+  REAL,SAVE           :: freq_ISCCP_omp, ecrit_ISCCP_omp
   real,SAVE           :: fact_cldcon_omp, facttemps_omp,ratqsbas_omp
   real,SAVE           :: ratqshaut_omp
@@ -80,4 +82,5 @@
   REAL,SAVE :: cdmmax_omp,cdhmax_omp,ksta_omp,ksta_ter_omp
   LOGICAL,SAVE :: ok_kzmin_omp
+  REAL, SAVE ::  fmagic_omp
   INTEGER,SAVE :: iflag_pbl_omp,lev_histhf_omp,lev_histday_omp,lev_histmth_omp
   CHARACTER*4, SAVE :: type_run_omp
@@ -119,4 +122,13 @@
   call getin('OK_journe', ok_journe_omp)
 !
+!Config Key  = ok_hf
+!Config Desc = Pour des sorties haute frequence
+!Config Def  = .false.
+!Config Help = Pour creer le fichier histhf contenant les sorties
+!              haute frequence ( 3h ou 6h)
+!
+  ok_hf_omp = .false.
+  call getin('ok_hf', ok_hf_omp)
+!
 !Config Key  = OK_mensuel
 !Config Desc = Pour des sorties mensuelles 
@@ -171,5 +183,22 @@
   call getin('bl95_b1', bl95_b1_omp)
 
-!
+!Config Key  = freq_ISCCP
+!Config Desc = Frequence d'appel du simulateur ISCCP en secondes;
+!              par defaut 10800, i.e. 3 heures 
+!Config Def  = 10800.
+!Config Help = Used in ini_histISCCP.h
+!
+  freq_ISCCP_omp = 10800.
+  call getin('freq_ISCCP', freq_ISCCP_omp)
+!
+!Config Key  = ecrit_ISCCP
+!Config Desc = Frequence d'ecriture des resultats du simulateur ISCCP en nombre de jours;
+!              par defaut 1., i.e. 1 jour
+!Config Def  = 1.
+!Config Help = Used in ini_histISCCP.h
+!
+!
+  ecrit_ISCCP_omp = 1.
+  call getin('ecrit_ISCCP', ecrit_ISCCP_omp)
 !
 !Config Key  = ip_ebil_phy
@@ -562,4 +591,13 @@
   call getin('ok_kzmin',ok_kzmin_omp)
 
+!
+!Config Key  = fmagic
+!Config Desc = 
+!Config Def  = 1.
+!Config Help = Used in albedo.F
+!
+  fmagic_omp = 1.
+  call getin('fmagic',fmagic_omp)
+
 !Config Key = ok_lic_melt
 !Config Desc = Prise en compte de la fonte de la calotte dans le bilan d'eau
@@ -636,5 +674,5 @@
   call getin('type_run',type_run_omp)
 
-  !
+!
 !Config Key  = ok_isccp
 !Config Desc =
@@ -693,5 +731,5 @@
 !Config Desc =
 !Config Def  = 1.0 !tous les jours
-!Config Help =
+!Config Help = nombre de jours pour ecriture fichier histday.nc
 !
   ecrit_day_omp = 1.0
@@ -773,4 +811,5 @@
     ksta_ter = ksta_ter_omp
     ok_kzmin = ok_kzmin_omp
+    fmagic = fmagic_omp
     iflag_pbl = iflag_pbl_omp
     lev_histhf = lev_histhf_omp
@@ -782,6 +821,9 @@
     ok_newmicro = ok_newmicro_omp
     ok_journe = ok_journe_omp
+    ok_hf = ok_hf_omp
     ok_mensuel = ok_mensuel_omp
     ok_instan = ok_instan_omp
+    freq_ISCCP = freq_ISCCP_omp
+    ecrit_ISCCP = ecrit_ISCCP_omp
     ok_ade = ok_ade_omp
     ok_aie = ok_aie_omp
@@ -818,6 +860,9 @@
   write(numout,*)' Config veget = ', ok_veget
   write(numout,*)' Sortie journaliere = ', ok_journe
+  write(numout,*)' Sortie haute frequence = ', ok_hf
   write(numout,*)' Sortie mensuelle = ', ok_mensuel
   write(numout,*)' Sortie instantanee = ', ok_instan
+  write(numout,*)' Frequence appel simulateur ISCCP, freq_ISCCP =', freq_ISCCP
+  write(numout,*)' Frequence appel simulateur ISCCP, ecrit_ISCCP =', ecrit_ISCCP
   write(numout,*)' Sortie bilan d''energie, ip_ebil_phy =', ip_ebil_phy
   write(numout,*)' Excentricite = ',R_ecc
@@ -858,4 +903,5 @@
   write(numout,*)' ksta_ter = ',ksta_ter 
   write(numout,*)' ok_kzmin = ',ok_kzmin 
+  write(numout,*)' fmagic = ',fmagic
   write(numout,*)' ok_ade = ',ok_ade
   write(numout,*)' ok_aie = ',ok_aie
@@ -871,6 +917,6 @@
   write(numout,*)' lonmin lonmax latmin latmax bilKP_ins =',&
  & lonmin_ins, lonmax_ins, latmin_ins, latmax_ins
-  write(numout,*)' ecrit_ hf, day, mth, reg',&
- & ecrit_hf, ecrit_day, ecrit_mth, ecrit_reg, ecrit_tra
+  write(numout,*)' ecrit_ hf, day, mth, reg, tra, ISCCP',&
+ & ecrit_hf, ecrit_day, ecrit_mth, ecrit_reg, ecrit_tra, ecrit_ISCCP
 
 !$OMP END MASTER
Index: LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/cpl_mod.F90
===================================================================
--- LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/cpl_mod.F90	(revision 844)
+++ LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/cpl_mod.F90	(revision 845)
@@ -17,5 +17,5 @@
 ! Use statements
 !*************************************************************************************
-  USE dimphy, ONLY : klon, zmasq
+  USE dimphy, ONLY : klon
   USE mod_phys_lmdz_para
   USE ioipsl
@@ -71,6 +71,4 @@
   REAL, ALLOCATABLE, DIMENSION(:,:), SAVE   :: pctsrf_sav   
   !$OMP THREADPRIVATE(pctsrf_sav)
-  REAL, ALLOCATABLE, DIMENSION(:,:), SAVE   :: zmasq2D
-  !$OMP THREADPRIVATE(zmasq2D)
   INTEGER, ALLOCATABLE, DIMENSION(:), SAVE  :: unity
   !$OMP THREADPRIVATE(unity)
@@ -181,7 +179,4 @@
     ALLOCATE(read_alb_sic(iim, jj_nb), stat = error)
     sum_error = sum_error + error
-    ALLOCATE(zmasq2D(iim, jj_nb), stat = error)
-    sum_error = sum_error + error    
-   
 
     IF (sum_error /= 0) THEN
@@ -202,12 +197,4 @@
     cpl_taux = 0.   ; cpl_tauy = 0.  ; cpl_rriv2D = 0. ; cpl_rcoa2D = 0.
     cpl_rlic2D = 0. ; cpl_windsp = 0.
-
-!*************************************************************************************
-! Transform the land-ocean mask into 2D grid. 
-! Colorize zmasq2D with 99 so that after gath2cpl points not valid can be recognized. 
-!
-!*************************************************************************************
-    zmasq2D(:,:) = 99.
-    CALL gath2cpl(zmasq, zmasq2D, klon, unity)
 
 !*************************************************************************************
@@ -936,16 +923,16 @@
     INTEGER, DIMENSION(iim*(jjm+1))                      :: ndexct
     REAL                                                 :: Up, Down
-    REAL, DIMENSION(iim, jj_nb)                       :: tmp_lon, tmp_lat
-    REAL, DIMENSION(iim, jj_nb, 4)                    :: pctsrf2D
-    REAL, DIMENSION(iim, jj_nb)                       :: deno
+    REAL, DIMENSION(iim, jj_nb)                          :: tmp_lon, tmp_lat
+    REAL, DIMENSION(iim, jj_nb, 4)                       :: pctsrf2D
+    REAL, DIMENSION(iim, jj_nb)                          :: deno
     CHARACTER(len = 20)                                  :: modname = 'cpl_send_all'
     CHARACTER(len = 80)                                  :: abort_message
    
 ! Variables with fields to coupler
-    REAL, DIMENSION(iim, jj_nb)                       :: tmp_taux
-    REAL, DIMENSION(iim, jj_nb)                       :: tmp_tauy
-    REAL, DIMENSION(iim, jj_nb)                       :: tmp_calv
+    REAL, DIMENSION(iim, jj_nb)                          :: tmp_taux
+    REAL, DIMENSION(iim, jj_nb)                          :: tmp_tauy
+    REAL, DIMENSION(iim, jj_nb)                          :: tmp_calv
 ! Table with all fields to send to coupler
-    REAL, DIMENSION(iim, jj_nb, jpflda2o1+jpflda2o2)  :: tab_flds
+    REAL, DIMENSION(iim, jj_nb, jpflda2o1+jpflda2o2)     :: tab_flds
 #ifdef CPP_PARA
     INCLUDE 'mpif.h'
@@ -1036,17 +1023,18 @@
     tmp_tauy(:,:)    = 0.0
     
-    ! For all valid grid cells not entier land
-    WHERE (zmasq2D /= 1. .AND. zmasq2D /=99. )
-       deno =  pctsrf2D(:,:,is_oce) + pctsrf2D(:,:,is_sic) ! fraction oce+seaice
+
+    ! fraction oce+seaice
+    deno =  pctsrf2D(:,:,is_oce) + pctsrf2D(:,:,is_sic) 
+    ! For all valid grid cells containing some fraction of ocean or sea-ice
+    WHERE ( deno(:,:) /= 0 )
+       tab_flds(:,:,15) = cpl_rain2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) +    &
+            cpl_rain2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:)
+       tab_flds(:,:,16) = cpl_snow2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) +    &
+            cpl_snow2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:)
        
-       tab_flds(:,:,15) = cpl_rain2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno +    &
-            cpl_rain2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno
-       tab_flds(:,:,16) = cpl_snow2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno +    &
-            cpl_snow2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno
-       
-       tmp_taux = cpl_taux2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno +    &
-            cpl_taux2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno
-       tmp_tauy = cpl_tauy2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno +    &
-            cpl_tauy2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno
+       tmp_taux = cpl_taux2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) +    &
+            cpl_taux2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:)
+       tmp_tauy = cpl_tauy2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) +    &
+            cpl_tauy2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:)
     ENDWHERE
 
Index: LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/cv3_routines.F
===================================================================
--- LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/cv3_routines.F	(revision 844)
+++ LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/cv3_routines.F	(revision 845)
@@ -1075,5 +1075,6 @@
         endif
  506   continue
-       buoy(icb(i),k)=buoybase(i)
+cIM cf. CRio/JYG 270807   buoy(icb(i),k)=buoybase(i)
+       buoy(i,icb(i))=buoybase(i)
  505  continue
 
@@ -1204,5 +1205,5 @@
 	enddo
       enddo
-      
+
       do 600 k=minorig+1,nl
         do 590 i=1,ncum
Index: LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/ini_histISCCP.h
===================================================================
--- LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/ini_histISCCP.h	(revision 844)
+++ LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/ini_histISCCP.h	(revision 845)
@@ -15,5 +15,7 @@
 cIM 300505     zstophy = dtime 
 c appel du simulateur toutes les 3heures
-          zcals(1) = dtime *6.  !toutes les 3h (en s)
+!IM on lit la frequence d'appel dans physiq.def
+!         zcals(1) = dtime *6.  !toutes les 3h (en s)
+          zcals(1) = freq_ISCCP !toutes les freq_ISCCP secondes
         DO n=1, napisccp
           zcalh(n) = zcals(n)/3600. !stoutes les Xh (en heures)
@@ -29,5 +31,7 @@
 c       IF(freqout_isccp.EQ.1.) THEN
 c ecriture jounaliere
-          zout_isccp(1) = ecrit_day !(en s)
+!IM on ecrit les resultats du simulateur ISCCP toutes les 
+! ecrit_ISCCP secondes      zout_isccp(1) = ecrit_day !(en s)
+          zout_isccp(1) = ecrit_ISCCP !(en s)
 c ecriture mensuelle
 c         zout = dtime * ecrit_mth !(en s)
@@ -37,5 +41,10 @@
 c le nombre de sous-colonnes ncol : ncol=(100.*zcalh)/zoutd
           ncol(n)=NINT((100.*zcalh(n))/zoutj(n))
-          PRINT*,'n ncol',n,ncol(n)
+          IF(ncol(n).GT.ncolmx) THEN
+           PRINT*,'Warning: Augmenter le nombre colonnes du simulateur'
+           PRINT*,'         ISCCP ncol=', ncol,' ncolmx=',ncolmx
+c          PRINT*,'n ncol',n,ncol(n)
+           CALL abort
+          ENDIF
 c
         DO l=1, ncol(n)
@@ -80,5 +89,5 @@
 cym          enddo
 c
-          print*,'On stoke le fichier histISCCP instantanne sur ',
+          print*,'On stoke le fichier histISCCP sur ',
      s   imin_ins,imax_ins,jmin_ins,jmax_ins
 cym          print*,'On stoke le fichier histISCCP instantanne sur ',
@@ -94,5 +103,4 @@
          CALL histbeg_phy("histISCCP.nc", itau_phy, zjulian, dtime,
      .                 nhori, nid_isccp)
-
         ENDIF !(1.EQ.0) THEN
 c
@@ -106,5 +114,4 @@
          CALL histbeg_phy("histISCCP.nc", itau_phy, zjulian, dtime,
      .                 nhori, nid_isccp)
-
 c
         IF(type_run.EQ."ENSP".OR.type_run.EQ."CLIM") THEN
@@ -128,5 +135,5 @@
 c
          DO k=1, kmaxm1
-          CALL histdef(nid_isccp, "cldISCCP_"//taulev(k)//typinout(n),
+          CALL histdef(nid_isccp, "cldISCCP_"//taulev(k)//verticaxe(n),
      .                "LMDZ ISCCP cld", "%",
      .                iim, jj_nb,nhori,lmaxm1,1,lmaxm1,nvert,32,
@@ -134,5 +141,5 @@
          ENDDO
 c
-         CALL histdef(nid_isccp, "nsunlit"//typinout(n),
+         CALL histdef(nid_isccp, "nsunlit"//verticaxe(n),
      .                "Nb of calls with sunlit ", "%",
      .                iim, jj_nb,nhori,1,1,1,-99,32,
@@ -150,5 +157,5 @@
            DO l=1, lmaxm1
 c
-           CALL histdef(nid_isccp, pclev(l)//taulev(k)//typinout(n),
+           CALL histdef(nid_isccp, pclev(l)//taulev(k)//verticaxe(n),
      .                "LMDZ ISCCP cld "//cnameisccp(l,k), "%",
      .                iim, jj_nb,nhori,1,1,1,-99,32,
@@ -159,5 +166,5 @@
 c
 c         print*,'n=',n,' avant histdef(..Nb of calls sunlit'
-          CALL histdef(nid_isccp, "nsunlit"//typinout(n),
+          CALL histdef(nid_isccp, "nsunlit"//verticaxe(n),
      .                "Nb of calls with sunlit ", "%",
      .                iim, jj_nb,nhori,1,1,1,-99,32,
Index: LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/ini_histmth.h
===================================================================
--- LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/ini_histmth.h	(revision 844)
+++ LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/ini_histmth.h	(revision 845)
@@ -833,15 +833,10 @@
 C
          if (nqmax.GE.3) THEN
-         DO iq=1,nqmax-2
-         IF (iq.LE.99) THEN
-         WRITE(str2,'(i2.2)') iq
-         CALL histdef(nid_mth, "trac"//str2, "Tracer No."//str2, "-",
-     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
-     .                "ave(X)", zstophy,zout)
-         ELSE
-         PRINT*, "Trop de traceurs"
-         CALL abort
-         ENDIF
-         ENDDO
+           DO iq=3,nqmax
+           iiq=niadv(iq)
+             CALL histdef(nid_mth, tnom(iq), ttext(iiq), "-",
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
+     .                "ave(X)", zstophy,zout)
+           ENDDO
          ENDIF
 c
@@ -1745,11 +1740,11 @@
 C
          if (nqmax.GE.3) THEN
-         DO iq=3,nqmax
-         iiq=niadv(iq)
-         CALL histdef(nid_mth, tnom(iq), ttext(iiq), "-",
-     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
-     .                "ave(X)", zstophy,zout)
-         ENDDO
-         ENDIF
+           DO iq=3,nqmax
+             iiq=niadv(iq)
+             CALL histdef(nid_mth, tnom(iq), ttext(iiq), "-",
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
+     .                "ave(X)", zstophy,zout)
+             ENDDO
+           ENDIF
 
       ENDIF !lev_histmth.GE.4
Index: LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/ini_paramLMDZ_phy.h
===================================================================
--- LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/ini_paramLMDZ_phy.h	(revision 844)
+++ LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/ini_paramLMDZ_phy.h	(revision 845)
@@ -347,11 +347,11 @@
      .                "once", zstophy,zout)
 c
-       CALL histdef(nid_ctesGCM, "freqin_isccp",
-     .                "freqin_isccp", "-",
-     .                iim,jjmp1,nhori, 1,1,1, -99, 32,
-     .                "once", zstophy,zout)
-c
-       CALL histdef(nid_ctesGCM, "freqout_isccp",
-     .                "freqout_isccp", "-",
+       CALL histdef(nid_ctesGCM, "freq_ISCCP",
+     .                "freq_ISCCP", "-",
+     .                iim,jjmp1,nhori, 1,1,1, -99, 32,
+     .                "once", zstophy,zout)
+c
+       CALL histdef(nid_ctesGCM, "ecrit_ISCCP",
+     .                "ecrit_ISCCP", "-",
      .                iim,jjmp1,nhori, 1,1,1, -99, 32,
      .                "once", zstophy,zout)
Index: LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/physiq.F
===================================================================
--- LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/physiq.F	(revision 844)
+++ LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/physiq.F	(revision 845)
@@ -385,5 +385,8 @@
       INTEGER jmin_debut, nbptj 
 cIM parametres ISCCP BEG
-      INTEGER nbapp_isccp,isccppas
+      INTEGER nbapp_isccp
+!     INTEGER nbapp_isccp,isccppas
+!     PARAMETER(isccppas=6) !appel du simulateurs tous les 6pas de temps de la physique
+!                           !i.e. toutes les 3 heures 
       INTEGER n, napisccp
 c     PARAMETER(napisccp=3)
@@ -419,5 +422,6 @@
       INTEGER ncolmx, seed(klon,napisccp)
       REAL nbsunlit(nregISCtot,klon,napisccp)  !nbsunlit : moyenne de sunlit
-      PARAMETER(ncolmx=350)
+c     PARAMETER(ncolmx=1500)
+      PARAMETER(ncolmx=300)
 c
 cIM verif boxptop BEG
@@ -495,15 +499,7 @@
 c$OMP THREADPRIVATE(nid_isccp)
 
-c     data ok_isccp,ecrit_isccp/.true.,0.125/      
-c     data ok_isccp,ecrit_isccp/.true.,1./      
-cIM 190504     data ok_isccp/.true./      
-cIM 190504 #else
-cIM 190504     data ok_isccp/.false./
-cIM 190504 #endif
-
       REAL zx_tau(kmaxm1), zx_pc(lmaxm1), zx_o500(iwmax)
       DATA zx_tau/0.0, 0.3, 1.3, 3.6, 9.4, 23., 60./
       SAVE zx_tau
-cIM bad 151205     DATA zx_pc/50., 180., 310., 440., 560., 680., 800./
       DATA zx_pc/180., 310., 440., 560., 680., 800., 1000./
       SAVE zx_pc
@@ -600,9 +596,9 @@
 c  QUESTION : noms de variables ?
 
-#ifdef histhf
-      data ok_hf/.true./
-#else
-      data ok_hf/.false./
-#endif
+c#ifdef histhf
+c      data ok_hf/.true./
+c#else
+c      data ok_hf/.false./
+c#endif
       INTEGER        longcles
       PARAMETER    ( longcles = 20 )
@@ -1167,5 +1163,4 @@
       REAL tabcntr0( length       )
 c
-
       INTEGER ndex2d(iim*jjmp1),ndex3d(iim*jjmp1*klev)
 cIM
@@ -1526,5 +1521,6 @@
 c
          call conf_phys(ocean, ok_veget, ok_journe, ok_mensuel,
-     .                  ok_instan, fact_cldcon, facttemps,ok_newmicro,
+     .                  ok_instan, ok_hf,
+     .                  fact_cldcon, facttemps,ok_newmicro,
 cIM  .                  iflag_cldcon,ratqsbas,ratqshaut, if_ebil,
      .                  iflag_cldcon,ratqsbas,ratqshaut,
@@ -1696,8 +1692,16 @@
 cIM on passe les frequences de jours en secondes : ecrit_ins, ecrit_hf, ecrit_day, ecrit_mth, ecrit_tra, ecrit_reg
          ecrit_hf = ecrit_hf * un_jour
-         ecrit_day = ecrit_day * un_jour
+!IM
+         IF(ecrit_day.LE.1.) THEN
+          ecrit_day = ecrit_day * un_jour !en secondes
+         ENDIF
+!IM
          ecrit_mth = ecrit_mth * un_jour
          ecrit_reg = ecrit_reg * un_jour
          ecrit_tra = ecrit_tra * un_jour
+         ecrit_ISCCP = ecrit_ISCCP * un_jour
+c
+         PRINT*,'physiq ecrit_ hf day mth reg tra ISCCP',ecrit_hf,
+     .   ecrit_day,ecrit_mth,ecrit_reg,ecrit_tra,ecrit_ISCCP
 cIM 030306 END
 
@@ -1744,5 +1748,4 @@
 #endif
 
-c#include "ini_histday_seri.h"
 #include "ini_histday_seri.h"
 
@@ -2532,7 +2535,12 @@
 cIM calcul nuages par le simulateur ISCCP
 c
+#ifdef histISCCP
       IF (ok_isccp) THEN
+cIM appel simulateur toutes les  NINT(freq_ISCCP/dtime) heures
+       IF (MOD(itap,NINT(freq_ISCCP/dtime)).EQ.0) THEN
 #include "calcul_simulISCCP.h"
+       ENDIF !(MOD(itap,NINT(freq_ISCCP/dtime))
       ENDIF !ok_isccp
+#endif
 
 c   On prend la somme des fractions nuageuses et des contenus en eau
Index: LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/surf_land_orchidee_mod.F90
===================================================================
--- LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/surf_land_orchidee_mod.F90	(revision 844)
+++ LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/surf_land_orchidee_mod.F90	(revision 845)
@@ -371,5 +371,5 @@
 #endif
 #ifdef ORC_PREPAR
-          ! Interface for version 1.8 or earlier of ORCHIDEE
+          ! Interface for ORCHIDEE version 1.9 or earlier compiled in sequential mode(without preprocessing flag CPP_PARA)
           CALL intersurf_main (itime+itau_phy-1, iim, jjm+1, knon, ktindex, dtime, &
                lrestart_read, lrestart_write, lalo, &
@@ -383,4 +383,5 @@
 
 #else          
+          ! Interface for ORCHIDEE version 1.9 compiled in parallel mode(with preprocessing flag CPP_PARA)
           CALL intersurf_main (itime+itau_phy-1, iim, jjm+1, offset, knon, ktindex, & 
                orch_comm, dtime, lrestart_read, lrestart_write, lalo, &
@@ -406,11 +407,11 @@
     
 #ifdef ORC_PREPAR
-       ! Interface for version 1.8 or earlier of ORCHIDEE
-       CALL intersurf_main (itime+itau_phy-1, iim, jjm+1, knon, ktindex, dtime, &
+       ! Interface for ORCHIDEE version 1.9 or earlier compiled in sequential mode(without preprocessing flag CPP_PARA)
+       CALL intersurf_main (itime+itau_phy, iim, jjm+1, knon, ktindex, dtime, &
             lrestart_read, lrestart_write, lalo, &
             contfrac, neighbours, resolution, date0, &
             zlev,  u1_lay, v1_lay, spechum, temp_air, epot_air, ccanopy, &
             cdrag, petA_orc, peqA_orc, petB_orc, peqB_orc, &
-            precip_rain, precip_snow, lwdown, swnet, swdown, ps, &
+            precip_rain, precip_snow, lwdown, swnet, swdown_vrai, ps, &
             evap, fluxsens, fluxlat, coastalflow, riverflow, &
             tsol_rad, tsurf_new, qsurf, albedo_out, emis_new, z0_new, &
@@ -418,5 +419,5 @@
        
 #else
-
+       ! Interface for ORCHIDEE version 1.9 compiled in parallel mode(with preprocessing flag CPP_PARA)
        CALL intersurf_main (itime+itau_phy, iim, jjm+1,offset, knon, ktindex, & 
             orch_comm,dtime, lrestart_read, lrestart_write, lalo, &
Index: LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/write_histISCCP.h
===================================================================
--- LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/write_histISCCP.h	(revision 844)
+++ LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/write_histISCCP.h	(revision 845)
@@ -20,10 +20,10 @@
 cIM: champ 3d : (lon,lat,pres) pour un tau fixe
 c
-       CALL histwrite_phy(nid_isccp,"cldISCCP_"//taulev(k)//typinout(n),
+       CALL histwrite_phy(nid_isccp,"cldISCCP_"//taulev(k)//verticaxe(n),
      .                  itau_w,zx_tmp_fi3d)
         ENDDO !k
 c
 cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1,nbsunlit(1,:,n),zx_tmp_2d)
-        CALL histwrite_phy(nid_isccp,"nsunlit"//typinout(n),itau_w,
+        CALL histwrite_phy(nid_isccp,"nsunlit"//verticaxe(n),itau_w,
      .                 nbsunlit(1,:,n))
 c
@@ -55,6 +55,6 @@
 cIM: champ 2d : (lon,lat) pour un tau et une pc fixes
 c
-         CALL histwrite_phy(nid_isccp,pclev(l)//taulev(k)//typinout(n),
-     .                  itau_w,fq_is_true(:,:,l,n))
+         CALL histwrite_phy(nid_isccp,pclev(l)//taulev(k)//verticaxe(n),
+     .                  itau_w,fq_is_true(:,k,l,n))
          ENDDO !l
         ENDDO !k
@@ -62,5 +62,5 @@
 c       print*,'n=',n,' write_ISCCP avant nbsunlit'
 cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1,nbsunlit(1,:,n),zx_tmp_2d)
-        CALL histwrite_phy(nid_isccp,"nsunlit"//typinout(n),
+        CALL histwrite_phy(nid_isccp,"nsunlit"//verticaxe(n),
      .                 itau_w,nbsunlit(1,:,n))
 c
