Index: LMDZ6/trunk/libf/dyn3dmem/gcm.F90
===================================================================
--- LMDZ6/trunk/libf/dyn3dmem/gcm.F90	(revision 4608)
+++ LMDZ6/trunk/libf/dyn3dmem/gcm.F90	(revision 4619)
@@ -28,7 +28,5 @@
                        itau_dyn,itau_phy,day_ini,jD_ref,jH_ref,day_end, &
                        dt,hour_ini,itaufin
-#ifdef CPP_XIOS
   USE mod_xios_dyn3dmem, ONLY: xios_dyn3dmem_init
-#endif
 
   IMPLICIT NONE
@@ -457,10 +455,8 @@
 
 ! setting up DYN3D/XIOS inerface
-#ifdef CPP_XIOS
-   if (ok_dyn_xios) then
-     CALL xios_dyn3dmem_init(xios_cal_type, anref, moisref, jourref,heureref, an,   &
+  if (ok_dyn_xios) then
+      CALL xios_dyn3dmem_init(xios_cal_type, anref, moisref, jourref,heureref, an,   &
           mois, jour, heure, zdtvr)
   endif
-#endif
 
   ! #endif of #ifdef CPP_IOIPSL
Index: LMDZ6/trunk/libf/dyn3dmem/leapfrog_loc.F
===================================================================
--- LMDZ6/trunk/libf/dyn3dmem/leapfrog_loc.F	(revision 4608)
+++ LMDZ6/trunk/libf/dyn3dmem/leapfrog_loc.F	(revision 4619)
@@ -42,8 +42,8 @@
        USE temps_mod, ONLY: itaufin,jD_ref,jH_ref,day_ini,
      &                        day_ref,start_time,dt
-#ifdef CPP_XIOS
        USE mod_xios_dyn3dmem, ONLY : dyn3d_ctx_handle
-       USE xios, ONLY: xios_update_calendar, xios_set_current_context
-#endif
+       USE lmdz_xios, ONLY: xios_update_calendar, 
+     &                      xios_set_current_context, 
+     &                      using_xios
        
       IMPLICIT NONE
@@ -1523,5 +1523,4 @@
             CALL finalize_inca
 !     switching back to LMDZDYN context
-#ifdef CPP_XIOS
 !$OMP MASTER
             IF (ok_dyn_xios) THEN
@@ -1529,5 +1528,4 @@
             ENDIF
 !$OMP END MASTER
-#endif
          ENDIF
 #endif
@@ -1582,5 +1580,4 @@
                  CALL finalize_inca
 !     switching back to LMDZDYN context
-#ifdef CPP_XIOS
 !$OMP MASTER
                  IF (ok_dyn_xios) THEN
@@ -1588,5 +1585,4 @@
                  ENDIF
 !$OMP END MASTER
-#endif
               ENDIF
 #endif
@@ -1661,5 +1657,4 @@
 #endif
              
-#ifdef CPP_XIOS
               IF (ok_dyn_xios) THEN
 c$OMP MASTER
@@ -1670,5 +1665,4 @@
      &                 ucov,teta,pk,phi,q,masse,ps,phis)
               ENDIF
-#endif
               
           endif                 ! of if (leapf.or.(.not.leapf.and.(.not.forward)))
@@ -1759,5 +1753,4 @@
                     CALL finalize_inca
 !     switching back to LMDZDYN context
-#ifdef CPP_XIOS
 !$OMP MASTER
                     IF (ok_dyn_xios) THEN
@@ -1765,5 +1758,4 @@
                     ENDIF
 !$OMP END MASTER
-#endif
                  ENDIF
 
@@ -1833,5 +1825,4 @@
 #endif
 
-#ifdef CPP_XIOS
               IF (ok_dyn_xios) THEN
 c$OMP MASTER
@@ -1842,5 +1833,4 @@
      &                 ucov,teta,pk,phi,q,masse,ps,phis)
               ENDIF
-#endif
               
            ENDIF                ! of IF(MOD(itau,iecri).EQ.0)
@@ -1877,5 +1867,4 @@
          CALL finalize_inca
 !     switching back to LMDZDYN context
-#ifdef CPP_XIOS
 !$OMP MASTER
          IF (ok_dyn_xios) THEN
@@ -1883,5 +1872,4 @@
          ENDIF
 !$OMP END MASTER
-#endif
       ENDIF
 
Index: LMDZ6/trunk/libf/dyn3dmem/mod_const_mpi.F90
===================================================================
--- LMDZ6/trunk/libf/dyn3dmem/mod_const_mpi.F90	(revision 4608)
+++ LMDZ6/trunk/libf/dyn3dmem/mod_const_mpi.F90	(revision 4619)
@@ -23,7 +23,5 @@
     USE mod_prism
 #endif
-#ifdef CPP_XIOS
     USE wxios, only: wxios_init
-#endif
     IMPLICIT NONE
 
@@ -44,10 +42,10 @@
 #ifdef CPP_COUPLE
 !$OMP MASTER
