Index: NEMO/branches/2020/dev_12905_xios_restart/src/ICE/ice.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/ICE/ice.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/ICE/ice.F90	(revision 12969)
@@ -168,4 +168,5 @@
    LOGICAL , PUBLIC ::   ln_cndflx        !: use conduction flux as surface boundary condition (instead of qsr and qns) 
    LOGICAL , PUBLIC ::   ln_cndemulate    !: emulate conduction flux (if not provided) 
+   LOGICAL , PUBLIC ::   lrixios          !: use xios to read restart in SI3
    !                                      ! Conduction flux as surface forcing or not
    INTEGER, PUBLIC, PARAMETER ::   np_cnd_OFF = 0  !: no forcing from conduction flux (ice thermodynamics forced via qsr and qns)
Index: NEMO/branches/2020/dev_12905_xios_restart/src/ICE/icedia.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/ICE/icedia.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/ICE/icedia.F90	(revision 12969)
@@ -221,18 +221,18 @@
          IF( ln_rstart ) THEN                   !* Read the restart file
             !
-            IF(lrxios) CALL iom_swap(crixios_context)
-            CALL iom_get( numrir, 'kt_ice' , ziter, ldxios = lrxios )
+            IF(lrixios) CALL iom_swap(crixios_context)
+            CALL iom_get( numrir, 'kt_ice' , ziter, ldxios = lrixios )
             IF(lwp) WRITE(numout,*)
             IF(lwp) WRITE(numout,*) 'ice_dia_rst read at time step = ', ziter
             IF(lwp) WRITE(numout,*) '~~~~~~~~~~'
-            CALL iom_get( numrir, 'frc_voltop' , frc_voltop, ldxios = lrxios  )
-            CALL iom_get( numrir, 'frc_volbot' , frc_volbot, ldxios = lrxios  )
-            CALL iom_get( numrir, 'frc_temtop' , frc_temtop, ldxios = lrxios  )
-            CALL iom_get( numrir, 'frc_tembot' , frc_tembot, ldxios = lrxios  )
-            CALL iom_get( numrir, 'frc_sal'    , frc_sal, ldxios = lrxios     )
-            CALL iom_get( numrir, jpdom_autoglo, 'vol_loc_ini', vol_loc_ini, ldxios = lrxios )
-            CALL iom_get( numrir, jpdom_autoglo, 'tem_loc_ini', tem_loc_ini, ldxios = lrxios )
-            CALL iom_get( numrir, jpdom_autoglo, 'sal_loc_ini', sal_loc_ini, ldxios = lrxios )
-            IF(lrxios) CALL iom_swap(cxios_context)
+            CALL iom_get( numrir, 'frc_voltop' , frc_voltop, ldxios = lrixios  )
+            CALL iom_get( numrir, 'frc_volbot' , frc_volbot, ldxios = lrixios  )
+            CALL iom_get( numrir, 'frc_temtop' , frc_temtop, ldxios = lrixios  )
+            CALL iom_get( numrir, 'frc_tembot' , frc_tembot, ldxios = lrixios  )
+            CALL iom_get( numrir, 'frc_sal'    , frc_sal, ldxios = lrixios     )
+            CALL iom_get( numrir, jpdom_autoglo, 'vol_loc_ini', vol_loc_ini, ldxios = lrixios )
+            CALL iom_get( numrir, jpdom_autoglo, 'tem_loc_ini', tem_loc_ini, ldxios = lrixios )
+            CALL iom_get( numrir, jpdom_autoglo, 'sal_loc_ini', sal_loc_ini, ldxios = lrixios )
+            IF(lrixios) CALL iom_swap(cxios_context)
          ELSE
             IF(lwp) WRITE(numout,*)
Index: NEMO/branches/2020/dev_12905_xios_restart/src/ICE/icedyn_adv_pra.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/ICE/icedyn_adv_pra.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/ICE/icedyn_adv_pra.F90	(revision 12969)
@@ -770,49 +770,49 @@
          !
          IF( id1 > 0 ) THEN                     !**  Read the restart file  **!
-            IF(lrxios) CALL iom_swap(crixios_context)
+            IF(lrixios) CALL iom_swap(crixios_context)
             !
             !                                                        ! ice thickness
-            CALL iom_get( numrir, jpdom_autoglo, 'sxice' , sxice, ldxios = lrxios  )
-            CALL iom_get( numrir, jpdom_autoglo, 'syice' , syice, ldxios = lrxios  )
-            CALL iom_get( numrir, jpdom_autoglo, 'sxxice', sxxice, ldxios = lrxios )
-            CALL iom_get( numrir, jpdom_autoglo, 'syyice', syyice, ldxios = lrxios )
-            CALL iom_get( numrir, jpdom_autoglo, 'sxyice', sxyice, ldxios = lrxios )
+            CALL iom_get( numrir, jpdom_autoglo, 'sxice' , sxice, ldxios = lrixios  )
+            CALL iom_get( numrir, jpdom_autoglo, 'syice' , syice, ldxios = lrixios  )
+            CALL iom_get( numrir, jpdom_autoglo, 'sxxice', sxxice, ldxios = lrixios )
+            CALL iom_get( numrir, jpdom_autoglo, 'syyice', syyice, ldxios = lrixios )
+            CALL iom_get( numrir, jpdom_autoglo, 'sxyice', sxyice, ldxios = lrixios )
             !                                                        ! snow thickness
-            CALL iom_get( numrir, jpdom_autoglo, 'sxsn'  , sxsn, ldxios = lrxios   )
-            CALL iom_get( numrir, jpdom_autoglo, 'sysn'  , sysn, ldxios = lrxios   )
-            CALL iom_get( numrir, jpdom_autoglo, 'sxxsn' , sxxsn, ldxios = lrxios  )
-            CALL iom_get( numrir, jpdom_autoglo, 'syysn' , syysn, ldxios = lrxios  )
-            CALL iom_get( numrir, jpdom_autoglo, 'sxysn' , sxysn, ldxios = lrxios  )
+            CALL iom_get( numrir, jpdom_autoglo, 'sxsn'  , sxsn, ldxios = lrixios   )
+            CALL iom_get( numrir, jpdom_autoglo, 'sysn'  , sysn, ldxios = lrixios   )
+            CALL iom_get( numrir, jpdom_autoglo, 'sxxsn' , sxxsn, ldxios = lrixios  )
+            CALL iom_get( numrir, jpdom_autoglo, 'syysn' , syysn, ldxios = lrixios  )
+            CALL iom_get( numrir, jpdom_autoglo, 'sxysn' , sxysn, ldxios = lrixios  )
             !                                                        ! ice concentration
-            CALL iom_get( numrir, jpdom_autoglo, 'sxa'   , sxa, ldxios = lrxios    )
-            CALL iom_get( numrir, jpdom_autoglo, 'sya'   , sya, ldxios = lrxios    )
-            CALL iom_get( numrir, jpdom_autoglo, 'sxxa'  , sxxa, ldxios = lrxios   )
-            CALL iom_get( numrir, jpdom_autoglo, 'syya'  , syya, ldxios = lrxios   )
-            CALL iom_get( numrir, jpdom_autoglo, 'sxya'  , sxya, ldxios = lrxios   )
+            CALL iom_get( numrir, jpdom_autoglo, 'sxa'   , sxa, ldxios = lrixios    )
+            CALL iom_get( numrir, jpdom_autoglo, 'sya'   , sya, ldxios = lrixios    )
+            CALL iom_get( numrir, jpdom_autoglo, 'sxxa'  , sxxa, ldxios = lrixios   )
+            CALL iom_get( numrir, jpdom_autoglo, 'syya'  , syya, ldxios = lrixios   )
+            CALL iom_get( numrir, jpdom_autoglo, 'sxya'  , sxya, ldxios = lrixios   )
             !                                                        ! ice salinity
-            CALL iom_get( numrir, jpdom_autoglo, 'sxsal' , sxsal, ldxios = lrxios  )
-            CALL iom_get( numrir, jpdom_autoglo, 'sysal' , sysal, ldxios = lrxios  )
-            CALL iom_get( numrir, jpdom_autoglo, 'sxxsal', sxxsal, ldxios = lrxios )
-            CALL iom_get( numrir, jpdom_autoglo, 'syysal', syysal, ldxios = lrxios )
-            CALL iom_get( numrir, jpdom_autoglo, 'sxysal', sxysal, ldxios = lrxios )
+            CALL iom_get( numrir, jpdom_autoglo, 'sxsal' , sxsal, ldxios = lrixios  )
+            CALL iom_get( numrir, jpdom_autoglo, 'sysal' , sysal, ldxios = lrixios  )
+            CALL iom_get( numrir, jpdom_autoglo, 'sxxsal', sxxsal, ldxios = lrixios )
+            CALL iom_get( numrir, jpdom_autoglo, 'syysal', syysal, ldxios = lrixios )
+            CALL iom_get( numrir, jpdom_autoglo, 'sxysal', sxysal, ldxios = lrixios )
             !                                                        ! ice age
-            CALL iom_get( numrir, jpdom_autoglo, 'sxage' , sxage, ldxios = lrxios  )
-            CALL iom_get( numrir, jpdom_autoglo, 'syage' , syage, ldxios = lrxios  )
-            CALL iom_get( numrir, jpdom_autoglo, 'sxxage', sxxage, ldxios = lrxios )
-            CALL iom_get( numrir, jpdom_autoglo, 'syyage', syyage, ldxios = lrxios )
-            CALL iom_get( numrir, jpdom_autoglo, 'sxyage', sxyage, ldxios = lrxios )
+            CALL iom_get( numrir, jpdom_autoglo, 'sxage' , sxage, ldxios = lrixios  )
+            CALL iom_get( numrir, jpdom_autoglo, 'syage' , syage, ldxios = lrixios  )
+            CALL iom_get( numrir, jpdom_autoglo, 'sxxage', sxxage, ldxios = lrixios )
+            CALL iom_get( numrir, jpdom_autoglo, 'syyage', syyage, ldxios = lrixios )
+            CALL iom_get( numrir, jpdom_autoglo, 'sxyage', sxyage, ldxios = lrixios )
             !                                                        ! snow layers heat content
             DO jk = 1, nlay_s
                WRITE(zchar1,'(I2.2)') jk
                znam = 'sxc0'//'_l'//zchar1  
-               CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrxios )   ;   sxc0 (:,:,jk,:) = z3d(:,:,:)
+               CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrixios )   ;   sxc0 (:,:,jk,:) = z3d(:,:,:)
                znam = 'syc0'//'_l'//zchar1  
-               CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrxios )   ;   syc0 (:,:,jk,:) = z3d(:,:,:)
+               CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrixios )   ;   syc0 (:,:,jk,:) = z3d(:,:,:)
                znam = 'sxxc0'//'_l'//zchar1 
-               CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrxios )   ;   sxxc0(:,:,jk,:) = z3d(:,:,:)
+               CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrixios )   ;   sxxc0(:,:,jk,:) = z3d(:,:,:)
                znam = 'syyc0'//'_l'//zchar1 
-               CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrxios )   ;   syyc0(:,:,jk,:) = z3d(:,:,:)
+               CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrixios )   ;   syyc0(:,:,jk,:) = z3d(:,:,:)
                znam = 'sxyc0'//'_l'//zchar1 
-               CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrxios )   ;   sxyc0(:,:,jk,:) = z3d(:,:,:)
+               CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrixios )   ;   sxyc0(:,:,jk,:) = z3d(:,:,:)
             END DO
             !                                                        ! ice layers heat content
@@ -820,29 +820,29 @@
                WRITE(zchar1,'(I2.2)') jk
                znam = 'sxe'//'_l'//zchar1   
-               CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrxios )   ;   sxe (:,:,jk,:) = z3d(:,:,:)
+               CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrixios )   ;   sxe (:,:,jk,:) = z3d(:,:,:)
                znam = 'sye'//'_l'//zchar1   
-               CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrxios )   ;   sye (:,:,jk,:) = z3d(:,:,:)
+               CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrixios )   ;   sye (:,:,jk,:) = z3d(:,:,:)
                znam = 'sxxe'//'_l'//zchar1  
-               CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrxios )   ;   sxxe(:,:,jk,:) = z3d(:,:,:)
+               CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrixios )   ;   sxxe(:,:,jk,:) = z3d(:,:,:)
                znam = 'syye'//'_l'//zchar1  
-               CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrxios )   ;   syye(:,:,jk,:) = z3d(:,:,:)
+               CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrixios )   ;   syye(:,:,jk,:) = z3d(:,:,:)
                znam = 'sxye'//'_l'//zchar1  
-               CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrxios )   ;   sxye(:,:,jk,:) = z3d(:,:,:)
+               CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrixios )   ;   sxye(:,:,jk,:) = z3d(:,:,:)
             END DO
             !
             IF( ln_pnd_H12 ) THEN                                    ! melt pond fraction
