Index: /LMDZ6/trunk/libf/phylmd/phys_output_write_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/phys_output_write_mod.F90	(revision 3549)
+++ /LMDZ6/trunk/libf/phylmd/phys_output_write_mod.F90	(revision 3550)
@@ -2234,7 +2234,6 @@
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        IF (iflag_phytrac == 1 ) then
-       IF (nqtot.GE.nqo+1) THEN
-          DO iq=nqo+1, nqtot
-            IF (type_trac == 'lmdz' .OR. type_trac == 'repr' .OR. type_trac == 'coag') THEN
+         IF (type_trac == 'lmdz' .OR. type_trac == 'repr' .OR. type_trac == 'coag') THEN
+           DO iq=nqo+1, nqtot
              !--3D fields
              CALL histwrite_phy(o_trac(iq-nqo), tr_seri(:,:,iq-nqo))
@@ -2263,7 +2262,9 @@
              CALL histwrite_phy(o_trac_cum(iq-nqo), zx_tmp_fi2d)
 #endif
-            ENDIF   !--type_trac
+           ENDDO !--iq
+         ENDIF   !--type_trac
 !
-            IF (type_trac == 'co2i') THEN
+         IF (type_trac == 'co2i') THEN
+           DO iq=nqo+1, nqtot
              !--3D fields
              CALL histwrite_phy(o_trac(iq-nqo), tr_seri(:,:,iq-nqo))
@@ -2280,15 +2281,13 @@
              ENDIF
              CALL histwrite_phy(o_trac_cum(iq-nqo), zx_tmp_fi2d)
-             !--CO2 net fluxes
-             CALL histwrite_phy(o_flx_co2_land,  fco2_land)
-             CALL histwrite_phy(o_flx_co2_ocean, fco2_ocean)
-             CALL histwrite_phy(o_flx_co2_ff,    fco2_ff)
-             CALL histwrite_phy(o_flx_co2_bb,    fco2_bb)
-            ENDIF !--type_trac co2i
-
-          ENDDO !--iq
-       ENDIF !--nqtot > nqo+1
-
-       IF (type_trac == 'repr') THEN
+           ENDDO !--iq
+           !--CO2 net fluxes
+           CALL histwrite_phy(o_flx_co2_land,  fco2_land)
+           CALL histwrite_phy(o_flx_co2_ocean, fco2_ocean)
+           CALL histwrite_phy(o_flx_co2_ff,    fco2_ff)
+           CALL histwrite_phy(o_flx_co2_bb,    fco2_bb)
+         ENDIF !--type_trac co2i
+
+         IF (type_trac == 'repr') THEN
 #ifdef REPROBUS
            DO iq=1,nbnas
@@ -2296,5 +2295,5 @@
            ENDDO
 #endif
-       ENDIF
+         ENDIF
 
        ENDIF   !(iflag_phytrac==1)
