Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90	(revision 9531)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90	(revision 9535)
@@ -65,6 +65,6 @@
    PRIVATE set_grid, set_grid_bounds, set_scalar, set_xmlatt, set_mooring, iom_update_file_name, iom_sdate
    PRIVATE iom_set_rst_context, iom_set_rstw_active, iom_set_rstr_active
-   PUBLIC iom_set_rstw_var_active, iom_set_rst_vars
 # endif
+   PUBLIC iom_set_rstw_var_active, iom_set_rstw_core, iom_set_rst_vars
 
    INTERFACE iom_get
@@ -245,5 +245,7 @@
    INTEGER :: i
    LOGICAL :: llis_set
-
+   CHARACTER(LEN=256) :: clinfo    ! info character
+
+#if defined key_iomput
    llis_set = .FALSE.
 
@@ -263,4 +265,8 @@
         nstop = nstop + 1
    ENDIF
+#else
+        clinfo = 'key_iomput is needed to use XIOS restart read/write functionality'
+        CALL ctl_stop(TRIM(clinfo))
+#endif
 
    END SUBROUTINE iom_set_rstw_var_active
@@ -276,4 +282,6 @@
 !sets enabled = .TRUE. for each field in restart file
    CHARACTER(len=256) :: rst_file
+
+#if defined key_iomput
    TYPE(xios_field) :: field_hdl
    TYPE(xios_file) :: file_hdl
@@ -319,4 +327,5 @@
          ENDIF
         END DO
+#endif
    END SUBROUTINE iom_set_rstr_active
 
@@ -328,5 +337,6 @@
       !!---------------------------------------------------------------------
    CHARACTER (len=*), INTENT (IN) :: cdmdl ! model OPA or SAS
-   
+   CHARACTER(LEN=256)             :: clinfo    ! info character
+#if defined key_iomput
    IF(cdmdl == "OPA") THEN
 !from restart.F90
@@ -362,9 +372,13 @@
          CALL iom_set_rstw_var_active('sbc_sc_b')
    ENDIF
+#else
+        clinfo = 'key_iomput is needed to use XIOS restart read/write functionality'
+        CALL ctl_stop(TRIM(clinfo))
+#endif
    END SUBROUTINE iom_set_rstw_core
 
    SUBROUTINE iom_set_rst_vars(fields)
       !!---------------------------------------------------------------------
-      !!                   ***  SUBROUTINE  iom_set_rstr_active  ***
+      !!                   ***  SUBROUTINE iom_set_rst_vars   ***
       !!
       !! ** Purpose :  Fill array fields with the information about all 
@@ -373,6 +387,6 @@
       !!---------------------------------------------------------------------
    TYPE(RST_FIELD), INTENT(INOUT) :: fields(max_rst_fields)
-
    INTEGER :: i
+
         i = 0
         i = i + 1; fields(i)%vname="rdt";            fields(i)%grid="grid_scalar"
@@ -480,5 +494,4 @@
         nstop = nstop + 1
         ENDIF
-
    END SUBROUTINE iom_set_rst_vars
 
@@ -486,5 +499,5 @@
    SUBROUTINE iom_set_rstw_active(cdrst_file)
       !!---------------------------------------------------------------------
-      !!                   ***  SUBROUTINE  iom_set_rstr_active  ***
+      !!                   ***  SUBROUTINE iom_set_rstw_active   ***
       !!
       !! ** Purpose :  define file name in XIOS context for writing restart
@@ -539,5 +552,5 @@
    SUBROUTINE iom_set_rst_context( ) 
      !!---------------------------------------------------------------------
-      !!                   ***  SUBROUTINE  iom_set_rstr_active  ***
+      !!                   ***  SUBROUTINE  iom_set_rst_context  ***
       !!
       !! ** Purpose : Define domain, axis and grid for restart (read/write) 
@@ -929,8 +942,13 @@
          ENDIF
       ELSE
+#if defined key_iomput
          IF(lwp) WRITE(numout,*) 'XIOS RST READ (0D): ', trim(cdvar)
          CALL iom_swap( TRIM(crxios_context) )
          CALL xios_recv_field( trim(cdvar), pvar)
          CALL iom_swap( TRIM(cxios_context) )
+#else
+         nstop = nstop + 1 
+         clinfo = 'Can not use XIOS in iom_g0d, file: '//trim(clname)//', var:'//trim(cdvar)
+#endif
       ENDIF
    END SUBROUTINE iom_g0d
@@ -1292,4 +1310,5 @@
          CALL iom_swap( TRIM(crxios_context) ) 
          IF( PRESENT(pv_r3d) ) THEN
+            pv_r3d(:, :, :) = 0.
             if(lwp) write(numout,*) 'XIOS RST READ (3D): ',trim(cdvar)
             CALL xios_recv_field( trim(cdvar), pv_r3d)
@@ -1298,4 +1317,5 @@
             ENDIF
          ELSEIF( PRESENT(pv_r2d) ) THEN
+            pv_r2d(:, :) = 0.
             if(lwp) write(numout,*) 'XIOS RST READ (2D): ', trim(cdvar)
             CALL xios_recv_field( trim(cdvar), pv_r2d)
@@ -1304,4 +1324,5 @@
             ENDIF
          ELSEIF( PRESENT(pv_r1d) ) THEN
+            pv_r1d(:) = 0.
             if(lwp) write(numout,*) 'XIOS RST READ (1D): ', trim(cdvar)
             CALL xios_recv_field( trim(cdvar), pv_r1d)
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90	(revision 9531)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90	(revision 9535)
@@ -62,4 +62,5 @@
       CHARACTER(lc)       ::   clpath   ! full path to ocean output restart file
       CHARACTER(LEN=52)   ::   clpname   ! ocean output restart file name including prefix for AGRIF
+      CHARACTER(LEN=256)  ::   clinfo    ! info character
       !!----------------------------------------------------------------------
       !
@@ -110,4 +111,5 @@
                CALL iom_open( TRIM(clpath)//TRIM(clname), numrow, ldwrt = .TRUE., kiolib = jprstlib )
             ELSE
+#if defined key_iomput
                cwxios_context = "rstw_"//TRIM(ADJUSTL(clkt))
                IF( TRIM(Agrif_CFixed()) == '0' ) THEN
@@ -119,4 +121,8 @@
                CALL xios_update_calendar(nitrst)
                CALL iom_swap(      cxios_context          )
+#else
+               clinfo = 'Can not use XIOS in rst_opn'
+               CALL ctl_stop(TRIM(clinfo))
+#endif
             ENDIF
             lrst_oce = .TRUE.
