Index: NEMO/branches/2020/dev_12905_xios_restart/src/ICE/ice.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/ICE/ice.F90	(revision 13750)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/ICE/ice.F90	(revision 13871)
@@ -179,5 +179,4 @@
    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 13750)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/ICE/icedia.F90	(revision 13871)
@@ -221,18 +221,18 @@
          IF( ln_rstart ) THEN                   !* Read the restart file
             !
-            IF(lrixios) CALL iom_swap(crixios_context)
-            CALL iom_get( numrir, 'kt_ice' , ziter, ldxios = lrixios )
+            IF(lrxios) CALL iom_swap(cr_icerst_cxt)
+            CALL iom_get( numrir, 'kt_ice' , ziter, ldxios = lrxios )
             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 = 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_auto, 'vol_loc_ini', vol_loc_ini, ldxios = lrixios )
-            CALL iom_get( numrir, jpdom_auto, 'tem_loc_ini', tem_loc_ini, ldxios = lrixios )
-            CALL iom_get( numrir, jpdom_auto, 'sal_loc_ini', sal_loc_ini, ldxios = lrixios )
-            IF(lrixios) CALL iom_swap(cxios_context)
+            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_auto, 'vol_loc_ini', vol_loc_ini, ldxios = lrxios )
+            CALL iom_get( numrir, jpdom_auto, 'tem_loc_ini', tem_loc_ini, ldxios = lrxios )
+            CALL iom_get( numrir, jpdom_auto, 'sal_loc_ini', sal_loc_ini, ldxios = lrxios )
+            IF(lrxios) CALL iom_swap(cxios_context)
          ELSE
             IF(lwp) WRITE(numout,*)
@@ -263,5 +263,5 @@
          ! Write in numriw (if iter == nitrst)
          ! ------------------ 
-         IF( lwxios ) CALL iom_swap(      cwixios_context         )
+         IF( lwxios ) CALL iom_swap(      cw_icerst_cxt         )
          CALL iom_rstput( iter, nitrst, numriw, 'frc_voltop' , frc_voltop,  ldxios = lwxios )
          CALL iom_rstput( iter, nitrst, numriw, 'frc_volbot' , frc_volbot,  ldxios = lwxios )
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 13750)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/ICE/icedyn_adv_pra.F90	(revision 13871)
@@ -955,49 +955,49 @@
          !
          IF( id1 > 0 ) THEN                     !**  Read the restart file  **!
-            IF(lrixios) CALL iom_swap(crixios_context)
+            IF(lrxios) CALL iom_swap(cr_icerst_cxt)
             !
             !                                                        ! ice thickness
-            CALL iom_get( numrir, jpdom_auto, 'sxice' , sxice , psgn = -1._wp, ldxios = lrixios )
-            CALL iom_get( numrir, jpdom_auto, 'syice' , syice , psgn = -1._wp, ldxios = lrixios )
-            CALL iom_get( numrir, jpdom_auto, 'sxxice', sxxice, ldxios = lrixios )
-            CALL iom_get( numrir, jpdom_auto, 'syyice', syyice, ldxios = lrixios )
-            CALL iom_get( numrir, jpdom_auto, 'sxyice', sxyice, ldxios = lrixios )
+            CALL iom_get( numrir, jpdom_auto, 'sxice' , sxice , psgn = -1._wp, ldxios = lrxios )
+            CALL iom_get( numrir, jpdom_auto, 'syice' , syice , psgn = -1._wp, ldxios = lrxios )
+            CALL iom_get( numrir, jpdom_auto, 'sxxice', sxxice, ldxios = lrxios )
+            CALL iom_get( numrir, jpdom_auto, 'syyice', syyice, ldxios = lrxios )
+            CALL iom_get( numrir, jpdom_auto, 'sxyice', sxyice, ldxios = lrxios )
             !                                                        ! snow thickness