-               CALL iom_get( numrir, jpdom_autoglo, 'sxap' , sxap,  ldxios = lrxios )
-               CALL iom_get( numrir, jpdom_autoglo, 'syap' , syap,  ldxios = lrxios )
-               CALL iom_get( numrir, jpdom_autoglo, 'sxxap', sxxap, ldxios = lrxios )
-               CALL iom_get( numrir, jpdom_autoglo, 'syyap', syyap, ldxios = lrxios )
-               CALL iom_get( numrir, jpdom_autoglo, 'sxyap', sxyap, ldxios = lrxios )
+               CALL iom_get( numrir, jpdom_autoglo, 'sxap' , sxap,  ldxios = lrixios )
+               CALL iom_get( numrir, jpdom_autoglo, 'syap' , syap,  ldxios = lrixios )
+               CALL iom_get( numrir, jpdom_autoglo, 'sxxap', sxxap, ldxios = lrixios )
+               CALL iom_get( numrir, jpdom_autoglo, 'syyap', syyap, ldxios = lrixios )
+               CALL iom_get( numrir, jpdom_autoglo, 'sxyap', sxyap, ldxios = lrixios )
                !                                                     ! melt pond volume
-               CALL iom_get( numrir, jpdom_autoglo, 'sxvp' , sxvp,  ldxios = lrxios )
-               CALL iom_get( numrir, jpdom_autoglo, 'syvp' , syvp,  ldxios = lrxios )
-               CALL iom_get( numrir, jpdom_autoglo, 'sxxvp', sxxvp, ldxios = lrxios )
-               CALL iom_get( numrir, jpdom_autoglo, 'syyvp', syyvp, ldxios = lrxios )
-               CALL iom_get( numrir, jpdom_autoglo, 'sxyvp', sxyvp, ldxios = lrxios )
+               CALL iom_get( numrir, jpdom_autoglo, 'sxvp' , sxvp,  ldxios = lrixios )
+               CALL iom_get( numrir, jpdom_autoglo, 'syvp' , syvp,  ldxios = lrixios )
+               CALL iom_get( numrir, jpdom_autoglo, 'sxxvp', sxxvp, ldxios = lrixios )
+               CALL iom_get( numrir, jpdom_autoglo, 'syyvp', syyvp, ldxios = lrixios )
+               CALL iom_get( numrir, jpdom_autoglo, 'sxyvp', sxyvp, ldxios = lrixios )
             ENDIF
-            IF(lrxios) CALL iom_swap(cxios_context)
+            IF(lrixios) CALL iom_swap(cxios_context)
             !
          ELSE                                   !**  start rheology from rest  **!
Index: NEMO/branches/2020/dev_12905_xios_restart/src/ICE/icedyn_rhg_evp.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/ICE/icedyn_rhg_evp.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/ICE/icedyn_rhg_evp.F90	(revision 12969)
@@ -839,5 +839,5 @@
          IF( ln_rstart ) THEN                   !* Read the restart file
             !
-            IF(lrxios) CALL iom_swap(crixios_context)
+            IF(lrixios) CALL iom_swap(crixios_context)
             id1 = iom_varid( numrir, 'stress1_i' , ldstop = .FALSE. )
             id2 = iom_varid( numrir, 'stress2_i' , ldstop = .FALSE. )
@@ -845,7 +845,7 @@
             !
             IF( MIN( id1, id2, id3 ) > 0 ) THEN      ! fields exist
-               CALL iom_get( numrir, jpdom_autoglo, 'stress1_i' , stress1_i,  ldxios = lrxios )
-               CALL iom_get( numrir, jpdom_autoglo, 'stress2_i' , stress2_i,  ldxios = lrxios )
-               CALL iom_get( numrir, jpdom_autoglo, 'stress12_i', stress12_i, ldxios = lrxios )
+               CALL iom_get( numrir, jpdom_autoglo, 'stress1_i' , stress1_i,  ldxios = lrixios )
+               CALL iom_get( numrir, jpdom_autoglo, 'stress2_i' , stress2_i,  ldxios = lrixios )
+               CALL iom_get( numrir, jpdom_autoglo, 'stress12_i', stress12_i, ldxios = lrixios )
             ELSE                                     ! start rheology from rest
                IF(lwp) WRITE(numout,*)
@@ -855,5 +855,5 @@
                stress12_i(:,:) = 0._wp
             ENDIF
-            IF(lrxios) CALL iom_swap(cxios_context)
+            IF(lrixios) CALL iom_swap(cxios_context)
          ELSE                                   !* Start from rest
             IF(lwp) WRITE(numout,*)
Index: NEMO/branches/2020/dev_12905_xios_restart/src/ICE/icerst.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/ICE/icerst.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/ICE/icerst.F90	(revision 12969)
@@ -213,8 +213,8 @@
       CALL iom_open ( TRIM(cn_icerst_indir)//'/'//cn_icerst_in, numrir )
 
-      IF( lrxios .AND. .NOT. lxios_sini) STOP 'OCE and ICE restart must be in a single file'
-      IF(lwp) write(numout, *) 'USE XIOS to read restart: ', lrxios
+      lrixios = lrxios.AND.lxios_sini
+      IF(lwp) write(numout, *) 'USE XIOS to read restart: ', lrixios
       IF(lwp) CALL FLUSH(numout)
-      IF( lrxios) THEN
+      IF( lrixios) THEN
           crixios_context = 'si3_rst'
           IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS for SI3'
@@ -234,8 +234,8 @@
       IF( id0 > 0 ) THEN   ! == case of a normal restart == !
          !                 ! ------------------------------ !
-         IF(lrxios) CALL iom_swap(crixios_context) 
+         IF(lrixios) CALL iom_swap(crixios_context) 
          ! Time info
-         CALL iom_get( numrir, 'nn_fsbc', zfice, ldxios = lrxios )
-         CALL iom_get( numrir, 'kt_ice' , ziter, ldxios = lrxios )    
+         CALL iom_get( numrir, 'nn_fsbc', zfice, ldxios = lrixios )
+         CALL iom_get( numrir, 'kt_ice' , ziter, ldxios = lrixios )    
          IF(lwp) WRITE(numout,*) '   read ice restart file at time step    : ', ziter
          IF(lwp) WRITE(numout,*) '   in any case we force it to nit000 - 1 : ', nit000 - 1
@@ -252,16 +252,16 @@
 
          ! --- mandatory fields --- ! 
-         CALL iom_get( numrir, jpdom_autoglo, 'v_i'  , v_i,   ldxios = lrxios )
-         CALL iom_get( numrir, jpdom_autoglo, 'v_s'  , v_s,   ldxios = lrxios )
-         CALL iom_get( numrir, jpdom_autoglo, 'sv_i' , sv_i,  ldxios = lrxios )
-         CALL iom_get( numrir, jpdom_autoglo, 'a_i'  , a_i,   ldxios = lrxios )
-         CALL iom_get( numrir, jpdom_autoglo, 't_su' , t_su,  ldxios = lrxios )
-         CALL iom_get( numrir, jpdom_autoglo, 'u_ice', u_ice, ldxios = lrxios )
-         CALL iom_get( numrir, jpdom_autoglo, 'v_ice', v_ice, ldxios = lrxios )
+         CALL iom_get( numrir, jpdom_autoglo, 'v_i'  , v_i,   ldxios = lrixios )
+         CALL iom_get( numrir, jpdom_autoglo, 'v_s'  , v_s,   ldxios = lrixios )
+         CALL iom_get( numrir, jpdom_autoglo, 'sv_i' , sv_i,  ldxios = lrixios )
+         CALL iom_get( numrir, jpdom_autoglo, 'a_i'  , a_i,   ldxios = lrixios )
+         CALL iom_get( numrir, jpdom_autoglo, 't_su' , t_su,  ldxios = lrixios )
+         CALL iom_get( numrir, jpdom_autoglo, 'u_ice', u_ice, ldxios = lrixios )
+         CALL iom_get( numrir, jpdom_autoglo, 'v_ice', v_ice, ldxios = lrixios )
          ! Snow enthalpy
          DO jk = 1, nlay_s
             WRITE(zchar1,'(I2.2)') jk
             znam = 'e_s'//'_l'//zchar1
-            CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrxios )
+            CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrixios )
             e_s(:,:,jk,:) = z3d(:,:,:)
          END DO
@@ -270,5 +270,5 @@
             WRITE(zchar1,'(I2.2)') jk
             znam = 'e_i'//'_l'//zchar1
-            CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrxios )
+            CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrixios )
             e_i(:,:,jk,:) = z3d(:,:,:)
          END DO
@@ -277,5 +277,5 @@
          id1 = iom_varid( numrir, 'oa_i' , ldstop = .FALSE. )
          IF( id1 > 0 ) THEN                       ! fields exist
-            CALL iom_get( numrir, jpdom_autoglo, 'oa_i', oa_i, ldxios = lrxios )
+            CALL iom_get( numrir, jpdom_autoglo, 'oa_i', oa_i, ldxios = lrixios )
          ELSE                                     ! start from rest
             IF(lwp) WRITE(numout,*) '   ==>>   previous run without ice age output then set it to zero'
@@ -285,6 +285,6 @@
          id2 = iom_varid( numrir, 'a_ip' , ldstop = .FALSE. )
          IF( id2 > 0 ) THEN                       ! fields exist
-            CALL iom_get( numrir, jpdom_autoglo, 'a_ip' , a_ip, ldxios = lrxios )
-            CALL iom_get( numrir, jpdom_autoglo, 'v_ip' , v_ip, ldxios = lrxios )
+            CALL iom_get( numrir, jpdom_autoglo, 'a_ip' , a_ip, ldxios = lrixios )
+            CALL iom_get( numrir, jpdom_autoglo, 'v_ip' , v_ip, ldxios = lrixios )
          ELSE                                     ! start from rest
             IF(lwp) WRITE(numout,*) '   ==>>   previous run without melt ponds output then set it to zero'
@@ -297,6 +297,6 @@
             id4 = iom_varid( numrir, 't1_ice'  , ldstop = .FALSE. )
             IF( id3 > 0 .AND. id4 > 0 ) THEN         ! fields exist
-               CALL iom_get( numrir, jpdom_autoglo, 'cnd_ice', cnd_ice, ldxios = lrxios )
-               CALL iom_get( numrir, jpdom_autoglo, 't1_ice' , t1_ice,  ldxios = lrxios )
+               CALL iom_get( numrir, jpdom_autoglo, 'cnd_ice', cnd_ice, ldxios = lrixios )
+               CALL iom_get( numrir, jpdom_autoglo, 't1_ice' , t1_ice,  ldxios = lrixios )
             ELSE                                     ! start from rest
                IF(lwp) WRITE(numout,*) '   ==>>   previous run without conductivity output then set it to zero'
@@ -307,5 +307,5 @@
 
          CALL iom_delay_rst( 'READ', 'ICE', numrir )   ! read only ice delayed global communication variables
-         IF(lrxios) CALL iom_swap(cxios_context)
+         IF(lrixios) CALL iom_swap(cxios_context)
          !                 ! ---------------------------------- !
       ELSE                 ! == case of a simplified restart == !
Index: NEMO/branches/2020/dev_12905_xios_restart/src/ICE/icestp.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/ICE/icestp.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/ICE/icestp.F90	(revision 12969)
@@ -282,5 +282,5 @@
       IF( ln_rstart )  THEN
           CALL iom_close( numrir )  ! close input ice restart file
-          IF(lrxios) CALL iom_context_finalize(      crixios_context         )
+          IF(lrixios) CALL iom_context_finalize(      crixios_context         )
       ENDIF
       !
Index: NEMO/branches/2020/dev_12905_xios_restart/src/ICE/iceupdate.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/ICE/iceupdate.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/ICE/iceupdate.F90	(revision 12969)
@@ -417,8 +417,8 @@
             !
             IF( id1 > 0 ) THEN                       ! fields exist
-               IF(lrxios) CALL iom_swap(crixios_context) 
-               CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass'  , snwice_mass,   ldxios = lrxios )
-               CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass_b', snwice_mass_b, ldxios = lrxios )
-               IF(lrxios) CALL iom_swap(cxios_context)
+               IF(lrixios) CALL iom_swap(crixios_context) 
+               CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass'  , snwice_mass,   ldxios = lrixios )
+               CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass_b', snwice_mass_b, ldxios = lrixios )
+               IF(lrixios) CALL iom_swap(cxios_context)
             ELSE                                     ! start from rest
                IF(lwp) WRITE(numout,*) '   ==>>   previous run without snow-ice mass output then set it'
Index: NEMO/branches/2020/dev_12905_xios_restart/src/OCE/DIA/diahsb.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/OCE/DIA/diahsb.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/OCE/DIA/diahsb.F90	(revision 12969)
@@ -262,23 +262,23 @@
             IF(lwp) WRITE(numout,*) '   dia_hsb_rst : read hsb restart at it= ', kt,' date= ', ndastp
             IF(lwp) WRITE(numout,*)
-            IF( lrxios ) CALL iom_swap( TRIM(crxios_context) )
-            CALL iom_get( numror, 'frc_v', frc_v, ldxios = lrxios )
-            CALL iom_get( numror, 'frc_t', frc_t, ldxios = lrxios )
-            CALL iom_get( numror, 'frc_s', frc_s, ldxios = lrxios )
+            IF( lroxios ) CALL iom_swap( TRIM(crxios_context) )
+            CALL iom_get( numror, 'frc_v', frc_v, ldxios = lroxios )
+            CALL iom_get( numror, 'frc_t', frc_t, ldxios = lroxios )
+            CALL iom_get( numror, 'frc_s', frc_s, ldxios = lroxios )
             IF( ln_linssh ) THEN
