Index: /LMDZ6/trunk/DefLists/file_def_histmth_lmdz.xml
===================================================================
--- /LMDZ6/trunk/DefLists/file_def_histmth_lmdz.xml	(revision 3238)
+++ /LMDZ6/trunk/DefLists/file_def_histmth_lmdz.xml	(revision 3239)
@@ -367,43 +367,43 @@
                 <field field_ref="z0m" level="10" />
                 <field field_ref="z0h" level="10" />
-                <field field_ref="topswad" level="5" />
-                <field field_ref="topswad0" level="5" />
-                <field field_ref="topswai" level="5" />
-                <field field_ref="solswad" level="5" />
-                <field field_ref="solswad0" level="5" />
-                <field field_ref="solswai" level="5" />
-                <field field_ref="toplwad" level="5" />
-                <field field_ref="toplwad0" level="5" />
-                <field field_ref="toplwai" level="5" />
-                <field field_ref="sollwad" level="5" />
-                <field field_ref="sollwad0" level="5" />
-                <field field_ref="sollwai" level="5" />
-                <field field_ref="od550_ASBCM" level="2" />
-                <field field_ref="od550_ASPOMM" level="2" />
-                <field field_ref="od550_ASSO4M" level="2" />
-                <field field_ref="od550_CSSO4M" level="2" />
-                <field field_ref="od550_SSSSM" level="2" />
-                <field field_ref="od550_ASSSM" level="2" />
-                <field field_ref="od550_CSSSM" level="2" />
-                <field field_ref="od550_CIDUSTM" level="2" />
-                <field field_ref="od550_AIBCM" level="2" />
-                <field field_ref="od550_AIPOMM" level="2" />
-                <field field_ref="od550_ASNO3M" level="2" />
-                <field field_ref="od550_CSNO3M" level="2" />
-                <field field_ref="od550_CINO3M" level="2" />
-                <field field_ref="od550_STRAT" level="2" />
-                <field field_ref="dryod550_ASBCM" level="2" />
-                <field field_ref="dryod550_ASPOMM" level="2" />
-                <field field_ref="dryod550_ASSO4M" level="2" />
-                <field field_ref="dryod550_CSSO4M" level="2" />
-                <field field_ref="dryod550_SSSSM" level="2" />
-                <field field_ref="dryod550_ASSSM" level="2" />
-                <field field_ref="dryod550_CSSSM" level="2" />
-                <field field_ref="dryod550_CIDUSTM" level="2" />
-                <field field_ref="dryod550_AIBCM" level="2" />
-                <field field_ref="dryod550_AIPOMM" level="2" />
-                <field field_ref="dryod550_ASNO3M" level="2" />
-                <field field_ref="dryod550_CSNO3M" level="2" />
-                <field field_ref="dryod550_CINO3M" level="2" />
+                <field field_ref="topswad" level="10" />
+                <field field_ref="topswad0" level="10" />
+                <field field_ref="topswai" level="10" />
+                <field field_ref="solswad" level="10" />
+                <field field_ref="solswad0" level="10" />
+                <field field_ref="solswai" level="10" />
+                <field field_ref="toplwad" level="10" />
+                <field field_ref="toplwad0" level="10" />
+                <field field_ref="toplwai" level="10" />
+                <field field_ref="sollwad" level="10" />
+                <field field_ref="sollwad0" level="10" />
+                <field field_ref="sollwai" level="10" />
+                <field field_ref="od550_ASBCM" level="7" />
+                <field field_ref="od550_ASPOMM" level="7" />
+                <field field_ref="od550_ASSO4M" level="7" />
+                <field field_ref="od550_CSSO4M" level="7" />
+                <field field_ref="od550_SSSSM" level="7" />
+                <field field_ref="od550_ASSSM" level="7" />
+                <field field_ref="od550_CSSSM" level="7" />
+                <field field_ref="od550_CIDUSTM" level="7" />
+                <field field_ref="od550_AIBCM" level="7" />
+                <field field_ref="od550_AIPOMM" level="7" />
+                <field field_ref="od550_ASNO3M" level="7" />
+                <field field_ref="od550_CSNO3M" level="7" />
+                <field field_ref="od550_CINO3M" level="7" />
+                <field field_ref="od550_STRAT" level="7" />
+                <field field_ref="dryod550_ASBCM" level="7" />
+                <field field_ref="dryod550_ASPOMM" level="7" />
+                <field field_ref="dryod550_ASSO4M" level="7" />
+                <field field_ref="dryod550_CSSO4M" level="7" />
+                <field field_ref="dryod550_SSSSM" level="7" />
+                <field field_ref="dryod550_ASSSM" level="7" />
+                <field field_ref="dryod550_CSSSM" level="7" />
+                <field field_ref="dryod550_CIDUSTM" level="7" />
+                <field field_ref="dryod550_AIBCM" level="7" />
+                <field field_ref="dryod550_AIPOMM" level="7" />
+                <field field_ref="dryod550_ASNO3M" level="7" />
+                <field field_ref="dryod550_CSNO3M" level="7" />
+                <field field_ref="dryod550_CINO3M" level="7" />
                 <field field_ref="od550aer" level="2" />
                 <field field_ref="dryod550aer" level="2" />
