Index: NEMO/branches/2020/test_12905_xios_restart/src/OCE/IOM/restart.F90
===================================================================
--- NEMO/branches/2020/test_12905_xios_restart/src/OCE/IOM/restart.F90	(revision 12987)
+++ NEMO/branches/2020/test_12905_xios_restart/src/OCE/IOM/restart.F90	(revision 13751)
@@ -116,6 +116,5 @@
                   clpname = TRIM(Agrif_CFixed())//"_"//clname   
                ENDIF
-               CALL iom_init( cwxios_context, TRIM(clpath)//TRIM(clpname), ld_tmppatch = .false.,&
-                                                                           ld_closedef = .FALSE. )
+               CALL iom_init( cwxios_context, fname = TRIM(clpath)//TRIM(clpname), ld_closedef = .false. )
                CALL iom_swap(      cxios_context          )
 #else
@@ -221,5 +220,5 @@
              ENDIF
              CALL iom_init( crxios_context, fname = TRIM(clpath)//TRIM(clpname), &
-                              idfp = iom_file(numror)%nfid, ld_tmppatch = .TRUE. )
+                              idfp = iom_file(numror)%nfid, ld_closedef = .TRUE. )
          ENDIF
 
@@ -261,10 +260,10 @@
       
       ! Diurnal DSST 
-      IF( ln_diurnal ) CALL iom_get( numror, jpdom_autoglo, 'Dsst' , x_dsst, ldxios = lroxios ) 
+      IF( ln_diurnal ) CALL iom_get( numror, jpdom_auto, '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 = lroxios ) 
+         CALL iom_get( numror, jpdom_auto, 'tn'     , w3d, ldxios = lroxios ) 
          ts(:,:,1,jp_tem,Kmm) = w3d(:,:,1)
          RETURN 
@@ -272,20 +271,22 @@
 
       IF( iom_varid( numror, 'ub', ldstop = .FALSE. ) > 0 ) THEN
-         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 )
+         ! before fields
+         CALL iom_get( numror, jpdom_auto, 'ub'     , uu(:,:,:       ,Kbb), ldxios = lrxios, cd_type = 'U', psgn = -1._wp )
+         CALL iom_get( numror, jpdom_auto, 'vb'     , vv(:,:,:       ,Kbb), ldxios = lrxios, cd_type = 'V', psgn = -1._wp )
+         CALL iom_get( numror, jpdom_auto, 'tb'     , ts(:,:,:,jp_tem,Kbb), ldxios = lrxios )
+         CALL iom_get( numror, jpdom_auto, 'sb'     , ts(:,:,:,jp_sal,Kbb), ldxios = lrxios )
+         CALL iom_get( numror, jpdom_auto, 'sshb'   ,ssh(:,:         ,Kbb), ldxios = lrxios )
       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 = 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 )
+      ! now fields
+      CALL iom_get( numror, jpdom_auto, 'un'     , uu(:,:,:       ,Kmm), ldxios = lrxios, cd_type = 'U', psgn = -1._wp )
+      CALL iom_get( numror, jpdom_auto, 'vn'     , vv(:,:,:       ,Kmm), ldxios = lrxios, cd_type = 'V', psgn = -1._wp )
+      CALL iom_get( numror, jpdom_auto, 'tn'     , ts(:,:,:,jp_tem,Kmm), ldxios = lrxios )
+      CALL iom_get( numror, jpdom_auto, 'sn'     , ts(:,:,:,jp_sal,Kmm), ldxios = lrxios )
+      CALL iom_get( numror, jpdom_auto, 'sshn'   ,ssh(:,:         ,Kmm), ldxios = lrxios )
       IF( iom_varid( numror, 'rhop', ldstop = .FALSE. ) > 0 ) THEN
-         CALL iom_get( numror, jpdom_autoglo, 'rhop'   , rhop, ldxios = lroxios )   ! now    potential density
+         CALL iom_get( numror, jpdom_auto, 'rhop'   , rhop, ldxios = lroxios )   ! now    potential density
       ELSE
          CALL eos( ts(:,:,:,:,Kmm), rhd, rhop, gdept(:,:,:,Kmm) )   
@@ -298,11 +299,4 @@
          vv   (:,:,:  ,Kbb) = vv   (:,:,:  ,Kmm)
          ssh  (:,:    ,Kbb) = ssh  (:,:    ,Kmm)
-         !
-         IF( .NOT.ln_linssh ) THEN
-            DO jk = 1, jpk
-               e3t(:,:,jk,Kbb) = e3t(:,:,jk,Kmm)
-            END DO
-         ENDIF
-         !
       ENDIF
       !
