Index: /LMDZ4/trunk/libf/phylmd/clesphys.h
===================================================================
--- /LMDZ4/trunk/libf/phylmd/clesphys.h	(revision 827)
+++ /LMDZ4/trunk/libf/phylmd/clesphys.h	(revision 828)
@@ -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/trunk/libf/phylmd/conf_phys.F90
===================================================================
--- /LMDZ4/trunk/libf/phylmd/conf_phys.F90	(revision 827)
+++ /LMDZ4/trunk/libf/phylmd/conf_phys.F90	(revision 828)
@@ -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
@@ -79,5 +81,5 @@
   INTEGER,SAVE :: top_height_omp,overlap_omp
   REAL,SAVE :: cdmmax_omp,cdhmax_omp,ksta_omp,ksta_ter_omp
-  LOGICAL,SAVE :: ok_kzmin_omp
+  LOGICAL,SAVE :: ok_kzmin_omp, fmagic_omp
   INTEGER,SAVE :: iflag_pbl_omp,lev_histhf_omp,lev_histday_omp,lev_histmth_omp
   CHARACTER*4, SAVE :: type_run_omp
@@ -110,5 +112,5 @@
   call getin('VEGET', ok_veget_omp)
 !
-!Config Key  = OK_journe
+!Config Key  = ok_journe
 !Config Desc = Pour des sorties journalieres 
 !Config Def  = .false.
@@ -117,5 +119,14 @@
 !
   ok_journe_omp = .false.
-  call getin('OK_journe', ok_journe_omp)
+  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
@@ -171,5 +182,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 +590,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 +673,5 @@
   call getin('type_run',type_run_omp)
 
-  !
+!
 !Config Key  = ok_isccp
 !Config Desc =
@@ -693,5 +730,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 +810,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 +820,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 +859,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 +902,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 +916,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/trunk/libf/phylmd/ini_paramLMDZ_phy.h
===================================================================
--- /LMDZ4/trunk/libf/phylmd/ini_paramLMDZ_phy.h	(revision 827)
+++ /LMDZ4/trunk/libf/phylmd/ini_paramLMDZ_phy.h	(revision 828)
@@ -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/trunk/libf/phylmd/physiq.F
===================================================================
--- /LMDZ4/trunk/libf/phylmd/physiq.F	(revision 827)
+++ /LMDZ4/trunk/libf/phylmd/physiq.F	(revision 828)
@@ -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"
 
@@ -2533,5 +2536,8 @@
 c
       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
 
Index: /LMDZ4/trunk/libf/phylmd/write_paramLMDZ_phy.h
===================================================================
--- /LMDZ4/trunk/libf/phylmd/write_paramLMDZ_phy.h	(revision 827)
+++ /LMDZ4/trunk/libf/phylmd/write_paramLMDZ_phy.h	(revision 828)
@@ -327,10 +327,10 @@
      .               zx_tmp_2d,iim*jjmp1,ndex2d)
 c
-      zx_tmp_2d(1:iim,1:jjmp1)=freqin_isccp
-      CALL histwrite(nid_ctesGCM,"freqin_isccp",itau_w,
-     .               zx_tmp_2d,iim*jjmp1,ndex2d)
-c
-      zx_tmp_2d(1:iim,1:jjmp1)=freqout_isccp
-      CALL histwrite(nid_ctesGCM,"freqout_isccp",itau_w,
+      zx_tmp_2d(1:iim,1:jjmp1)=freq_ISCCP
+      CALL histwrite(nid_ctesGCM,"freq_ISCCP",itau_w,
+     .               zx_tmp_2d,iim*jjmp1,ndex2d)
+c
+      zx_tmp_2d(1:iim,1:jjmp1)=ecrit_ISCCP
+      CALL histwrite(nid_ctesGCM,"ecrit_ISCCP",itau_w,
      .               zx_tmp_2d,iim*jjmp1,ndex2d)
 c
