Index: NEMO/branches/2019/dev_r11756_SI3restart_XIOS/src/ICE/icedyn_adv_pra.F90
===================================================================
--- NEMO/branches/2019/dev_r11756_SI3restart_XIOS/src/ICE/icedyn_adv_pra.F90	(revision 11870)
+++ NEMO/branches/2019/dev_r11756_SI3restart_XIOS/src/ICE/icedyn_adv_pra.F90	(revision 11893)
@@ -702,30 +702,16 @@
          CALL iom_set_rstw_var_active(rsti_wfields, 'syyage')
          CALL iom_set_rstw_var_active(rsti_wfields, 'sxyage')
-         DO jk = 1, nlay_s
-            WRITE(zchar1,'(I2.2)') jk
-            znam = 'sxc0'//'_l'//zchar1  
-            CALL iom_set_rstw_var_active(rsti_wfields, znam )
-            znam = 'syc0'//'_l'//zchar1  
-            CALL iom_set_rstw_var_active(rsti_wfields, znam )
-            znam = 'sxxc0'//'_l'//zchar1 
-            CALL iom_set_rstw_var_active(rsti_wfields, znam )
-            znam = 'syyc0'//'_l'//zchar1 
-            CALL iom_set_rstw_var_active(rsti_wfields, znam )
-            znam = 'sxyc0'//'_l'//zchar1 
-            CALL iom_set_rstw_var_active(rsti_wfields, znam )
-         END DO
-         DO jk = 1, nlay_i
-            WRITE(zchar1,'(I2.2)') jk
-            znam = 'sxe'//'_l'//zchar1   
-            CALL iom_set_rstw_var_active(rsti_wfields, znam )
-            znam = 'sye'//'_l'//zchar1   
-            CALL iom_set_rstw_var_active(rsti_wfields, znam )
-            znam = 'sxxe'//'_l'//zchar1  
-            CALL iom_set_rstw_var_active(rsti_wfields, znam )
-            znam = 'syye'//'_l'//zchar1  
-            CALL iom_set_rstw_var_active(rsti_wfields, znam )
-            znam = 'sxye'//'_l'//zchar1  
-            CALL iom_set_rstw_var_active(rsti_wfields, znam )
-         END DO
+       
+         CALL iom_set_rstw_var_active(rsti_wfields, 'sxc0')
+         CALL iom_set_rstw_var_active(rsti_wfields, 'syc0')
+         CALL iom_set_rstw_var_active(rsti_wfields, 'sxxc0')
+         CALL iom_set_rstw_var_active(rsti_wfields, 'syyc0')
+         CALL iom_set_rstw_var_active(rsti_wfields, 'sxyc0')
+
+         CALL iom_set_rstw_var_active(rsti_wfields, 'sxe')
+         CALL iom_set_rstw_var_active(rsti_wfields, 'sye')
+         CALL iom_set_rstw_var_active(rsti_wfields, 'sxxe')
+         CALL iom_set_rstw_var_active(rsti_wfields, 'syye')
+         CALL iom_set_rstw_var_active(rsti_wfields, 'sxye')
          !
          IF( ln_pnd_H12 ) THEN                                       ! melt pond fraction
@@ -842,9 +828,9 @@
                CALL iom_get( numrir, jpdom_autoglo, "syyc0", syyc0, ldxios = lrxios )
                CALL iom_get( numrir, jpdom_autoglo, "sxyc0", sxyc0, ldxios = lrxios )
-               CALL iom_get( numrir, jpdom_autoglo, "sxe", sxc0, ldxios = lrxios )
-               CALL iom_get( numrir, jpdom_autoglo, "sye", syc0, ldxios = lrxios )
-               CALL iom_get( numrir, jpdom_autoglo, "sxxe", sxxc0, ldxios = lrxios )
-               CALL iom_get( numrir, jpdom_autoglo, "syye", syyc0, ldxios = lrxios )
-               CALL iom_get( numrir, jpdom_autoglo, "sxye", sxyc0, ldxios = lrxios )
+               CALL iom_get( numrir, jpdom_autoglo, "sxe", sxe, ldxios = lrxios )
+               CALL iom_get( numrir, jpdom_autoglo, "sye", sye, ldxios = lrxios )
+               CALL iom_get( numrir, jpdom_autoglo, "sxxe", sxxe, ldxios = lrxios )
+               CALL iom_get( numrir, jpdom_autoglo, "syye", syye, ldxios = lrxios )
+               CALL iom_get( numrir, jpdom_autoglo, "sxye", sxye, ldxios = lrxios )
             ENDIF
             !
@@ -924,45 +910,60 @@
          CALL iom_rstput( iter, nitrst, numriw, 'sxyage', sxyage, ldxios = lwxios ) 
          !                                                           ! snow layers heat content
