Index: LMDZ4/trunk/libf/phylmd/ini_histrac.h
===================================================================
--- LMDZ4/trunk/libf/phylmd/ini_histrac.h	(revision 672)
+++ LMDZ4/trunk/libf/phylmd/ini_histrac.h	(revision 673)
@@ -21,5 +21,5 @@
      .                 nhori, nid_tra2)
 
-         CALL histbeg("histrac_inst", iim,zx_lon(:,1), jjm+1,zx_lat(1,:),
+         CALL histbeg("histrac_inst", iim,zx_lon, jjm+1,zx_lat,
      .                 1,iim,1,jjm+1,  itau_phy, zjulian, pdtphys,
      .                 nhori, nid_tra3)
@@ -27,8 +27,8 @@
          call histvert(nid_tra2, "presnivs", "Vertical levels", "mb",
      .                 klev, presnivs, nvert)
-
-         call histvert(nid_tra3, "presnivs", "Vertical levels", "mb",
+         call histvert(nid_tra3, "presnivs", "presnivs", "mb",
      .                 klev, presnivs, nvert)
 #endif
+
 
          zsto = pdtphys
@@ -84,4 +84,6 @@
 #ifdef INCA
 #ifdef INCAINFO
+
+#ifdef INCA_CH4
          DO it=1, phtcnt
          WRITE(str2,'(i2.2)') it
@@ -96,5 +98,4 @@
      .                "ave(X)", zsto,zout)
          ENDDO
-
          DO it=1, extcnt
          WRITE(str2,'(i2.2)') it
@@ -103,5 +104,25 @@
      .                "ave(X)", zsto,zout)
          ENDDO
-
+#endif
+#ifdef INCA_NMHC
+         DO it=1, phtcnt
+         WRITE(str2,'(i2.2)') it
+         CALL histdef(nid_tra, "j"//str2,"j"//str2, "CM-3 S-1",
+     .                iim,jjm+1,nhori, klev,1,klev,nvert, 32,
+     .                "ave(X)", zsto,zout)
+         ENDDO
+         DO it=1, hetcnt
+         WRITE(str2,'(i2.2)') it
+         CALL histdef(nid_tra, "w"//str2,"w"//str2, "S-1",
+     .                iim,jjm+1,nhori, klev,1,klev,nvert, 32,
+     .                "ave(X)", zsto,zout)
+         ENDDO
+         DO it=1, extcnt
+         WRITE(str2,'(i2.2)') it
+         CALL histdef(nid_tra, "ext"//str2,"ext"//str2, "CM-3 S-1",
+     .                iim,jjm+1,nhori, klev,1,klev,nvert, 32,
+     .                "ave(X)", zsto,zout)
+         ENDDO
+#endif
          DO it=1, nfs
          WRITE(str2,'(i2.2)') it
@@ -112,4 +133,6 @@
 
 #else
+
+#ifdef INCA_NMHC
          CALL histdef(nid_tra, "jO3","jO3", "CM-3 S-1",
      .                iim,jjm+1,nhori, klev,1,klev,nvert, 32,
@@ -131,10 +154,31 @@
      .                "ave(X)", zsto,zout)
 #endif
-
-         DO it=1, grpcnt
-         CALL histdef(nid_tra, grpsym(it), grpsym(it), "VMR",
-     .                iim,jjm+1,nhori, klev,1,klev,nvert, 32,
-     .                "ave(X)", zsto,zout)
-         ENDDO
+#ifdef INCA_CH4
+         CALL histdef(nid_tra, "jO3","jO3", "CM-3 S-1",
+     .                iim,jjm+1,nhori, klev,1,klev,nvert, 32,
+     .                "ave(X)", zsto,zout)
+         CALL histdef(nid_tra, "jNO2","jNO2", "CM-3 S-1",
+     .                iim,jjm+1,nhori, klev,1,klev,nvert, 32,
+     .                "ave(X)", zsto,zout)
+         CALL histdef(nid_tra, "jH2O2","jH2O2", "CM-3 S-1",
+     .                iim,jjm+1,nhori, klev,1,klev,nvert, 32,
+     .                "ave(X)", zsto,zout)
+         CALL histdef(nid_tra, "wHNO3","wHNO3", "S-1",
+     .                iim,jjm+1,nhori, klev,1,klev,nvert, 32,
+     .                "ave(X)", zsto,zout)
+         CALL histdef(nid_tra, "kN2O5", "kN2O5","CM-3 S-1",
+     .                iim,jjm+1,nhori, klev,1,klev,nvert, 32,
+     .                "ave(X)", zsto,zout)
+         CALL histdef(nid_tra, "LghtNO","LghtNO", "CM-3 S-1",
+     .                iim,jjm+1,nhori, klev,1,klev,nvert, 32,
+     .                "ave(X)", zsto,zout)
+#endif
+#endif
+
+!         DO it=1, grpcnt
+!         CALL histdef(nid_tra, grpsym(it), grpsym(it), "VMR",
+!     .                iim,jjm+1,nhori, klev,1,klev,nvert, 32,
+!     .                "ave(X)", zsto,zout)
+!         ENDDO
 #endif
 