-            CALL iom_get( numrir, jpdom_auto, 'sxsn'  , sxsn  , psgn = -1._wp, ldxios = lrixios )
-            CALL iom_get( numrir, jpdom_auto, 'sysn'  , sysn  , psgn = -1._wp, ldxios = lrixios )
-            CALL iom_get( numrir, jpdom_auto, 'sxxsn' , sxxsn, ldxios = lrixios  )
-            CALL iom_get( numrir, jpdom_auto, 'syysn' , syysn, ldxios = lrixios  )
-            CALL iom_get( numrir, jpdom_auto, 'sxysn' , sxysn, ldxios = lrixios  )
+            CALL iom_get( numrir, jpdom_auto, 'sxsn'  , sxsn  , psgn = -1._wp, ldxios = lrxios )
+            CALL iom_get( numrir, jpdom_auto, 'sysn'  , sysn  , psgn = -1._wp, ldxios = lrxios )
+            CALL iom_get( numrir, jpdom_auto, 'sxxsn' , sxxsn, ldxios = lrxios  )
+            CALL iom_get( numrir, jpdom_auto, 'syysn' , syysn, ldxios = lrxios  )
+            CALL iom_get( numrir, jpdom_auto, 'sxysn' , sxysn, ldxios = lrxios  )
             !                                                        ! ice concentration
-            CALL iom_get( numrir, jpdom_auto, 'sxa'   , sxa   , psgn = -1._wp, ldxios = lrixios )
-            CALL iom_get( numrir, jpdom_auto, 'sya'   , sya   , psgn = -1._wp, ldxios = lrixios )
-            CALL iom_get( numrir, jpdom_auto, 'sxxa'  , sxxa, ldxios = lrixios   )
-            CALL iom_get( numrir, jpdom_auto, 'syya'  , syya, ldxios = lrixios   )
-            CALL iom_get( numrir, jpdom_auto, 'sxya'  , sxya, ldxios = lrixios   )
+            CALL iom_get( numrir, jpdom_auto, 'sxa'   , sxa   , psgn = -1._wp, ldxios = lrxios )
+            CALL iom_get( numrir, jpdom_auto, 'sya'   , sya   , psgn = -1._wp, ldxios = lrxios )
+            CALL iom_get( numrir, jpdom_auto, 'sxxa'  , sxxa, ldxios = lrxios   )
+            CALL iom_get( numrir, jpdom_auto, 'syya'  , syya, ldxios = lrxios   )
+            CALL iom_get( numrir, jpdom_auto, 'sxya'  , sxya, ldxios = lrxios   )
             !                                                        ! ice salinity
-            CALL iom_get( numrir, jpdom_auto, 'sxsal' , sxsal , psgn = -1._wp, ldxios = lrixios )
-            CALL iom_get( numrir, jpdom_auto, 'sysal' , sysal , psgn = -1._wp, ldxios = lrixios )
-            CALL iom_get( numrir, jpdom_auto, 'sxxsal', sxxsal, ldxios = lrixios )
-            CALL iom_get( numrir, jpdom_auto, 'syysal', syysal, ldxios = lrixios )
-            CALL iom_get( numrir, jpdom_auto, 'sxysal', sxysal, ldxios = lrixios )
+            CALL iom_get( numrir, jpdom_auto, 'sxsal' , sxsal , psgn = -1._wp, ldxios = lrxios )
+            CALL iom_get( numrir, jpdom_auto, 'sysal' , sysal , psgn = -1._wp, ldxios = lrxios )
+            CALL iom_get( numrir, jpdom_auto, 'sxxsal', sxxsal, ldxios = lrxios )
+            CALL iom_get( numrir, jpdom_auto, 'syysal', syysal, ldxios = lrxios )
+            CALL iom_get( numrir, jpdom_auto, 'sxysal', sxysal, ldxios = lrxios )
             !                                                        ! ice age