-               CALL iom_get( numror, 'frc_wn_t', frc_wn_t, ldxios = lrxios )
-               CALL iom_get( numror, 'frc_wn_s', frc_wn_s, ldxios = lrxios )
+               CALL iom_get( numror, 'frc_wn_t', frc_wn_t, ldxios = lroxios )
+               CALL iom_get( numror, 'frc_wn_s', frc_wn_s, ldxios = lroxios )
             ENDIF
-            CALL iom_get( numror, jpdom_autoglo, 'surf_ini'  , surf_ini  , ldxios = lrxios ) ! ice sheet coupling
-            CALL iom_get( numror, jpdom_autoglo, 'ssh_ini'   , ssh_ini   , ldxios = lrxios )
-            CALL iom_get( numror, jpdom_autoglo, 'e3t_ini'   , e3t_ini   , ldxios = lrxios )
-            CALL iom_get( numror, jpdom_autoglo, 'tmask_ini' , tmask_ini , ldxios = lrxios )
-            CALL iom_get( numror, jpdom_autoglo, 'hc_loc_ini', hc_loc_ini, ldxios = lrxios )
-            CALL iom_get( numror, jpdom_autoglo, 'sc_loc_ini', sc_loc_ini, ldxios = lrxios )
+            CALL iom_get( numror, jpdom_autoglo, 'surf_ini'  , surf_ini  , ldxios = lroxios ) ! ice sheet coupling
+            CALL iom_get( numror, jpdom_autoglo, 'ssh_ini'   , ssh_ini   , ldxios = lroxios )
+            CALL iom_get( numror, jpdom_autoglo, 'e3t_ini'   , e3t_ini   , ldxios = lroxios )
+            CALL iom_get( numror, jpdom_autoglo, 'tmask_ini' , tmask_ini , ldxios = lroxios )
+            CALL iom_get( numror, jpdom_autoglo, 'hc_loc_ini', hc_loc_ini, ldxios = lroxios )
+            CALL iom_get( numror, jpdom_autoglo, 'sc_loc_ini', sc_loc_ini, ldxios = lroxios )
             IF( ln_linssh ) THEN
-               CALL iom_get( numror, jpdom_autoglo, 'ssh_hc_loc_ini', ssh_hc_loc_ini, ldxios = lrxios )
-               CALL iom_get( numror, jpdom_autoglo, 'ssh_sc_loc_ini', ssh_sc_loc_ini, ldxios = lrxios )
+               CALL iom_get( numror, jpdom_autoglo, 'ssh_hc_loc_ini', ssh_hc_loc_ini, ldxios = lroxios )
+               CALL iom_get( numror, jpdom_autoglo, 'ssh_sc_loc_ini', ssh_sc_loc_ini, ldxios = lroxios )
             ENDIF
-            IF( lrxios ) CALL iom_swap( TRIM(cxios_context) )
+            IF( lroxios ) CALL iom_swap( TRIM(cxios_context) )
          ELSE
             IF(lwp) WRITE(numout,*)
Index: NEMO/branches/2020/dev_12905_xios_restart/src/OCE/DOM/daymod.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/OCE/DOM/daymod.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/OCE/DOM/daymod.F90	(revision 12969)
@@ -315,8 +315,8 @@
 
       IF( TRIM(cdrw) == 'READ' ) THEN
-         IF( lrxios ) CALL iom_swap( TRIM(crxios_context) )
+         IF( lroxios ) CALL iom_swap( TRIM(crxios_context) )
          IF( iom_varid( numror, 'kt', ldstop = .FALSE. ) > 0 ) THEN
             ! Get Calendar informations
-            CALL iom_get( numror, 'kt', zkt, ldxios = lrxios )   ! last time-step of previous run
+            CALL iom_get( numror, 'kt', zkt, ldxios = lroxios )   ! last time-step of previous run
             IF(lwp) THEN
                WRITE(numout,*) ' *** Info read in restart : '
@@ -337,8 +337,8 @@
             IF ( nrstdt == 2 ) THEN
                ! read the parameters corresponding to nit000 - 1 (last time step of previous run)
-               CALL iom_get( numror, 'ndastp', zndastp, ldxios = lrxios )
+               CALL iom_get( numror, 'ndastp', zndastp, ldxios = lroxios )
                ndastp = NINT( zndastp )
-               CALL iom_get( numror, 'adatrj', adatrj , ldxios = lrxios )
-	       CALL iom_get( numror, 'ntime' , ktime  , ldxios = lrxios )
+               CALL iom_get( numror, 'adatrj', adatrj , ldxios = lroxios )
+	       CALL iom_get( numror, 'ntime' , ktime  , ldxios = lroxios )
                nn_time0 = NINT(ktime)
                ! calculate start time in hours and minutes
@@ -383,5 +383,5 @@
             adatrj = ( REAL( nit000-1, wp ) * rn_Dt ) / rday
          ENDIF
-         IF( lrxios ) CALL iom_swap( TRIM(cxios_context) )
+         IF( lroxios ) CALL iom_swap( TRIM(cxios_context) )
          IF( ABS(adatrj  - REAL(NINT(adatrj),wp)) < 0.1 / rday )   adatrj = REAL(NINT(adatrj),wp)   ! avoid truncation error
          !
Index: NEMO/branches/2020/dev_12905_xios_restart/src/OCE/DOM/domvvl.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/OCE/DOM/domvvl.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/OCE/DOM/domvvl.F90	(revision 12969)
@@ -775,6 +775,6 @@
          IF( ln_rstart ) THEN                   !* Read the restart file
             CALL rst_read_open                  !  open the restart file if necessary
-            IF( lrxios ) CALL iom_swap( TRIM(crxios_context) )
-            CALL iom_get( numror, jpdom_autoglo, 'sshn'   , ssh(:,:,Kmm), ldxios = lrxios    )
+            IF( lroxios ) CALL iom_swap( TRIM(crxios_context) )
+            CALL iom_get( numror, jpdom_autoglo, 'sshn'   , ssh(:,:,Kmm), ldxios = lroxios    )
             !
             id1 = iom_varid( numror, 'e3t_b', ldstop = .FALSE. )
@@ -789,6 +789,6 @@
             !
             IF( MIN( id1, id2 ) > 0 ) THEN       ! all required arrays exist
-               CALL iom_get( numror, jpdom_autoglo, 'e3t_b', e3t(:,:,:,Kbb), ldxios = lrxios )
-               CALL iom_get( numror, jpdom_autoglo, 'e3t_n', e3t(:,:,:,Kmm), ldxios = lrxios )
+               CALL iom_get( numror, jpdom_autoglo, 'e3t_b', e3t(:,:,:,Kbb), ldxios = lroxios )
+               CALL iom_get( numror, jpdom_autoglo, 'e3t_n', e3t(:,:,:,Kmm), ldxios = lroxios )
                ! needed to restart if land processor not computed 
                IF(lwp) write(numout,*) 'dom_vvl_rst : e3t(:,:,:,Kbb) and e3t(:,:,:,Kmm) found in restart files'
@@ -804,5 +804,5 @@
                IF(lwp) write(numout,*) 'e3t_n set equal to e3t_b.'
                IF(lwp) write(numout,*) 'l_1st_euler is forced to true'
-               CALL iom_get( numror, jpdom_autoglo, 'e3t_b', e3t(:,:,:,Kbb), ldxios = lrxios )
+               CALL iom_get( numror, jpdom_autoglo, 'e3t_b', e3t(:,:,:,Kbb), ldxios = lroxios )
                e3t(:,:,:,Kmm) = e3t(:,:,:,Kbb)
                l_1st_euler = .true.
@@ -811,5 +811,5 @@
                IF(lwp) write(numout,*) 'e3t_b set equal to e3t_n.'
                IF(lwp) write(numout,*) 'l_1st_euler is forced to true'
-               CALL iom_get( numror, jpdom_autoglo, 'e3t_n', e3t(:,:,:,Kmm), ldxios = lrxios )
+               CALL iom_get( numror, jpdom_autoglo, 'e3t_n', e3t(:,:,:,Kmm), ldxios = lroxios )
                e3t(:,:,:,Kbb) = e3t(:,:,:,Kmm)
                l_1st_euler = .true.
@@ -836,6 +836,6 @@
                !                          ! ----------------------- !
                IF( MIN( id3, id4 ) > 0 ) THEN  ! all required arrays exist
-                  CALL iom_get( numror, jpdom_autoglo, 'tilde_e3t_b', tilde_e3t_b(:,:,:), ldxios = lrxios )
-                  CALL iom_get( numror, jpdom_autoglo, 'tilde_e3t_n', tilde_e3t_n(:,:,:), ldxios = lrxios )
+                  CALL iom_get( numror, jpdom_autoglo, 'tilde_e3t_b', tilde_e3t_b(:,:,:), ldxios = lroxios )
+                  CALL iom_get( numror, jpdom_autoglo, 'tilde_e3t_n', tilde_e3t_n(:,:,:), ldxios = lroxios )
                ELSE                            ! one at least array is missing
                   tilde_e3t_b(:,:,:) = 0.0_wp
@@ -846,5 +846,5 @@
                   !                       ! ------------ !
                   IF( id5 > 0 ) THEN  ! required array exists
-                     CALL iom_get( numror, jpdom_autoglo, 'hdiv_lf', hdiv_lf(:,:,:), ldxios = lrxios )
+                     CALL iom_get( numror, jpdom_autoglo, 'hdiv_lf', hdiv_lf(:,:,:), ldxios = lroxios )
                   ELSE                ! array is missing
                      hdiv_lf(:,:,:) = 0.0_wp
@@ -852,5 +852,5 @@
                ENDIF
             ENDIF
-            IF( lrxios ) CALL iom_swap( TRIM(cxios_context) )
+            IF( lroxios ) CALL iom_swap( TRIM(cxios_context) )
             !
          ELSE                                   !* Initialize at "rest"
Index: NEMO/branches/2020/dev_12905_xios_restart/src/OCE/DYN/dynspg_ts.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/OCE/DYN/dynspg_ts.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/OCE/DYN/dynspg_ts.F90	(revision 12969)
@@ -890,23 +890,23 @@
       IF( TRIM(cdrw) == 'READ' ) THEN        ! Read/initialise 
          !                                   ! ---------------
-         IF( lrxios ) CALL iom_swap( TRIM(crxios_context) )
+         IF( lroxios ) CALL iom_swap( TRIM(crxios_context) )
          IF( ln_rstart .AND. ln_bt_fw .AND. (.NOT.l_1st_euler) ) THEN    !* Read the restart file
-            CALL iom_get( numror, jpdom_autoglo, 'ub2_b'  , ub2_b  (:,:), ldxios = lrxios )   
-            CALL iom_get( numror, jpdom_autoglo, 'vb2_b'  , vb2_b  (:,:), ldxios = lrxios ) 
-            CALL iom_get( numror, jpdom_autoglo, 'un_bf'  , un_bf  (:,:), ldxios = lrxios )   
-            CALL iom_get( numror, jpdom_autoglo, 'vn_bf'  , vn_bf  (:,:), ldxios = lrxios ) 
+            CALL iom_get( numror, jpdom_autoglo, 'ub2_b'  , ub2_b  (:,:), ldxios = lroxios )   
+            CALL iom_get( numror, jpdom_autoglo, 'vb2_b'  , vb2_b  (:,:), ldxios = lroxios ) 
+            CALL iom_get( numror, jpdom_autoglo, 'un_bf'  , un_bf  (:,:), ldxios = lroxios )   
+            CALL iom_get( numror, jpdom_autoglo, 'vn_bf'  , vn_bf  (:,:), ldxios = lroxios ) 
             IF( .NOT.ln_bt_av ) THEN
-               CALL iom_get( numror, jpdom_autoglo, 'sshbb_e'  , sshbb_e(:,:), ldxios = lrxios )   
-               CALL iom_get( numror, jpdom_autoglo, 'ubb_e'    ,   ubb_e(:,:), ldxios = lrxios )   
-               CALL iom_get( numror, jpdom_autoglo, 'vbb_e'    ,   vbb_e(:,:), ldxios = lrxios )
-               CALL iom_get( numror, jpdom_autoglo, 'sshb_e'   ,  sshb_e(:,:), ldxios = lrxios ) 
-               CALL iom_get( numror, jpdom_autoglo, 'ub_e'     ,    ub_e(:,:), ldxios = lrxios )   
-               CALL iom_get( numror, jpdom_autoglo, 'vb_e'     ,    vb_e(:,:), ldxios = lrxios )
+               CALL iom_get( numror, jpdom_autoglo, 'sshbb_e'  , sshbb_e(:,:), ldxios = lroxios )   
+               CALL iom_get( numror, jpdom_autoglo, 'ubb_e'    ,   ubb_e(:,:), ldxios = lroxios )   
+               CALL iom_get( numror, jpdom_autoglo, 'vbb_e'    ,   vbb_e(:,:), ldxios = lroxios )
+               CALL iom_get( numror, jpdom_autoglo, 'sshb_e'   ,  sshb_e(:,:), ldxios = lroxios ) 
+               CALL iom_get( numror, jpdom_autoglo, 'ub_e'     ,    ub_e(:,:), ldxios = lroxios )   
+               CALL iom_get( numror, jpdom_autoglo, 'vb_e'     ,    vb_e(:,:), ldxios = lroxios )
             ENDIF
 #if defined key_agrif
             ! Read time integrated fluxes
             IF ( .NOT.Agrif_Root() ) THEN