@@ -481,8 +481,8 @@
                 <field field_ref="f0_th" level="4" />
                 <field field_ref="zmax_th" level="4" />
-                <field field_ref="rsut4co2" level="5" />
-                <field field_ref="rlut4co2" level="5" />
-                <field field_ref="rsutcs4co2" level="5" />
-                <field field_ref="rlutcs4co2" level="5" />
+                <field field_ref="rsut4co2" level="10" />
+                <field field_ref="rlut4co2" level="10" />
+                <field field_ref="rsutcs4co2" level="10" />
+                <field field_ref="rlutcs4co2" level="10" />
                 <field field_ref="dqphy2d" level="2" />
                 <field field_ref="dqlphy2d" level="2" />
@@ -663,12 +663,12 @@
                 <field field_ref="ref_liq" level="4" />
                 <field field_ref="ref_ice" level="4" />
-                <field field_ref="rsu4co2" level="5" />
-                <field field_ref="rlu4co2" level="5" />
-                <field field_ref="rsucs4co2" level="5" />
-                <field field_ref="rlucs4co2" level="5" />
-                <field field_ref="rsd4co2" level="5" />
-                <field field_ref="rld4co2" level="5" />
-                <field field_ref="rsdcs4co2" level="5" />
-                <field field_ref="rldcs4co2" level="5" />
+                <field field_ref="rsu4co2" level="10" />
+                <field field_ref="rlu4co2" level="10" />
+                <field field_ref="rsucs4co2" level="10" />
+                <field field_ref="rlucs4co2" level="10" />
+                <field field_ref="rsd4co2" level="10" />
+                <field field_ref="rld4co2" level="10" />
+                <field field_ref="rsdcs4co2" level="10" />
+                <field field_ref="rldcs4co2" level="10" />
             </field_group>
 
Index: /LMDZ6/trunk/libf/phylmd/physiq_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/physiq_mod.F90	(revision 3238)
+++ /LMDZ6/trunk/libf/phylmd/physiq_mod.F90	(revision 3239)
@@ -1657,34 +1657,4 @@
 
 #ifdef CPP_XIOS 
