Index: /LMDZ5/trunk/libf/phylmd/calcul_STDlev.h
===================================================================
--- /LMDZ5/trunk/libf/phylmd/calcul_STDlev.h	(revision 1911)
+++ /LMDZ5/trunk/libf/phylmd/calcul_STDlev.h	(revision 1912)
@@ -6,11 +6,5 @@
         missing_val=nf90_fill_real
 !
-!IM freq_moyNMC = frequences auxquelles on moyenne les champs accumules 
-!IM               sur les niveaux de pression standard du NMC
-      DO n=1, nout
-       freq_moyNMC(n)=freq_outNMC(n)/freq_calNMC(n)
-      ENDDO
-!
-        CALL ini_undefSTD(itap,freq_outNMC)
+        CALL ini_undefSTD(itap,itapm1)
 !
 !IM on interpole les champs sur les niveaux STD de pression 
@@ -135,9 +129,9 @@
 !IM on somme les valeurs toutes les freq_calNMC secondes
 !
-       CALL undefSTD(itap,freq_calNMC, read_climoz)
-!
-!IM on moyenne a la fin du mois ou du jour (toutes les freq_outNMC secondes)
-!
-       CALL moy_undefSTD(itap,freq_outNMC,freq_moyNMC)
+       CALL undefSTD(itap, read_climoz)
+!
+!IM on moyenne a la fin du mois, du jour ou toutes les 6h
+!
+       CALL moy_undefSTD(itap,itapm1)
 !
        CALL plevel(klon,klev,.true.,pplay,50000., &
Index: /LMDZ5/trunk/libf/phylmd/calcul_divers.h
===================================================================
--- /LMDZ5/trunk/libf/phylmd/calcul_divers.h	(revision 1911)
+++ /LMDZ5/trunk/libf/phylmd/calcul_divers.h	(revision 1912)
@@ -2,11 +2,8 @@
 ! $Header$
 !
-
-!     Initialisations diverses au "debut" du mois
-      IF(debut) THEN
-         nday_rain(:)=0.
-
+! Initialisations diverses au tout debut
+      IF(itap.EQ.1) THEN
+         itapm1=0
 !        surface terre
-         paire_ter(:)=0.
          DO i=1, klon
             IF(pctsrf(i,is_ter).GT.0.) THEN
@@ -16,6 +13,13 @@
       ENDIF
 
-!IM   Calcul une fois par jour : total_rain, nday_rain
-      IF(MOD(itap,INT(un_jour/dtime)).EQ.0) THEN
+! Initialisation debut de mois
+      IF(itap.EQ.itapm1+1) THEN
+        nday_rain(:)=0.
+!       print*,'initialisation mois suivants day_rain itap',itap
+      ENDIF
+
+! Calcul fin de journee : total_rain, nday_rain
+      IF(MOD(itap,NINT(un_jour/dtime)).EQ.0) THEN
+!        print*,'calcul nday_rain itap ',itap
          DO i = 1, klon
             total_rain(i)=rain_fall(i)+snow_fall(i)  
@@ -23,2 +27,8 @@
          ENDDO
       ENDIF
+
+! Initialisation fin de mois
+      IF(MOD(itap-itapm1,NINT(mth_len*un_jour/dtime)).EQ.0) THEN
+        itapm1=itapm1+NINT(mth_len*un_jour/dtime)
+!       print*,'initialisation itapm1 ',itapm1
+      ENDIF
Index: /LMDZ5/trunk/libf/phylmd/ini_undefSTD.F
===================================================================
--- /LMDZ5/trunk/libf/phylmd/ini_undefSTD.F	(revision 1911)
+++ /LMDZ5/trunk/libf/phylmd/ini_undefSTD.F	(revision 1912)
@@ -3,9 +3,10 @@
 !
 
-      SUBROUTINE ini_undefSTD(itap,
-     $           freq_outNMC)
+      SUBROUTINE ini_undefSTD(itap,itapm1)
       USE dimphy
       USE phys_state_var_mod ! Variables sauvegardees de la physique
+      USE phys_cal_mod, only : mth_len
       IMPLICIT none
+      include "clesphys.h"
 c
 c====================================================================
@@ -36,5 +37,5 @@
 c variables Input/Output
 c     INTEGER nlevSTD, klevSTD, itap
-      INTEGER itap
+      INTEGER itap, itapm1
 c     PARAMETER(klevSTD=17)
 c     REAL dtime
@@ -44,5 +45,7 @@
       INTEGER i, k, n
 c     PARAMETER(nout=3) !nout=1 day/nout=2 mth/nout=3 NMC
-      REAL freq_outNMC(nout)
+c     REAL freq_outNMC(nout)
+      REAL un_jour
+      PARAMETER(un_jour=86400.)
 c
 c variables Output
@@ -52,7 +55,9 @@
       DO n=1, nout
 c
-c initialisation variables en debut de la journee ou du mois
+c initialisation variables en debut du mois, de la journee ou des 6h
 c
-       IF(MOD(itap,NINT(freq_outNMC(n)/dtime)).EQ.1.) THEN
+       IF(n.EQ.1.AND.itap-itapm1.EQ.1.OR.
+     &n.GT.1.AND.MOD(itap,NINT(freq_outNMC(n)/dtime)).EQ.1) THEN
+c       print*,'ini_undefSTD n itap',n,itap
         DO k=1, nlevSTD
          DO i=1, klon
@@ -78,9 +83,6 @@
          ENDDO !i
         ENDDO !k
-c
-       ENDIF !MOD(itap,NINT(freq_outNMC(n)/dtime)).EQ.1.
-c
+       ENDIF !
       ENDDO !n
-c
       RETURN
       END  
Index: /LMDZ5/trunk/libf/phylmd/moy_undefSTD.F
===================================================================
--- /LMDZ5/trunk/libf/phylmd/moy_undefSTD.F	(revision 1911)
+++ /LMDZ5/trunk/libf/phylmd/moy_undefSTD.F	(revision 1912)
@@ -2,9 +2,11 @@
 ! $Id$
 !
-      SUBROUTINE moy_undefSTD(itap,freq_outNMC,freq_moyNMC)
+      SUBROUTINE moy_undefSTD(itap,itapm1)
       USE netcdf
       USE dimphy
-      USE phys_state_var_mod ! Variables sauvegardees de la physique
+      USE phys_state_var_mod
+      USE phys_cal_mod, only : mth_len
       IMPLICIT none
+      include "clesphys.h"
 c
 c====================================================================
@@ -33,5 +35,5 @@
 c     INTEGER nlevSTD, klevSTD, itap
 c     PARAMETER(klevSTD=17)
-      INTEGER itap
+      INTEGER itap, itapm1
 c
 c variables locales
@@ -40,5 +42,6 @@
       INTEGER i, k, n
 c     REAL dtime, freq_outNMC(nout), freq_moyNMC(nout)
-      REAL freq_outNMC(nout), freq_moyNMC(nout)
+c     REAL freq_outNMC(nout), freq_calNMC(nout)
+      REAL freq_moyNMC(nout)
 c
 c variables Output
@@ -46,4 +49,6 @@
 c     REAL tsumSTD(klon,klevSTD,nout)
 c
+      REAL un_jour
+      PARAMETER(un_jour=86400.)
       REAL missing_val
 c
@@ -51,8 +56,16 @@
 c
       DO n=1, nout
+       IF(freq_outNMC(n).LT.0) THEN
+         freq_moyNMC(n)=(mth_len*un_jour)/freq_calNMC(n)
+c        print*,'moy_undefSTD n freq_out freq_moy =',
+c    $n,freq_moyNMC(n)
+       ENDIF         
 c 
-c calcul 1 fois par jour
+c calcul 1 fois pas mois, 1 fois par jour ou toutes les 6h
 c
-       IF(MOD(itap,NINT(freq_outNMC(n)/dtime)).EQ.0) THEN
+       IF(n.EQ.1.AND.itap.EQ.itapm1.OR.
+     $n.GT.1.AND.MOD(itap,NINT(freq_outNMC(n)/dtime)).EQ.0) THEN
+c
+c       print*,'moy_undefSTD n itap itapm1',n,itap,itapm1
 c
         DO k=1, nlevSTD
@@ -61,5 +74,4 @@
            tsumSTD(i,k,n)=tsumSTD(i,k,n)/
      $     (freq_moyNMC(n)-tnondef(i,k,n))
-cIM BEG
           usumSTD(i,k,n)=usumSTD(i,k,n)/
      $     (freq_moyNMC(n)-tnondef(i,k,n))
@@ -96,5 +108,4 @@
           O3daysumSTD(i,k,n)=O3daysumSTD(i,k,n)/
      $     (freq_moyNMC(n)-tnondef(i,k,n))
-cIM END
           ELSE
            tsumSTD(i,k,n)=missing_val
Index: /LMDZ5/trunk/libf/phylmd/phys_output_ctrlout_mod.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/phys_output_ctrlout_mod.F90	(revision 1911)
+++ /LMDZ5/trunk/libf/phylmd/phys_output_ctrlout_mod.F90	(revision 1912)
@@ -500,33 +500,33 @@
 
   TYPE(ctrl_out), SAVE, DIMENSION(7) :: o_uSTDlevs     = (/                    &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'u850', "Zonal wind 1hPa", "m/s",     &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'u700', "Zonal wind 2hPa", "m/s",     &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'u500', "Zonal wind 3hPa", "m/s",     &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'u200', "Zonal wind 4hPa", "m/s",     &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'u100', "Zonal wind 5hPa", "m/s",     &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'u50', "Zonal wind 6hPa", "m/s",     &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'u10', "Zonal wind 7hPa", "m/s",     &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'u850', "Zonal wind 850hPa", "m/s",     &
+      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'u700', "Zonal wind 700hPa", "m/s",     &
+      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'u500', "Zonal wind 500hPa", "m/s",     &
+      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'u200', "Zonal wind 200hPa", "m/s",     &
+      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'u100', "Zonal wind 100hPa", "m/s",     &
+      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'u50', "Zonal wind 50hPa", "m/s",     &
+      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'u10', "Zonal wind 10hPa", "m/s",     &
       (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)) /)
 
   TYPE(ctrl_out), SAVE, DIMENSION(7) :: o_vSTDlevs     = (/                     &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'v850', "Meridional wind 1hPa", "m/s", &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'v850', "Meridional wind 850hPa", "m/s", &
       (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)),  &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'v700', "Meridional wind 2hPa", "m/s", &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'v700', "Meridional wind 700hPa", "m/s", &
       (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)),  &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'v500', "Meridional wind 3hPa", "m/s", &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'v500', "Meridional wind 500hPa", "m/s", &
       (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)),  &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'v200', "Meridional wind 4hPa", "m/s", &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'v200', "Meridional wind 200hPa", "m/s", &
       (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)),  &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'v100', "Meridional wind 5hPa", "m/s", &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'v100', "Meridional wind 100hPa", "m/s", &
       (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)),  &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'v50', "Meridional wind 6hPa", "m/s",  &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'v50', "Meridional wind 50hPa", "m/s",  &
       (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)),  &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'v10', "Meridional wind 7hPa", "m/s",  &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'v10', "Meridional wind 10hPa", "m/s",  &
       (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)) /)
 