-            CALL iom_get( numrir, jpdom_auto, 'sxage' , sxage , psgn = -1._wp, ldxios = lrixios )
-            CALL iom_get( numrir, jpdom_auto, 'syage' , syage , psgn = -1._wp, ldxios = lrixios )
-            CALL iom_get( numrir, jpdom_auto, 'sxxage', sxxage, ldxios = lrixios )
-            CALL iom_get( numrir, jpdom_auto, 'syyage', syyage, ldxios = lrixios )
-            CALL iom_get( numrir, jpdom_auto, 'sxyage', sxyage, ldxios = lrixios )
+            CALL iom_get( numrir, jpdom_auto, 'sxage' , sxage , psgn = -1._wp, ldxios = lrxios )
+            CALL iom_get( numrir, jpdom_auto, 'syage' , syage , psgn = -1._wp, ldxios = lrxios )
+            CALL iom_get( numrir, jpdom_auto, 'sxxage', sxxage, ldxios = lrxios )
+            CALL iom_get( numrir, jpdom_auto, 'syyage', syyage, ldxios = lrxios )
+            CALL iom_get( numrir, jpdom_auto, 'sxyage', sxyage, ldxios = lrxios )
             !                                                        ! snow layers heat content
             DO jk = 1, nlay_s
                WRITE(zchar1,'(I2.2)') jk
                znam = 'sxc0'//'_l'//zchar1  
-               CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp, ldxios = lrixios )   ;   sxc0 (:,:,jk,:) = z3d(:,:,:)
+               CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp, ldxios = lrxios )   ;   sxc0 (:,:,jk,:) = z3d(:,:,:)
                znam = 'syc0'//'_l'//zchar1  
-               CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp, ldxios = lrixios )   ;   syc0 (:,:,jk,:) = z3d(:,:,:)
+               CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp, ldxios = lrxios )   ;   syc0 (:,:,jk,:) = z3d(:,:,:)
                znam = 'sxxc0'//'_l'//zchar1 
-               CALL iom_get( numrir, jpdom_auto, znam , z3d, ldxios = lrixios )   ;   sxxc0(:,:,jk,:) = z3d(:,:,:)
+               CALL iom_get( numrir, jpdom_auto, znam , z3d, ldxios = lrxios )   ;   sxxc0(:,:,jk,:) = z3d(:,:,:)
                znam = 'syyc0'//'_l'//zchar1 
-               CALL iom_get( numrir, jpdom_auto, znam , z3d, ldxios = lrixios )   ;   syyc0(:,:,jk,:) = z3d(:,:,:)
+               CALL iom_get( numrir, jpdom_auto, znam , z3d, ldxios = lrxios )   ;   syyc0(:,:,jk,:) = z3d(:,:,:)
                znam = 'sxyc0'//'_l'//zchar1 
-               CALL iom_get( numrir, jpdom_auto, znam , z3d, ldxios = lrixios )   ;   sxyc0(:,:,jk,:) = z3d(:,:,:)
+               CALL iom_get( numrir, jpdom_auto, znam , z3d, ldxios = lrxios )   ;   sxyc0(:,:,jk,:) = z3d(:,:,:)
             END DO
             !                                                        ! ice layers heat content
@@ -1005,28 +1005,28 @@
                WRITE(zchar1,'(I2.2)') jk
                znam = 'sxe'//'_l'//zchar1   
-               CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp, ldxios = lrixios )   ;   sxe (:,:,jk,:) = z3d(:,:,:)
+               CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp, ldxios = lrxios )   ;   sxe (:,:,jk,:) = z3d(:,:,:)
                znam = 'sye'//'_l'//zchar1   
-               CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp, ldxios = lrixios )   ;   sye (:,:,jk,:) = z3d(:,:,:)
+               CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp, ldxios = lrxios )   ;   sye (:,:,jk,:) = z3d(:,:,:)
                znam = 'sxxe'//'_l'//zchar1  
-               CALL iom_get( numrir, jpdom_auto, znam , z3d, ldxios = lrixios )   ;   sxxe(:,:,jk,:) = z3d(:,:,:)
+               CALL iom_get( numrir, jpdom_auto, znam , z3d, ldxios = lrxios )   ;   sxxe(:,:,jk,:) = z3d(:,:,:)
                znam = 'syye'//'_l'//zchar1  
