Index: /NEMO/branches/2020/dev_12905_xios_restart/src/OCE/DOM/domain.F90
===================================================================
--- /NEMO/branches/2020/dev_12905_xios_restart/src/OCE/DOM/domain.F90	(revision 12976)
+++ /NEMO/branches/2020/dev_12905_xios_restart/src/OCE/DOM/domain.F90	(revision 12977)
@@ -58,5 +58,5 @@
 CONTAINS
 
-   SUBROUTINE dom_init( Kbb, Kmm, Kaa, cdstr )
+   SUBROUTINE dom_init( Kbb, Kmm, Kaa )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE dom_init  ***
@@ -74,5 +74,4 @@
       !!----------------------------------------------------------------------
       INTEGER          , INTENT(in) :: Kbb, Kmm, Kaa          ! ocean time level indices
-      CHARACTER (len=*), INTENT(in) :: cdstr                  ! model: NEMO or SAS. Determines core restart variables
       !
       INTEGER ::   ji, jj, jk, ik   ! dummy loop indices
@@ -122,12 +121,4 @@
       CALL dom_glo                     ! global domain versus local domain
       CALL dom_nam                     ! read namelist ( namrun, namdom )
-      !
-!reset namelist for SAS
-      IF(cdstr == 'SAS') THEN
-         IF(lrxios) THEN
-               IF(lwp) write(numout,*) 'Disable reading restart file using XIOS for SAS'
-               lrxios = .FALSE.
-         ENDIF
-      ENDIF
       !
       CALL dom_hgr                      ! Horizontal mesh
Index: /NEMO/branches/2020/dev_12905_xios_restart/src/OCE/IOM/iom.F90
===================================================================
--- /NEMO/branches/2020/dev_12905_xios_restart/src/OCE/IOM/iom.F90	(revision 12976)
+++ /NEMO/branches/2020/dev_12905_xios_restart/src/OCE/IOM/iom.F90	(revision 12977)
@@ -618,5 +618,4 @@
 #if defined key_iomput
       TYPE(xios_context) :: nemo_hdl
-      IF(lwp) write(numout, *) 'SWAP TO: ', TRIM(cdname),' AGRIF: ', TRIM(Agrif_CFixed())
       IF( TRIM(Agrif_CFixed()) == '0' ) THEN
         CALL xios_get_handle(TRIM(cdname),nemo_hdl)
Index: /NEMO/branches/2020/dev_12905_xios_restart/src/OCE/nemogcm.F90
===================================================================
--- /NEMO/branches/2020/dev_12905_xios_restart/src/OCE/nemogcm.F90	(revision 12976)
+++ /NEMO/branches/2020/dev_12905_xios_restart/src/OCE/nemogcm.F90	(revision 12977)
@@ -428,5 +428,5 @@
       IF( lk_c1d       )   CALL     c1d_init        ! 1D column configuration
                            CALL     wad_init        ! Wetting and drying options
-                           CALL     dom_init( Nbb, Nnn, Naa, "OPA") ! Domain
+                           CALL     dom_init( Nbb, Nnn, Naa ) ! Domain
       IF( ln_crs       )   CALL     crs_init(      Nnn )       ! coarsened grid: domain initialization 
       IF( sn_cfctl%l_prtctl )   &
Index: /NEMO/branches/2020/dev_12905_xios_restart/src/OCE/step.F90
===================================================================
--- /NEMO/branches/2020/dev_12905_xios_restart/src/OCE/step.F90	(revision 12976)
+++ /NEMO/branches/2020/dev_12905_xios_restart/src/OCE/step.F90	(revision 12977)
@@ -351,5 +351,5 @@
       IF( kstp == nit000 ) THEN                          ! 1st time step only
                                         CALL iom_close( numror )   ! close input  ocean restart file
-         IF( lroxios )                   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/OFF/nemogcm.F90
===================================================================
--- /NEMO/branches/2020/dev_12905_xios_restart/src/OFF/nemogcm.F90	(revision 12976)
+++ /NEMO/branches/2020/dev_12905_xios_restart/src/OFF/nemogcm.F90	(revision 12977)
@@ -323,5 +323,5 @@
                            CALL     eos_init        ! Equation of state
       IF( lk_c1d       )   CALL     c1d_init        ! 1D column configuration
-                           CALL     dom_init( Nbb, Nnn, Naa, "OPA") ! Domain
+                           CALL     dom_init( Nbb, Nnn, Naa ) ! Domain
       IF( sn_cfctl%l_prtctl )   &
          &                 CALL prt_ctl_init        ! Print control
Index: /NEMO/branches/2020/dev_12905_xios_restart/src/SAO/nemogcm.F90
===================================================================
--- /NEMO/branches/2020/dev_12905_xios_restart/src/SAO/nemogcm.F90	(revision 12976)
+++ /NEMO/branches/2020/dev_12905_xios_restart/src/SAO/nemogcm.F90	(revision 12977)
@@ -246,5 +246,5 @@
                            CALL phy_cst            ! Physical constants
                            CALL eos_init           ! Equation of state
-                           CALL dom_init( Nbb, Nnn, Naa, 'SAO')    ! Domain
+                           CALL dom_init( Nbb, Nnn, Naa )    ! Domain
 
 
Index: /NEMO/branches/2020/dev_12905_xios_restart/src/SAS/nemogcm.F90
===================================================================
--- /NEMO/branches/2020/dev_12905_xios_restart/src/SAS/nemogcm.F90	(revision 12976)
+++ /NEMO/branches/2020/dev_12905_xios_restart/src/SAS/nemogcm.F90	(revision 12977)
@@ -370,10 +370,9 @@
                            CALL phy_cst         ! Physical constants
                            CALL eos_init        ! Equation of seawater
-                           CALL dom_init( Nbb, Nnn, Naa, 'SAS') ! Domain
+                           CALL dom_init( Nbb, Nnn, Naa ) ! Domain
       IF( sn_cfctl%l_prtctl )   &
          &                 CALL prt_ctl_init        ! Print control
-      
+      IF( ln_rstart )      CALL rst_read_open
                            CALL day_init        ! model calendar (using both namelist and restart infos)
-      IF( ln_rstart )      CALL rst_read_open
 
       !                                      ! external forcing 
Index: /NEMO/branches/2020/dev_12905_xios_restart/src/SAS/step.F90
===================================================================
--- /NEMO/branches/2020/dev_12905_xios_restart/src/SAS/step.F90	(revision 12976)
+++ /NEMO/branches/2020/dev_12905_xios_restart/src/SAS/step.F90	(revision 12977)
@@ -95,5 +95,4 @@
                                                           ! need to keep the same interface 
       IF( kstp == nit000 )   CALL iom_init( cxios_context ) ! iom_put initialization (must be done after nemo_init for AGRIF+XIOS+OASIS)
-      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
@@ -107,4 +106,6 @@
 #endif
       ENDIF
+      IF( kstp /= nit000 )   CALL day( kstp )             ! Calendar (day was already called at nit000 in day_init)
+
 #if defined key_si3
       IF(((kstp + nn_fsbc - 1) == nitrst) .AND. lwxios) THEN
@@ -153,5 +154,8 @@
       ! File manipulation at the end of the first time step
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<                         
-      IF( kstp == nit000   ) CALL iom_close( numror )                          ! close input  ocean restart file
+      IF( kstp == nit000   ) THEN
+            CALL iom_close( numror )                          ! close input  ocean restart file
+            IF( lroxios )     CALL iom_context_finalize(      crxios_context      )
+      ENDIF
       
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