-               CALL iom_get( numror, jpdom_autoglo, 'ub2_i_b'  , ub2_i_b(:,:), ldxios = lrxios )   
-               CALL iom_get( numror, jpdom_autoglo, 'vb2_i_b'  , vb2_i_b(:,:), ldxios = lrxios )
+               CALL iom_get( numror, jpdom_autoglo, 'ub2_i_b'  , ub2_i_b(:,:), ldxios = lroxios )   
+               CALL iom_get( numror, jpdom_autoglo, 'vb2_i_b'  , vb2_i_b(:,:), ldxios = lroxios )
             ENDIF
 #endif
@@ -923,5 +923,5 @@
 #endif
          ENDIF
-         IF( lrxios ) CALL iom_swap( TRIM(cxios_context) )
+         IF( lroxios ) CALL iom_swap( TRIM(cxios_context) )
          !
       ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN   ! Create restart file
Index: NEMO/branches/2020/dev_12905_xios_restart/src/OCE/IOM/iom_def.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/OCE/IOM/iom_def.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/OCE/IOM/iom_def.F90	(revision 12969)
@@ -43,5 +43,6 @@
    INTEGER, PUBLIC            ::   nxioso          !: type of restart file when writing using XIOS 1 - single, 2 - multiple
 !XIOS read restart   
-   LOGICAL, PUBLIC            ::   lrxios          !: read single file restart using XIOS
+   LOGICAL, PUBLIC            ::   lrxios          !: read single file restart using XIOS main switch
+   LOGICAL, PUBLIC            ::   lroxios         !: read single file restart using XIOS for oce      
    LOGICAL, PUBLIC            ::   lxios_sini = .FALSE. ! is restart in a single file
 
Index: NEMO/branches/2020/dev_12905_xios_restart/src/OCE/IOM/restart.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/OCE/IOM/restart.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/OCE/IOM/restart.F90	(revision 12969)
@@ -210,7 +210,7 @@
 ! can handle checking if variable is in the restart file (there will be no need to open
 ! restart)
-         lrxios = lrxios.AND.lxios_sini
-
-         IF( lrxios) THEN
+         lroxios = lrxios.AND.lxios_sini
+
+         IF( lroxios) THEN
              crxios_context = 'oce_rst'
              IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS'
@@ -246,7 +246,7 @@
 
       ! Check dynamics and tracer time-step consistency and force Euler restart if changed
-      IF( lrxios ) CALL iom_swap( TRIM(crxios_context) )
+      IF( lroxios ) CALL iom_swap( TRIM(crxios_context) )
       IF( iom_varid( numror, 'rdt', ldstop = .FALSE. ) > 0 )   THEN
-         CALL iom_get( numror, 'rdt', zrdt, ldxios = lrxios )
+         CALL iom_get( numror, 'rdt', zrdt, ldxios = lroxios )
          IF( zrdt /= rn_Dt ) THEN
             IF(lwp) WRITE( numout,*)
@@ -261,10 +261,10 @@
       
       ! Diurnal DSST 
-      IF( ln_diurnal ) CALL iom_get( numror, jpdom_autoglo, 'Dsst' , x_dsst, ldxios = lrxios ) 
+      IF( ln_diurnal ) CALL iom_get( numror, jpdom_autoglo, 'Dsst' , x_dsst, ldxios = lroxios ) 
       IF ( ln_diurnal_only ) THEN 
          IF(lwp) WRITE( numout, * ) &
          &   "rst_read:- ln_diurnal_only set, setting rhop=rho0" 
          rhop = rho0
-         CALL iom_get( numror, jpdom_autoglo, 'tn'     , w3d, ldxios = lrxios ) 
+         CALL iom_get( numror, jpdom_autoglo, 'tn'     , w3d, ldxios = lroxios ) 
          ts(:,:,1,jp_tem,Kmm) = w3d(:,:,1)
          RETURN 
@@ -272,24 +272,24 @@
 
       IF( iom_varid( numror, 'ub', ldstop = .FALSE. ) > 0 ) THEN
-         CALL iom_get( numror, jpdom_autoglo, 'ub'     , uu(:,:,:       ,Kbb), ldxios = lrxios )   ! before fields
-         CALL iom_get( numror, jpdom_autoglo, 'vb'     , vv(:,:,:       ,Kbb), ldxios = lrxios )
-         CALL iom_get( numror, jpdom_autoglo, 'tb'     , ts(:,:,:,jp_tem,Kbb), ldxios = lrxios )
-         CALL iom_get( numror, jpdom_autoglo, 'sb'     , ts(:,:,:,jp_sal,Kbb), ldxios = lrxios )
-         CALL iom_get( numror, jpdom_autoglo, 'sshb'   ,ssh(:,:         ,Kbb), ldxios = lrxios )
+         CALL iom_get( numror, jpdom_autoglo, 'ub'     , uu(:,:,:       ,Kbb), ldxios = lroxios )   ! before fields
+         CALL iom_get( numror, jpdom_autoglo, 'vb'     , vv(:,:,:       ,Kbb), ldxios = lroxios )
+         CALL iom_get( numror, jpdom_autoglo, 'tb'     , ts(:,:,:,jp_tem,Kbb), ldxios = lroxios )
+         CALL iom_get( numror, jpdom_autoglo, 'sb'     , ts(:,:,:,jp_sal,Kbb), ldxios = lroxios )
+         CALL iom_get( numror, jpdom_autoglo, 'sshb'   ,ssh(:,:         ,Kbb), ldxios = lroxios )
       ELSE
          l_1st_euler =  .TRUE.      ! before field not found, forced euler 1st time-step
       ENDIF
       !
-      CALL iom_get( numror, jpdom_autoglo, 'un'     , uu(:,:,:       ,Kmm), ldxios = lrxios )       ! now    fields
-      CALL iom_get( numror, jpdom_autoglo, 'vn'     , vv(:,:,:       ,Kmm), ldxios = lrxios )
-      CALL iom_get( numror, jpdom_autoglo, 'tn'     , ts(:,:,:,jp_tem,Kmm), ldxios = lrxios )
-      CALL iom_get( numror, jpdom_autoglo, 'sn'     , ts(:,:,:,jp_sal,Kmm), ldxios = lrxios )
-      CALL iom_get( numror, jpdom_autoglo, 'sshn'   ,ssh(:,:         ,Kmm), ldxios = lrxios )
+      CALL iom_get( numror, jpdom_autoglo, 'un'     , uu(:,:,:       ,Kmm), ldxios = lroxios )       ! now    fields
+      CALL iom_get( numror, jpdom_autoglo, 'vn'     , vv(:,:,:       ,Kmm), ldxios = lroxios )
+      CALL iom_get( numror, jpdom_autoglo, 'tn'     , ts(:,:,:,jp_tem,Kmm), ldxios = lroxios )
+      CALL iom_get( numror, jpdom_autoglo, 'sn'     , ts(:,:,:,jp_sal,Kmm), ldxios = lroxios )
+      CALL iom_get( numror, jpdom_autoglo, 'sshn'   ,ssh(:,:         ,Kmm), ldxios = lroxios )
       IF( iom_varid( numror, 'rhop', ldstop = .FALSE. ) > 0 ) THEN
-         CALL iom_get( numror, jpdom_autoglo, 'rhop'   , rhop, ldxios = lrxios )   ! now    potential density
+         CALL iom_get( numror, jpdom_autoglo, 'rhop'   , rhop, ldxios = lroxios )   ! now    potential density
       ELSE
          CALL eos( ts(:,:,:,:,Kmm), rhd, rhop, gdept(:,:,:,Kmm) )   
       ENDIF
-      IF( lrxios ) CALL iom_swap( TRIM(cxios_context) )
+      IF( lroxios ) CALL iom_swap( TRIM(cxios_context) )
       !
       IF( l_1st_euler ) THEN                                  ! Euler restart 
Index: NEMO/branches/2020/dev_12905_xios_restart/src/OCE/ISF/isfcpl.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/OCE/ISF/isfcpl.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/OCE/ISF/isfcpl.F90	(revision 12969)
@@ -157,7 +157,7 @@
       !!----------------------------------------------------------------------
       !
-      IF( lrxios ) CALL iom_swap( TRIM(crxios_context) )
-      CALL iom_get( numror, jpdom_autoglo, 'ssmask'  , zssmask_b, ldxios = lrxios   ) ! need to extrapolate T/S
-      IF( lrxios ) CALL iom_swap( TRIM(cxios_context) )
+      IF( lroxios ) CALL iom_swap( TRIM(crxios_context) )
+      CALL iom_get( numror, jpdom_autoglo, 'ssmask'  , zssmask_b, ldxios = lroxios   ) ! need to extrapolate T/S
+      IF( lroxios ) CALL iom_swap( TRIM(cxios_context) )
 
       ! compute new ssh if we open a full water column 
@@ -238,9 +238,9 @@
       !!----------------------------------------------------------------------
       ! 
-      IF( lrxios ) CALL iom_swap( TRIM(crxios_context) )
-      CALL iom_get( numror, jpdom_autoglo, 'tmask'  , ztmask_b, ldxios = lrxios   ) ! need to extrapolate T/S
-      !CALL iom_get( numror, jpdom_autoglo, 'wmask'  , zwmask_b, ldxios = lrxios   ) ! need to extrapolate T/S
-      !CALL iom_get( numror, jpdom_autoglo, 'gdepw_n', zdepw_b(:,:,:), ldxios = lrxios ) ! need to interpol vertical profile (vvl)
-      IF( lrxios ) CALL iom_swap( TRIM(cxios_context) )
+      IF( lroxios ) CALL iom_swap( TRIM(crxios_context) )
+      CALL iom_get( numror, jpdom_autoglo, 'tmask'  , ztmask_b, ldxios = lroxios   ) ! need to extrapolate T/S
+      !CALL iom_get( numror, jpdom_autoglo, 'wmask'  , zwmask_b, ldxios = lroxios   ) ! need to extrapolate T/S
+      !CALL iom_get( numror, jpdom_autoglo, 'gdepw_n', zdepw_b(:,:,:), ldxios = lroxios ) ! need to interpol vertical profile (vvl)
+      IF( lroxios ) CALL iom_swap( TRIM(cxios_context) )
       !
       ! 
@@ -386,9 +386,9 @@
       !!----------------------------------------------------------------------
       !
-      IF( lrxios ) CALL iom_swap( TRIM(crxios_context) )
-      CALL iom_get( numror, jpdom_autoglo, 'tmask'  , ztmask_b, ldxios = lrxios )
-      CALL iom_get( numror, jpdom_autoglo, 'e3u_n'  , ze3u_b  , ldxios = lrxios )
-      CALL iom_get( numror, jpdom_autoglo, 'e3v_n'  , ze3v_b  , ldxios = lrxios )
-      IF( lrxios ) CALL iom_swap( TRIM(cxios_context) )
+      IF( lroxios ) CALL iom_swap( TRIM(crxios_context) )
+      CALL iom_get( numror, jpdom_autoglo, 'tmask'  , ztmask_b, ldxios = lroxios )
+      CALL iom_get( numror, jpdom_autoglo, 'e3u_n'  , ze3u_b  , ldxios = lroxios )
+      CALL iom_get( numror, jpdom_autoglo, 'e3v_n'  , ze3v_b  , ldxios = lroxios )
+      IF( lroxios ) CALL iom_swap( TRIM(cxios_context) )
       !
       ! 1.0: compute horizontal volume flux divergence difference before-after coupling
@@ -492,10 +492,10 @@
 
       ! get restart variable
-      IF( lrxios ) CALL iom_swap( TRIM(crxios_context) )
-      CALL iom_get( numror, jpdom_autoglo, 'tmask'  , ztmask_b(:,:,:), ldxios = lrxios   ) ! need to extrapolate T/S
-      CALL iom_get( numror, jpdom_autoglo, 'e3t_n'  , ze3t_b(:,:,:)  , ldxios = lrxios )
-      CALL iom_get( numror, jpdom_autoglo, 'tn'     , zt_b(:,:,:)    , ldxios = lrxios )
-      CALL iom_get( numror, jpdom_autoglo, 'sn'     , zs_b(:,:,:)    , ldxios = lrxios )
-      IF( lrxios ) CALL iom_swap( TRIM(cxios_context) )
+      IF( lroxios ) CALL iom_swap( TRIM(crxios_context) )
+      CALL iom_get( numror, jpdom_autoglo, 'tmask'  , ztmask_b(:,:,:), ldxios = lroxios   ) ! need to extrapolate T/S
+      CALL iom_get( numror, jpdom_autoglo, 'e3t_n'  , ze3t_b(:,:,:)  , ldxios = lroxios )
+      CALL iom_get( numror, jpdom_autoglo, 'tn'     , zt_b(:,:,:)    , ldxios = lroxios )
+      CALL iom_get( numror, jpdom_autoglo, 'sn'     , zs_b(:,:,:)    , ldxios = lroxios )
+      IF( lroxios ) CALL iom_swap( TRIM(cxios_context) )
 
       ! compute run length
Index: NEMO/branches/2020/dev_12905_xios_restart/src/OCE/ISF/isfrst.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/OCE/ISF/isfrst.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/OCE/ISF/isfrst.F90	(revision 12969)
@@ -53,9 +53,9 @@
       IF( iom_varid( numror, cfwf_b, ldstop = .FALSE. ) > 0 ) THEN
          IF(lwp) WRITE(numout,*) '          nit000-1 isf tracer content forcing fields read in the restart file'