-               CALL iom_get( numrir, jpdom_auto, znam , z3d, ldxios = lrixios )   ;   syye(:,:,jk,:) = z3d(:,:,:)
+               CALL iom_get( numrir, jpdom_auto, znam , z3d, ldxios = lrxios )   ;   syye(:,:,jk,:) = z3d(:,:,:)
                znam = 'sxye'//'_l'//zchar1  
-               CALL iom_get( numrir, jpdom_auto, znam , z3d, ldxios = lrixios )   ;   sxye(:,:,jk,:) = z3d(:,:,:)
+               CALL iom_get( numrir, jpdom_auto, znam , z3d, ldxios = lrxios )   ;   sxye(:,:,jk,:) = z3d(:,:,:)
             END DO
             !
             IF( ln_pnd_LEV ) THEN                                    ! melt pond fraction
                IF( iom_varid( numrir, 'sxap', ldstop = .FALSE. ) > 0 ) THEN
-                  CALL iom_get( numrir, jpdom_auto, 'sxap' , sxap , psgn = -1._wp, ldxios = lrixios )
-                  CALL iom_get( numrir, jpdom_auto, 'syap' , syap , psgn = -1._wp, ldxios = lrixios )
-                  CALL iom_get( numrir, jpdom_auto, 'sxxap', sxxap, ldxios = lrixios )
-                  CALL iom_get( numrir, jpdom_auto, 'syyap', syyap, ldxios = lrixios )
-                  CALL iom_get( numrir, jpdom_auto, 'sxyap', sxyap, ldxios = lrixios )
+                  CALL iom_get( numrir, jpdom_auto, 'sxap' , sxap , psgn = -1._wp, ldxios = lrxios )
+                  CALL iom_get( numrir, jpdom_auto, 'syap' , syap , psgn = -1._wp, ldxios = lrxios )
+                  CALL iom_get( numrir, jpdom_auto, 'sxxap', sxxap, ldxios = lrxios )
+                  CALL iom_get( numrir, jpdom_auto, 'syyap', syyap, ldxios = lrxios )
+                  CALL iom_get( numrir, jpdom_auto, 'sxyap', sxyap, ldxios = lrxios )
                   !                                                     ! melt pond volume
-                  CALL iom_get( numrir, jpdom_auto, 'sxvp' , sxvp , psgn = -1._wp, ldxios = lrixios )
-                  CALL iom_get( numrir, jpdom_auto, 'syvp' , syvp , psgn = -1._wp, ldxios = lrixios )
-                  CALL iom_get( numrir, jpdom_auto, 'sxxvp', sxxvp, ldxios = lrixios )
-                  CALL iom_get( numrir, jpdom_auto, 'syyvp', syyvp, ldxios = lrixios )
-                  CALL iom_get( numrir, jpdom_auto, 'sxyvp', sxyvp, ldxios = lrixios )
+                  CALL iom_get( numrir, jpdom_auto, 'sxvp' , sxvp , psgn = -1._wp, ldxios = lrxios )
+                  CALL iom_get( numrir, jpdom_auto, 'syvp' , syvp , psgn = -1._wp, ldxios = lrxios )
+                  CALL iom_get( numrir, jpdom_auto, 'sxxvp', sxxvp, ldxios = lrxios )
+                  CALL iom_get( numrir, jpdom_auto, 'syyvp', syyvp, ldxios = lrxios )
+                  CALL iom_get( numrir, jpdom_auto, 'sxyvp', sxyvp, ldxios = lrxios )
                ELSE
                   sxap = 0._wp ;   syap = 0._wp    ;   sxxap = 0._wp    ;   syyap = 0._wp    ;   sxyap = 0._wp   ! melt pond fraction
@@ -1036,9 +1036,9 @@
                IF ( ln_pnd_lids ) THEN                               ! melt pond lid volume
                   IF( iom_varid( numrir, 'sxvl', ldstop = .FALSE. ) > 0 ) THEN
