Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/aeropt_spl.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/aeropt_spl.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/aeropt_spl.F	(revision 4727)
@@ -12,8 +12,8 @@
       IMPLICIT none
 c
-#include "chem.h"
-#include "dimensions.h"
-c #include "dimphy.h"
-#include "YOMCST.h"
+      INCLUDE "chem.h"
+      INCLUDE "dimensions.h"
+cINCLUDE "dimphy.h"
+      INCLUDE "YOMCST.h"
 c
 c Arguments:
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/bcscav_spl.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/bcscav_spl.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/bcscav_spl.F	(revision 4727)
@@ -9,8 +9,8 @@
 c=====================================================================
 c
-#include "dimensions.h"
-#include "chem.h"
-#include "YOMCST.h"
-#include "YOECUMF.h"
+      INCLUDE "dimensions.h"
+      INCLUDE "chem.h"
+      INCLUDE "YOMCST.h"
+      INCLUDE "YOECUMF.h"
 c
       REAL pdtime, alpha_r, alpha_s, R_r, R_s 
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/bl_for_dms.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/bl_for_dms.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/bl_for_dms.F	(revision 4727)
@@ -17,8 +17,8 @@
 c===================================================================
 c
-#include "dimensions.h"
-#include "YOMCST.h"
-#include "YOETHF.h"
-#include "FCTTRE.h"
+      INCLUDE "dimensions.h"
+      INCLUDE "YOMCST.h"
+      INCLUDE "YOETHF.h"
+      INCLUDE "FCTTRE.h"
 c
 c Arguments :
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/blcloud_scav.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/blcloud_scav.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/blcloud_scav.F	(revision 4727)
@@ -10,8 +10,8 @@
       IMPLICIT NONE
 
-#include "dimensions.h"
-#include "chem.h"
-#include "YOMCST.h"
-#include "paramet.h"
+      INCLUDE "dimensions.h"
+      INCLUDE "chem.h"
+      INCLUDE "YOMCST.h"
+      INCLUDE "paramet.h"
 
 c============================= INPUT ===================================
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/blcloud_scav_lsc.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/blcloud_scav_lsc.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/blcloud_scav_lsc.F	(revision 4727)
@@ -10,8 +10,8 @@
       IMPLICIT NONE
 
-#include "dimensions.h"
-#include "chem.h"
-#include "YOMCST.h"
-#include "paramet.h"
+      INCLUDE "dimensions.h"
+      INCLUDE "chem.h"
+      INCLUDE "YOMCST.h"
+      INCLUDE "paramet.h"
 
 c============================= INPUT ===================================
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/checkmass.F90
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/checkmass.F90	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/checkmass.F90	(revision 4727)
@@ -4,5 +4,5 @@
   IMPLICIT NONE
 
-#include "YOMCST.h"
+  INCLUDE "YOMCST.h"
 
 ! Entrees
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/cltrac_spl.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/cltrac_spl.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/cltrac_spl.F	(revision 4727)
@@ -26,5 +26,5 @@
 c flux_tr--output-R- flux de tr
 c======================================================================
-#include "dimensions.h"
+      INCLUDE "dimensions.h"
       REAL dtime
       REAL coef(klon,klev)
@@ -36,5 +36,5 @@
 c      REAL flux_tr(klon,klev)
 c======================================================================
-#include "YOMCST.h"
+      INCLUDE "YOMCST.h"
 c======================================================================
       INTEGER i, k
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/cm3_to_kg.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/cm3_to_kg.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/cm3_to_kg.F	(revision 4727)
@@ -7,6 +7,6 @@
       IMPLICIT NONE
 c
-#include "dimensions.h"
-#include "YOMCST.h"
+      INCLUDE "dimensions.h"
+      INCLUDE "YOMCST.h"
 c      
       REAL t_seri(klon,klev), pplay(klon,klev)
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/coarsemission.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/coarsemission.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/coarsemission.F	(revision 4727)
@@ -33,9 +33,9 @@
       IMPLICIT NONE
 
-#include "dimensions.h"
-#include "chem.h"
-#include "chem_spla.h"
-#include "YOMCST.h"
-#include "paramet.h"
+      INCLUDE "dimensions.h"
+      INCLUDE "chem.h"
+      INCLUDE "chem_spla.h"
+      INCLUDE "YOMCST.h"
+      INCLUDE "paramet.h"
       
 c============================== INPUT ==================================
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/condsurfc.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/condsurfc.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/condsurfc.F	(revision 4727)
@@ -9,6 +9,7 @@
 ! --------------------------------------------------------
 !
