Index: /LMDZ.3.3/trunk/libf/phylmd/ini_histISCCP.h
===================================================================
--- /LMDZ.3.3/trunk/libf/phylmd/ini_histISCCP.h	(revision 484)
+++ /LMDZ.3.3/trunk/libf/phylmd/ini_histISCCP.h	(revision 484)
@@ -0,0 +1,71 @@
+      IF (ok_isccp) THEN
+c
+       IF (region.EQ.'3d') THEN !region
+c pour les champs instantannes, il faut mettre la meme valeur pour
+c zout et zsto.
+c dtime est passe par ailleurs a histbeg
+c zsto = frequence de stockage des champs
+c zout = frequence d'ecriture des champs
+         zsto = dtime
+c
+c ecriture 8 fois par jour
+c       zout = dtime * REAL(NINT(86400./dtime*ecrit_isccp))
+c ecriture toutes les 2h (12 fois par jour)
+c       zout = dtime * 4.
+c ecriture toutes les 1/h (48 fois par jour)
+c       zout = dtime
+c
+c ecriture mensuelle
+        zout = dtime * ecrit_mth
+c
+      ELSE IF (region.EQ.'1d') THEN !region      
+       zsto = dtime
+       zout = dtime *4.
+c      zout = dtime
+      ENDIF
+c
+        print*,'ISCCP zout,zsto=',zout,zsto
+c
+c       PRINT*, 'La frequence de sortie ISCCP est de ', ecrit_isccp
+c
+        idayref = day_ref
+        CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian)
+        write(*,*)'ISCCP ', itau_phy, zjulian
+c
+c
+c definition coordonnees lon,lat en globale
+c
+        CALL gr_fi_ecrit(1,klon,iim,jjmp1,rlon,zx_lon)
+        DO i = 1, iim
+          zx_lon(i,1) = rlon(i+1)
+          zx_lon(i,jjmp1) = rlon(i+1)
+        ENDDO
+
+        CALL gr_fi_ecrit(1,klon,iim,jjmp1,rlat,zx_lat)
+c
+         CALL histbeg("histISCCP.nc", iim,zx_lon(:,1),jjmp1,zx_lat(1,:),
+     .                 imin_debut,nbpti,
+     .                 jmin_debut,nbptj,
+     .                 itau_phy, zjulian, dtime,
+     .                 nhori, nid_isccp)
+c
+         CALL histvert(nid_isccp, "cldtopres","Cloud Top Pressure","mb",
+     .                 lmaxm1, cldtopres, nvert,'down')
+c
+c variables a ecrire
+c
+         DO k=1, kmaxm1
+          CALL histdef(nid_isccp, "cldISCCP_"//taulev(k),
+     .                "LMDZ ISCCP cld", "%",
+     .                iim, jjmp1,nhori,lmaxm1,1,lmaxm1,nvert,32,
+     .                "ave(X)", zsto,zout)
+         ENDDO
+c
+         CALL histdef(nid_isccp, "nsunlit",
+     .                "Nb of calls with sunlit ", "%",
+     .                iim, jjmp1,nhori,1,1,1,-99,32,
+     .                "ave(X)", zsto,zout)
+c
+        CALL histend(nid_isccp)
+c
+      ENDIF ! ok_isccp
Index: /LMDZ.3.3/trunk/libf/phylmd/ini_histREGDYN.h
===================================================================
--- /LMDZ.3.3/trunk/libf/phylmd/ini_histREGDYN.h	(revision 484)
+++ /LMDZ.3.3/trunk/libf/phylmd/ini_histREGDYN.h	(revision 484)
@@ -0,0 +1,117 @@
+
+      IF (ok_regdyn) THEN
+c
+         PRINT*, 'La frequence de sortie REGDYN est de ', ecrit_mth
+c        PRINT*, 'La frequence de sortie REGDYN est de ', ecrit_regdyn
+cIM cf. LF
+         idayref = day_ref
+         CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian)
+
+cccIM    CALL ymds2ju(anne_ini, 1, 1, 0.0, zjulian)
+c        CALL ymds2ju(annee_ref, 1, 1, 0.0, zjulian)
+c        zjulian = zjulian + day_ini
+c
+
+c axe vertical pour les differents niveaux des histogrammes
+      DO iw=1, iwmax
+        zx_o500(iw)=wmin+(iw-1./2.)*pas_w
+      ENDDO
+
+         CALL histbeg("histREGDYN", kmaxm1,zx_tau, lmaxm1,zx_pc,
+     .                 1,kmaxm1,1,lmaxm1, itau_phy, zjulian, dtime, 
+     .                 nhoriRD, nid_regdyn)
+
+         CALL histvert(nid_regdyn, "omeganivs", "Omega levels", 
+     .                 "mb/day",
+     .                 iwmax, zx_o500, komega)
+
+c   pour les champs instantannes, il faut mettre la meme valeur pour
+c   zout et tsto.
+c   dtime est passe par ailleurs a histbeg
+
+c        zout = dtime * REAL(NINT(86400./dtime*ecrit_regdyn))
+c        zsto = zout
+c        print*,'zout,zsto=',zout,zsto
+c ecriture mensuelle
+c
+         zsto = dtime
+         zout = dtime * ecrit_mth
+c        zout = dtime * REAL(NINT(86400./dtime*ecrit_regdyn))
+
+c
+c Champs 3D:
+c
+c TROP
+         CALL histdef(nid_regdyn, "hw1", "Tropics Histogram ", "%",
+     &                kmaxm1,lmaxm1,nhoriRD, iwmax,1,iwmax, komega, 32, 
+     &                "ave(X)", zsto,zout)
+
+         CALL histdef(nid_regdyn, "nh1", "Nb of pixels Tropics Histo",
+     &                "%",kmaxm1,lmaxm1,nhoriRD, iwmax,1,iwmax, komega,
+     &                32,"ave(X)", zsto,zout)
+c
+
+         CALL histdef(nid_regdyn, "nht1","Total Nb pixels Tropics Histo"
+     &                ,"%",kmaxm1,lmaxm1,nhoriRD, iwmax,1,iwmax, komega,
+     &                32,"ave(X)", zsto,zout)
+c
+c PAN
+         CALL histdef(nid_regdyn, "hw2", "North Pacific Histogram", "%",
+     &                kmaxm1,lmaxm1,nhoriRD, iwmax,1,iwmax, komega, 32, 
+     &                "ave(X)", zsto,zout)
+
+         CALL histdef(nid_regdyn, "nh2", "Nb of pixels North Pacific",
+     &                "%",kmaxm1,lmaxm1,nhoriRD, iwmax,1,iwmax, komega,
+     &                32,"ave(X)", zsto,zout)
+c
+
+         CALL histdef(nid_regdyn, "nht2","Total Nb pixels North Pacific 
+     &                Histo"
+     &                ,"%",kmaxm1,lmaxm1,nhoriRD, iwmax,1,iwmax, komega,
+     &                32,"ave(X)", zsto,zout)
+c CAL
+         CALL histdef(nid_regdyn, "hw3", "California Histogram", "%",
+     &                kmaxm1,lmaxm1,nhoriRD, iwmax,1,iwmax, komega, 32, 
+     &                "ave(X)", zsto,zout)
+
+         CALL histdef(nid_regdyn, "nh3", "Nb of pixels California 
+     &                Histo",
+     &                "%",kmaxm1,lmaxm1,nhoriRD, iwmax,1,iwmax, komega,
+     &                32,"ave(X)", zsto,zout)
+c
+
+         CALL histdef(nid_regdyn, "nht3","Total Nb pixels California 
+     &                Histo"
+     &                ,"%",kmaxm1,lmaxm1,nhoriRD, iwmax,1,iwmax, komega,
+     &                32,"ave(X)", zsto,zout)
+c HAW
+         CALL histdef(nid_regdyn, "hw4", "Hawai Histogram", "%",
+     &                kmaxm1,lmaxm1,nhoriRD, iwmax,1,iwmax, komega, 32, 
+     &                "ave(X)", zsto,zout)
+
+         CALL histdef(nid_regdyn, "nh4", "Nb of pixels Hawai Histo",
+     &                "%",kmaxm1,lmaxm1,nhoriRD, iwmax,1,iwmax, komega,
+     &                32,"ave(X)", zsto,zout)
+c
+
+         CALL histdef(nid_regdyn, "nht4","Total Nb pixels Hawai Histo"
+     &                ,"%",kmaxm1,lmaxm1,nhoriRD, iwmax,1,iwmax, komega,
+     &                32,"ave(X)", zsto,zout)
+c WAP
+         CALL histdef(nid_regdyn, "hw5", "Warm Pool Histogram", "%",
+     &                kmaxm1,lmaxm1,nhoriRD, iwmax,1,iwmax, komega, 32, 
+     &                "ave(X)", zsto,zout)
+
+         CALL histdef(nid_regdyn, "nh5", "Nb of pixels Warm Pool Histo",
+     &                "%",kmaxm1,lmaxm1,nhoriRD, iwmax,1,iwmax, komega,
+     &                32,"ave(X)", zsto,zout)
+c
+
+         CALL histdef(nid_regdyn, "nht5","Total Nb pixels Warm Pool 
+     &                Histo"
+     &                ,"%",kmaxm1,lmaxm1,nhoriRD, iwmax,1,iwmax, komega,
+     &                32,"ave(X)", zsto,zout)
+c
+         CALL histend(nid_regdyn)
+
+      endif ! ok_regdyn
Index: /LMDZ.3.3/trunk/libf/phylmd/write_histISCCP.h
===================================================================
--- /LMDZ.3.3/trunk/libf/phylmd/write_histISCCP.h	(revision 484)
+++ /LMDZ.3.3/trunk/libf/phylmd/write_histISCCP.h	(revision 484)
@@ -0,0 +1,29 @@
+      IF (ok_isccp) THEN
+c
+       ndex0d = 0
+       ndex1d = 0
+       ndex2d = 0
+       ndex3d = 0
+c
+       itau_w = itau_phy + itap
+c
+        DO k=1,kmaxm1
+         zx_tmp_fi3d(1:klon, 1:lmaxm1)=fq_isccp(1:klon,k,1:lmaxm1)*100.
+         CALL gr_fi_ecrit(lmaxm1,klon,iim,jjmp1,zx_tmp_fi3d,
+     .                    zx_tmp_3d)
+c
+cIM: champ 3d : (lon,lat,pres) pour un tau fixe
+c
+         CALL histwrite(nid_isccp,"cldISCCP_"//taulev(k),itau_w,
+     .                  zx_tmp_3d,iim*jjmp1*lmaxm1,ndex3d)
+        ENDDO !k
+c
+        CALL gr_fi_ecrit(1, klon,iim,jjmp1,nbsunlit(1,:),zx_tmp_2d)
+        CALL histwrite(nid_isccp,"nsunlit",itau_w,
+     .                 zx_tmp_2d,iim*jjmp1,ndex2d)
+c
+       if (ok_sync) then
+        call histsync(nid_isccp)
+       endif
+
+      ENDIF !ok_isccp
Index: /LMDZ.3.3/trunk/libf/phylmd/write_histREGDYN.h
===================================================================
--- /LMDZ.3.3/trunk/libf/phylmd/write_histREGDYN.h	(revision 484)
+++ /LMDZ.3.3/trunk/libf/phylmd/write_histREGDYN.h	(revision 484)
@@ -0,0 +1,85 @@
+      if (ok_regdyn) then
+
+c   Comprendre comment marche el i=nint(zout/zsto)
+c
+      ndex2d = 0
+      ndex3d = 0
+c
+c        itap = 0
+c        zsto = dtime * REAL(NINT(86400./dtime*ecrit_regdyn))
+c        zout = dtime * ecrit_mth
+
+c        zsto = dtime
+c        zout = dtime * ecrit_mth
+c        zsto = dtime * REAL(NINT(86400./dtime*ecrit_regdyn))
+         itau_w = itau_phy + itap
+c
+c     i = NINT(zout/zsto)
+c     CALL gr_fi_ecrit(1,klon,iim,jjmp1,pphis,zx_tmp_2d)
+c     CALL histwrite(nid_regdyn,"phis",i,zx_tmp_2d,iim*jjmp1,ndex2d)
+c
+c     i = NINT(zout/zsto)
+c     CALL gr_fi_ecrit(1,klon,iim,jjmp1,paire,zx_tmp_2d)
+c     CALL histwrite(nid_regdyn,"aire",i,zx_tmp_2d,iim*jjmp1,ndex2d)
+C
+c     CALL gr_fi_ecrit(1, klon,iim,jjmp1, zxtsol,zx_tmp_2d)
+c     CALL histwrite(nid_regdyn,"tsol",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
+c
+c 8 or day     CALL histwrite(nid_regdyn,"histoW",itap,histoW,
+c 
+c     CALL gr_fi_ecrit(klev,klon,iim,jjmp1, t_seri, zx_tmp_3d)
+
+c
+c     CALL gr_fi_ecrit(iwmax,kmaxm1*lmaxm1,kmaxm1,lmaxm1,
+c    . histoW, zx_tmp_3d)
+
+       CALL histwrite(nid_regdyn,"hw1",itau_w,histoW(:,:,:,1),
+     &               kmaxm1*lmaxm1*iwmax,ndex3d)
+c
+       CALL histwrite(nid_regdyn,"nh1",itau_w,nhistoW(:,:,:,1),
+     &               kmaxm1*lmaxm1*iwmax,ndex3d)
+c
+       CALL histwrite(nid_regdyn,"nht1",itau_w,nhistoWt(:,:,:,1),
+     &               kmaxm1*lmaxm1*iwmax,ndex3d)
+c
+       CALL histwrite(nid_regdyn,"hw2",itau_w,histoW(:,:,:,2),
+     &               kmaxm1*lmaxm1*iwmax,ndex3d)
+c
+       CALL histwrite(nid_regdyn,"nh2",itau_w,nhistoW(:,:,:,2),
+     &               kmaxm1*lmaxm1*iwmax,ndex3d)
+c
+       CALL histwrite(nid_regdyn,"nht2",itau_w,nhistoWt(:,:,:,2),
+     &               kmaxm1*lmaxm1*iwmax,ndex3d)
+c
+       CALL histwrite(nid_regdyn,"hw3",itau_w,histoW(:,:,:,3),
+     &               kmaxm1*lmaxm1*iwmax,ndex3d)
+c
+       CALL histwrite(nid_regdyn,"nh3",itau_w,nhistoW(:,:,:,3),
+     &               kmaxm1*lmaxm1*iwmax,ndex3d)
+c
+       CALL histwrite(nid_regdyn,"nht3",itau_w,nhistoWt(:,:,:,3),
+     &               kmaxm1*lmaxm1*iwmax,ndex3d)
+c
+       CALL histwrite(nid_regdyn,"hw4",itau_w,histoW(:,:,:,4),
+     &               kmaxm1*lmaxm1*iwmax,ndex3d)
+c
+       CALL histwrite(nid_regdyn,"nh4",itau_w,nhistoW(:,:,:,4),
+     &               kmaxm1*lmaxm1*iwmax,ndex3d)
+c
+       CALL histwrite(nid_regdyn,"nht4",itau_w,nhistoWt(:,:,:,4),
+     &               kmaxm1*lmaxm1*iwmax,ndex3d)
+c
+       CALL histwrite(nid_regdyn,"hw5",itau_w,histoW(:,:,:,5),
+     &               kmaxm1*lmaxm1*iwmax,ndex3d)
+c
+       CALL histwrite(nid_regdyn,"nh5",itau_w,nhistoW(:,:,:,5),
+     &               kmaxm1*lmaxm1*iwmax,ndex3d)
+c
+       CALL histwrite(nid_regdyn,"nht5",itau_w,nhistoWt(:,:,:,5),
+     &               kmaxm1*lmaxm1*iwmax,ndex3d)
+
+      if (ok_sync) then
+        call histsync(nid_regdyn)
+      endif
+
+      endif