-                     CALL iom_get( numrir, jpdom_auto, 'sxvl' , sxvl , psgn = -1._wp, ldxios = lrixios )
-                     CALL iom_get( numrir, jpdom_auto, 'syvl' , syvl , psgn = -1._wp, ldxios = lrixios )
-                     CALL iom_get( numrir, jpdom_auto, 'sxxvl', sxxvl, ldxios = lrixios )
-                     CALL iom_get( numrir, jpdom_auto, 'syyvl', syyvl, ldxios = lrixios )
-                     CALL iom_get( numrir, jpdom_auto, 'sxyvl', sxyvl, ldxios = lrixios )
+                     CALL iom_get( numrir, jpdom_auto, 'sxvl' , sxvl , psgn = -1._wp, ldxios = lrxios )
+                     CALL iom_get( numrir, jpdom_auto, 'syvl' , syvl , psgn = -1._wp, ldxios = lrxios )
+                     CALL iom_get( numrir, jpdom_auto, 'sxxvl', sxxvl, ldxios = lrxios )
+                     CALL iom_get( numrir, jpdom_auto, 'syyvl', syyvl, ldxios = lrxios )
+                     CALL iom_get( numrir, jpdom_auto, 'sxyvl', sxyvl, ldxios = lrxios )
                   ELSE
                      sxvl = 0._wp; syvl = 0._wp    ;   sxxvl = 0._wp    ;   syyvl = 0._wp    ;   sxyvl = 0._wp   ! melt pond lid volume
@@ -1046,5 +1046,5 @@
                ENDIF
             ENDIF
-            IF(lrixios) CALL iom_swap(cxios_context)
+            IF(lrxios) CALL iom_swap(cxios_context)
             !
          ELSE                                   !**  start rheology from rest  **!
@@ -1079,5 +1079,5 @@
          !
          !                                                           ! ice thickness
-         IF( lwxios ) CALL iom_swap(      cwixios_context         )
+         IF( lwxios ) CALL iom_swap(      cw_icerst_cxt         )
          CALL iom_rstput( iter, nitrst, numriw, 'sxice' , sxice,  ldxios = lwxios)
          CALL iom_rstput( iter, nitrst, numriw, 'syice' , syice,  ldxios = lwxios)
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 13750)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/ICE/icedyn_rhg_evp.F90	(revision 13871)
@@ -1005,5 +1005,5 @@
          IF( ln_rstart ) THEN                   !* Read the restart file
             !
-            IF(lrixios) CALL iom_swap(crixios_context)
+            IF(lrxios) CALL iom_swap(cr_icerst_cxt)
             id1 = iom_varid( numrir, 'stress1_i' , ldstop = .FALSE. )
             id2 = iom_varid( numrir, 'stress2_i' , ldstop = .FALSE. )
@@ -1011,7 +1011,7 @@
             !
             IF( MIN( id1, id2, id3 ) > 0 ) THEN      ! fields exist
-               CALL iom_get( numrir, jpdom_auto, 'stress1_i' , stress1_i , cd_type = 'T', ldxios = lrixios )
-               CALL iom_get( numrir, jpdom_auto, 'stress2_i' , stress2_i , cd_type = 'T', ldxios = lrixios )
-               CALL iom_get( numrir, jpdom_auto, 'stress12_i', stress12_i, cd_type = 'F', ldxios = lrixios )
+               CALL iom_get( numrir, jpdom_auto, 'stress1_i' , stress1_i , cd_type = 'T', ldxios = lrxios )
+               CALL iom_get( numrir, jpdom_auto, 'stress2_i' , stress2_i , cd_type = 'T', ldxios = lrxios )
+               CALL iom_get( numrir, jpdom_auto, 'stress12_i', stress12_i, cd_type = 'F', ldxios = lrxios )
             ELSE                                     ! start rheology from rest
                IF(lwp) WRITE(numout,*)
@@ -1021,5 +1021,5 @@
                stress12_i(:,:) = 0._wp
             ENDIF
-            IF(lrixios) CALL iom_swap(cxios_context)
+            IF(lrxios) CALL iom_swap(cxios_context)
          ELSE                                   !* Start from rest
             IF(lwp) WRITE(numout,*)