-#ifdef CPP_XIOS
-        CALL wxios_init("LMDZ", outcom=COMM_LMDZ, type_ocean=type_ocean)
-#else
-        CALL prism_init_comp_proto (comp_id, 'LMDZ', ierr)
-        CALL prism_get_localcomm_proto(COMM_LMDZ,ierr)
-#endif
+        IF (using_xios) THEN
+          CALL wxios_init("LMDZ", outcom=COMM_LMDZ, type_ocean=type_ocean)
+        ELSE
+          CALL prism_init_comp_proto (comp_id, 'LMDZ', ierr)
+          CALL prism_get_localcomm_proto(COMM_LMDZ,ierr)
+        ENDIF
 !$OMP END MASTER
 #endif
@@ -61,8 +59,6 @@
   SUBROUTINE Init_mpi
     USE lmdz_mpi
+    USE wxios, only: wxios_init, using_xios
 
-#ifdef CPP_XIOS
-    USE wxios, only: wxios_init
-#endif
   IMPLICIT NONE
     INTEGER             :: ierr
@@ -83,8 +79,8 @@
 ! Initialisation de XIOS
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-#ifdef CPP_XIOS
-      WRITE(*,*)'IN Init_mpi call wxios_init'
-      CALL wxios_init("LMDZ", outcom=COMM_LMDZ)
-#endif
+      IF (using_xios) THEN
+        WRITE(*,*)'IN Init_mpi call wxios_init'
+        CALL wxios_init("LMDZ", outcom=COMM_LMDZ)
+      ENDIF
 !$OMP END MASTER
 
Index: LMDZ6/trunk/libf/dyn3dmem/mod_xios_dyn3dmem.F90
===================================================================
--- LMDZ6/trunk/libf/dyn3dmem/mod_xios_dyn3dmem.F90	(revision 4608)
+++ LMDZ6/trunk/libf/dyn3dmem/mod_xios_dyn3dmem.F90	(revision 4619)
@@ -12,9 +12,8 @@
 !
 !
-#ifdef CPP_XIOS
 
 MODULE mod_xios_dyn3dmem
 
-     USE xios
+     USE lmdz_xios
      USE wxios, ONLY : g_comm
      CHARACTER(len=100), SAVE :: dyn3d_ctx_name = "LMDZDYN"
@@ -259,4 +258,3 @@
    
 END MODULE mod_xios_dyn3dmem 
-#endif
-
+
Index: LMDZ6/trunk/libf/dyn3dmem/parallel_lmdz.F90
===================================================================
--- LMDZ6/trunk/libf/dyn3dmem/parallel_lmdz.F90	(revision 4608)
+++ LMDZ6/trunk/libf/dyn3dmem/parallel_lmdz.F90	(revision 4619)
@@ -384,8 +384,7 @@
     subroutine Finalize_parallel
     USE lmdz_mpi
-#ifdef CPP_XIOS
     ! ug Pour les sorties XIOS
-	USE wxios
-#endif
+  	USE wxios
+
 #ifdef CPP_COUPLE
 ! Use of Oasis-MCT coupler 
@@ -416,21 +415,21 @@
 
       if (type_ocean == 'couple') then
-#ifdef CPP_XIOS
-    !Fermeture propre de XIOS
-      CALL wxios_close()
-#else
+        IF (using_xios) THEN
+          !Fermeture propre de XIOS
+          CALL wxios_close()
+        ELSE
 #ifdef CPP_COUPLE
-         call prism_terminate_proto(ierr)
-         IF (ierr .ne. PRISM_Ok) THEN
-            call abort_gcm('Finalize_parallel',' Probleme dans prism_terminate_proto ',1)
-         endif
+           call prism_terminate_proto(ierr)
+           IF (ierr .ne. PRISM_Ok) THEN
+              call abort_gcm('Finalize_parallel',' Probleme dans prism_terminate_proto ',1)
+           endif
 #endif 
-#endif
+        ENDIF
       else
-#ifdef CPP_XIOS
-    !Fermeture propre de XIOS
-      CALL wxios_close()
-#endif
-      IF (using_mpi) call MPI_FINALIZE(ierr)
+        IF (using_xios) THEN
+          !Fermeture propre de XIOS
+          CALL wxios_close()
+        ENDIF
+        IF (using_mpi) call MPI_FINALIZE(ierr)
       end if
       
Index: LMDZ6/trunk/libf/dyn3dmem/writedyn_xios.F90
===================================================================
--- LMDZ6/trunk/libf/dyn3dmem/writedyn_xios.F90	(revision 4608)
+++ LMDZ6/trunk/libf/dyn3dmem/writedyn_xios.F90	(revision 4619)
@@ -5,6 +5,5 @@
      &                           masse,ps,phis)
 
-#ifdef CPP_XIOS
-      USE xios
+      USE lmdz_xios
       USE parallel_lmdz
       USE misc_mod
@@ -180,5 +179,3 @@
       CALL writefield_dyn_u('PS', ps(ijb:ije))
 
-#endif
-
       END
