Index: LMDZ4/branches/LMDZ4V5.0-dev/libf/phylmd/ini_histmthNMC.h
===================================================================
--- LMDZ4/branches/LMDZ4V5.0-dev/libf/phylmd/ini_histmthNMC.h	(revision 1299)
+++ LMDZ4/branches/LMDZ4V5.0-dev/libf/phylmd/ini_histmthNMC.h	(revision 1350)
@@ -2,15 +2,11 @@
 ! $Id$
 !
-      IF (ok_mensuel) THEN
-c
 c$OMP MASTER
 
-       zstophy = dtime
-       zstohf = ecrit_hf
-       zstomth = ecrit_mth
-       zout = ecrit_mth
 c
-         idayref = day_ref
-         CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian)
+       zout = freq_outNMC(1)
+c
+       idayref = day_ref
+       CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian)
 c
 cym         CALL gr_fi_ecrit(1,klon,iim,jjmp1,rlon,zx_lon)
@@ -25,109 +21,74 @@
 cym         CALL histbeg("histNMC.nc", iim,zx_lon(:,1), jjmp1,zx_lat(1,:),
 cym     .                 1,iim,1,jjmp1, itau_phy, zjulian, dtime, 
-cym     .                 nhori, nid_nmc)
+cym     .                 nhori, nid_mthnmc)
 
-         CALL histbeg_phy("histNMC",itau_phy, zjulian, dtime, 
-     .                 nhori, nid_nmc)
+         CALL histbeg_phy("histmthNMC",itau_phy, zjulian, dtime, 
+     .                 nhori, nid_mthnmc)
 c
-         CALL histvert(nid_nmc, "presnivs", "Vertical levels", "mb",
-     .                 nlevSTD, rlevSTD/100., nvert)
+         CALL histvert(nid_mthnmc, "plev", "pressure", "Pa",
+     .                 nlevSTD, rlevSTD, nvert)
 ccc
 ccc Champs 3D interpolles sur des niveaux de pression du NMC
 ccc
-      IF(type_run.EQ."ENSP".OR.type_run.EQ."CLIM") THEN
 c