@@ -1035,5 +1035,5 @@
          iter = kt + nn_fsbc - 1             ! ice restarts are written at kt == nitrst - nn_fsbc + 1
          !
-         IF( lwxios ) CALL iom_swap(      cwixios_context         )
+         IF( lwxios ) CALL iom_swap(      cw_icerst_cxt         )
          CALL iom_rstput( iter, nitrst, numriw, 'stress1_i' , stress1_i,  ldxios = lwxios )
          CALL iom_rstput( iter, nitrst, numriw, 'stress2_i' , stress2_i,  ldxios = lwxios )
Index: NEMO/branches/2020/dev_12905_xios_restart/src/ICE/icerst.F90
===================================================================
--- NEMO/branches/2020/dev_12905_xios_restart/src/ICE/icerst.F90	(revision 13750)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/ICE/icerst.F90	(revision 13871)
@@ -89,5 +89,5 @@
             ELSE
 #if defined key_iomput
-               cwixios_context = "rstwi_"//TRIM(ADJUSTL(clkt))
+               cw_icerst_cxt = "rstwi_"//TRIM(ADJUSTL(clkt))
                IF( TRIM(Agrif_CFixed()) == '0' ) THEN
                   clpname = clname
@@ -95,5 +95,5 @@
                   clpname = TRIM(Agrif_CFixed())//"_"//clname
                ENDIF