@@ -159,5 +203,4 @@
 C champ 2D
 #ifdef INCA
-         IF ( prt_flag_ts(it) == 0 ) CYCLE
 
          CALL histdef(nid_tra, "Emi_"//solsym(it), "Emi_"//solsym(it),
@@ -341,4 +384,14 @@
 #endif
 
+#ifdef INCA_CH4
+         DO it=1, grpcnt
+         CALL histdef(nid_tra, grpsym(it), grpsym(it), "VMR",
+     .                iim,jjm+1,nhori, klev,1,klev,nvert, 32,
+     .                "ave(X)", zsto,zout)
+         ENDDO
+
+#endif
+
+
 #ifdef INCA_NMHC
          CALL histdef(nid_tra, "CO2_basprod", "CO2_basprod", "CM-3 S-1",
@@ -363,4 +416,12 @@
      .                iim,jjm+1,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zsto,zout)
+
+         DO it=1, grpcnt
+         CALL histdef(nid_tra, grpsym(it), grpsym(it), "VMR",
+     .                iim,jjm+1,nhori, klev,1,klev,nvert, 32,
+     .                "ave(X)", zsto,zout)
+         ENDDO
+
+
 #endif
 ! Fin ajout Anne
Index: LMDZ4/trunk/libf/phylmd/phytrac.F
===================================================================
--- LMDZ4/trunk/libf/phylmd/phytrac.F	(revision 672)
+++ LMDZ4/trunk/libf/phylmd/phytrac.F	(revision 673)
@@ -69,8 +69,14 @@
       USE species_names
       USE chem_mods
+#ifdef INCA_NMHC
       USE pht_tables, ONLY : jrates
+      USE lightning, ONLY : prod_light
+#endif
+#ifdef INCA_CH4
+      USE pht_tables, ONLY : jrates
+      USE lightning, ONLY : prod_light
+#endif
       USE transport_controls, ONLY : conv_flg, pbl_flg
       USE airplane_src, ONLY : ptrop
-      USE lightning, ONLY : prod_light
 #ifdef INCA_AER
       USE AEROSOL_MOD, only : ntr,trmx,trnx
@@ -340,32 +346,4 @@
       INTEGER           :: ncsec
 
-      INTEGER           :: prt_flag_ts(nbtr)=(/1,1,1
-#ifdef INCA_CH4
-     .                                              ,0,0,1,1,1,1,1,
-     .                                         0,1,0,0,0,0,0,1,0,0,
-     .                                         0,1,1,1,1,0,1,1,1,0,
-     .                                         1,1,1,1,1,1,1,1,1,1,
-     .                                         1,0,0
-#endif
-#ifdef INCA_NMHC
-     .                                                 , 1, 1, 1, 1, 1, 1, 1,
-     .                                          1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-     .                                          1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-     .                                          1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-     .                                          1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-     .                                          1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-     .                                          1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-     .                                          1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-     .                                          1, 1, 1, 1, 1, 1, 1
-#endif
-#ifdef INCA_AER
-     .                                         ,1,1,1,1,0,1,1,1
-#endif
-#ifdef INCA_AER
-c aerosol tracers
-     .                                        ,1,0,1,1,1,1,1,1,0,1,
-     .                                         0,1,1,1,1,1,0,1,0,1,1,1
-#endif
-     .                                         /)
 
 
Index: LMDZ4/trunk/libf/phylmd/write_histrac.h
===================================================================
--- LMDZ4/trunk/libf/phylmd/write_histrac.h	(revision 672)
+++ LMDZ4/trunk/libf/phylmd/write_histrac.h	(revision 673)
@@ -63,4 +63,5 @@
 #ifdef INCA
 #ifdef INCAINFO
+#ifdef INCA_NMHC
       DO it=1, phtcnt
       WRITE(str2,'(i2.2)') it
@@ -86,4 +87,30 @@
      .                                   iim*(jjm+1)*klev,ndex3d)
       ENDDO
+#endif
+#ifdef INCA_CH4
+       DO it=1, phtcnt
+      WRITE(str2,'(i2.2)') it
+      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,jrates(1,1,it),
+     .     zx_tmp_3d)
+      CALL histwrite(nid_tra,"j"//str2,itau_w,zx_tmp_3d,
+     .                                   iim*(jjm+1)*klev,ndex3d)
+      ENDDO
+
+      DO it=1, hetcnt
+      WRITE(str2,'(i2.2)') it
+      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,hrates(1,1,it),
+     .     zx_tmp_3d)
+      CALL histwrite(nid_tra,"w"//str2,itau_w,zx_tmp_3d,
+     .                                   iim*(jjm+1)*klev,ndex3d)
+      ENDDO
+
+      DO it=1, extcnt
+      WRITE(str2,'(i2.2)') it
+      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,extflx(1,1,it),
+     .     zx_tmp_3d)
+      CALL histwrite(nid_tra,"ext"//str2,itau_w,zx_tmp_3d,
+     .                                   iim*(jjm+1)*klev,ndex3d)
+      ENDDO
+#endif
 
       DO it=1, nfs