-         IF( lrxios ) CALL iom_swap( TRIM(crxios_context) )
-         CALL iom_get( numror, jpdom_autoglo, cfwf_b, pfwf_b(:,:)        , ldxios = lrxios )   ! before ice shelf melt
-         CALL iom_get( numror, jpdom_autoglo, chc_b , ptsc_b (:,:,jp_tem), ldxios = lrxios )   ! before ice shelf heat flux
-         CALL iom_get( numror, jpdom_autoglo, csc_b , ptsc_b (:,:,jp_sal), ldxios = lrxios )   ! before ice shelf heat flux
-         IF( lrxios ) CALL iom_swap( TRIM(cxios_context) )
+         IF( lroxios ) CALL iom_swap( TRIM(crxios_context) )
+         CALL iom_get( numror, jpdom_autoglo, cfwf_b, pfwf_b(:,:)        , ldxios = lroxios )   ! before ice shelf melt
+         CALL iom_get( numror, jpdom_autoglo, chc_b , ptsc_b (:,:,jp_tem), ldxios = lroxios )   ! before ice shelf heat flux
+         CALL iom_get( numror, jpdom_autoglo, csc_b , ptsc_b (:,:,jp_sal), ldxios = lroxios )   ! before ice shelf heat flux
+         IF( lroxios ) CALL iom_swap( TRIM(cxios_context) )
       ELSE
          pfwf_b(:,:)   = pfwf(:,:)
Index: NEMO/branches/2020/dev_12905_xios_restart/src/OCE/SBC/sbcapr.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/OCE/SBC/sbcapr.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/OCE/SBC/sbcapr.F90	(revision 12969)
@@ -65,5 +65,4 @@
       CHARACTER(len=100) ::  cn_dir   ! Root directory for location of ssr files
       TYPE(FLD_N)        ::  sn_apr   ! informations about the fields to be read
-      LOGICAL            ::  lrxios   ! read restart using XIOS?
       !!
       NAMELIST/namsbc_apr/ cn_dir, sn_apr, ln_ref_apr, rn_pref, ln_apr_obc
@@ -149,8 +148,8 @@
          !                                      ! ---------------------------------------- !
          !                                            !* Restart: read in restart file
-         IF( lrxios ) CALL iom_swap( TRIM(crxios_context) )
+         IF( lroxios ) CALL iom_swap( TRIM(crxios_context) )
          IF( ln_rstart .AND. iom_varid( numror, 'ssh_ibb', ldstop = .FALSE. ) > 0 ) THEN 
             IF(lwp) WRITE(numout,*) 'sbc_apr:   ssh_ibb read in the restart file'
-            CALL iom_get( numror, jpdom_autoglo, 'ssh_ibb', ssh_ibb, ldxios = lrxios )   ! before inv. barometer ssh
+            CALL iom_get( numror, jpdom_autoglo, 'ssh_ibb', ssh_ibb, ldxios = lroxios )   ! before inv. barometer ssh
             !
          ELSE                                         !* no restart: set from nit000 values
@@ -158,5 +157,5 @@
             ssh_ibb(:,:) = ssh_ib(:,:)
          ENDIF
-         IF( lrxios ) CALL iom_swap( TRIM(cxios_context) )
+         IF( lroxios ) CALL iom_swap( TRIM(cxios_context) )
       ENDIF
       !                                         ! ---------------------------------------- !
Index: NEMO/branches/2020/dev_12905_xios_restart/src/OCE/SBC/sbcmod.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/OCE/SBC/sbcmod.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/OCE/SBC/sbcmod.F90	(revision 12969)
@@ -504,17 +504,17 @@
       IF( kt == nit000 ) THEN                          !   set the forcing field at nit000 - 1    !
          !                                             ! ---------------------------------------- !
-         IF( lrxios ) CALL iom_swap( TRIM(crxios_context) )
+         IF( lroxios ) CALL iom_swap( TRIM(crxios_context) )
          IF( ln_rstart .AND.    &                               !* Restart: read in restart file
             & iom_varid( numror, 'utau_b', ldstop = .FALSE. ) > 0 ) THEN
             IF(lwp) WRITE(numout,*) '          nit000-1 surface forcing fields red in the restart file'
-            CALL iom_get( numror, jpdom_autoglo, 'utau_b', utau_b, ldxios = lrxios )   ! before i-stress  (U-point)
-            CALL iom_get( numror, jpdom_autoglo, 'vtau_b', vtau_b, ldxios = lrxios )   ! before j-stress  (V-point)
-            CALL iom_get( numror, jpdom_autoglo,  'qns_b',  qns_b, ldxios = lrxios )   ! before non solar heat flux (T-point)
+            CALL iom_get( numror, jpdom_autoglo, 'utau_b', utau_b, ldxios = lroxios )   ! before i-stress  (U-point)
+            CALL iom_get( numror, jpdom_autoglo, 'vtau_b', vtau_b, ldxios = lroxios )   ! before j-stress  (V-point)
+            CALL iom_get( numror, jpdom_autoglo,  'qns_b',  qns_b, ldxios = lroxios )   ! before non solar heat flux (T-point)
             ! The 3D heat content due to qsr forcing is treated in traqsr
-            ! CALL iom_get( numror, jpdom_autoglo, 'qsr_b' , qsr_b, ldxios = lrxios  ) ! before     solar heat flux (T-point)
-            CALL iom_get( numror, jpdom_autoglo, 'emp_b', emp_b, ldxios = lrxios  )    ! before     freshwater flux (T-point)
+            ! CALL iom_get( numror, jpdom_autoglo, 'qsr_b' , qsr_b, ldxios = lroxios  ) ! before     solar heat flux (T-point)
+            CALL iom_get( numror, jpdom_autoglo, 'emp_b', emp_b, ldxios = lroxios  )    ! before     freshwater flux (T-point)
             ! To ensure restart capability with 3.3x/3.4 restart files    !! to be removed in v3.6
             IF( iom_varid( numror, 'sfx_b', ldstop = .FALSE. ) > 0 ) THEN
-               CALL iom_get( numror, jpdom_autoglo, 'sfx_b', sfx_b, ldxios = lrxios )  ! before salt flux (T-point)
+               CALL iom_get( numror, jpdom_autoglo, 'sfx_b', sfx_b, ldxios = lroxios )  ! before salt flux (T-point)
             ELSE
                sfx_b (:,:) = sfx(:,:)
@@ -528,5 +528,5 @@
             sfx_b (:,:) = sfx (:,:)
          ENDIF
-         IF( lrxios ) CALL iom_swap( TRIM(cxios_context) )
+         IF( lroxios ) CALL iom_swap( TRIM(cxios_context) )
       ENDIF
       !                                                ! ---------------------------------------- !
Index: NEMO/branches/2020/dev_12905_xios_restart/src/OCE/SBC/sbcrnf.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/OCE/SBC/sbcrnf.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/OCE/SBC/sbcrnf.F90	(revision 12969)
@@ -156,11 +156,11 @@
       IF( kt == nit000 ) THEN                          !   set the forcing field at nit000 - 1    !
          !                                             ! ---------------------------------------- !
-         IF( lrxios ) CALL iom_swap( TRIM(crxios_context) )
+         IF( lroxios ) CALL iom_swap( TRIM(crxios_context) )
          IF( ln_rstart .AND.    &                               !* Restart: read in restart file
             & iom_varid( numror, 'rnf_b', ldstop = .FALSE. ) > 0 ) THEN
-            IF(lwp) WRITE(numout,*) '          nit000-1 runoff forcing fields red in the restart file', lrxios
-            CALL iom_get( numror, jpdom_autoglo, 'rnf_b', rnf_b, ldxios = lrxios )     ! before runoff
-            CALL iom_get( numror, jpdom_autoglo, 'rnf_hc_b', rnf_tsc_b(:,:,jp_tem), ldxios = lrxios )   ! before heat content of runoff
-            CALL iom_get( numror, jpdom_autoglo, 'rnf_sc_b', rnf_tsc_b(:,:,jp_sal), ldxios = lrxios )   ! before salinity content of runoff
+            IF(lwp) WRITE(numout,*) '          nit000-1 runoff forcing fields red in the restart file', lroxios
+            CALL iom_get( numror, jpdom_autoglo, 'rnf_b', rnf_b, ldxios = lroxios )     ! before runoff
+            CALL iom_get( numror, jpdom_autoglo, 'rnf_hc_b', rnf_tsc_b(:,:,jp_tem), ldxios = lroxios )   ! before heat content of runoff
+            CALL iom_get( numror, jpdom_autoglo, 'rnf_sc_b', rnf_tsc_b(:,:,jp_sal), ldxios = lroxios )   ! before salinity content of runoff
          ELSE                                                   !* no restart: set from nit000 values
             IF(lwp) WRITE(numout,*) '          nit000-1 runoff forcing fields set to nit000'
@@ -168,5 +168,5 @@
             rnf_tsc_b(:,:,:) = rnf_tsc(:,:,:)
          ENDIF
-         IF( lrxios ) CALL iom_swap( TRIM(cxios_context) )
+         IF( lroxios ) CALL iom_swap( TRIM(cxios_context) )
       ENDIF
       !                                                ! ---------------------------------------- !
Index: NEMO/branches/2020/dev_12905_xios_restart/src/OCE/SBC/sbcssm.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/OCE/SBC/sbcssm.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/OCE/SBC/sbcssm.F90	(revision 12969)
@@ -205,17 +205,17 @@
          IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~ '
          !
-         IF( lrxios ) CALL iom_swap( TRIM(crxios_context) )
+         IF( lroxios ) CALL iom_swap( TRIM(crxios_context) )
          IF( ln_rstart .AND. iom_varid( numror, 'nn_fsbc', ldstop = .FALSE. ) > 0 ) THEN
             l_ssm_mean = .TRUE.
-            CALL iom_get( numror               , 'nn_fsbc', zf_sbc, ldxios = lrxios )    ! sbc frequency of previous run
-            CALL iom_get( numror, jpdom_autoglo, 'ssu_m'  , ssu_m, ldxios = lrxios  )    ! sea surface mean velocity    (U-point)
-            CALL iom_get( numror, jpdom_autoglo, 'ssv_m'  , ssv_m, ldxios = lrxios  )    !   "         "    velocity    (V-point)
-            CALL iom_get( numror, jpdom_autoglo, 'sst_m'  , sst_m, ldxios = lrxios  )    !   "         "    temperature (T-point)
-            CALL iom_get( numror, jpdom_autoglo, 'sss_m'  , sss_m, ldxios = lrxios  )    !   "         "    salinity    (T-point)
-            CALL iom_get( numror, jpdom_autoglo, 'ssh_m'  , ssh_m, ldxios = lrxios  )    !   "         "    height      (T-point)
-            CALL iom_get( numror, jpdom_autoglo, 'e3t_m'  , e3t_m, ldxios = lrxios  )    ! 1st level thickness          (T-point)
+            CALL iom_get( numror               , 'nn_fsbc', zf_sbc, ldxios = lroxios )    ! sbc frequency of previous run
+            CALL iom_get( numror, jpdom_autoglo, 'ssu_m'  , ssu_m, ldxios = lroxios  )    ! sea surface mean velocity    (U-point)
+            CALL iom_get( numror, jpdom_autoglo, 'ssv_m'  , ssv_m, ldxios = lroxios  )    !   "         "    velocity    (V-point)
+            CALL iom_get( numror, jpdom_autoglo, 'sst_m'  , sst_m, ldxios = lroxios  )    !   "         "    temperature (T-point)
+            CALL iom_get( numror, jpdom_autoglo, 'sss_m'  , sss_m, ldxios = lroxios  )    !   "         "    salinity    (T-point)
+            CALL iom_get( numror, jpdom_autoglo, 'ssh_m'  , ssh_m, ldxios = lroxios  )    !   "         "    height      (T-point)
+            CALL iom_get( numror, jpdom_autoglo, 'e3t_m'  , e3t_m, ldxios = lroxios  )    ! 1st level thickness          (T-point)
             ! fraction of solar net radiation absorbed in 1st T level
             IF( iom_varid( numror, 'frq_m', ldstop = .FALSE. ) > 0 ) THEN
-               CALL iom_get( numror, jpdom_autoglo, 'frq_m'  , frq_m, ldxios = lrxios  )
+               CALL iom_get( numror, jpdom_autoglo, 'frq_m'  , frq_m, ldxios = lroxios  )
             ELSE
                frq_m(:,:) = 1._wp   ! default definition
@@ -236,5 +236,5 @@
             ENDIF
          ENDIF
-         IF( lrxios ) CALL iom_swap( TRIM(cxios_context) )
+         IF( lroxios ) CALL iom_swap( TRIM(cxios_context) )
       ENDIF
       !
Index: NEMO/branches/2020/dev_12905_xios_restart/src/OCE/TRA/traqsr.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/OCE/TRA/traqsr.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/OCE/TRA/traqsr.F90	(revision 12969)
@@ -135,14 +135,14 @@
       !                         !-----------------------------------!
       IF( kt == nit000 ) THEN          !==  1st time step  ==!