-               CALL iom_init( cwixios_context, fname = TRIM(clpath)//TRIM(clpname), ld_closedef = .FALSE. )
+               CALL iom_init( cw_icerst_cxt, fname = TRIM(clpath)//TRIM(clpname), ld_closedef = .FALSE. )
                CALL iom_swap(      cxios_context          )
 #else
@@ -138,5 +138,5 @@
       ! ------------------ 
       !                                                                        ! calendar control
-      IF( lwxios ) CALL iom_swap(      cwixios_context         )
+      IF( lwxios ) CALL iom_swap(      cw_icerst_cxt         )
       CALL iom_rstput( iter, nitrst, numriw, 'nn_fsbc', REAL( nn_fsbc, wp ), ldxios = lwxios )      ! time-step 
       CALL iom_rstput( iter, nitrst, numriw, 'kt_ice' , REAL( iter   , wp ), ldxios = lwxios )      ! date
@@ -183,5 +183,5 @@
             CALL iom_close( numriw )
          ELSE
-            CALL iom_context_finalize(      cwixios_context          )
+            CALL iom_context_finalize(      cw_icerst_cxt          )
          ENDIF
          lrst_ice = .FALSE.
@@ -217,7 +217,6 @@
       CALL iom_open ( TRIM(cn_icerst_indir)//'/'//cn_icerst_in, numrir )
 
-      lrixios = lrxios.AND.lxios_sini
-      IF( lrixios) THEN
-          crixios_context = 'si3_rst'
+      IF( lrxios) THEN
+          cr_icerst_cxt = 'si3_rst'
           IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS for SI3'
           IF( TRIM(Agrif_CFixed()) == '0' ) THEN
@@ -226,5 +225,5 @@
              clpname = TRIM(Agrif_CFixed())//"_"//cn_icerst_in   
           ENDIF
-          CALL iom_init( crixios_context, fname = TRIM(cn_icerst_indir)//'/'//TRIM(clpname), &
+          CALL iom_init( cr_icerst_cxt, fname = TRIM(cn_icerst_indir)//'/'//TRIM(clpname), &
                                           idfp = iom_file(numrir)%nfid, ld_closedef = .TRUE. )
       ENDIF
@@ -236,8 +235,8 @@
       IF( id0 > 0 ) THEN   ! == case of a normal restart == !
          !                 ! ------------------------------ !
-         IF(lrixios) CALL iom_swap(crixios_context) 
+         IF(lrxios) CALL iom_swap(cr_icerst_cxt) 
          ! Time info
-         CALL iom_get( numrir, 'nn_fsbc', zfice, ldxios = lrixios )
-         CALL iom_get( numrir, 'kt_ice' , ziter, ldxios = lrixios )    
+         CALL iom_get( numrir, 'nn_fsbc', zfice, ldxios = lrxios )
+         CALL iom_get( numrir, 'kt_ice' , ziter, ldxios = lrxios )    
          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
@@ -254,16 +253,16 @@
 
          ! --- mandatory fields --- ! 
-         CALL iom_get( numrir, jpdom_auto, 'v_i'  , v_i  , ldxios = lrixios )
-         CALL iom_get( numrir, jpdom_auto, 'v_s'  , v_s  , ldxios = lrixios )
-         CALL iom_get( numrir, jpdom_auto, 'sv_i' , sv_i , ldxios = lrixios )
-         CALL iom_get( numrir, jpdom_auto, 'a_i'  , a_i  , ldxios = lrixios )
-         CALL iom_get( numrir, jpdom_auto, 't_su' , t_su , ldxios = lrixios )
-         CALL iom_get( numrir, jpdom_auto, 'u_ice', u_ice, cd_type = 'U', psgn = -1._wp, ldxios = lrixios )
-         CALL iom_get( numrir, jpdom_auto, 'v_ice', v_ice, cd_type = 'V', psgn = -1._wp, ldxios = lrixios )
+         CALL iom_get( numrir, jpdom_auto, 'v_i'  , v_i  , ldxios = lrxios )
+         CALL iom_get( numrir, jpdom_auto, 'v_s'  , v_s  , ldxios = lrxios )
+         CALL iom_get( numrir, jpdom_auto, 'sv_i' , sv_i , ldxios = lrxios )
+         CALL iom_get( numrir, jpdom_auto, 'a_i'  , a_i  , ldxios = lrxios )
+         CALL iom_get( numrir, jpdom_auto, 't_su' , t_su , ldxios = lrxios )
+         CALL iom_get( numrir, jpdom_auto, 'u_ice', u_ice, cd_type = 'U', psgn = -1._wp, ldxios = lrxios )
+         CALL iom_get( numrir, jpdom_auto, 'v_ice', v_ice, cd_type = 'V', psgn = -1._wp, ldxios = lrxios )
          ! Snow enthalpy
          DO jk = 1, nlay_s
             WRITE(zchar1,'(I2.2)') jk
             znam = 'e_s'//'_l'//zchar1
-            CALL iom_get( numrir, jpdom_auto, znam , z3d, ldxios = lrixios )
+            CALL iom_get( numrir, jpdom_auto, znam , z3d, ldxios = lrxios )
             e_s(:,:,jk,:) = z3d(:,:,:)
          END DO
@@ -272,5 +271,5 @@
             WRITE(zchar1,'(I2.2)') jk
             znam = 'e_i'//'_l'//zchar1
-            CALL iom_get( numrir, jpdom_auto, znam , z3d, ldxios = lrixios )
+            CALL iom_get( numrir, jpdom_auto, znam , z3d, ldxios = lrxios )
             e_i(:,:,jk,:) = z3d(:,:,:)
          END DO
@@ -279,5 +278,5 @@
          id1 = iom_varid( numrir, 'oa_i' , ldstop = .FALSE. )
          IF( id1 > 0 ) THEN                       ! fields exist
-            CALL iom_get( numrir, jpdom_auto, 'oa_i', oa_i, ldxios = lrixios )
+            CALL iom_get( numrir, jpdom_auto, 'oa_i', oa_i, ldxios = lrxios )
          ELSE                                     ! start from rest
             IF(lwp) WRITE(numout,*) '   ==>>   previous run without ice age output then set it to zero'
@@ -287,6 +286,6 @@
          id2 = iom_varid( numrir, 'a_ip' , ldstop = .FALSE. )
          IF( id2 > 0 ) THEN                       ! fields exist
-            CALL iom_get( numrir, jpdom_auto, 'a_ip' , a_ip, ldxios = lrixios )
-            CALL iom_get( numrir, jpdom_auto, 'v_ip' , v_ip, ldxios = lrixios )
+            CALL iom_get( numrir, jpdom_auto, 'a_ip' , a_ip, ldxios = lrxios )
+            CALL iom_get( numrir, jpdom_auto, 'v_ip' , v_ip, ldxios = lrxios )
          ELSE                                     ! start from rest
             IF(lwp) WRITE(numout,*) '   ==>>   previous run without melt ponds output then set it to zero'
@@ -297,5 +296,5 @@
          id3 = iom_varid( numrir, 'v_il' , ldstop = .FALSE. )
          IF( id3 > 0 ) THEN
-            CALL iom_get( numrir, jpdom_auto, 'v_il', v_il, ldxios = lrixios)
+            CALL iom_get( numrir, jpdom_auto, 'v_il', v_il, ldxios = lrxios)
          ELSE
             IF(lwp) WRITE(numout,*) '   ==>>   previous run without melt ponds lids output then set it to zero'
@@ -307,6 +306,6 @@
             id5 = iom_varid( numrir, 't1_ice'  , ldstop = .FALSE. )
             IF( id4 > 0 .AND. id5 > 0 ) THEN         ! fields exist
-               CALL iom_get( numrir, jpdom_auto, 'cnd_ice', cnd_ice, ldxios = lrixios )
-               CALL iom_get( numrir, jpdom_auto, 't1_ice' , t1_ice , ldxios = lrixios )
+               CALL iom_get( numrir, jpdom_auto, 'cnd_ice', cnd_ice, ldxios = lrxios )
+               CALL iom_get( numrir, jpdom_auto, 't1_ice' , t1_ice , ldxios = lrxios )
             ELSE                                     ! start from rest
                IF(lwp) WRITE(numout,*) '   ==>>   previous run without conductivity output then set it to zero'
@@ -317,5 +316,5 @@
 
          CALL iom_delay_rst( 'READ', 'ICE', numrir )   ! read only ice delayed global communication variables
-         IF(lrixios) CALL iom_swap(cxios_context)
+         IF(lrxios) 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 13750)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/ICE/icestp.F90	(revision 13871)
@@ -293,5 +293,5 @@
       IF( ln_rstart )  THEN
           CALL iom_close( numrir )  ! close input ice restart file
-          IF(lrixios) CALL iom_context_finalize(      crixios_context         )
+          IF(lrxios) CALL iom_context_finalize(      cr_icerst_cxt         )
       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 13750)
+++ NEMO/branches/2020/dev_12905_xios_restart/src/ICE/iceupdate.F90	(revision 13871)
@@ -427,8 +427,8 @@
             !
             IF( id1 > 0 ) THEN                       ! fields exist
-               IF(lrixios) CALL iom_swap(crixios_context)
-               CALL iom_get( numrir, jpdom_auto, 'snwice_mass'  , snwice_mass  , ldxios = lrixios )
-               CALL iom_get( numrir, jpdom_auto, 'snwice_mass_b', snwice_mass_b, ldxios = lrixios )
-               IF(lrixios) CALL iom_swap(cxios_context)
+               IF(lrxios) CALL iom_swap(cr_icerst_cxt)
+               CALL iom_get( numrir, jpdom_auto, 'snwice_mass'  , snwice_mass  , ldxios = lrxios )
+               CALL iom_get( numrir, jpdom_auto, 'snwice_mass_b', snwice_mass_b, ldxios = lrxios )
+               IF(lrxios) CALL iom_swap(cxios_context)
             ELSE                                     ! start from rest
                IF(lwp) WRITE(numout,*) '   ==>>   previous run without snow-ice mass output then set it'
@@ -447,5 +447,5 @@
          iter = kt + nn_fsbc - 1             ! ice restarts are written at kt == nitrst - nn_fsbc + 1
          !
-         IF( lwxios ) CALL iom_swap(      cwixios_context         )
+         IF( lwxios ) CALL iom_swap(      cw_icerst_cxt         )
          CALL iom_rstput( iter, nitrst, numriw, 'snwice_mass'  , snwice_mass,   ldxios = lwxios )
          CALL iom_rstput( iter, nitrst, numriw, 'snwice_mass_b', snwice_mass_b, ldxios = lwxios )