@@ -95,4 +122,5 @@
       ENDDO
 #else
+#ifdef INCA_NMHC
       CALL gr_fi_ecrit(klev,klon,iim,jjm+1,jrates(1,1,2),
      .     zx_tmp_3d)
@@ -125,11 +153,42 @@
      .                                   iim*(jjm+1)*klev,ndex3d)
 #endif
-      DO it=1, grpcnt
-
-      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,nas(1,1,it),zx_tmp_3d)
-      zx_tmp_3d = zx_tmp_3d * dry_mass / nadv_mass(it)
-      CALL histwrite(nid_tra,grpsym(it),itau_w,zx_tmp_3d,
-     .                                   iim*(jjm+1)*klev,ndex3d)
-      ENDDO
+#ifdef INCA_CH4
+      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,jrates(1,1,2),
+     .     zx_tmp_3d)
+      CALL histwrite(nid_tra,"jO3",itau_w,zx_tmp_3d,
+     .                                   iim*(jjm+1)*klev,ndex3d)
+
+      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,jrates(1,1,4),
+     .     zx_tmp_3d)
+      CALL histwrite(nid_tra,"jNO2",itau_w,zx_tmp_3d,
+     .                                   iim*(jjm+1)*klev,ndex3d)
+
+      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,jrates(1,1,13),
+     .     zx_tmp_3d)
+      CALL histwrite(nid_tra,"jH2O2",itau_w,zx_tmp_3d,
+     .                                   iim*(jjm+1)*klev,ndex3d)
+
+      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,hrates(1,1,1),
+     .     zx_tmp_3d)
+      CALL histwrite(nid_tra,"wHNO3",itau_w,zx_tmp_3d,
+     .                                   iim*(jjm+1)*klev,ndex3d)
+
+      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,krates(1,1,1),
+     .     zx_tmp_3d)
+      CALL histwrite(nid_tra,"kN2O5",itau_w,zx_tmp_3d,
+     .                                   iim*(jjm+1)*klev,ndex3d)
+      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,extflx(1,1,1),
+     .     zx_tmp_3d)
+      CALL histwrite(nid_tra,"LghtNO",itau_w,zx_tmp_3d,
+     .                                   iim*(jjm+1)*klev,ndex3d)
+#endif
+#endif
+!      DO it=1, grpcnt
+!
+!      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,nas(1,1,it),zx_tmp_3d)
+!      zx_tmp_3d = zx_tmp_3d * dry_mass / nadv_mass(it)
+!      CALL histwrite(nid_tra,grpsym(it),itau_w,zx_tmp_3d,
+!     .                                   iim*(jjm+1)*klev,ndex3d)
+!      ENDDO
 #endif
 
@@ -160,5 +219,5 @@
 C champs 2D
 #ifdef INCA
-      IF ( prt_flag_ts(it) == 0 ) CYCLE
+
       CALL gr_fi_ecrit(1, klon,iim,jjm+1, eflux(1,it),zx_tmp_2d)
       CALL histwrite(nid_tra,"Emi_"//solsym(it),itau_w,zx_tmp_2d,
@@ -229,5 +288,10 @@
 #endif
        else
-#ifdef INCA
+#ifdef INCA_CH4
+       if ( solsym(it) == 'OX' ) then
+       zx_tmp_3d = zx_tmp_3d * dry_mass / nadv_mass(id_o3)
+       end if
+#endif
+#ifdef INCA_NMHC
        if ( solsym(it) == 'OX' ) then
        zx_tmp_3d = zx_tmp_3d * dry_mass / nadv_mass(id_o3)
@@ -364,4 +428,16 @@
 #endif
 
+#ifdef INCA_CH4
+      DO it=1, grpcnt
+
+      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,nas(1,1,it),zx_tmp_3d)
+      zx_tmp_3d = zx_tmp_3d * dry_mass / nadv_mass(it)
+      CALL histwrite(nid_tra,grpsym(it),itau_w,zx_tmp_3d,
+     .                                   iim*(jjm+1)*klev,ndex3d)
+      ENDDO
+
+#endif
+
+
 #ifdef INCA_NMHC
       CALL gr_fi_ecrit(klev,klon,iim,jjm+1,CO2_basprod(1,1),
@@ -399,4 +475,13 @@
       CALL histwrite(nid_tra,"CO_loss",itau_w,zx_tmp_3d,
      .                                   iim*(jjm+1)*klev,ndex)
+
+      DO it=1, grpcnt
+
+      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,nas(1,1,it),zx_tmp_3d)
+      zx_tmp_3d = zx_tmp_3d * dry_mass / nadv_mass(it)
+      CALL histwrite(nid_tra,grpsym(it),itau_w,zx_tmp_3d,
+     .                                   iim*(jjm+1)*klev,ndex3d)
+      ENDDO
+
 
 #endif