-         IF( lrxios ) CALL iom_swap( TRIM(crxios_context) )
+         IF( lroxios ) CALL iom_swap( TRIM(crxios_context) )
          IF( ln_rstart .AND. iom_varid( numror, 'qsr_hc_b', ldstop = .FALSE. ) > 0  .AND. .NOT.l_1st_euler ) THEN    ! read in restart
             IF(lwp) WRITE(numout,*) '          nit000-1 qsr tracer content forcing field read in the restart file'
             z1_2 = 0.5_wp
-            CALL iom_get( numror, jpdom_autoglo, 'qsr_hc_b', qsr_hc_b, ldxios = lrxios )   ! before heat content trend due to Qsr flux
+            CALL iom_get( numror, jpdom_autoglo, 'qsr_hc_b', qsr_hc_b, ldxios = lroxios )   ! before heat content trend due to Qsr flux
          ELSE                                           ! No restart or restart not found: Euler forward time stepping
             z1_2 = 1._wp
             qsr_hc_b(:,:,:) = 0._wp
          ENDIF
-         IF( lrxios ) CALL iom_swap( TRIM(cxios_context) )
+         IF( lroxios ) CALL iom_swap( TRIM(cxios_context) )
       ELSE                             !==  Swap of qsr heat content  ==!
          z1_2 = 0.5_wp
@@ -403,11 +403,11 @@
       !
       ! 1st ocean level attenuation coefficient (used in sbcssm)
-      IF( lrxios ) CALL iom_swap( TRIM(crxios_context) )
+      IF( lroxios ) CALL iom_swap( TRIM(crxios_context) )
       IF( iom_varid( numror, 'fraqsr_1lev', ldstop = .FALSE. ) > 0 ) THEN
-         CALL iom_get( numror, jpdom_autoglo, 'fraqsr_1lev'  , fraqsr_1lev, ldxios = lrxios  )
+         CALL iom_get( numror, jpdom_autoglo, 'fraqsr_1lev'  , fraqsr_1lev, ldxios = lroxios  )
       ELSE
          fraqsr_1lev(:,:) = 1._wp   ! default : no penetration
       ENDIF
-      IF( lrxios ) CALL iom_swap( TRIM(cxios_context) )
+      IF( lroxios ) CALL iom_swap( TRIM(cxios_context) )
       !
    END SUBROUTINE tra_qsr_init
Index: NEMO/branches/2020/dev_12905_xios_restart/src/OCE/TRA/trasbc.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/OCE/TRA/trasbc.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/OCE/TRA/trasbc.F90	(revision 12969)
@@ -106,5 +106,5 @@
       !                             !==  Set before sbc tracer content fields  ==!
       IF( kt == nit000 ) THEN             !* 1st time-step
-         IF( lrxios ) CALL iom_swap( TRIM(crxios_context) )
+         IF( lroxios ) CALL iom_swap( TRIM(crxios_context) )
          IF( ln_rstart .AND.    &               ! Restart: read in restart file
               & iom_varid( numror, 'sbc_hc_b', ldstop = .FALSE. ) > 0 ) THEN
@@ -112,6 +112,6 @@
             zfact = 0.5_wp
             sbc_tsc(:,:,:) = 0._wp
-            CALL iom_get( numror, jpdom_autoglo, 'sbc_hc_b', sbc_tsc_b(:,:,jp_tem), ldxios = lrxios )   ! before heat content sbc trend
-            CALL iom_get( numror, jpdom_autoglo, 'sbc_sc_b', sbc_tsc_b(:,:,jp_sal), ldxios = lrxios )   ! before salt content sbc trend
+            CALL iom_get( numror, jpdom_autoglo, 'sbc_hc_b', sbc_tsc_b(:,:,jp_tem), ldxios = lroxios )   ! before heat content sbc trend
+            CALL iom_get( numror, jpdom_autoglo, 'sbc_sc_b', sbc_tsc_b(:,:,jp_sal), ldxios = lroxios )   ! before salt content sbc trend
          ELSE                                   ! No restart or restart not found: Euler forward time stepping
             zfact = 1._wp
@@ -119,5 +119,5 @@
             sbc_tsc_b(:,:,:) = 0._wp
          ENDIF
-         IF( lrxios ) CALL iom_swap( TRIM(cxios_context) )
+         IF( lroxios ) CALL iom_swap( TRIM(cxios_context) )
       ELSE                                !* other time-steps: swap of forcing fields
          zfact = 0.5_wp
Index: NEMO/branches/2020/dev_12905_xios_restart/src/OCE/ZDF/zdfgls.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/OCE/ZDF/zdfgls.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/OCE/ZDF/zdfgls.F90	(revision 12969)
@@ -1052,5 +1052,5 @@
          !                                   ! ---------------
          IF( ln_rstart ) THEN                   !* Read the restart file
-            IF( lrxios ) CALL iom_swap( TRIM(crxios_context) )
+            IF( lroxios ) CALL iom_swap( TRIM(crxios_context) )
             id1 = iom_varid( numror, 'en'    , ldstop = .FALSE. )
             id2 = iom_varid( numror, 'avt_k' , ldstop = .FALSE. )
@@ -1059,8 +1059,8 @@
             !
             IF( MIN( id1, id2, id3, id4 ) > 0 ) THEN        ! all required arrays exist
-               CALL iom_get( numror, jpdom_autoglo, 'en'    , en    , ldxios = lrxios )
-               CALL iom_get( numror, jpdom_autoglo, 'avt_k' , avt_k , ldxios = lrxios )
-               CALL iom_get( numror, jpdom_autoglo, 'avm_k' , avm_k , ldxios = lrxios )
-               CALL iom_get( numror, jpdom_autoglo, 'hmxl_n', hmxl_n, ldxios = lrxios )
+               CALL iom_get( numror, jpdom_autoglo, 'en'    , en    , ldxios = lroxios )
+               CALL iom_get( numror, jpdom_autoglo, 'avt_k' , avt_k , ldxios = lroxios )
+               CALL iom_get( numror, jpdom_autoglo, 'avm_k' , avm_k , ldxios = lroxios )
+               CALL iom_get( numror, jpdom_autoglo, 'hmxl_n', hmxl_n, ldxios = lroxios )
             ELSE                        
                IF(lwp) WRITE(numout,*)
@@ -1070,5 +1070,5 @@
                ! avt_k, avm_k already set to the background value in zdf_phy_init
             ENDIF
-            IF( lrxios ) CALL iom_swap( TRIM(cxios_context) )
+            IF( lroxios ) CALL iom_swap( TRIM(cxios_context) )
          ELSE                                   !* Start from rest
             IF(lwp) WRITE(numout,*)
Index: NEMO/branches/2020/dev_12905_xios_restart/src/OCE/ZDF/zdfosm.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/OCE/ZDF/zdfosm.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/OCE/ZDF/zdfosm.F90	(revision 12969)
@@ -1454,8 +1454,8 @@
      !!-----------------------------------------------------------------------------
      IF( TRIM(cdrw) == 'READ'.AND. ln_rstart) THEN
-        IF( lrxios ) CALL iom_swap( TRIM(crxios_context) )
+        IF( lroxios ) CALL iom_swap( TRIM(crxios_context) )
         id1 = iom_varid( numror, 'wn'   , ldstop = .FALSE. )
         IF( id1 > 0 ) THEN                       ! 'wn' exists; read
-           CALL iom_get( numror, jpdom_autoglo, 'wn', ww, ldxios = lrxios )
+           CALL iom_get( numror, jpdom_autoglo, 'wn', ww, ldxios = lroxios )
            WRITE(numout,*) ' ===>>>> :  ww read from restart file'
         ELSE
@@ -1466,13 +1466,13 @@
         id2 = iom_varid( numror, 'hbli'   , ldstop = .FALSE. )
         IF( id1 > 0 .AND. id2 > 0) THEN                       ! 'hbl' exists; read and return
-           CALL iom_get( numror, jpdom_autoglo, 'hbl' , hbl , ldxios = lrxios )
-           CALL iom_get( numror, jpdom_autoglo, 'hbli', hbli, ldxios = lrxios  )
+           CALL iom_get( numror, jpdom_autoglo, 'hbl' , hbl , ldxios = lroxios )
+           CALL iom_get( numror, jpdom_autoglo, 'hbli', hbli, ldxios = lroxios  )
            WRITE(numout,*) ' ===>>>> :  hbl & hbli read from restart file'
-           IF( lrxios ) CALL iom_swap( TRIM(cxios_context) )
+           IF( lroxios ) CALL iom_swap( TRIM(cxios_context) )
            RETURN
         ELSE                      ! 'hbl' & 'hbli' not in restart file, recalculate
            WRITE(numout,*) ' ===>>>> : previous run without osmosis scheme, hbl computed from stratification'
         END IF
-        IF( lrxios ) CALL iom_swap( TRIM(cxios_context) )
+        IF( lroxios ) CALL iom_swap( TRIM(cxios_context) )
      END IF
 
Index: NEMO/branches/2020/dev_12905_xios_restart/src/OCE/ZDF/zdfric.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/OCE/ZDF/zdfric.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/OCE/ZDF/zdfric.F90	(revision 12969)
@@ -206,13 +206,13 @@
          !           !* Read the restart file
          IF( ln_rstart ) THEN
-            IF( lrxios ) CALL iom_swap( TRIM(crxios_context) )
+            IF( lroxios ) CALL iom_swap( TRIM(crxios_context) )
             id1 = iom_varid( numror, 'avt_k', ldstop = .FALSE. )
             id2 = iom_varid( numror, 'avm_k', ldstop = .FALSE. )
             !
             IF( MIN( id1, id2 ) > 0 ) THEN         ! restart exists => read it
-               CALL iom_get( numror, jpdom_autoglo, 'avt_k', avt_k, ldxios = lrxios )
-               CALL iom_get( numror, jpdom_autoglo, 'avm_k', avm_k, ldxios = lrxios )
+               CALL iom_get( numror, jpdom_autoglo, 'avt_k', avt_k, ldxios = lroxios )
+               CALL iom_get( numror, jpdom_autoglo, 'avm_k', avm_k, ldxios = lroxios )
             ENDIF
-            IF( lrxios ) CALL iom_swap( TRIM(cxios_context) )
+            IF( lroxios ) CALL iom_swap( TRIM(cxios_context) )
          ENDIF
          !           !* otherwise Kz already set to the background value in zdf_phy_init
Index: NEMO/branches/2020/dev_12905_xios_restart/src/OCE/ZDF/zdftke.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/OCE/ZDF/zdftke.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/OCE/ZDF/zdftke.F90	(revision 12969)
@@ -659,5 +659,5 @@
          !                                   ! ---------------
          IF( ln_rstart ) THEN                   !* Read the restart file
-            IF( lrxios ) CALL iom_swap( TRIM(crxios_context) )
+            IF( lroxios ) CALL iom_swap( TRIM(crxios_context) )
             id1 = iom_varid( numror, 'en'   , ldstop = .FALSE. )
             id2 = iom_varid( numror, 'avt_k', ldstop = .FALSE. )
@@ -666,8 +666,8 @@
             !
             IF( MIN( id1, id2, id3, id4 ) > 0 ) THEN      ! fields exist
-               CALL iom_get( numror, jpdom_autoglo, 'en'   , en   , ldxios = lrxios )
-               CALL iom_get( numror, jpdom_autoglo, 'avt_k', avt_k, ldxios = lrxios )
-               CALL iom_get( numror, jpdom_autoglo, 'avm_k', avm_k, ldxios = lrxios )
-               CALL iom_get( numror, jpdom_autoglo, 'dissl', dissl, ldxios = lrxios )
+               CALL iom_get( numror, jpdom_autoglo, 'en'   , en   , ldxios = lroxios )
+               CALL iom_get( numror, jpdom_autoglo, 'avt_k', avt_k, ldxios = lroxios )
+               CALL iom_get( numror, jpdom_autoglo, 'avm_k', avm_k, ldxios = lroxios )
+               CALL iom_get( numror, jpdom_autoglo, 'dissl', dissl, ldxios = lroxios )
             ELSE                                          ! start TKE from rest
                IF(lwp) WRITE(numout,*)
@@ -677,5 +677,5 @@
                ! avt_k, avm_k already set to the background value in zdf_phy_init
             ENDIF
-            IF( lrxios ) CALL iom_swap( TRIM(cxios_context) )
+            IF( lroxios ) CALL iom_swap( TRIM(cxios_context) )
          ELSE                                   !* Start from rest
             IF(lwp) WRITE(numout,*)
Index: NEMO/branches/2020/dev_12905_xios_restart/src/OCE/step.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/OCE/step.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/OCE/step.F90	(revision 12969)
@@ -351,5 +351,5 @@
       IF( kstp == nit000 ) THEN                          ! 1st time step only
                                         CALL iom_close( numror )   ! close input  ocean restart file
-         IF( lrxios )                   CALL iom_context_finalize(      crxios_context         )
+         IF( lroxios )                   CALL iom_context_finalize(      crxios_context         )
          IF(lwm)                        CALL FLUSH    ( numond )   ! flush output namelist oce
          IF(lwm .AND. numoni /= -1 )    CALL FLUSH    ( numoni )   ! flush output namelist ice (if exist)
