Index: /LMDZ4/trunk/libf/phylmd/ini_histmth.h
===================================================================
--- /LMDZ4/trunk/libf/phylmd/ini_histmth.h	(revision 652)
+++ /LMDZ4/trunk/libf/phylmd/ini_histmth.h	(revision 653)
@@ -1392,4 +1392,8 @@
      .                "ave(X)", zstophy,zout)
 c
+         CALL histdef(nid_mth, "upwd", "saturated updraft", "kg/m2/s",
+     .                iim,jjmp1,nhori, klev,1,klev,nvert, 32,
+     .                "ave(X)", zstophy,zout)
+c
       ENDIF !iflag_con .GE. 3
 c34EK
@@ -1578,8 +1582,4 @@
      .                "ave(X)", zstophy,zout)
 c
-         CALL histdef(nid_mth, "upwd", "saturated updraft", "kg/m2/s",
-     .                iim,jjmp1,nhori, klev,1,klev,nvert, 32,
-     .                "ave(X)", zstophy,zout)
-c
          CALL histdef(nid_mth, "dtphy", "Physics dT", "K/s",
      .                iim,jjmp1,nhori, klev,1,klev,nvert, 32,
@@ -1740,17 +1740,12 @@
 C
          if (nqmax.GE.3) THEN
-         DO iq=1,nqmax-2
-         IF (iq.LE.99) THEN
-         WRITE(str2,'(i2.2)') iq
-         CALL histdef(nid_mth, "trac"//str2, "Tracer No."//str2, "-",
-     .                iim,jjmp1,nhori, klev,1,klev,nvert, 32,
-     .                "ave(X)", zstophy,zout)
-         ELSE
-         PRINT*, "Trop de traceurs"
-         CALL abort
-         ENDIF
+         DO iq=3,nqmax
+         iiq=niadv(iq)
+         CALL histdef(nid_mth, tnom(iq), ttext(iiq), "-",
+     .                iim,jjmp1,nhori, klev,1,klev,nvert, 32,
+     .                "ave(X)", zstophy,zout)
          ENDDO
          ENDIF
-c
+
       ENDIF !lev_histmth.GE.4
 c
Index: /LMDZ4/trunk/libf/phylmd/write_histmth.h
===================================================================
--- /LMDZ4/trunk/libf/phylmd/write_histmth.h	(revision 652)
+++ /LMDZ4/trunk/libf/phylmd/write_histmth.h	(revision 653)
@@ -719,12 +719,10 @@
      .                                   iim*jjmp1*klev,ndex3d)
 c
+      IF (iflag_con.GE.3) THEN
+c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, Ma, zx_tmp_3d)
       CALL histwrite(nid_mth,"Ma",itau_w,zx_tmp_3d,
      .                                   iim*jjmp1*klev,ndex3d)
 c
-      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, upwd, zx_tmp_3d)
-      CALL histwrite(nid_mth,"upwd",itau_w,zx_tmp_3d,
-     .                                   iim*jjmp1*klev,ndex3d)
-c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, dnwd, zx_tmp_3d)
       CALL histwrite(nid_mth,"dnwd",itau_w,zx_tmp_3d,
@@ -735,4 +733,5 @@
      .                                   iim*jjmp1*klev,ndex3d)
 c
+      ENDIF !iflag_con.GE.3
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_t_dyn, zx_tmp_3d)
@@ -881,14 +880,8 @@
 C
       IF (nqmax.GE.3) THEN
-      DO iq=1,nqmax-2
-      IF (iq.LE.99) THEN
-         CALL gr_fi_ecrit(klev,klon,iim,jjmp1, qx(1,1,iq+2), zx_tmp_3d)
-         WRITE(str2,'(i2.2)') iq
-         CALL histwrite(nid_mth,"trac"//str2,itau_w,zx_tmp_3d,
-     .                                   iim*jjmp1*klev,ndex3d)
-      ELSE
-         PRINT*, "Trop de traceurs"
-         CALL abort
-      ENDIF
+      DO iq=3,nqmax
+         CALL gr_fi_ecrit(klev,klon,iim,jjmp1, qx(1,1,iq), zx_tmp_3d)
+         CALL histwrite(nid_mth,tnom(iq),itau_w,zx_tmp_3d,
+     .                                   iim*jjmp1*klev,ndex3d)
       ENDDO
       ENDIF
@@ -1798,4 +1791,6 @@
      .                                   iim*jjmp1*klev,ndex3d)
 c
+      IF (iflag_con.GE.3) THEN
+c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, Ma, zx_tmp_3d)
       CALL histwrite(nid_mth,"Ma",itau_w,zx_tmp_3d,
@@ -1814,4 +1809,5 @@
      .                                   iim*jjmp1*klev,ndex3d)
 c
+      ENDIF !iflag_con.GE.3
 c
       CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_t_dyn, zx_tmp_3d)
@@ -1945,14 +1941,8 @@
 C
       IF (nqmax.GE.3) THEN
-      DO iq=1,nqmax-2
-      IF (iq.LE.99) THEN
-         CALL gr_fi_ecrit(klev,klon,iim,jjmp1, qx(1,1,iq+2), zx_tmp_3d)
-         WRITE(str2,'(i2.2)') iq
-         CALL histwrite(nid_mth,"trac"//str2,itau_w,zx_tmp_3d,
-     .                                   iim*jjmp1*klev,ndex3d)
-      ELSE
-         PRINT*, "Trop de traceurs"
-         CALL abort
-      ENDIF
+      DO iq=3,nqmax
+         CALL gr_fi_ecrit(klev,klon,iim,jjmp1, qx(1,1,iq), zx_tmp_3d)
+         CALL histwrite(nid_mth,tnom(iq),itau_w,zx_tmp_3d,
+     .                                   iim*jjmp1*klev,ndex3d)
       ENDDO
       ENDIF