-#include "dimensions.h"
-#include "netcdf.inc"
+      INCLUDE "dimensions.h"
+      INCLUDE "netcdf.inc"
+      
       REAL lmt_bcff(klon), lmt_bcbb(klon),lmt_bc_penner(klon)
       REAL lmt_omff(klon), lmt_ombb(klon)
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/condsurfc_new.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/condsurfc_new.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/condsurfc_new.F	(revision 4727)
@@ -11,6 +11,7 @@
 c --------------------------------------------------------
 c
-#include "dimensions.h"
-#include "netcdf.inc"
+      INCLUDE "dimensions.h"
+      INCLUDE "netcdf.inc"
+      
       REAL lmt_bcff(klon), lmt_bcnff(klon), lmt_bcba(klon)
       REAL lmt_omff(klon), lmt_omnff(klon), lmt_ombb(klon)
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/condsurfs.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/condsurfs.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/condsurfs.F	(revision 4727)
@@ -9,6 +9,6 @@
 c --------------------------------------------------------
 c
-#include "dimensions.h"
-#include "netcdf.inc"
+      INCLUDE "dimensions.h"
+      INCLUDE "netcdf.inc"
 c
       REAL lmt_so2h(klon), lmt_so2b(klon), lmt_so2bb(klon)
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/condsurfs_new.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/condsurfs_new.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/condsurfs_new.F	(revision 4727)
@@ -14,6 +14,6 @@
 c --------------------------------------------------------
 c
-#include "dimensions.h"
-#include "netcdf.inc"
+      INCLUDE "dimensions.h"
+      INCLUDE "netcdf.inc"
 c
       REAL lmt_so2b(klon), lmt_so2h(klon), lmt_so2nff(klon)
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/deposition.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/deposition.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/deposition.F	(revision 4727)
@@ -12,8 +12,8 @@
       IMPLICIT NONE
 
-#include "dimensions.h"
-#include "chem.h"
-#include "YOMCST.h"
-#include "paramet.h"
+      INCLUDE "dimensions.h"
+      INCLUDE "chem.h"
+      INCLUDE "YOMCST.h"
+      INCLUDE "paramet.h"
 
 c----------------------------- INPUT -----------------------------------
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/finemission.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/finemission.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/finemission.F	(revision 4727)
@@ -17,8 +17,8 @@
       IMPLICIT NONE
 
-#include "dimensions.h"
-#include "chem.h"
-#include "YOMCST.h"
-#include "paramet.h"
+      INCLUDE "dimensions.h"
+      INCLUDE "chem.h"
+      INCLUDE "YOMCST.h"
+      INCLUDE "paramet.h"
 
       INTEGER i, k, kminbc, kmaxbc
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/gastoparticle.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/gastoparticle.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/gastoparticle.F	(revision 4727)
@@ -10,9 +10,9 @@
       IMPLICIT NONE 
 c
-#include "dimensions.h"
-#include "chem.h"
-#include "chem_spla.h"
-#include "YOMCST.h"
-#include "YOECUMF.h"
+      INCLUDE "dimensions.h"
+      INCLUDE "chem.h"
+      INCLUDE "chem_spla.h"
+      INCLUDE "YOMCST.h"
+      INCLUDE "YOECUMF.h"
 c
       REAL pdtphys
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/incloud_scav.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/incloud_scav.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/incloud_scav.F	(revision 4727)
@@ -11,8 +11,8 @@
       IMPLICIT NONE
 
-#include "dimensions.h"
-#include "chem.h"
-#include "YOMCST.h"
-#include "paramet.h"
+      INCLUDE "dimensions.h"
+      INCLUDE "chem.h"
+      INCLUDE "YOMCST.h"
+      INCLUDE "paramet.h"
 
 c============================= INPUT ===================================
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/incloud_scav_lsc.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/incloud_scav_lsc.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/incloud_scav_lsc.F	(revision 4727)
@@ -11,8 +11,8 @@
       IMPLICIT NONE
 
