Index: /codes/icosagcm/trunk/src/restart.f90
===================================================================
--- /codes/icosagcm/trunk/src/restart.f90	(revision 515)
+++ /codes/icosagcm/trunk/src/restart.f90	(revision 516)
@@ -6,5 +6,5 @@
   END TYPE t_field_array
 
-
+  LOGICAL,SAVE :: write_start=.TRUE.
 
 CONTAINS
@@ -25,8 +25,8 @@
       CALL getin("restart_file_name",restart_file_name)
       IF (is_omp_master) THEN
-        CALL xios_set_file_attr("start",name=TRIM(ADJUSTL(start_file_name)),output_freq=(itaumax+1)*xios_timestep)
+!        CALL xios_set_file_attr("start",name=TRIM(ADJUSTL(start_file_name)),output_freq=(itaumax+1)*xios_timestep)
+        CALL xios_set_file_attr("start",name=TRIM(ADJUSTL(start_file_name)),output_freq=1*xios_timestep)
         CALL xios_set_file_attr("restart",name=TRIM(ADJUSTL(restart_file_name)),output_freq=itaumax*xios_timestep)
         CALL xios_set_fieldgroup_attr("group_restart", freq_op=itaumax*xios_timestep)
-!        CALL xios_set_axis_attr("lev_read", n_glo=llm)
       ENDIF
     ENDIF
@@ -63,5 +63,6 @@
   TYPE(t_field),POINTER :: field(:)
   
-  CHARACTER(LEN=255) :: restart_file_name
+  CHARACTER(LEN=255) :: file_name
+  CHARACTER(LEN=255) :: suffix
   INTEGER,PARAMETER  :: nvert=6
   INTEGER    ::  ncid, cellId, levId, edgeId,  vertid, lonId, latId, bounds_lonId, bounds_latId, nqId, levAxisId
@@ -72,29 +73,36 @@
     IF (no_io) RETURN
     
-    restart_file_name="restart"
-    CALL getin("restart_file_name",restart_file_name)
-
+    IF (it==0) THEN
+      file_name="start"
+      CALL getin("start_file_name",file_name)
+      suffix="_start"
+    ELSE
+      file_name="restart"
+      CALL getin("restart_file_name",file_name)
+      suffix="_restart"
+    ENDIF  
+     
     IF (using_xios) THEN