-          CALL histdef(nid_nmc, "temp",
-     .                 "Temperature","K",
+c ATTENTION : pour AMIP2 on interpole t,u,v,wphi,q,rh
+c             sur les niveaux du NMC et on somme & moyenne
+c             toutes les freq_moyNMC secondes par des routines undefSTD et
+c             moy_undefSTD pour eliminer les valeurs "undef"
+c             de la moyenne mensuelle
+c ======> le "inst(X)" ci-dessous est par consequence factice !
+c
+c
+          CALL histdef(nid_mthnmc, "tnondef",
+     .                 "Valeurs non-definies","-",
      .                iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
      .                "inst(X)", zout,zout)
 c
-         CALL histdef(nid_nmc, "phi",
-     .                "Geopotential", "m",
+          CALL histdef(nid_mthnmc, "ta",
+     .                 "Air temperature","K",
      .                iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
      .                "inst(X)", zout,zout)
 c
-          CALL histdef(nid_nmc, "q",
-     .                 "Specific humidity","kg/kg",
+         CALL histdef(nid_mthnmc, "zg",
+     .                "Geopotential height", "m",
      .                iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
      .                "inst(X)", zout,zout)
 c
-         CALL histdef(nid_nmc, "rh",
+          CALL histdef(nid_mthnmc, "hus",
+     .                 "Specific humidity","1",
+     .                iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
+     .                "inst(X)", zout,zout)
+c
+         CALL histdef(nid_mthnmc, "hur",
      .                 "Relative humidity", "%",
      .                iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
      .                "inst(X)", zout,zout)
 c
-          CALL histdef(nid_nmc, "u",
-     .                 "Zonal wind","m/s",
+          CALL histdef(nid_mthnmc, "ua",
+     .                 "Eastward wind","m s-1",
      .                iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
      .                "inst(X)", zout,zout)
 c
-          CALL histdef(nid_nmc, "v",
-     .                 "Meridional wind","m/s",
+          CALL histdef(nid_mthnmc, "va",
+     .                 "Northward wind","m s-1",
      .                iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
      .                "inst(X)", zout,zout)
 c
-      ELSE IF(type_run.EQ."AMIP".OR.type_run.EQ."CFMI") THEN
-c
-c ATTENTION : pour AMIP2 on interpole t,u,v,wphi,q,rh
-c             sur les niveaux du NMC et on somme & moyenne
-c             toutes les 6 heures par des routines undefSTD et
-c             moy_undefSTD pour eliminer les valeurs "undef"
-c             de la moyenne mensuelle
-c ======> le "inst(X)" ci-dessous est par consequence factice !
-c
-          CALL histdef(nid_nmc, "temp",
-     .                 "Temperature","K",
+          CALL histdef(nid_mthnmc, "wap",
+     .                 "Lagrangian tendency of air pressure","Pa s-1",
      .                iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
      .                "inst(X)", zout,zout)
 c
-         CALL histdef(nid_nmc, "phi",
-     .                "Geopotential ", "m",
-     .                iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
-     .                "inst(X)", zout,zout)
-c
-          CALL histdef(nid_nmc, "q",
-     .                 "Specific humidity","kg/kg",
-     .                iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
-     .                "inst(X)", zout,zout)
-c
-         CALL histdef(nid_nmc, "rh",
-     .                 "Relative humidity", "%",
-     .                iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
-     .                "inst(X)", zout,zout)
-c
-          CALL histdef(nid_nmc, "u",
-     .                 "Zonal wind","m/s",
-     .                iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
-     .                "inst(X)", zout,zout)
-c
-          CALL histdef(nid_nmc, "v",
-     .                 "Meridional wind","m/s",
-     .                iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
-     .                "inst(X)", zout,zout)
-c
-          CALL histdef(nid_nmc, "w",
-     .                 "Vertical motion","Pa/s",
-     .                iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
-     .                "inst(X)", zout,zout)
-c
-c ATTENTION : pour AMIP2 on interpole t,u,v,wphi,q,rh
-c             sur les niveaux du NMC et on somme & moyenne
-c             toutes les 6 heures par des routines undefSTD et
-c             moy_undefSTD pour eliminer les valeurs "undef"
-c             de la moyenne mensuelle
-c ======> le "inst(X)" ci-dessus est par consequence factice !
-c
-c
-          CALL histdef(nid_nmc, "psbg",
+          CALL histdef(nid_mthnmc, "psbg",
      .         "Pressure sfce below ground","%",
      .         iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
      .         "inst(X)", zout,zout)
 c
-          CALL histdef(nid_nmc, "uv",
+          CALL histdef(nid_mthnmc, "uv",
      .         "uv ",
      .         "m2/s2",iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
      .         "inst(X)", zout,zout)
 c
-          CALL histdef(nid_nmc, "vq",
+          CALL histdef(nid_mthnmc, "vq",
      .         "vq ",
      .         "m/s * (kg/kg)",iim,jj_nb,nhori, 
@@ -135,5 +96,5 @@
      .         "inst(X)", zout,zout)
 c
-          CALL histdef(nid_nmc, "vT",
+          CALL histdef(nid_mthnmc, "vT",
      .         "vT ", 
      .         "mK/s",iim,jj_nb,nhori, 
@@ -141,5 +102,5 @@
      .         "inst(X)", zout,zout)
 c
-          CALL histdef(nid_nmc, "wq",
+          CALL histdef(nid_mthnmc, "wq",
      .         "wq ", 
      .         "(Pa/s)*(kg/kg)",iim,jj_nb,nhori,
@@ -147,5 +108,5 @@
      .         "inst(X)", zout,zout)
 c
-          CALL histdef(nid_nmc, "vphi",
+          CALL histdef(nid_mthnmc, "vphi",
      .         "vphi ", 
      .         "m2/s",iim,jj_nb,nhori, 
@@ -153,5 +114,5 @@
      .         "inst(X)", zout,zout)
 c
-          CALL histdef(nid_nmc, "wT",
+          CALL histdef(nid_mthnmc, "wT",
      .         "wT ", 
      .         "K*Pa/s",iim,jj_nb,nhori,
@@ -159,5 +120,5 @@
      .         "inst(X)", zout,zout)
 c
-          CALL histdef(nid_nmc, "uxu",
+          CALL histdef(nid_mthnmc, "uxu",
      .         "u2 ", 
      .         "m2/s2",iim,jj_nb,nhori,
@@ -165,5 +126,5 @@
      .         "inst(X)", zout,zout)
 c
-          CALL histdef(nid_nmc, "vxv",
+          CALL histdef(nid_mthnmc, "vxv",
      .         "v2 ", 
      .         "m2/s2",iim,jj_nb,nhori,
@@ -171,5 +132,5 @@
      .         "inst(X)", zout,zout)
 c
-          CALL histdef(nid_nmc, "TxT",
+          CALL histdef(nid_mthnmc, "TxT",
      .         "T2 ", 
      .         "K2",iim,jj_nb,nhori,
@@ -177,9 +138,6 @@
      .         "inst(X)", zout,zout)
 c
-      ENDIF !(type_run.EQ."AMIP")
 
-         CALL histend(nid_nmc)
+         CALL histend(nid_mthnmc)
 c
 c$OMP END MASTER
-
-      ENDIF ! fin de test sur ok_mensuel