-#include "dimensions.h"
-#include "chem.h"
-#include "YOMCST.h"
-#include "paramet.h"
+      INCLUDE "dimensions.h"
+      INCLUDE "chem.h"
+      INCLUDE "YOMCST.h"
+      INCLUDE "paramet.h"
 
 c============================= INPUT ===================================
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/inscav_spl.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/inscav_spl.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/inscav_spl.F	(revision 4727)
@@ -10,8 +10,8 @@
 c=====================================================================
 c
-#include "dimensions.h"
-#include "chem.h"
-#include "YOMCST.h"
-#include "YOECUMF.h" 
+      INCLUDE "dimensions.h"
+      INCLUDE "chem.h"
+      INCLUDE "YOMCST.h"
+      INCLUDE "YOECUMF.h" 
 c
       INTEGER it
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/kg_to_cm3.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/kg_to_cm3.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/kg_to_cm3.F	(revision 4727)
@@ -5,6 +5,6 @@
       IMPLICIT NONE
 c
-#include "dimensions.h"
-#include "YOMCST.h"
+      INCLUDE "dimensions.h"
+      INCLUDE "YOMCST.h"
 c      
       REAL t_seri(klon,klev), pplay(klon,klev)
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/minmaxqfi2.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/minmaxqfi2.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/minmaxqfi2.F	(revision 4727)
@@ -3,5 +3,5 @@
       USE dimphy
       USE infotrac
-#include "dimensions.h"
+      INCLUDE "dimensions.h"
 
 !      character*20 comment
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/minmaxsource.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/minmaxsource.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/minmaxsource.F	(revision 4727)
@@ -4,5 +4,5 @@
       USE infotrac
 
-#include "dimensions.h"
+      INCLUDE "dimensions.h"
 
 !      character*20 comment
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/neutral.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/neutral.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/neutral.F	(revision 4727)
@@ -28,5 +28,5 @@
 c
       USE dimphy
-#include "dimensions.h"
+      INCLUDE "dimensions.h"
 c
         real u10_mps(klon),ustar_mps(klon),obklen_m(klon)
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/nightingale.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/nightingale.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/nightingale.F	(revision 4727)
@@ -7,6 +7,6 @@
       IMPLICIT NONE 
 c
-#include "dimensions.h"
-#include "YOMCST.h"
+      INCLUDE "dimensions.h"
+      INCLUDE "YOMCST.h"
 c
       REAL u(klon,klev), v(klon,klev)
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/phys_output_write_spl_mod.F90
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/phys_output_write_spl_mod.F90	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/phys_output_write_spl_mod.F90	(revision 4727)
@@ -389,10 +389,7 @@
     USE iophy, ONLY: set_itau_iophy, histwrite_phy
     USE netcdf, ONLY: nf90_fill_real
-
-#ifdef CPP_XIOS
     ! ug Pour les sorties XIOS
-    USE xios, ONLY: xios_update_calendar
-    USE wxios, ONLY: wxios_closedef, missing_val
-#endif
+    USE lmdz_xios, ONLY: xios_update_calendar, using_xios
+    USE wxios, ONLY: wxios_closedef, missing_val_xios => missing_val
     USE phys_cal_mod, ONLY : mth_len
 
@@ -438,9 +435,12 @@
     INTEGER, DIMENSION(iim*jjmp1*klev) :: ndex3d
     REAL, PARAMETER :: dobson_u = 2.1415e-05 ! Dobson unit, in kg m-2
-!   REAL, PARAMETER :: missing_val=nf90_fill_real
-#ifndef CPP_XIOS
     REAL :: missing_val
-#endif
     REAL, PARAMETER :: un_jour=86400.
+
+    IF (using_xios) THEN
+      missing_val=missing_val_xios
+    ELSE
+      missing_val=nf90_fill_real
+    ENDIF
 
     ! On calcul le nouveau tau:
@@ -460,16 +460,17 @@
     ! ug la boucle qui suit ne sert qu'une fois, pour l'initialisation, sinon il n'y a toujours qu'un seul passage:
     DO iinit=1, iinitend