-      IF (PRESENT(field0))  THEN ; CALL  xios_write_field(TRIM(field0(1)%name)//'_restart',field0)  ; ENDIF
-      IF (PRESENT(field1))  THEN ; CALL  xios_write_field(TRIM(field1(1)%name)//'_restart',field1)  ; ENDIF
-      IF (PRESENT(field2))  THEN ; CALL  xios_write_field(TRIM(field2(1)%name)//'_restart',field2)  ; ENDIF
-      IF (PRESENT(field3))  THEN ; CALL  xios_write_field(TRIM(field3(1)%name)//'_restart',field3)  ; ENDIF
-      IF (PRESENT(field4))  THEN ; CALL  xios_write_field(TRIM(field4(1)%name)//'_restart',field4)  ; ENDIF
-      IF (PRESENT(field5))  THEN ; CALL  xios_write_field(TRIM(field5(1)%name)//'_restart',field5)  ; ENDIF
-      IF (PRESENT(field6))  THEN ; CALL  xios_write_field(TRIM(field6(1)%name)//'_restart',field6)  ; ENDIF
-      IF (PRESENT(field7))  THEN ; CALL  xios_write_field(TRIM(field7(1)%name)//'_restart',field7)  ; ENDIF
-      IF (PRESENT(field8))  THEN ; CALL  xios_write_field(TRIM(field8(1)%name)//'_restart',field8)  ; ENDIF
-      IF (PRESENT(field9))  THEN ; CALL  xios_write_field(TRIM(field9(1)%name)//'_restart',field9)  ; ENDIF
-      IF (PRESENT(field10))  THEN ; CALL  xios_write_field(TRIM(field10(1)%name)//'_restart',field10)  ; ENDIF
-      IF (PRESENT(field11))  THEN ; CALL  xios_write_field(TRIM(field11(1)%name)//'_restart',field11)  ; ENDIF
-      IF (PRESENT(field12))  THEN ; CALL  xios_write_field(TRIM(field12(1)%name)//'_restart',field12)  ; ENDIF
-      IF (PRESENT(field13))  THEN ; CALL  xios_write_field(TRIM(field13(1)%name)//'_restart',field13)  ; ENDIF
-      IF (PRESENT(field14))  THEN ; CALL  xios_write_field(TRIM(field14(1)%name)//'_restart',field14)  ; ENDIF
-      IF (PRESENT(field15))  THEN ; CALL  xios_write_field(TRIM(field15(1)%name)//'_restart',field15)  ; ENDIF
-      IF (PRESENT(field16))  THEN ; CALL  xios_write_field(TRIM(field16(1)%name)//'_restart',field16)  ; ENDIF
-      IF (PRESENT(field17))  THEN ; CALL  xios_write_field(TRIM(field17(1)%name)//'_restart',field17)  ; ENDIF
-      IF (PRESENT(field18))  THEN ; CALL  xios_write_field(TRIM(field18(1)%name)//'_restart',field18)  ; ENDIF
-      IF (PRESENT(field19))  THEN ; CALL  xios_write_field(TRIM(field19(1)%name)//'_restart',field19)  ; ENDIF
-      IF (is_omp_master) CALL xios_send_field("it_restart",it*1.0)
+      IF (PRESENT(field0))  THEN ; CALL  xios_write_field(TRIM(field0(1)%name)//TRIM(suffix),field0)  ; ENDIF
+      IF (PRESENT(field1))  THEN ; CALL  xios_write_field(TRIM(field1(1)%name)//TRIM(suffix),field1)  ; ENDIF
+      IF (PRESENT(field2))  THEN ; CALL  xios_write_field(TRIM(field2(1)%name)//TRIM(suffix),field2)  ; ENDIF
+      IF (PRESENT(field3))  THEN ; CALL  xios_write_field(TRIM(field3(1)%name)//TRIM(suffix),field3)  ; ENDIF
+      IF (PRESENT(field4))  THEN ; CALL  xios_write_field(TRIM(field4(1)%name)//TRIM(suffix),field4)  ; ENDIF
+      IF (PRESENT(field5))  THEN ; CALL  xios_write_field(TRIM(field5(1)%name)//TRIM(suffix),field5)  ; ENDIF
+      IF (PRESENT(field6))  THEN ; CALL  xios_write_field(TRIM(field6(1)%name)//TRIM(suffix),field6)  ; ENDIF
+      IF (PRESENT(field7))  THEN ; CALL  xios_write_field(TRIM(field7(1)%name)//TRIM(suffix),field7)  ; ENDIF
+      IF (PRESENT(field8))  THEN ; CALL  xios_write_field(TRIM(field8(1)%name)//TRIM(suffix),field8)  ; ENDIF
+      IF (PRESENT(field9))  THEN ; CALL  xios_write_field(TRIM(field9(1)%name)//TRIM(suffix),field9)  ; ENDIF
+      IF (PRESENT(field10))  THEN ; CALL  xios_write_field(TRIM(field10(1)%name)//TRIM(suffix),field10)  ; ENDIF
+      IF (PRESENT(field11))  THEN ; CALL  xios_write_field(TRIM(field11(1)%name)//TRIM(suffix),field11)  ; ENDIF
+      IF (PRESENT(field12))  THEN ; CALL  xios_write_field(TRIM(field12(1)%name)//TRIM(suffix),field12)  ; ENDIF
+      IF (PRESENT(field13))  THEN ; CALL  xios_write_field(TRIM(field13(1)%name)//TRIM(suffix),field13)  ; ENDIF
+      IF (PRESENT(field14))  THEN ; CALL  xios_write_field(TRIM(field14(1)%name)//TRIM(suffix),field14)  ; ENDIF
+      IF (PRESENT(field15))  THEN ; CALL  xios_write_field(TRIM(field15(1)%name)//TRIM(suffix),field15)  ; ENDIF
+      IF (PRESENT(field16))  THEN ; CALL  xios_write_field(TRIM(field16(1)%name)//TRIM(suffix),field16)  ; ENDIF
+      IF (PRESENT(field17))  THEN ; CALL  xios_write_field(TRIM(field17(1)%name)//TRIM(suffix),field17)  ; ENDIF
+      IF (PRESENT(field18))  THEN ; CALL  xios_write_field(TRIM(field18(1)%name)//TRIM(suffix),field18)  ; ENDIF
+      IF (PRESENT(field19))  THEN ; CALL  xios_write_field(TRIM(field19(1)%name)//TRIM(suffix),field19)  ; ENDIF
+      IF (is_omp_master) CALL xios_send_field('it'//TRIM(suffix),it*1.0)
 
     ELSE
@@ -127,5 +135,5 @@
 
       IF (is_mpi_root) THEN
-        status = NF90_CREATE(TRIM(ADJUSTL(restart_file_name))//'.nc', NF90_CLOBBER, ncid)
+        status = NF90_CREATE(TRIM(ADJUSTL(file_name))//'.nc', NF90_CLOBBER, ncid)
         status = NF90_DEF_DIM(ncid,'cell',ncell_glo,cellId)
         status = NF90_DEF_DIM(ncid,'edge',3*ncell_glo,edgeId)
Index: /codes/icosagcm/trunk/src/timeloop_gcm.f90
===================================================================
--- /codes/icosagcm/trunk/src/timeloop_gcm.f90	(revision 515)
+++ /codes/icosagcm/trunk/src/timeloop_gcm.f90	(revision 516)
@@ -224,5 +224,5 @@
     END IF
     
-!    IF (write_start) CALL write_etat0(itau0,f_ps, f_phis,f_theta_rhodz,f_u,f_q)  ! FIXME : write_start undefined
+    IF (write_start) CALL write_etat0(itau0,f_ps, f_phis,f_theta_rhodz,f_u,f_q)  ! FIXME : write_start undefined
    
     CALL write_output_fields_basic(.TRUE., f_phis, f_ps, f_mass, f_geopot, f_theta_rhodz, f_u, f_W, f_q)