Index: NEMO/branches/2020/dev_12905_xios_restart/src/SAS/step.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/SAS/step.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/SAS/step.F90	(revision 12969)
@@ -97,4 +97,21 @@
       IF( kstp /= nit000 )   CALL day( kstp )             ! Calendar (day was already called at nit000 in day_init)
                              CALL iom_setkt( kstp - nit000 + 1, cxios_context )   ! tell iom we are at time step kstp
+      IF((kstp == nitrst) .AND. lwxios) THEN
+         CALL iom_swap(      cwxios_context          )
+         CALL iom_init_closedef(cwxios_context)
+         CALL iom_setkt( kstp - nit000 + 1,      cwxios_context          )
+#if defined key_top
+         CALL iom_swap(      cwtxios_context          )
+         CALL iom_init_closedef(cwtxios_context)
+         CALL iom_setkt( kstp - nit000 + 1,      cwtxios_context          )
+#endif
+      ENDIF
+#if defined key_si3
+      IF(((kstp + nn_fsbc - 1) == nitrst) .AND. lwxios) THEN
+         CALL iom_swap(      cwixios_context          )
+         CALL iom_init_closedef(cwixios_context)
+         CALL iom_setkt( kstp - nit000 + 1,      cwixios_context          )
+      ENDIF
+#endif
 
       ! ==> clem: open boundaries is mandatory for sea-ice because ice BDY is not decoupled from  
Index: NEMO/branches/2020/dev_12905_xios_restart/src/TOP/C14/trcini_c14.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/TOP/C14/trcini_c14.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/TOP/C14/trcini_c14.F90	(revision 12969)
@@ -68,11 +68,11 @@
         IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~'
         ! 
-        IF(lrxios) CALL iom_swap(crtxios_context)
-        CALL iom_get( numrtr, 'co2sbc', co2sbc, ldxios = lrxios ) 
-        CALL iom_get( numrtr, jpdom_autoglo, 'c14sbc', c14sbc, ldxios = lrxios ) 
-        CALL iom_get( numrtr, jpdom_autoglo, 'exch_co2', exch_co2, ldxios = lrxios ) 
-        CALL iom_get( numrtr, jpdom_autoglo, 'exch_c14', exch_c14, ldxios = lrxios ) 
-        CALL iom_get( numrtr, jpdom_autoglo, 'qtr_c14', qtr_c14, ldxios = lrxios )
-        IF(lrxios) CALL iom_swap(cxios_context)
+        IF(lrtxios) CALL iom_swap(crtxios_context)
+        CALL iom_get( numrtr, 'co2sbc', co2sbc, ldxios = lrtxios ) 
+        CALL iom_get( numrtr, jpdom_autoglo, 'c14sbc', c14sbc, ldxios = lrtxios ) 
+        CALL iom_get( numrtr, jpdom_autoglo, 'exch_co2', exch_co2, ldxios = lrtxios ) 
+        CALL iom_get( numrtr, jpdom_autoglo, 'exch_c14', exch_c14, ldxios = lrtxios ) 
+        CALL iom_get( numrtr, jpdom_autoglo, 'qtr_c14', qtr_c14, ldxios = lrtxios )
+        IF(lrtxios) CALL iom_swap(cxios_context)
         !
       END IF
@@ -87,7 +87,7 @@
       ELSE
         !
-        IF(lrxios) CALL iom_swap(crtxios_context)
-        CALL iom_get( numrtr, jpdom_autoglo, 'qint_c14', qint_c14, ldxios = lrxios ) 
-        IF(lrxios) CALL iom_swap(cxios_context)
+        IF(lrtxios) CALL iom_swap(crtxios_context)
+        CALL iom_get( numrtr, jpdom_autoglo, 'qint_c14', qint_c14, ldxios = lrtxios ) 
+        IF(lrtxios) CALL iom_swap(cxios_context)
         !
       ENDIF
Index: NEMO/branches/2020/dev_12905_xios_restart/src/TOP/CFC/trcsms_cfc.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/TOP/CFC/trcsms_cfc.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/TOP/CFC/trcsms_cfc.F90	(revision 12969)
@@ -297,10 +297,10 @@
          !
          jl = 0
-         IF(lrxios) CALL iom_swap(crtxios_context)
+         IF(lrtxios) CALL iom_swap(crtxios_context)
          DO jn = jp_cfc0, jp_cfc1
             jl = jl + 1