-#ifdef CPP_XIOS
-       !$OMP MASTER
-       IF (vars_defined) THEN
-          IF (prt_level >= 10) THEN
-             write(lunout,*)"phys_output_write: call xios_update_calendar, itau_w=",itau_w
-          ENDIF
-!          CALL xios_update_calendar(itau_w)
-          CALL xios_update_calendar(itap)
-       ENDIF
-       !$OMP END MASTER
-       !$OMP BARRIER
-#endif
+       IF (using_xios) THEN
+         !$OMP MASTER
+         IF (vars_defined) THEN
+            IF (prt_level >= 10) THEN
+               write(lunout,*)"phys_output_write: call xios_update_calendar, itau_w=",itau_w
+            ENDIF
+!           CALL xios_update_calendar(itau_w)
+            CALL xios_update_calendar(itap)
+         ENDIF
+         !$OMP END MASTER
+         !$OMP BARRIER
+       ENDIF !using_xios
+
        ! On procède à l'écriture ou à la définition des nombreuses variables:
 !!! Champs 1D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -489,5 +490,5 @@
 !!! Champs 2D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 ! JE20141223 <<
-#include "spla_output_write.h"
+       INCLUDE "spla_output_write.h"
 ! JE20141223 >>
 
@@ -828,38 +829,37 @@
 
 #ifdef CPP_IOIPSL