@@ -534,15 +534,15 @@
       ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'w850', "Vertical wind 1hPa", "Pa/s", &
       (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'w700', "Vertical wind 2hPa", "Pa/s", &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'w500', "Vertical wind 3hPa", "Pa/s", &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'w200', "Vertical wind 4hPa", "Pa/s", &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'w100', "Vertical wind 5hPa", "Pa/s", &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'w50', "Vertical wind 6hPa", "Pa/s",  &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'w10', "Vertical wind 7hPa", "Pa/s",  &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'w700', "Vertical wind 700hPa", "Pa/s", &
+      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'w500', "Vertical wind 500hPa", "Pa/s", &
+      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'w200', "Vertical wind 200hPa", "Pa/s", &
+      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'w100', "Vertical wind 100hPa", "Pa/s", &
+      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'w50', "Vertical wind 50hPa", "Pa/s",  &
+      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'w10', "Vertical wind 10hPa", "Pa/s",  &
       (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)) /)
 
@@ -550,15 +550,15 @@
       ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'t850', "Temperature 1hPa", "K",      &
       (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'t700', "Temperature 2hPa", "K",      &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'t500', "Temperature 3hPa", "K",      &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'t200', "Temperature 4hPa", "K",      &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'t100', "Temperature 5hPa", "K",      &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'t50',  "Temperature 6hPa", "K",      &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'t10',  "Temperature 7hPa", "K",      &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'t700', "Temperature 700hPa", "K",      &
+      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'t500', "Temperature 500hPa", "K",      &
+      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'t200', "Temperature 200hPa", "K",      &
+      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'t100', "Temperature 100hPa", "K",      &
+      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'t50',  "Temperature 50hPa", "K",      &
+      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'t10',  "Temperature 10hPa", "K",      &
       (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)) /)
 