-            CALL iom_get( numrtr, jpdom_autoglo, 'qint_'//ctrcnm(jn), qint_cfc(:,:,jl), ldxios = lrxios ) 
+            CALL iom_get( numrtr, jpdom_autoglo, 'qint_'//ctrcnm(jn), qint_cfc(:,:,jl), ldxios = lrtxios ) 
          END DO
-         IF(lrxios) CALL iom_swap(cxios_context)
+         IF(lrtxios) CALL iom_swap(cxios_context)
       ENDIF
       IF(lwp) WRITE(numout,*)
Index: NEMO/branches/2020/dev_12905_xios_restart/src/TOP/PISCES/P2Z/p2zexp.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/TOP/PISCES/P2Z/p2zexp.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/TOP/PISCES/P2Z/p2zexp.F90	(revision 12969)
@@ -215,8 +215,8 @@
       !
       IF( ln_rsttr ) THEN
-         IF(lrxios) CALL iom_swap(crtxios_context)
-         CALL iom_get( numrtr, jpdom_autoglo, 'SEDB'//ctrcnm(jpdet), sedpocb(:,:), ldxios = lrxios )
-         CALL iom_get( numrtr, jpdom_autoglo, 'SEDN'//ctrcnm(jpdet), sedpocn(:,:), ldxios = lrxios )
-         IF(lrxios) CALL iom_swap(cxios_context)
+         IF(lrtxios) CALL iom_swap(crtxios_context)
+         CALL iom_get( numrtr, jpdom_autoglo, 'SEDB'//ctrcnm(jpdet), sedpocb(:,:), ldxios = lrtxios )
+         CALL iom_get( numrtr, jpdom_autoglo, 'SEDN'//ctrcnm(jpdet), sedpocn(:,:), ldxios = lrtxios )
+         IF(lrtxios) CALL iom_swap(cxios_context)
       ELSE
          sedpocb(:,:) = 0._wp
Index: NEMO/branches/2020/dev_12905_xios_restart/src/TOP/PISCES/P4Z/p4zsms.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/TOP/PISCES/P4Z/p4zsms.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/TOP/PISCES/P4Z/p4zsms.F90	(revision 12969)
@@ -339,14 +339,14 @@
          IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~'
          ! 
-         IF(lrxios) CALL iom_swap(crtxios_context)
+         IF(lrtxios) CALL iom_swap(crtxios_context)
          IF( iom_varid( numrtr, 'PH', ldstop = .FALSE. ) > 0 ) THEN
-            CALL iom_get( numrtr, jpdom_autoglo, 'PH' , hi(:,:,:), ldxios = lrxios  )
+            CALL iom_get( numrtr, jpdom_autoglo, 'PH' , hi(:,:,:), ldxios = lrtxios  )
          ELSE
             CALL p4z_che( Kbb, Kmm )                  ! initialize the chemical constants
             CALL ahini_for_at( hi, Kbb )
          ENDIF
-         CALL iom_get( numrtr, jpdom_autoglo, 'Silicalim', xksi(:,:), ldxios = lrxios )
+         CALL iom_get( numrtr, jpdom_autoglo, 'Silicalim', xksi(:,:), ldxios = lrtxios )
          IF( iom_varid( numrtr, 'Silicamax', ldstop = .FALSE. ) > 0 ) THEN
-            CALL iom_get( numrtr, jpdom_autoglo, 'Silicamax' , xksimax(:,:), ldxios = lrxios  )
+            CALL iom_get( numrtr, jpdom_autoglo, 'Silicamax' , xksimax(:,:), ldxios = lrtxios  )
          ELSE
             xksimax(:,:) = xksi(:,:)
@@ -354,5 +354,5 @@
          !
          IF( iom_varid( numrtr, 'tcflxcum', ldstop = .FALSE. ) > 0 ) THEN  ! cumulative total flux of carbon
-            CALL iom_get( numrtr, 'tcflxcum' , t_oce_co2_flx_cum, ldxios = lrxios  )
+            CALL iom_get( numrtr, 'tcflxcum' , t_oce_co2_flx_cum, ldxios = lrtxios  )
          ELSE
             t_oce_co2_flx_cum = 0._wp
@@ -361,7 +361,7 @@
          IF( ln_p5z ) THEN
             IF( iom_varid( numrtr, 'sized', ldstop = .FALSE. ) > 0 ) THEN
-               CALL iom_get( numrtr, jpdom_autoglo, 'sizep' , sizep(:,:,:), ldxios = lrxios  )
-               CALL iom_get( numrtr, jpdom_autoglo, 'sizen' , sizen(:,:,:), ldxios = lrxios  )
-               CALL iom_get( numrtr, jpdom_autoglo, 'sized' , sized(:,:,:), ldxios = lrxios  )
+               CALL iom_get( numrtr, jpdom_autoglo, 'sizep' , sizep(:,:,:), ldxios = lrtxios  )
+               CALL iom_get( numrtr, jpdom_autoglo, 'sizen' , sizen(:,:,:), ldxios = lrtxios  )
+               CALL iom_get( numrtr, jpdom_autoglo, 'sized' , sized(:,:,:), ldxios = lrtxios  )
             ELSE
                sizep(:,:,:) = 1.
@@ -370,5 +370,5 @@
             ENDIF
         ENDIF
-        IF(lrxios) CALL iom_swap(cxios_context)
+        IF(lrtxios) CALL iom_swap(cxios_context)
         !
       ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN
Index: NEMO/branches/2020/dev_12905_xios_restart/src/TOP/PISCES/SED/sed.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/TOP/PISCES/SED/sed.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/TOP/PISCES/SED/sed.F90	(revision 12969)
@@ -53,4 +53,5 @@
    INTEGER             , PUBLIC   ::  nn_rstsed      !: control of the time step ( 0 or 1 ) for pass. tr.
    INTEGER , PUBLIC               ::  nn_dtsed = 1   !: frequency of step on passive tracers
+   LOGICAL,  PUBLIC               ::  lrsxios        !: use xios to read restart
    CHARACTER(len = 80) , PUBLIC   ::  cn_sedrst_in   !: suffix of pass. tracer restart name (input)
    CHARACTER(len = 256), PUBLIC   ::  cn_sedrst_indir  !: restart input directory
Index: NEMO/branches/2020/dev_12905_xios_restart/src/TOP/PISCES/SED/sedrst.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/TOP/PISCES/SED/sedrst.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/TOP/PISCES/SED/sedrst.F90	(revision 12969)
@@ -139,9 +139,9 @@
       zdta2 = 0.
 
-      IF(lrxios) CALL iom_swap(crsxios_context)
+      IF(lrsxios) CALL iom_swap(crsxios_context)
       DO jn = 1, jptrased
          cltra = TRIM(sedtrcd(jn))
          IF( iom_varid( numrsr, TRIM(cltra) , ldstop = .FALSE. ) > 0 ) THEN
-            CALL iom_get( numrsr, jpdom_autoglo, TRIM(cltra), zdta(:,:,:,jn), ldxios = lrxios )
+            CALL iom_get( numrsr, jpdom_autoglo, TRIM(cltra), zdta(:,:,:,jn), ldxios = lrsxios )
          ELSE
             zdta(:,:,:,jn) = 0.0
@@ -162,5 +162,5 @@
          cltra = TRIM(seddia3d(jn))
          IF( iom_varid( numrsr, TRIM(cltra) , ldstop = .FALSE. ) > 0 ) THEN
-            CALL iom_get( numrsr, jpdom_autoglo, TRIM(cltra), zdta1(:,:,:,jn), ldxios = lrxios )
+            CALL iom_get( numrsr, jpdom_autoglo, TRIM(cltra), zdta1(:,:,:,jn), ldxios = lrsxios )
          ELSE
             zdta1(:,:,:,jn) = 0.0
@@ -189,5 +189,5 @@
       cltra = "dbioturb"
       IF( iom_varid( numrsr, TRIM(cltra) , ldstop = .FALSE. ) > 0 ) THEN
-         CALL iom_get( numrsr, jpdom_autoglo, TRIM(cltra), zdta2(:,:,:), ldxios = lrxios )
+         CALL iom_get( numrsr, jpdom_autoglo, TRIM(cltra), zdta2(:,:,:), ldxios = lrsxios )
       ELSE
          zdta2(:,:,:) = 0.0
@@ -199,5 +199,5 @@
       cltra = "irrig"
       IF( iom_varid( numrsr, TRIM(cltra) , ldstop = .FALSE. ) > 0 ) THEN
-         CALL iom_get( numrsr, jpdom_autoglo, TRIM(cltra), zdta2(:,:,:), ldxios = lrxios )
+         CALL iom_get( numrsr, jpdom_autoglo, TRIM(cltra), zdta2(:,:,:), ldxios = lrsxios )
       ELSE
          zdta2(:,:,:) = 0.0
@@ -209,5 +209,5 @@
       cltra = "sedligand"
       IF( iom_varid( numrsr, TRIM(cltra) , ldstop = .FALSE. ) > 0 ) THEN
-         CALL iom_get( numrsr, jpdom_autoglo, TRIM(cltra), zdta2(:,:,:), ldxios = lrxios )
+         CALL iom_get( numrsr, jpdom_autoglo, TRIM(cltra), zdta2(:,:,:), ldxios = lrsxios )
       ELSE
          zdta2(:,:,:) = 0.0
@@ -216,5 +216,5 @@
       CALL pack_arr( jpoce, sedligand(1:jpoce,1:jpksed), &
          &             zdta2(1:jpi,1:jpj,1:jpksed), iarroce(1:jpoce) )
-      IF(lrxios) CALL iom_swap(cxios_context)
+      IF(lrsxios) CALL iom_swap(cxios_context)
       IF( ln_timing )  CALL timing_stop('sed_rst_read')
      
@@ -382,21 +382,19 @@
             CALL iom_open( TRIM(cn_sedrst_indir)//'/'//cn_sedrst_in, numrsr )
 
-      IF( lrxios .AND. .NOT. lxios_sini) THEN
-          CALL ctl_stop('OCE and SED restart must be in a single file when XIOS is used to read restart')
-      ENDIF
-      IF( lrxios) THEN
-          crsxios_context = 'sed_rst'
-          IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS for SED'
-          IF( TRIM(Agrif_CFixed()) == '0' ) THEN
-             clpname = cn_sedrst_in
-          ELSE
-             clpname = TRIM(Agrif_CFixed())//"_"//cn_sedrst_in   
-          ENDIF
-          CALL iom_init( crsxios_context, fname = TRIM(cn_sedrst_indir)//'/'//TRIM(clpname), &
-                                          idfp = iom_file(numrsr)%nfid, ld_tmppatch = .TRUE. )
-      ENDIF
-            IF(lrxios) CALL iom_swap(crsxios_context)
-            CALL iom_get ( numrsr, 'kt', zkt, ldxios = lrxios )   ! last time-step of previous run
-            IF(lrxios) CALL iom_swap(cxios_context)
+            lrsxios = lrxios.AND.lxios_sini
+            IF( lrsxios) THEN
+                crsxios_context = 'sed_rst'
+                IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS for SED'
+                IF( TRIM(Agrif_CFixed()) == '0' ) THEN
+                   clpname = cn_sedrst_in
+                ELSE
+                   clpname = TRIM(Agrif_CFixed())//"_"//cn_sedrst_in   
+                ENDIF
+                CALL iom_init( crsxios_context, fname = TRIM(cn_sedrst_indir)//'/'//TRIM(clpname), &
+                                                idfp = iom_file(numrsr)%nfid, ld_tmppatch = .TRUE. )
+            ENDIF
+            IF(lrsxios) CALL iom_swap(crsxios_context)
+            CALL iom_get ( numrsr, 'kt', zkt, ldxios = lrsxios )   ! last time-step of previous run
+            IF(lrsxios) CALL iom_swap(cxios_context)
             IF(lwp) THEN
                WRITE(numsed,*) ' *** Info read in restart : '
@@ -419,9 +417,9 @@
             !                                          ! set the date in offline mode
             IF( ln_rst_sed .AND. nn_rstsed == 2 ) THEN
-               IF(lrxios) CALL iom_swap(crsxios_context)
-               CALL iom_get( numrsr, 'ndastp', zndastp, ldxios = lrxios )
+               IF(lrsxios) CALL iom_swap(crsxios_context)
+               CALL iom_get( numrsr, 'ndastp', zndastp, ldxios = lrsxios )
                ndastp = NINT( zndastp )
-               CALL iom_get( numrsr, 'adatrj', adatrj, ldxios = lrxios  )
-               IF(lrxios) CALL iom_swap(crxios_context)
+               CALL iom_get( numrsr, 'adatrj', adatrj, ldxios = lrsxios  )
+               IF(lrsxios) CALL iom_swap(crxios_context)
              ELSE
                ndastp = ndate0 - 1     ! ndate0 read in the namelist in dom_nam
Index: NEMO/branches/2020/dev_12905_xios_restart/src/TOP/PISCES/SED/sedstp.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/TOP/PISCES/SED/sedstp.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/TOP/PISCES/SED/sedstp.F90	(revision 12969)
@@ -86,5 +86,5 @@
       IF( kt == nitsed000 ) THEN
           CALL iom_close( numrsr )       ! close input tracer restart file
-          IF(lrxios) CALL iom_context_finalize(      crsxios_context  )
+          IF(lrsxios) CALL iom_context_finalize(      crsxios_context  )
 !          IF(lwm) CALL FLUSH( numont )   ! flush namelist output
       ENDIF
Index: NEMO/branches/2020/dev_12905_xios_restart/src/TOP/TRP/trcsbc.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/TOP/TRP/trcsbc.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/TOP/TRP/trcsbc.F90	(revision 12969)
@@ -86,9 +86,9 @@
             IF(lwp) WRITE(numout,*) '          nittrc000-1 surface tracer content forcing fields read in the restart file'
             zfact = 0.5_wp
-            IF(lrxios) CALL iom_swap(crtxios_context)
+            IF(lrtxios) CALL iom_swap(crtxios_context)
             DO jn = 1, jptra
-               CALL iom_get( numrtr, jpdom_autoglo, 'sbc_'//TRIM(ctrcnm(jn))//'_b', sbc_trc_b(:,:,jn), ldxios = lrxios )   ! before tracer content sbc
+               CALL iom_get( numrtr, jpdom_autoglo, 'sbc_'//TRIM(ctrcnm(jn))//'_b', sbc_trc_b(:,:,jn), ldxios = lrtxios )   ! before tracer content sbc
             END DO
-            IF(lrxios) CALL iom_swap(cxios_context)
+            IF(lrtxios) CALL iom_swap(cxios_context)
          ELSE                                         ! No restart or restart not found: Euler forward time stepping
            zfact = 1._wp
Index: NEMO/branches/2020/dev_12905_xios_restart/src/TOP/trc.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/TOP/trc.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/TOP/trc.F90	(revision 12969)
@@ -69,4 +69,5 @@
    INTEGER             , PUBLIC ::   nittrc000          !: first time step of passive tracers model
    LOGICAL             , PUBLIC ::   l_trcdm2dc         !: Diurnal cycle for TOP
+   LOGICAL             , PUBLIC ::   lrtxios            !: read TOP restart with XIOS
 
    !! Information for the ice module for tracers
Index: NEMO/branches/2020/dev_12905_xios_restart/src/TOP/trcrst.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/TOP/trcrst.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/TOP/trcrst.F90	(revision 12969)
@@ -130,15 +130,15 @@
 
       ! READ prognostic variables and computes diagnostic variable
-      IF(lrxios) CALL iom_swap(crtxios_context)
+      IF(lrtxios) CALL iom_swap(crtxios_context)
       DO jn = 1, jptra
-         CALL iom_get( numrtr, jpdom_autoglo, 'TRN'//ctrcnm(jn), tr(:,:,:,jn,Kmm), ldxios = lrxios )
+         CALL iom_get( numrtr, jpdom_autoglo, 'TRN'//ctrcnm(jn), tr(:,:,:,jn,Kmm), ldxios = lrtxios )
       END DO
 
       DO jn = 1, jptra
-         CALL iom_get( numrtr, jpdom_autoglo, 'TRB'//ctrcnm(jn), tr(:,:,:,jn,Kbb), ldxios = lrxios )
+         CALL iom_get( numrtr, jpdom_autoglo, 'TRB'//ctrcnm(jn), tr(:,:,:,jn,Kbb), ldxios = lrtxios )
       END DO
       !
       CALL iom_delay_rst( 'READ', 'TOP', numrtr )   ! read only TOP delayed global communication variables
-      IF(lrxios) CALL iom_swap(cxios_context) 
+      IF(lrtxios) CALL iom_swap(cxios_context) 
    END SUBROUTINE trc_rst_read
 
@@ -234,8 +234,6 @@
             lxios_sini = .FALSE.
             CALL iom_open( TRIM(cn_trcrst_indir)//'/'//cn_trcrst_in, numrtr )
-            IF( lrxios .AND. .NOT. lxios_sini) THEN
-               CALL ctl_stop('OCE and TOP restart must be in a single file when XIOS is used to read restart')
-            ENDIF
-            IF( lrxios) THEN
+            lrtxios = lrxios.AND.lxios_sini
+            IF( lrtxios) THEN
                 crtxios_context = 'top_rst'
                 IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS for TOP'
@@ -249,7 +247,7 @@
             ENDIF
 
-            IF(lrxios) CALL iom_swap(crtxios_context)
-            CALL iom_get ( numrtr, 'kt', zkt, ldxios = lrxios )   ! last time-step of previous run
-            IF(lrxios) CALL iom_swap(cxios_context)
+            IF(lrtxios) CALL iom_swap(crtxios_context)
+            CALL iom_get ( numrtr, 'kt', zkt, ldxios = lrtxios )   ! last time-step of previous run
+            IF(lrtxios) CALL iom_swap(cxios_context)
 
             IF(lwp) THEN
@@ -273,10 +271,10 @@
             !                                          ! set the date in offline mode
             IF( ln_rsttr .AND. nn_rsttr == 2 ) THEN
-               IF(lrxios) CALL iom_swap(crtxios_context)
-               CALL iom_get( numrtr, 'ndastp', zndastp, ldxios = lrxios )
+               IF(lrtxios) CALL iom_swap(crtxios_context)
+               CALL iom_get( numrtr, 'ndastp', zndastp, ldxios = lrtxios )
                ndastp = NINT( zndastp )
-               CALL iom_get( numrtr, 'adatrj', adatrj, ldxios = lrxios  )
-               CALL iom_get( numrtr, 'ntime' , ktime, ldxios = lrxios   )
-               IF(lrxios) CALL iom_swap(cxios_context)
+               CALL iom_get( numrtr, 'adatrj', adatrj, ldxios = lrtxios  )
+               CALL iom_get( numrtr, 'ntime' , ktime, ldxios = lrtxios   )
+               IF(lrtxios) CALL iom_swap(cxios_context)
                nn_time0=INT(ktime)
                ! calculate start time in hours and minutes
Index: NEMO/branches/2020/dev_12905_xios_restart/src/TOP/trcstp.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/TOP/trcstp.F90	(revision 12968)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/TOP/trcstp.F90	(revision 12969)
@@ -109,5 +109,5 @@
       IF( kt == nittrc000 ) THEN
          CALL iom_close( numrtr )                         ! close input tracer restart file
-         IF(lrxios) CALL iom_context_finalize(      crtxios_context          )
+         IF(lrtxios) CALL iom_context_finalize(      crtxios_context          )
          IF(lwm) CALL FLUSH( numont )                     ! flush namelist output
       ENDIF
@@ -196,18 +196,18 @@
            &                              .AND. iom_varid( numrtr, 'ktdcy'    , ldstop = .FALSE. ) > 0  &
            &                              .AND. iom_varid( numrtr, 'nrdcy'    , ldstop = .FALSE. ) > 0  ) THEN
-            IF(lrxios) CALL iom_swap(crtxios_context)
-            CALL iom_get( numrtr, 'ktdcy', zkt, ldxios = lrxios )  
+            IF(lrtxios) CALL iom_swap(crtxios_context)
+            CALL iom_get( numrtr, 'ktdcy', zkt, ldxios = lrtxios )  
             rsecfst = INT( zkt ) * rn_Dt
             IF(lwp) WRITE(numout,*) 'trc_qsr_mean:   qsr_mean read in the restart file at time-step rsecfst =', rsecfst, ' s '
-            CALL iom_get( numrtr, jpdom_autoglo, 'qsr_mean', qsr_mean, ldxios = lrxios )   !  A mean of qsr
-            CALL iom_get( numrtr, 'nrdcy', zrec, ldxios = lrxios )   !  Number of record per days
+            CALL iom_get( numrtr, jpdom_autoglo, 'qsr_mean', qsr_mean, ldxios = lrtxios )   !  A mean of qsr
+            CALL iom_get( numrtr, 'nrdcy', zrec, ldxios = lrtxios )   !  Number of record per days
             IF( INT( zrec ) == nb_rec_per_day ) THEN
                DO jn = 1, nb_rec_per_day 
                   IF( jn <= 9 )  THEN
                     WRITE(cl1,'(i1)') jn
-                    CALL iom_get( numrtr, jpdom_autoglo, 'qsr_arr_'//cl1, qsr_arr(:,:,jn), ldxios = lrxios )   !  A mean of qsr
+                    CALL iom_get( numrtr, jpdom_autoglo, 'qsr_arr_'//cl1, qsr_arr(:,:,jn), ldxios = lrtxios )   !  A mean of qsr
                   ELSE
                     WRITE(cl2,'(i2.2)') jn
-                    CALL iom_get( numrtr, jpdom_autoglo, 'qsr_arr_'//cl2, qsr_arr(:,:,jn), ldxios = lrxios )   !  A mean of qsr
+                    CALL iom_get( numrtr, jpdom_autoglo, 'qsr_arr_'//cl2, qsr_arr(:,:,jn), ldxios = lrtxios )   !  A mean of qsr
                   ENDIF
               END DO
@@ -217,5 +217,5 @@
                ENDDO
             ENDIF
-            IF(lrxios) CALL iom_swap(cxios_context)
+            IF(lrtxios) CALL iom_swap(cxios_context)
          ELSE                                         !* no restart: set from nit000 values
             IF(lwp) WRITE(numout,*) 'trc_qsr_mean:   qsr_mean set to nit000 values'