-       !--setting up swaero_diag to TRUE in XIOS case 
-       IF (xios_field_is_active("topswad").OR.xios_field_is_active("topswad0").OR. & 
-           xios_field_is_active("solswad").OR.xios_field_is_active("solswad0").OR. & 
-           xios_field_is_active("topswai").OR.xios_field_is_active("solswai").OR.  & 
-             (iflag_rrtm==1.AND.(xios_field_is_active("toplwad").OR.xios_field_is_active("toplwad0").OR. & 
-                                 xios_field_is_active("sollwad").OR.xios_field_is_active("sollwad0"))))  & 
-           !!!--for now these fields are not in the XML files so they are omitted 
-           !!!  xios_field_is_active("toplwai").OR.xios_field_is_active("sollwai") !))) & 
-           swaero_diag=.TRUE. 
-
-       !--setting up swaerofree_diag to TRUE in XIOS case 
-       IF (xios_field_is_active("SWdnSFCcleanclr").OR.xios_field_is_active("SWupSFCcleanclr").OR. &
-           xios_field_is_active("SWupTOAcleanclr").OR.xios_field_is_active("rsucsaf").OR.   &
-           xios_field_is_active("rsdcsaf") .OR. xios_field_is_active("LWdnSFCcleanclr").OR. &
-           xios_field_is_active("LWupTOAcleanclr")) &
-           swaerofree_diag=.TRUE. 
-
-       !--setting up dryaod_diag to TRUE in XIOS case 
-       DO naero = 1, naero_tot-1
-         IF (xios_field_is_active("dryod550_"//name_aero_tau(naero))) dryaod_diag=.TRUE. 
-       ENDDO
-       !
-       !--setting up ok_4xCO2atm to TRUE in XIOS case 
-       IF (xios_field_is_active("rsut4co2").OR.xios_field_is_active("rlut4co2").OR. & 
-           xios_field_is_active("rsutcs4co2").OR.xios_field_is_active("rlutcs4co2").OR. &
-           xios_field_is_active("rsu4co2").OR.xios_field_is_active("rsucs4co2").OR. &
-           xios_field_is_active("rsd4co2").OR.xios_field_is_active("rsdcs4co2").OR. &
-           xios_field_is_active("rlu4co2").OR.xios_field_is_active("rlucs4co2").OR. &
-           xios_field_is_active("rld4co2").OR.xios_field_is_active("rldcs4co2")) &
-           ok_4xCO2atm=.TRUE. 
 ! Need to put this initialisation after phyetat0 as in the coupled model the XIOS context is only
 ! initialised at that moment
@@ -4848,4 +4818,46 @@
 #endif
 
+! On remet des variables a .false. apres un premier appel
+    if (debut) then
+#ifdef CPP_XIOS
+      swaero_diag=.FALSE.
+      swaerofree_diag=.FALSE.
+      dryaod_diag=.FALSE.
+      ok_4xCO2atm= .FALSE.
+      if (is_master) write (lunout,*)'ok_4xCO2atm= ',swaero_diag, swaerofree_diag, dryaod_diag, ok_4xCO2atm
+
+       !--setting up swaero_diag to TRUE in XIOS case 
+       IF (xios_field_is_active("topswad").OR.xios_field_is_active("topswad0").OR. & 
+           xios_field_is_active("solswad").OR.xios_field_is_active("solswad0").OR. & 
+           xios_field_is_active("topswai").OR.xios_field_is_active("solswai").OR.  & 
+             (iflag_rrtm==1.AND.(xios_field_is_active("toplwad").OR.xios_field_is_active("toplwad0").OR. & 
+                                 xios_field_is_active("sollwad").OR.xios_field_is_active("sollwad0"))))  & 
+           !!!--for now these fields are not in the XML files so they are omitted 
+           !!!  xios_field_is_active("toplwai").OR.xios_field_is_active("sollwai") !))) & 
+           swaero_diag=.TRUE. 
+
+       !--setting up swaerofree_diag to TRUE in XIOS case 
+       IF (xios_field_is_active("SWdnSFCcleanclr").OR.xios_field_is_active("SWupSFCcleanclr").OR. &
+           xios_field_is_active("SWupTOAcleanclr").OR.xios_field_is_active("rsucsaf").OR.   &
+           xios_field_is_active("rsdcsaf") .OR. xios_field_is_active("LWdnSFCcleanclr").OR. &
+           xios_field_is_active("LWupTOAcleanclr")) &
+           swaerofree_diag=.TRUE. 
+
+       !--setting up dryaod_diag to TRUE in XIOS case 
+       DO naero = 1, naero_tot-1
+         IF (xios_field_is_active("dryod550_"//name_aero_tau(naero))) dryaod_diag=.TRUE. 
+       ENDDO
+       !
+       !--setting up ok_4xCO2atm to TRUE in XIOS case 
+       IF (xios_field_is_active("rsut4co2").OR.xios_field_is_active("rlut4co2").OR. & 
+           xios_field_is_active("rsutcs4co2").OR.xios_field_is_active("rlutcs4co2").OR. &
+           xios_field_is_active("rsu4co2").OR.xios_field_is_active("rsucs4co2").OR. &
+           xios_field_is_active("rsd4co2").OR.xios_field_is_active("rsdcs4co2").OR. &
+           xios_field_is_active("rlu4co2").OR.xios_field_is_active("rlucs4co2").OR. &
+           xios_field_is_active("rld4co2").OR.xios_field_is_active("rldcs4co2")) &
+           ok_4xCO2atm=.TRUE. 
+      if (is_master) write (lunout,*)'ok_4xCO2atm= ',swaero_diag, swaerofree_diag, dryaod_diag, ok_4xCO2atm
+#endif
+    endif
 
     !====================================================================