-#ifndef CPP_XIOS
-  IF (.NOT.ok_all_xml) THEN
-       ! ATTENTION, LES ANCIENS HISTWRITE ONT ETES CONSERVES EN ATTENDANT MIEUX:
-       ! Champs interpolles sur des niveaux de pression
-       missing_val=missing_val_nf90
-       DO iff=1, nfiles
-          ll=0
-          DO k=1, nlevSTD
-             bb2=clevSTD(k) 
-             IF (bb2.EQ."850".OR.bb2.EQ."700".OR. &
-                  bb2.EQ."500".OR.bb2.EQ."200".OR. &
-                  bb2.EQ."100".OR. &
-                  bb2.EQ."50".OR.bb2.EQ."10") THEN
-
-                ! a refaire correctement !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-                ll=ll+1
-                CALL histwrite_phy(o_uSTDlevs(ll),uwriteSTD(:,k,iff), iff)
-                CALL histwrite_phy(o_vSTDlevs(ll),vwriteSTD(:,k,iff), iff)
-                CALL histwrite_phy(o_wSTDlevs(ll),wwriteSTD(:,k,iff), iff)
-                CALL histwrite_phy(o_zSTDlevs(ll),phiwriteSTD(:,k,iff), iff)
-                CALL histwrite_phy(o_qSTDlevs(ll),qwriteSTD(:,k,iff), iff)
-                CALL histwrite_phy(o_tSTDlevs(ll),twriteSTD(:,k,iff), iff)
-
-             ENDIF !(bb2.EQ."850".OR.bb2.EQ."700".OR.
-          ENDDO
-       ENDDO
-  ENDIF
+  IF (.NOT. using_xios) THEN
+    IF (.NOT.ok_all_xml) THEN
+         ! ATTENTION, LES ANCIENS HISTWRITE ONT ETES CONSERVES EN ATTENDANT MIEUX:
+         ! Champs interpolles sur des niveaux de pression
+         DO iff=1, nfiles
+           ll=0
+            DO k=1, nlevSTD
+               bb2=clevSTD(k) 
+               IF (bb2.EQ."850".OR.bb2.EQ."700".OR. &
+                    bb2.EQ."500".OR.bb2.EQ."200".OR. &
+                    bb2.EQ."100".OR. &
+                    bb2.EQ."50".OR.bb2.EQ."10") THEN
+
+                  ! a refaire correctement !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+                  ll=ll+1
+                  CALL histwrite_phy(o_uSTDlevs(ll),uwriteSTD(:,k,iff), iff)
+                  CALL histwrite_phy(o_vSTDlevs(ll),vwriteSTD(:,k,iff), iff)
+                  CALL histwrite_phy(o_wSTDlevs(ll),wwriteSTD(:,k,iff), iff)
+                  CALL histwrite_phy(o_zSTDlevs(ll),phiwriteSTD(:,k,iff), iff)
+                  CALL histwrite_phy(o_qSTDlevs(ll),qwriteSTD(:,k,iff), iff)
+                  CALL histwrite_phy(o_tSTDlevs(ll),twriteSTD(:,k,iff), iff)
+
+               ENDIF !(bb2.EQ."850".OR.bb2.EQ."700".OR.
+            ENDDO
+         ENDDO
+    ENDIF
+  ENDIF !.NOT.using_xios
 #endif
-#endif
-
-#ifdef CPP_XIOS
-  IF (ok_all_xml) THEN
-!XIOS  CALL xios_get_field_attr("u850",default_value=missing_val)
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+  IF (using_xios) THEN
+    IF (ok_all_xml) THEN
+  !XIOS  CALL xios_get_field_attr("u850",default_value=missing_val)
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
           ll=0
           DO k=1, nlevSTD
@@ -878,6 +878,6 @@
              ENDIF !(bb2.EQ."850".OR.bb2.EQ."700".OR.
           ENDDO
-  ENDIF
-#endif
+    ENDIF
+  ENDIF !using_xios
        IF (vars_defined) THEN
           DO i=1, klon
@@ -1471,9 +1471,9 @@
 !!!!!!!!!!!! Sorties niveaux de pression NMC !!!!!!!!!!!!!!!!!!!!
 #ifdef CPP_IOIPSL
-#ifndef CPP_XIOS
-  IF (.NOT.ok_all_xml) THEN 
-       ! ATTENTION, LES ANCIENS HISTWRITE ONT ETES CONSERVES EN ATTENDANT MIEUX:
-       ! Champs interpolles sur des niveaux de pression
-       missing_val=missing_val_nf90
+
+  IF (.NOT. using_xios) THEN
+    IF (.NOT.ok_all_xml) THEN 
+         ! ATTENTION, LES ANCIENS HISTWRITE ONT ETES CONSERVES EN ATTENDANT MIEUX:
+         ! Champs interpolles sur des niveaux de pression
        DO iff=7, nfiles-1 !--here we deal with files 7,8 and 9
 
@@ -1539,8 +1539,9 @@
           CALL histwrite_phy(o_TxT,T2sumSTD(:,:,iff-6),iff)
        ENDDO !nfiles
+    ENDIF
   ENDIF
 #endif
-#endif
-#ifdef CPP_XIOS
+
+IF (using_xios) THEN
   IF (ok_all_xml) THEN 
 !      DO iff=7, nfiles
@@ -1607,6 +1608,6 @@
           CALL histwrite_phy(o_TxT,T2STD(:,:))
 !      ENDDO !nfiles
-  ENDIF
-#endif
+    ENDIF
+  ENDIF !using_xios
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            itr = 0
@@ -1651,8 +1652,6 @@
           ENDDO !  iff
 #endif
-#ifdef CPP_XIOS
           !On finalise l'initialisation:
-          CALL wxios_closedef()
-#endif
+          IF (using_xios) CALL wxios_closedef()
 
           !$OMP END MASTER
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/phytracr_spl_mod.F90
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/phytracr_spl_mod.F90	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/phytracr_spl_mod.F90	(revision 4727)
@@ -804,7 +804,7 @@
 
       USE mod_phys_lmdz_transfert_para
-
-  USE phys_cal_mod, only: jD_1jan,year_len, mth_len, days_elapsed, jh_1jan, year_cur, &
-       mth_cur, phys_cal_update
+      USE lmdz_thermcell_dq,  ONLY : thermcell_dq
+      USE phys_cal_mod, only: jD_1jan,year_len, mth_len, days_elapsed, jh_1jan, year_cur, &
+                              mth_cur, phys_cal_update
 
 !
@@ -823,11 +823,11 @@
 !!   et c'est encore different avec le parser de DC ?
 !======================================================================
-#include "dimensions.h"
-#include "chem.h"
-#include "chem_spla.h"
-#include "YOMCST.h"
-#include "YOETHF.h"
-#include "paramet.h"
-#include "alpale.h"
+      INCLUDE "dimensions.h"
+      INCLUDE "chem.h"
+      INCLUDE "chem_spla.h"
+      INCLUDE "YOMCST.h"
+      INCLUDE "YOETHF.h"
+      INCLUDE "paramet.h"
+      INCLUDE "alpale.h"
 
 !======================================================================
@@ -1070,5 +1070,5 @@
 !----------
       REAL,DIMENSION(klon,klev+1),INTENT(IN)   :: fm_therm
-      REAL,DIMENSION(klon,klev),INTENT(IN)     :: entr_therm
+      REAL,DIMENSION(klon,klev),INTENT(INOUT)     :: entr_therm
 
 
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/precuremission.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/precuremission.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/precuremission.F	(revision 4727)
@@ -22,9 +22,9 @@
       IMPLICIT NONE
 
-#include "dimensions.h"
-#include "chem.h"
-#include "chem_spla.h"
-#include "YOMCST.h"
-#include "paramet.h"
+      INCLUDE "dimensions.h"
+      INCLUDE "chem.h"
+      INCLUDE "chem_spla.h"
+      INCLUDE "YOMCST.h"
+      INCLUDE "paramet.h"
 
 c============================= INPUT ===================================
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/read_dust.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/read_dust.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/read_dust.F	(revision 4727)
@@ -5,7 +5,7 @@
       IMPLICIT NONE 
 c
-#include "dimensions.h"
-#include "paramet.h"
-#include "netcdf.inc"
+      INCLUDE "dimensions.h"
+      INCLUDE "paramet.h"
+      INCLUDE "netcdf.inc"
 c
       INTEGER step, nbjour
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/read_newemissions.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/read_newemissions.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/read_newemissions.F	(revision 4727)
@@ -26,5 +26,5 @@
 
 
-#include "dimensions.h"
+      INCLUDE "dimensions.h"
 c      INCLUDE 'dimphy.h'      
       INCLUDE 'paramet.h'      
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/read_surface.F90
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/read_surface.F90	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/read_surface.F90	(revision 4727)
@@ -13,7 +13,7 @@
        IMPLICIT NONE
 
-       include "netcdf.inc"
-#include "dimensions.h"
-#include "paramet.h"
+       INCLUDE "netcdf.inc"
+       INCLUDE "dimensions.h"
+       INCLUDE "paramet.h"
 
        character*10 name
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/read_vent.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/read_vent.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/read_vent.F	(revision 4727)
@@ -5,8 +5,8 @@
 !      USE write_field_phy
       IMPLICIT NONE 
-#include "dimensions.h"
-c #include "dimphy.h"
-#include "paramet.h"
-#include "netcdf.inc"
+      INCLUDE "dimensions.h"
+c       INCLUDE "dimphy.h"
+      INCLUDE "paramet.h"
+      INCLUDE "netcdf.inc"
 c
       INTEGER step, nbjour
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/seasalt.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/seasalt.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/seasalt.F	(revision 4727)
@@ -7,9 +7,9 @@
       IMPLICIT NONE 
 c
-#include "dimensions.h"
-#include "chem.h"
-#include "chem_spla.h"
-#include "YOMCST.h"
-#include "YOECUMF.h"
+      INCLUDE "dimensions.h"
+      INCLUDE "chem.h"
+      INCLUDE "chem_spla.h"
+      INCLUDE "YOMCST.h"
+      INCLUDE "YOECUMF.h"
 c
       INTEGER i, bin                 !local variables
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/sediment_mod.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/sediment_mod.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/sediment_mod.F	(revision 4727)
@@ -12,9 +12,9 @@
       IMPLICIT NONE 
 c
-#include "dimensions.h"
-#include "chem.h"
-c #include "dimphy.h"
-#include "YOMCST.h"
-#include "YOECUMF.h"
+      INCLUDE "dimensions.h"
+      INCLUDE "chem.h"
+c       INCLUDE "dimphy.h"
+      INCLUDE "YOMCST.h"
+      INCLUDE "YOECUMF.h"
 c
        REAL RHcl(klon,klev)     ! humidite relative ciel clair
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/tiedqneg.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/tiedqneg.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/tiedqneg.F	(revision 4727)
@@ -15,6 +15,6 @@
 c======================================================================
 c
-#include "dimensions.h"
-c #include "dimphy.h"
+      INCLUDE "dimensions.h"
+c       INCLUDE "dimphy.h"
       REAL pres_h(klon,klev+1)
       REAL q(klon,klev)
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/trconvect.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/trconvect.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/Dust/trconvect.F	(revision 4727)
@@ -10,8 +10,8 @@
       IMPLICIT NONE
 
-#include "dimensions.h"
-#include "chem.h"
-#include "YOMCST.h"
-#include "paramet.h"
+      INCLUDE "dimensions.h"
+      INCLUDE "chem.h"
+      INCLUDE "YOMCST.h"
+      INCLUDE "paramet.h"
 
 c============================= INPUT ===================================
