Index: LMDZ.3.3/branches/rel-LF/libf/phylmd/ini_histmthNMC.h
===================================================================
--- LMDZ.3.3/branches/rel-LF/libf/phylmd/ini_histmthNMC.h	(revision 507)
+++ LMDZ.3.3/branches/rel-LF/libf/phylmd/ini_histmthNMC.h	(revision 508)
@@ -4,5 +4,13 @@
        IF(region.EQ.'3d') THEN
          zsto = dtime
+cIM 150304 BEG
          zout = dtime * ecrit_mth
+c        zout = dtime * REAL(NINT(86400./dtime*ecrit_hf))
+cIM 150304 END
+cIM 120304 BEG
+c       zout = dtime * REAL(NINT(86400./dtime*ecrit_hf))
+c       zsto = zout
+c       zsto = dtime
+cIM 120304 END
        ELSEIF(region.EQ.'1d') THEN
          zsto = dtime
@@ -40,175 +48,48 @@
 
 c Champs interpolles sur des niveaux de pression du NMC
-         CALL histdef(nid_nmc, "u1000",
-     . "Zonal wind 1000mb", 
-     .                "m/s",
-     .                iim,jjmp1,nhori, 1,1,1, -99, 32,
-     .                "ave(X)", zsto,zout)
-
-         CALL histdef(nid_nmc, "v1000",
-     .                "Meridional wind 1000mb", "m/s",
-     .                iim,jjmp1,nhori, 1,1,1, -99, 32,
-     .                "ave(X)", zsto,zout)
-
-         CALL histdef(nid_nmc, "u925", "Zonal wind 925mb", 
-     .                "m/s",
-     .                iim,jjmp1,nhori, 1,1,1, -99, 32,
-     .                "ave(X)", zsto,zout)
-
-         CALL histdef(nid_nmc, "v925", "Meridional wind 925mb", 
-     .                "m/s",
-     .                iim,jjmp1,nhori, 1,1,1, -99, 32,
-     .                "ave(X)", zsto,zout)
-
-         CALL histdef(nid_nmc, "u850", "Zonal wind 850mb", 
-     .                "m/s",
-     .                iim,jjmp1,nhori, 1,1,1, -99, 32,
-     .                "ave(X)", zsto,zout)
-
-         CALL histdef(nid_nmc, "v850", "Meridional wind 850mb", 
-     .                "m/s",
+c IMIMIM 110304 BEG
+c
+         DO k=1, nlevSTD
+c
+         bb=clevSTD(k)
+c
+         IF(k.GE.2) THEN
+          aa=clevSTD(k)
+          bb=aa(1:lnblnk1(aa))
+         ENDIF 
+c
+          CALL histdef(nid_nmc, "t"//bb,
+     .                 "Temperature"//bb//"mb","K",
      .                iim,jjmp1,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zsto,zout)
 c
-         CALL histdef(nid_nmc, "u700", "Zonal wind 700mb", 
-     .                "m/s",
-     .                iim,jjmp1,nhori, 1,1,1, -99, 32,
-     .                "ave(X)", zsto,zout)
-
-         CALL histdef(nid_nmc, "v700", "Meridional wind 700mb", 
-     .                "m/s",
+         CALL histdef(nid_nmc, "phi"//bb,
+     .                "Geopotential"//bb//"mb", "m2/s2",
      .                iim,jjmp1,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zsto,zout)
 c
-         CALL histdef(nid_nmc, "u600", "Zonal wind 600mb", 
-     .                "m/s",
-     .                iim,jjmp1,nhori, 1,1,1, -99, 32,
-     .                "ave(X)", zsto,zout)
-
-         CALL histdef(nid_nmc, "v600", "Meridional wind 600mb", 
-     .                "m/s",
+          CALL histdef(nid_nmc, "q"//bb,
+     .                 "Specific humidity"//bb//"mb","kg/kg",
      .                iim,jjmp1,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zsto,zout)
 c
-         CALL histdef(nid_nmc, "u500", "Zonal wind 500mb", 
-     .                "m/s",
-     .                iim,jjmp1,nhori, 1,1,1, -99, 32,
-     .                "ave(X)", zsto,zout)
-
-         CALL histdef(nid_nmc, "v500", "Meridional wind 500mb", 
-     .                "m/s",
+         CALL histdef(nid_nmc, "rh"//bb,
+     .                 "Relative humidity"//bb//"mb", "%",
      .                iim,jjmp1,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zsto,zout)
 c
-         CALL histdef(nid_nmc, "u400", "Zonal wind 400mb", 
-     .                "m/s",
-     .                iim,jjmp1,nhori, 1,1,1, -99, 32,
-     .                "ave(X)", zsto,zout)
-
-         CALL histdef(nid_nmc, "v400", "Meridional wind 400mb", 
-     .                "m/s",
+          CALL histdef(nid_nmc, "u"//bb,
+     .                 "Zonal wind"//bb//"mb","K",
      .                iim,jjmp1,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zsto,zout)
 c
-         CALL histdef(nid_nmc, "u300", "Zonal wind 300mb", 
-     .                "m/s",
-     .                iim,jjmp1,nhori, 1,1,1, -99, 32,
-     .                "ave(X)", zsto,zout)
-
-         CALL histdef(nid_nmc, "v300", "Meridional wind 300mb", 
-     .                "m/s",
+          CALL histdef(nid_nmc, "v"//bb,
+     .                 "Meridional wind"//bb//"mb","K",
      .                iim,jjmp1,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zsto,zout)
 c
-         CALL histdef(nid_nmc, "u250", "Zonal wind 250mb", 
-     .                "m/s",
-     .                iim,jjmp1,nhori, 1,1,1, -99, 32,
-     .                "ave(X)", zsto,zout)
+         ENDDO !nlevSTD
+c IMIMIM 110304 END
 
-         CALL histdef(nid_nmc, "v250", "Meridional wind 250mb", 
-     .                "m/s",
-     .                iim,jjmp1,nhori, 1,1,1, -99, 32,
-     .                "ave(X)", zsto,zout)
-c
-         CALL histdef(nid_nmc, "u200", "Zonal wind 200mb", 
-     .                "m/s",
-     .                iim,jjmp1,nhori, 1,1,1, -99, 32,
-     .                "ave(X)", zsto,zout)
-
-         CALL histdef(nid_nmc, "v200", "Meridional wind 200mb", 
-     .                "m/s",
-     .                iim,jjmp1,nhori, 1,1,1, -99, 32,
-     .                "ave(X)", zsto,zout)
-c
-         CALL histdef(nid_nmc, "u150", "Zonal wind 150mb", 
-     .                "m/s",
-     .                iim,jjmp1,nhori, 1,1,1, -99, 32,
-     .                "ave(X)", zsto,zout)
-
-         CALL histdef(nid_nmc, "v150", "Meridional wind 150mb", 
-     .                "m/s",
-     .                iim,jjmp1,nhori, 1,1,1, -99, 32,
-     .                "ave(X)", zsto,zout)
-c
-         CALL histdef(nid_nmc, "u100", "Zonal wind 100mb", 
-     .                "m/s",
-     .                iim,jjmp1,nhori, 1,1,1, -99, 32,
-     .                "ave(X)", zsto,zout)
-
-         CALL histdef(nid_nmc, "v100", "Meridional wind 100mb", 
-     .                "m/s",
-     .                iim,jjmp1,nhori, 1,1,1, -99, 32,
-     .                "ave(X)", zsto,zout)
-c
-         CALL histdef(nid_nmc, "u70", "Zonal wind 70mb", 
-     .                "m/s",
-     .                iim,jjmp1,nhori, 1,1,1, -99, 32,
-     .                "ave(X)", zsto,zout)
-
-         CALL histdef(nid_nmc, "v70", "Meridional wind 70mb", 
-     .                "m/s",
-     .                iim,jjmp1,nhori, 1,1,1, -99, 32,
-     .                "ave(X)", zsto,zout)
-c
-         CALL histdef(nid_nmc, "u50", "Zonal wind 50mb", 
-     .                "m/s",
-     .                iim,jjmp1,nhori, 1,1,1, -99, 32,
-     .                "ave(X)", zsto,zout)
-
-         CALL histdef(nid_nmc, "v50", "Meridional wind 50mb", 
-     .                "m/s",
-     .                iim,jjmp1,nhori, 1,1,1, -99, 32,
-     .                "ave(X)", zsto,zout)
-c
-         CALL histdef(nid_nmc, "u30", "Zonal wind 30mb", 
-     .                "m/s",
-     .                iim,jjmp1,nhori, 1,1,1, -99, 32,
-     .                "ave(X)", zsto,zout)
-
-         CALL histdef(nid_nmc, "v30", "Meridional wind 30mb", 
-     .                "m/s",
-     .                iim,jjmp1,nhori, 1,1,1, -99, 32,
-     .                "ave(X)", zsto,zout)
-c
-         CALL histdef(nid_nmc, "u20", "Zonal wind 20mb", 
-     .                "m/s",
-     .                iim,jjmp1,nhori, 1,1,1, -99, 32,
-     .                "ave(X)", zsto,zout)
-
-         CALL histdef(nid_nmc, "v20", "Meridional wind 20mb", 
-     .                "m/s",
-     .                iim,jjmp1,nhori, 1,1,1, -99, 32,
-     .                "ave(X)", zsto,zout)
-c
-         CALL histdef(nid_nmc, "u10", "Zonal wind 10mb", 
-     .                "m/s",
-     .                iim,jjmp1,nhori, 1,1,1, -99, 32,
-     .                "ave(X)", zsto,zout)
-
-         CALL histdef(nid_nmc, "v10", "Meridional wind 10mb", 
-     .                "m/s",
-     .                iim,jjmp1,nhori, 1,1,1, -99, 32,
-     .                "ave(X)", zsto,zout)
-c
          CALL histend(nid_nmc)
 c
Index: LMDZ.3.3/branches/rel-LF/libf/phylmd/write_histmthNMC.h
===================================================================
--- LMDZ.3.3/branches/rel-LF/libf/phylmd/write_histmthNMC.h	(revision 507)
+++ LMDZ.3.3/branches/rel-LF/libf/phylmd/write_histmthNMC.h	(revision 508)
@@ -15,141 +15,42 @@
 c
 c  Champs interpolles sur des niveaux de pression du NMC
+c110304 BEG
+      DO k=1, nlevSTD
 c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, u1000,zx_tmp_2d)
-      CALL histwrite(nid_nmc,
-     ."u1000",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
+         bb=clevSTD(k)
 c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, v1000,zx_tmp_2d)
-      CALL histwrite(nid_nmc,
-     ."v1000",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
+         IF(k.GE.2) THEN
+          aa=clevSTD(k)
+          bb=aa(1:lnblnk1(aa))
+         ENDIF
 c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, u925,zx_tmp_2d)
-      CALL histwrite(nid_nmc,
-     ."u925",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
+      CALL gr_fi_ecrit(1, klon,iim,jjmp1, tlevSTD(:,k),zx_tmp_2d)
+      CALL histwrite(nid_nmc,"t"//bb,itau_w,zx_tmp_2d,
+     $       iim*jjmp1,ndex2d)
 c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, v925,zx_tmp_2d)
-      CALL histwrite(nid_nmc,
-     ."v925",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
+      CALL gr_fi_ecrit(1, klon,iim,jjmp1, philevSTD(:,k),zx_tmp_2d)
+      CALL histwrite(nid_nmc,"phi"//bb,itau_w,zx_tmp_2d,
+     $       iim*jjmp1,ndex2d)
 c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, u850,zx_tmp_2d)
-      CALL histwrite(nid_nmc,
-     ."u850",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
+      CALL gr_fi_ecrit(1, klon,iim,jjmp1, qlevSTD(:,k),zx_tmp_2d)
+      CALL histwrite(nid_nmc,"q"//bb,itau_w,zx_tmp_2d,
+     $       iim*jjmp1,ndex2d)
 c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, v850,zx_tmp_2d)
-      CALL histwrite(nid_nmc,"v850",itau_w,
-     .zx_tmp_2d,iim*jjmp1,ndex2d)
+      CALL gr_fi_ecrit(1, klon,iim,jjmp1, rhlevSTD(:,k),zx_tmp_2d)
+      CALL histwrite(nid_nmc,"rh"//bb,itau_w,zx_tmp_2d,
+     $       iim*jjmp1,ndex2d)
 c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, u700,zx_tmp_2d)
-      CALL histwrite(nid_nmc,"u700",itau_w,
-     .zx_tmp_2d,iim*jjmp1,ndex2d)
+      CALL gr_fi_ecrit(1, klon,iim,jjmp1, ulevSTD(:,k),zx_tmp_2d)
+      CALL histwrite(nid_nmc,"u"//bb,itau_w,zx_tmp_2d,
+     $       iim*jjmp1,ndex2d)
 c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, v700,zx_tmp_2d)
-      CALL histwrite(nid_nmc,"v700",itau_w,
-     .zx_tmp_2d,iim*jjmp1,ndex2d)
+      CALL gr_fi_ecrit(1, klon,iim,jjmp1, vlevSTD(:,k),zx_tmp_2d)
+      CALL histwrite(nid_nmc,"v"//bb,itau_w,zx_tmp_2d,
+     $       iim*jjmp1,ndex2d)
 c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, u600,zx_tmp_2d)
-      CALL histwrite(nid_nmc,"u600",itau_w,
-     .zx_tmp_2d,iim*jjmp1,ndex2d)
+      ENDDO !k=1, nlevSTD
+ccc
+c110304 END
 c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, v600,zx_tmp_2d)
-      CALL histwrite(nid_nmc,"v600",itau_w,
-     .zx_tmp_2d,iim*jjmp1,ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, u500,zx_tmp_2d)
-      CALL histwrite(nid_nmc,"u500",itau_w,
-     .zx_tmp_2d,iim*jjmp1,ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, v500,zx_tmp_2d)
-      CALL histwrite(nid_nmc,"v500",itau_w,
-     .zx_tmp_2d,iim*jjmp1,ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, u400,zx_tmp_2d)
-      CALL histwrite(nid_nmc,"u400",itau_w,
-     .zx_tmp_2d,iim*jjmp1,ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, v400,zx_tmp_2d)
-      CALL histwrite(nid_nmc,"v400",itau_w,
-     .zx_tmp_2d,iim*jjmp1,ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, u300,zx_tmp_2d)
-      CALL histwrite(nid_nmc,"u300",itau_w,
-     .zx_tmp_2d,iim*jjmp1,ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, v300,zx_tmp_2d)
-      CALL histwrite(nid_nmc,"v300",itau_w,
-     .zx_tmp_2d,iim*jjmp1,ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, u250,zx_tmp_2d)
-      CALL histwrite(nid_nmc,"u250",itau_w,
-     .zx_tmp_2d,iim*jjmp1,ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, v250,zx_tmp_2d)
-      CALL histwrite(nid_nmc,"v250",itau_w,
-     .zx_tmp_2d,iim*jjmp1,ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, u200,zx_tmp_2d)
-      CALL histwrite(nid_nmc,"u200",itau_w,
-     .zx_tmp_2d,iim*jjmp1,ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, v200,zx_tmp_2d)
-      CALL histwrite(nid_nmc,"v200",itau_w,
-     .zx_tmp_2d,iim*jjmp1,ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, u150,zx_tmp_2d)
-      CALL histwrite(nid_nmc,"u150",itau_w,
-     .zx_tmp_2d,iim*jjmp1,ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, v150,zx_tmp_2d)
-      CALL histwrite(nid_nmc,"v150",itau_w,
-     .zx_tmp_2d,iim*jjmp1,ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, u100,zx_tmp_2d)
-      CALL histwrite(nid_nmc,"u100",itau_w,
-     .zx_tmp_2d,iim*jjmp1,ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, v100,zx_tmp_2d)
-      CALL histwrite(nid_nmc,"v100",itau_w,
-     .zx_tmp_2d,iim*jjmp1,ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, u70,zx_tmp_2d)
-      CALL histwrite(nid_nmc,"u70",itau_w,
-     .zx_tmp_2d,iim*jjmp1,ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, v70,zx_tmp_2d)
-      CALL histwrite(nid_nmc,"v70",itau_w,
-     .zx_tmp_2d,iim*jjmp1,ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, u50,zx_tmp_2d)
-      CALL histwrite(nid_nmc,"u50",itau_w,
-     .zx_tmp_2d,iim*jjmp1,ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, v50,zx_tmp_2d)
-      CALL histwrite(nid_nmc,"v50",itau_w,
-     .zx_tmp_2d,iim*jjmp1,ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, u30,zx_tmp_2d)
-      CALL histwrite(nid_nmc,"u30",itau_w,
-     .zx_tmp_2d,iim*jjmp1,ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, v30,zx_tmp_2d)
-      CALL histwrite(nid_nmc,"v30",itau_w,
-     .zx_tmp_2d,iim*jjmp1,ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, u20,zx_tmp_2d)
-      CALL histwrite(nid_nmc,"u20",itau_w,
-     .zx_tmp_2d,iim*jjmp1,ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, v20,zx_tmp_2d)
-      CALL histwrite(nid_nmc,"v20",itau_w,
-     .zx_tmp_2d,iim*jjmp1,ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, u10,zx_tmp_2d)
-      CALL histwrite(nid_nmc,"u10",itau_w,
-     .zx_tmp_2d,iim*jjmp1,ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjmp1, v10,zx_tmp_2d)
-      CALL histwrite(nid_nmc,"v10",itau_w,
-     .zx_tmp_2d,iim*jjmp1,ndex2d)
-
       if (ok_sync) then
         call histsync(nid_nmc)
