Index: LMDZ6/branches/LMDZ_ECRad/libf/dynphy_lonlat/calfis_loc.F
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/dynphy_lonlat/calfis_loc.F	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/dynphy_lonlat/calfis_loc.F	(revision 4727)
@@ -38,4 +38,6 @@
       USE IOPHY
 #endif
+      USE lmdz_mpi
+
 #ifdef CPP_PARA
       USE parallel_lmdz,ONLY:omp_chunk,using_mpi,jjb_u,jje_u,jjb_v,jje_v
@@ -117,7 +119,4 @@
       include "comgeom2.h"
       include "iniprint.h"
-#ifdef CPP_MPI
-      include 'mpif.h'
-#endif
 c    Arguments :
 c    -----------
@@ -233,9 +232,5 @@
       REAL,SAVE,dimension(1:iim,1:llm):: du_send,du_recv,dv_send,dv_recv
       INTEGER :: ierr
-#ifdef CPP_MPI
       INTEGER,dimension(MPI_STATUS_SIZE,4) :: Status
-#else
-      INTEGER,dimension(1,4) :: Status
-#endif
       INTEGER, dimension(4) :: Req
       REAL,ALLOCATABLE,SAVE:: zdufi2(:,:),zdvfi2(:,:)
@@ -873,5 +868,5 @@
 
 c$OMP BARRIER
-#ifdef CPP_MPI 
+
 c$OMP MASTER
 !$OMP CRITICAL (MPI)
@@ -882,5 +877,5 @@
 !$OMP END CRITICAL (MPI)
 c$OMP END MASTER
-#endif
+
 c$OMP BARRIER
      
@@ -889,5 +884,5 @@
       if (MPI_rank<MPI_Size-1) then
 c$OMP BARRIER
-#ifdef CPP_MPI 
+
 c$OMP MASTER      
 !$OMP CRITICAL (MPI)
@@ -898,5 +893,5 @@
 !$OMP END CRITICAL (MPI)
 c$OMP END MASTER
-#endif
+
       endif
 
@@ -904,5 +899,4 @@
 
 
-#ifdef CPP_MPI 
 c$OMP MASTER    
 !$OMP CRITICAL (MPI)
@@ -916,5 +910,4 @@
 !$OMP END CRITICAL (MPI)
 c$OMP END MASTER
-#endif
 
 c$OMP BARRIER     
Index: LMDZ6/branches/LMDZ_ECRad/libf/dynphy_lonlat/phylmd/callphysiq_mod.F90
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/dynphy_lonlat/phylmd/callphysiq_mod.F90	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/dynphy_lonlat/phylmd/callphysiq_mod.F90	(revision 4727)
@@ -22,8 +22,5 @@
   USE control_mod, ONLY: planet_type, ok_dyn_xios
   USE physiq_mod, ONLY: physiq
-#ifdef CPP_XIOS
-  USE mod_xios_dyn3dmem, ONLY : dyn3d_ctx_handle
-  USE xios, ONLY : xios_set_current_context
-#endif
+  USE lmdz_xios, ONLY : xios_set_current_context, xios_get_current_context, xios_context
   IMPLICIT NONE
 
@@ -56,5 +53,6 @@
   REAL,INTENT(OUT) :: zdqfi_omp(klon,llm,nqtot) ! tendency on tracers
   REAL,INTENT(OUT) :: zdpsrf_omp(klon) ! tendency on surface pressure
-  
+  TYPE(xios_context) :: dyn3d_ctx_handle
+
   ! Local variables
   CHARACTER(len=11) :: modname="call_physiq"
@@ -70,4 +68,9 @@
   ENDIF
 
+  !$OMP MASTER
+  if (ok_dyn_xios) then
+     CALL xios_get_current_context(dyn3d_ctx_handle)
+  endif
+  !$OMP END MASTER
 
 ! Call physics package with required inputs/outputs
@@ -95,5 +98,4 @@
 
 ! switching back to LMDZDYN context
-#ifdef CPP_XIOS
 !$OMP MASTER
   if (ok_dyn_xios) then
@@ -101,5 +103,4 @@
   endif
 !$OMP END MASTER
-#endif  
 
 
Index: LMDZ6/branches/LMDZ_ECRad/libf/dynphy_lonlat/phylmd/ce0l.F90
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/dynphy_lonlat/phylmd/ce0l.F90	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/dynphy_lonlat/phylmd/ce0l.F90	(revision 4727)
@@ -36,7 +36,5 @@
   USE mod_hallo,      ONLY: init_mod_hallo
   USE mod_interface_dyn_phys, ONLY: init_interface_dyn_phys
-#ifdef CPP_XIOS
-  USE xios, only: xios_finalize
-#endif
+  USE lmdz_xios, only: using_xios, xios_finalize
 #endif
 
@@ -46,4 +44,5 @@
   USE comvert_mod, ONLY: pa, preff, pressure_exner
   USE temps_mod, ONLY: calend, day_ini, dt
+  USE lmdz_mpi
 
   IMPLICIT NONE
@@ -55,7 +54,4 @@
   include "comgeom2.h"
   include "iniprint.h"
-#ifdef CPP_MPI
-  include 'mpif.h'
-#endif
   
   REAL               :: masque(iip1,jjp1)             !--- CONTINENTAL MASK
@@ -252,10 +248,6 @@
 #ifdef CPP_PARA
   END IF
-#ifdef CPP_XIOS
-  CALL xios_finalize
-#endif
-#ifdef CPP_MPI
+  IF (using_xios) CALL xios_finalize
   IF (using_mpi) call MPI_FINALIZE(ierr)
-#endif
 #endif
 
Index: LMDZ6/branches/LMDZ_ECRad/libf/dynphy_lonlat/phylmd/etat0phys_netcdf.F90
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/dynphy_lonlat/phylmd/etat0phys_netcdf.F90	(revision 4482)
+++ LMDZ6/branches/LMDZ_ECRad/libf/dynphy_lonlat/phylmd/etat0phys_netcdf.F90	(revision 4727)
@@ -94,5 +94,5 @@
   USE init_ssrf_m, ONLY: start_init_subsurf
   USE phys_state_var_mod, ONLY: beta_aridity, delta_tsurf, awake_dens, cv_gen, &
-       ratqs_inter, rneb_ancien
+       ratqs_inter_, rneb_ancien
   !use ioipsl_getincom
   IMPLICIT NONE
@@ -143,5 +143,5 @@
                    fact_cldcon, facttemps,ok_newmicro,iflag_radia,      &
                    iflag_cldcon,                                        &
-                   iflag_ratqs,ratqsbas,ratqshaut,tau_ratqs,            &
+                   ratqsbas,ratqshaut,tau_ratqs,            &
                    ok_ade, ok_aie, ok_alw, ok_cdnc, ok_volcan, flag_volc_surfstrat,     &
                    aerosol_couple, chemistry_couple, flag_aerosol, flag_aerosol_strat,  & 
@@ -285,5 +285,5 @@
   end IF
 
-  ratqs_inter = 0.002
+  ratqs_inter_ = 0.002
   rneb_ancien = 0.
   CALL phyredem( "startphy.nc" )