@@ -566,15 +566,15 @@
       ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'q850', "Specific humidity 1hPa", &
       "kg/kg", (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'q700', "Specific humidity 2hPa", &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'q700', "Specific humidity 700hPa", &
       "kg/kg", (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'q500', "Specific humidity 3hPa", &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'q500', "Specific humidity 500hPa", &
       "kg/kg", (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'q200', "Specific humidity 4hPa", &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'q200', "Specific humidity 200hPa", &
       "kg/kg", (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'q100', "Specific humidity 5hPa", &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'q100', "Specific humidity 100hPa", &
       "kg/kg", (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'q50', "Specific humidity 6hPa",  &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'q50', "Specific humidity 50hPa",  &
       "kg/kg", (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'q10', "Specific humidity 7hPa", &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'q10', "Specific humidity 10hPa", &
       "kg/kg", (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)) /)
 
@@ -582,15 +582,15 @@
       ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'z850', "Geopotential height 1hPa",        &
       "m", (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'z700', "Geopotential height 2hPa",        &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'z700', "Geopotential height 700hPa",        &
       "m", (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'z500', "Geopotential height 3hPa",        &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'z500', "Geopotential height 500hPa",        &
       "m", (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'z200', "Geopotential height 4hPa",        &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'z200', "Geopotential height 200hPa",        &
       "m", (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'z100', "Geopotential height 5hPa",        &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'z100', "Geopotential height 100hPa",        &
       "m", (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'z50', "Geopotential height 6hPa",         &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'z50', "Geopotential height 50hPa",         &
       "m", (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'z10', "Geopotential height 7hPa",         &
+      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11 /),'z10', "Geopotential height 10hPa",         &
       "m", (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)) /)
 
Index: /LMDZ5/trunk/libf/phylmd/phys_output_mod.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/phys_output_mod.F90	(revision 1911)
+++ /LMDZ5/trunk/libf/phylmd/phys_output_mod.F90	(revision 1912)
@@ -44,4 +44,5 @@
     USE surface_data, ONLY : ok_snow
     USE phys_output_ctrlout_mod
+    USE mod_grid_phy_lmdz, only: klon_glo
 
 #ifdef CPP_XIOS
@@ -207,7 +208,7 @@
     ecrit_files(5) = ecrit_LES
     ecrit_files(6) = ecrit_ins
-    ecrit_files(7) = freq_outNMC(1)/86400.
-    ecrit_files(8) = freq_outNMC(2)/86400.
-    ecrit_files(9) = freq_outNMC(3)/86400.
+    ecrit_files(7) = freq_outNMC(1)
+    ecrit_files(8) = freq_outNMC(2)
+    ecrit_files(9) = freq_outNMC(3)
 
     !! Lectures des parametres de sorties dans physiq.def
@@ -248,5 +249,9 @@
     ! ug Réglage du calendrier xios
     !Temps julian => an, mois, jour, heure
-    CALL ymds2ju(annee_ref, 1, day_ref, 0.0, zjulian)
+    IF (klon_glo==1) THEN                                       
+        CALL ymds2ju(annee_ref, 1, day_ref, hour, zjulian)
+    ELSE
+        CALL ymds2ju(annee_ref, 1, day_ref, 0.0, zjulian)
+    END IF 
     CALL ju2ymds(zjulian, x_an, x_mois, x_jour, x_heure)
     CALL wxios_set_cal(dtime, calend, x_an, x_mois, x_jour, x_heure)
@@ -278,4 +283,8 @@
           ! ...)*86400.
           ecrit_files(iff)=ecrit_files(iff)*86400.
+      ELSE IF (chtimestep(iff).eq.'-1') then
+          PRINT*,'ecrit_files(',iff,') < 0 so IOIPSL work on different'
+          PRINT*,'months length'
+          ecrit_files(iff)=-1.
       else
        CALL convers_timesteps(chtimestep(iff),dtime,ecrit_files(iff)) 
@@ -304,15 +313,15 @@
 
           idayref = day_ref
-!          CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian)       
-! correction pour l heure initiale                               !jyg 
-!                                                                !jyg 
-          CALL ymds2ju(annee_ref, 1, idayref, hour, zjulian)         !jyg
-! correction pour l heure initiale                               !jyg 
-!                                                                !jyg 
-!!!      CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian)       !jyg 
-! correction pour l heure initiale                               !jyg 
-!                                                                !jyg 
-!      CALL ymds2ju(annee_ref, 1, idayref, hour, zjulian)         !jyg
-
+! A noter pour
+! l heure initiale - dans les fichiers histoire hist* - on met comme  
+! heure de debut soit la vraie heure (pour le 1D) soit 0h (pour le 3D) 
+! afin d avoir une seule sortie mensuelle par mois lorsque l on tourne 
+! par annee (IM).
+!
+     IF (klon_glo==1) THEN                                       
+         CALL ymds2ju(annee_ref, 1, idayref, hour, zjulian)     !jyg
+     ELSE
+         CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian)
+     END IF                                                      
 !!!!!!!!!!!!!!!!! Traitement dans le cas ou l'on veut stocker sur un domaine limite !!
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -479,5 +488,11 @@
     ecrit_LES = ecrit_files(5)
     ecrit_ins = ecrit_files(6)
-
+    freq_outNMC(1) = ecrit_files(7)
+    freq_outNMC(2) = ecrit_files(8)
+    freq_outNMC(3) = ecrit_files(9)
+
+    WRITE(lunout,*)'freq_outNMC(1)=',freq_outNMC(1)
+    WRITE(lunout,*)'freq_outNMC(2)=',freq_outNMC(2)
+    WRITE(lunout,*)'freq_outNMC(3)=',freq_outNMC(3)
     WRITE(lunout,*)'swaero_diag=',swaero_diag
     WRITE(lunout,*)'Fin phys_output_mod.F90'
Index: /LMDZ5/trunk/libf/phylmd/physiq.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/physiq.F90	(revision 1911)
+++ /LMDZ5/trunk/libf/phylmd/physiq.F90	(revision 1912)
@@ -493,4 +493,6 @@
   REAL un_jour
   PARAMETER(un_jour=86400.)
+  INTEGER itapm1
+  SAVE itapm1
   !======================================================================
   !
@@ -3431,5 +3433,9 @@
   !   SORTIES
   !=======================================================================
-
+  !
+  !IM initialisation + calculs divers diag AMIP2
+  !
+  include "calcul_divers.h"
+  !
   !IM Interpolation sur les niveaux de pression du NMC
   !   -------------------------------------------------
@@ -3448,8 +3454,4 @@
      ENDDO
   ENDDO
-  !
-  !IM initialisation + calculs divers diag AMIP2
-  !
-  include "calcul_divers.h"
   !
   IF (type_trac == 'inca') THEN
Index: /LMDZ5/trunk/libf/phylmd/undefSTD.F
===================================================================
--- /LMDZ5/trunk/libf/phylmd/undefSTD.F	(revision 1911)
+++ /LMDZ5/trunk/libf/phylmd/undefSTD.F	(revision 1912)
@@ -2,9 +2,10 @@
 ! $Id$
 !
-      SUBROUTINE undefSTD(itap,freq_calNMC, read_climoz)
+      SUBROUTINE undefSTD(itap, read_climoz)
       USE netcdf
       USE dimphy
       USE phys_state_var_mod ! Variables sauvegardees de la physique
       IMPLICIT none
+      include "clesphys.h"
 c
 c====================================================================
@@ -42,5 +43,5 @@
 c     PARAMETER(nout=3) !nout=1 : day; =2 : mth; =3 : NMC
       INTEGER i, k, n
-      REAL freq_calNMC(nout)
+c     REAL freq_calNMC(nout)
       INTEGER read_climoz
 c