-         DO jk = 1, nlay_s
-            WRITE(zchar1,'(I2.2)') jk
-            znam = 'sxc0'//'_l'//zchar1  
-            z3d(:,:,:) = sxc0 (:,:,jk,:)  
-            CALL iom_rstput( iter, nitrst, numriw, znam , z3d,  ldxios = lwxios )
-
-            znam = 'syc0'//'_l'//zchar1  
-            z3d(:,:,:) = syc0 (:,:,jk,:)  
-            CALL iom_rstput( iter, nitrst, numriw, znam , z3d,  ldxios = lwxios )
-
-            znam = 'sxxc0'//'_l'//zchar1 
-            z3d(:,:,:) = sxxc0(:,:,jk,:)  
-            CALL iom_rstput( iter, nitrst, numriw, znam , z3d,  ldxios = lwxios )
-
-            znam = 'syyc0'//'_l'//zchar1 
-            z3d(:,:,:) = syyc0(:,:,jk,:)  
-            CALL iom_rstput( iter, nitrst, numriw, znam , z3d,  ldxios = lwxios )
-
-            znam = 'sxyc0'//'_l'//zchar1 
-            z3d(:,:,:) = sxyc0(:,:,jk,:)  
-            CALL iom_rstput( iter, nitrst, numriw, znam , z3d,  ldxios = lwxios )
-         END DO
-         !                                                           ! ice layers heat content
-         DO jk = 1, nlay_i
-            WRITE(zchar1,'(I2.2)') jk
-            znam = 'sxe'//'_l'//zchar1   
-            z3d(:,:,:) = sxe (:,:,jk,:)   
-            CALL iom_rstput( iter, nitrst, numriw, znam , z3d,  ldxios = lwxios )
-            znam = 'sye'//'_l'//zchar1   
-            z3d(:,:,:) = sye (:,:,jk,:)   
-            CALL iom_rstput( iter, nitrst, numriw, znam , z3d,  ldxios = lwxios )
-            znam = 'sxxe'//'_l'//zchar1  
-            z3d(:,:,:) = sxxe(:,:,jk,:)   
-            CALL iom_rstput( iter, nitrst, numriw, znam , z3d,  ldxios = lwxios )
-            znam = 'syye'//'_l'//zchar1  
-            z3d(:,:,:) = syye(:,:,jk,:)   
-            CALL iom_rstput( iter, nitrst, numriw, znam , z3d,  ldxios = lwxios )
-            znam = 'sxye'//'_l'//zchar1  
-            z3d(:,:,:) = sxye(:,:,jk,:)   
-            CALL iom_rstput( iter, nitrst, numriw, znam , z3d,  ldxios = lwxios )
-         END DO
+         IF(lwxios) THEN
+            CALL iom_rstput( iter, nitrst, numriw, 'sxc0' ,  sxc0,  ldxios = lwxios )
+            CALL iom_rstput( iter, nitrst, numriw, 'syc0' ,  syc0,  ldxios = lwxios )
+            CALL iom_rstput( iter, nitrst, numriw, 'sxxc0', sxxc0,  ldxios = lwxios )
+            CALL iom_rstput( iter, nitrst, numriw, 'syyc0', syyc0,  ldxios = lwxios )
+            CALL iom_rstput( iter, nitrst, numriw, 'sxyc0', sxyc0,  ldxios = lwxios )
+
+
+            CALL iom_rstput( iter, nitrst, numriw, 'sxe' ,  sxe,  ldxios = lwxios )
+            CALL iom_rstput( iter, nitrst, numriw, 'sye' ,  sye,  ldxios = lwxios )
+            CALL iom_rstput( iter, nitrst, numriw, 'sxxe', sxxe,  ldxios = lwxios )
+            CALL iom_rstput( iter, nitrst, numriw, 'syye', syye,  ldxios = lwxios )
+            CALL iom_rstput( iter, nitrst, numriw, 'sxye', sxye,  ldxios = lwxios )
+         ELSE
+            DO jk = 1, nlay_s
+               WRITE(zchar1,'(I2.2)') jk
+               znam = 'sxc0'//'_l'//zchar1  
+               z3d(:,:,:) = sxc0 (:,:,jk,:)  
+               CALL iom_rstput( iter, nitrst, numriw, znam , z3d,  ldxios = lwxios )
+
+               znam = 'syc0'//'_l'//zchar1  
+               z3d(:,:,:) = syc0 (:,:,jk,:)  
+               CALL iom_rstput( iter, nitrst, numriw, znam , z3d,  ldxios = lwxios )
+
+               znam = 'sxxc0'//'_l'//zchar1 
+               z3d(:,:,:) = sxxc0(:,:,jk,:)  
+               CALL iom_rstput( iter, nitrst, numriw, znam , z3d,  ldxios = lwxios )
+   
+               znam = 'syyc0'//'_l'//zchar1 
+               z3d(:,:,:) = syyc0(:,:,jk,:)  
+               CALL iom_rstput( iter, nitrst, numriw, znam , z3d,  ldxios = lwxios )
+   
+               znam = 'sxyc0'//'_l'//zchar1 
+               z3d(:,:,:) = sxyc0(:,:,jk,:)  
+               CALL iom_rstput( iter, nitrst, numriw, znam , z3d,  ldxios = lwxios )
+            END DO
+            !                                                           ! ice layers heat content
+            DO jk = 1, nlay_i
+               WRITE(zchar1,'(I2.2)') jk
+               znam = 'sxe'//'_l'//zchar1   
+               z3d(:,:,:) = sxe (:,:,jk,:)   
+               CALL iom_rstput( iter, nitrst, numriw, znam , z3d,  ldxios = lwxios )
+               znam = 'sye'//'_l'//zchar1   
+               z3d(:,:,:) = sye (:,:,jk,:)   
+               CALL iom_rstput( iter, nitrst, numriw, znam , z3d,  ldxios = lwxios )
+               znam = 'sxxe'//'_l'//zchar1  
+               z3d(:,:,:) = sxxe(:,:,jk,:)   
+               CALL iom_rstput( iter, nitrst, numriw, znam , z3d,  ldxios = lwxios )
+               znam = 'syye'//'_l'//zchar1  
+               z3d(:,:,:) = syye(:,:,jk,:)   
+               CALL iom_rstput( iter, nitrst, numriw, znam , z3d,  ldxios = lwxios )
+               znam = 'sxye'//'_l'//zchar1  
+               z3d(:,:,:) = sxye(:,:,jk,:)   
+               CALL iom_rstput( iter, nitrst, numriw, znam , z3d,  ldxios = lwxios )
+            END DO
+         ENDIF
          !
          IF( ln_pnd_H12 ) THEN                                       ! melt pond fraction
