Index: codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/caldyn_gcm.f90
===================================================================
--- codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/caldyn_gcm.f90	(revision 259)
+++ codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/caldyn_gcm.f90	(revision 260)
@@ -300,6 +300,6 @@
 !            f_buf_i, f_buf_v, f_buf_u3d, f_buf_ulon, f_buf_ulat, f_buf_s, f_buf_p)
        CALL un2ulonlat(f_u, f_buf_ulon, f_buf_ulat)
-       CALL writefield("ulon",f_buf_ulon)
-       CALL writefield("ulat",f_buf_ulat)
+       CALL output_field("ulon",f_buf_ulon)
+       CALL output_field("ulat",f_buf_ulat)
 
        CALL output_field("ps",f_ps)
Index: codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/domain.f90
===================================================================
--- codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/domain.f90	(revision 259)
+++ codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/domain.f90	(revision 260)
@@ -17,4 +17,5 @@
     INTEGER :: jj_end_glo
     INTEGER,POINTER  :: assign_domain(:,:)
+    INTEGER,POINTER  :: assign_cell_glo(:,:)
     INTEGER,POINTER  :: assign_i(:,:)
     INTEGER,POINTER  :: assign_j(:,:)
@@ -142,4 +143,5 @@
           d%face=nf        
           ALLOCATE(d%assign_domain(d%iim,d%jjm))
+          ALLOCATE(d%assign_cell_glo(d%iim,d%jjm))
           ALLOCATE(d%assign_i(d%iim,d%jjm))
           ALLOCATE(d%assign_j(d%iim,d%jjm))
@@ -183,4 +185,5 @@
     d2%jj_end_glo = d1%jj_end_glo
     d2%assign_domain => d1%assign_domain
+    d2%assign_cell_glo => d1%assign_cell_glo
     d2%assign_i => d1%assign_i
     d2%assign_j => d1%assign_j
@@ -268,4 +271,5 @@
           jj=d%jj_begin_glo-d%jj_begin+j
           ind=vertex_glo(ii,jj,nf)%ind
+          d%assign_cell_glo(i,j) = ind  
           d%assign_domain(i,j)=cell_glo(ind)%assign_domain
           d%assign_i(i,j)=cell_glo(ind)%assign_i
Index: codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/etat0.f90
===================================================================
--- codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/etat0.f90	(revision 259)
+++ codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/etat0.f90	(revision 260)
@@ -27,4 +27,5 @@
     USE dynetat0_gcm_mod, ONLY : dynetat0_start=>etat0 
     USE dynetat0_hz_mod,  ONLY : dynetat0_hz=>etat0 
+    USE etat0_start_file_mod, ONLY : etat0_start_file=>etat0  
 
     IMPLICIT NONE
@@ -66,4 +67,6 @@
        CALL etat0_collocated(f_phis,f_ps,f_mass,f_theta_rhodz,f_u, f_q)
        !------------------- Old interface --------------------
+    CASE ('start_file')
+       CALL etat0_start_file(f_ps,f_phis,f_theta_rhodz,f_u, f_q)
     CASE ('academic')
        CALL etat0_academic(f_ps,f_phis,f_theta_rhodz,f_u, f_q)
Index: codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/etat0_start_file.f90
===================================================================
--- codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/etat0_start_file.f90	(revision 260)
+++ codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/etat0_start_file.f90	(revision 260)
@@ -0,0 +1,66 @@
+MODULE etat0_start_file_mod
+
+
+
+
+CONTAINS
+  
+   
+  SUBROUTINE etat0(f_ps,f_phis,f_theta_rhodz,f_u, f_q)
+  USE icosa
+  USE restart_mod
+  USE wind_mod
+  USE write_field
+  IMPLICIT NONE
+    TYPE(t_field),POINTER :: f_ps(:)
+    TYPE(t_field),POINTER :: f_phis(:)
+    TYPE(t_field),POINTER :: f_theta_rhodz(:)
+    TYPE(t_field),POINTER :: f_u(:)
+    TYPE(t_field),POINTER :: f_q(:)
+  
+    TYPE(t_field),POINTER,SAVE :: f_ulon(:)
+    TYPE(t_field),POINTER,SAVE :: f_ulat(:)
+
+    LOGICAL :: etat0_start_file_colocated=.FALSE.
+    INTEGER :: ind
+
+      CALL getin("etat0_start_file_colocated",etat0_start_file_colocated)  
+
+      IF (.NOT. etat0_start_file_colocated) THEN    
+        CALL allocate_field(f_ulon,field_t,type_real,llm,name='ulon')
+        CALL allocate_field(f_ulat,field_t,type_real,llm,name='ulat')
+        CALL read_start(f_ps,f_phis,f_theta_rhodz,f_u, f_q)
+        CALL transfert_request(f_ps,req_i1)
+        CALL transfert_request(f_phis,req_i1)
+        CALL transfert_request(f_theta_rhodz,req_i1)
+        CALL transfert_request(f_q,req_i1)
+        CALL transfert_request(f_u,req_e1_vect)
+        CALL transfert_request(f_u,req_e0_vect)
+        CALL un2ulonlat(f_u,f_ulon,f_ulat)
+
+        CALL deallocate_field(f_ulon)
+        CALL deallocate_field(f_ulat)
+
+      ELSE
+        CALL allocate_field(f_ulon,field_t,type_real,llm,name='ulon')
+        CALL allocate_field(f_ulat,field_t,type_real,llm,name='ulat')
+        CALL read_start(f_ps,f_phis,f_theta_rhodz,f_ulon,f_ulat, f_q)
+        CALL transfert_request(f_ulat,req_i1)
+        CALL transfert_request(f_ulon,req_i1)
+
+        CALL ulonlat2un(f_ulon,f_ulat,f_u)
+
+        CALL transfert_request(f_ps,req_i1)
+        CALL transfert_request(f_phis,req_i1)
+        CALL transfert_request(f_theta_rhodz,req_i1)
+        CALL transfert_request(f_q,req_i1)
+        CALL transfert_request(f_u,req_e1_vect)
+        
+        CALL deallocate_field(f_ulon)
+        CALL deallocate_field(f_ulat)
+      ENDIF
+
+  END SUBROUTINE etat0
+  
+  
+END MODULE etat0_start_file_mod
Index: codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/field.f90
===================================================================
--- codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/field.f90	(revision 259)
+++ codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/field.f90	(revision 260)
@@ -116,5 +116,5 @@
   END SUBROUTINE allocate_field
 
-  SUBROUTINE allocate_field_glo(field,field_type,data_type,dim1,dim2)
+  SUBROUTINE allocate_field_glo(field,field_type,data_type,dim1,dim2,name)
   USE domain_mod
   IMPLICIT NONE
@@ -123,4 +123,5 @@
     INTEGER,INTENT(IN) :: data_type
     INTEGER,OPTIONAL :: dim1,dim2
+    CHARACTER(*), OPTIONAL :: name
     INTEGER :: ind
     INTEGER :: ii_size,jj_size
@@ -141,4 +142,9 @@
       ENDIF
     
+      IF(PRESENT(name)) THEN
+         field(ind)%name = name
+      ELSE
+         field(ind)%name = '(undefined)'
+      END IF
     
       field(ind)%data_type=data_type
@@ -180,5 +186,7 @@
     INTEGER :: ind
 
+!$OMP BARRIER
     DO ind=1,ndomain
+      IF (.NOT. assigned_domain(ind)) CYCLE
 
       data_type=field(ind)%data_type
@@ -199,5 +207,9 @@
       
    ENDDO
+!$OMP BARRIER
+!$OMP MASTER
    DEALLOCATE(field)
+!$OMP END MASTER
+!$OMP BARRIER
        
   END SUBROUTINE deallocate_field
Index: codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/geometry.f90
===================================================================
--- codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/geometry.f90	(revision 259)
+++ codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/geometry.f90	(revision 260)
@@ -83,5 +83,5 @@
   IMPLICIT NONE
   
-    CALL allocate_field(geom%Ai,field_t,type_real)
+    CALL allocate_field(geom%Ai,field_t,type_real,name='Ai')
     CALL allocate_field(geom%xyz_i,field_t,type_real,3)
     CALL allocate_field(geom%centroid,field_t,type_real,3)
Index: codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/physics_lmdz5.f90
===================================================================
--- codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/physics_lmdz5.f90	(revision 259)
+++ codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/physics_lmdz5.f90	(revision 260)
@@ -180,5 +180,9 @@
 !$OMP BARRIER
     dtphy=itau_physics*dt
-    
+    IF(it==itaumax) THEN 
+      lafin=.TRUE.
+    ELSE 
+      lafin=.FALSE.
+    ENDIF
     CALL transfert_message(f_u,req_u)
     offset=0
Index: codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/physics_lmdz_generic.f90
===================================================================
--- codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/physics_lmdz_generic.f90	(revision 259)
+++ codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/physics_lmdz_generic.f90	(revision 260)
@@ -231,4 +231,10 @@
     ENDIF
 
+    IF(it==itaumax) THEN 
+      lafin=.TRUE.
+    ELSE 
+      lafin=.FALSE.
+    ENDIF
+
 !$OMP MASTER        
 !    CALL update_calendar(it)
Index: codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/restart.f90
===================================================================
--- codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/restart.f90	(revision 260)
+++ codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/restart.f90	(revision 260)
@@ -0,0 +1,547 @@
+MODULE restart_mod
+  USE field_mod
+
+  TYPE t_field_array
+    TYPE(t_field),POINTER :: field(:)
+  END TYPE t_field_array
+
+
+
+CONTAINS
+  
+  SUBROUTINE write_restart(field0 ,field1 ,field2 ,field3 ,field4 ,field5 ,field6 ,field7 ,field8 ,field9,   &
+                           field10,field11,field12,field13,field14,field15,field16,field17,field18,field19 )
+  USE prec
+  USE metric
+  USE field_mod
+  USE domain_mod
+  USE netcdf_mod
+  USE mpipara
+  USE getin_mod
+  USE spherical_geom_mod
+  USE transfert_mod
+ 
+  IMPLICIT NONE
+  TYPE(t_field),POINTER,OPTIONAL,DIMENSION(:) :: field0 ,field1 ,field2 ,field3 ,field4 ,field5 ,field6 ,field7 ,field8 ,field9
+  TYPE(t_field),POINTER,OPTIONAL,DIMENSION(:) :: field10,field11,field12,field13,field14,field15,field16,field17,field18,field19
+
+  TYPE(t_field_array) :: field_array(20)
+  INTEGER             :: nfield
+  INTEGER             :: fieldId(20)
+   
+  TYPE(t_domain),POINTER :: d
+  TYPE(t_field),POINTER :: field_glo(:)
+  TYPE(t_field),POINTER :: field(:)
+  
+  CHARACTER(LEN=255) :: restart_file_name
+  INTEGER,PARAMETER  :: nvert=6
+  INTEGER    ::  ncid, cellId, levId, edgeId,  vertid, lonId, latId, bounds_lonId, bounds_latId, nqId
+  INTEGER    :: ind,ind_glo,i,j,k,nf
+  INTEGER    :: status
+  REAL(rstd),ALLOCATABLE :: lon(:),lat(:),bounds_lon(:,:),bounds_lat(:,:)
+   
+    restart_file_name="restart"
+    CALL getin("restart_file_name",restart_file_name)
+
+!$OMP MASTER
+
+    nfield=0
+    IF (PRESENT(field0))  THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field0  ; ENDIF
+    IF (PRESENT(field1))  THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field1  ; ENDIF
+    IF (PRESENT(field2))  THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field2  ; ENDIF
+    IF (PRESENT(field3))  THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field3  ; ENDIF
+    IF (PRESENT(field4))  THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field4  ; ENDIF
+    IF (PRESENT(field5))  THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field5  ; ENDIF
+    IF (PRESENT(field6))  THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field6  ; ENDIF
+    IF (PRESENT(field7))  THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field7  ; ENDIF
+    IF (PRESENT(field8))  THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field8  ; ENDIF
+    IF (PRESENT(field9))  THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field9  ; ENDIF
+    IF (PRESENT(field10)) THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field10 ; ENDIF
+    IF (PRESENT(field11)) THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field11 ; ENDIF
+    IF (PRESENT(field12)) THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field12 ; ENDIF
+    IF (PRESENT(field13)) THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field13 ; ENDIF
+    IF (PRESENT(field14)) THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field14 ; ENDIF
+    IF (PRESENT(field15)) THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field15 ; ENDIF
+    IF (PRESENT(field16)) THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field16 ; ENDIF
+    IF (PRESENT(field17)) THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field17 ; ENDIF
+    IF (PRESENT(field18)) THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field18 ; ENDIF
+    IF (PRESENT(field19)) THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field19 ; ENDIF
+    
+      
+
+    IF (is_mpi_root) THEN
+      status = NF90_CREATE(TRIM(ADJUSTL(restart_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)
+      status = NF90_DEF_DIM(ncid,'lev',llm,levId)
+      status = NF90_DEF_DIM(ncid,'nvert',nvert,vertId)
+      status = NF90_DEF_DIM(ncid,'nq',nqtot,nqId)
+      
+      status = NF90_DEF_VAR(ncid,'lon',NF90_DOUBLE,(/ cellId /),lonId)
+      status = NF90_PUT_ATT(ncid,lonId,"long_name","longitude")
+      status = NF90_PUT_ATT(ncid,lonId,"units","degrees_east")
+      status = NF90_PUT_ATT(ncid,lonId,"bounds","bounds_lon")
+      status = NF90_DEF_VAR(ncid,'lat',NF90_DOUBLE,(/ cellId /),latId)
+      status = NF90_PUT_ATT(ncid,latId,"long_name","latitude")
+      status = NF90_PUT_ATT(ncid,latId,"units","degrees_north")
+      status = NF90_PUT_ATT(ncid,latId,"bounds","bounds_lat")
+      status = NF90_DEF_VAR(ncid,'bounds_lon',NF90_DOUBLE,(/ vertId,cellId /),bounds_lonId)
+      status = NF90_DEF_VAR(ncid,'bounds_lat',NF90_DOUBLE,(/ vertId,cellId /),bounds_latId)
+      
+      DO nf=1,nfield
+        field=>field_array(nf)%field
+        IF (field(1)%field_type==field_T) THEN
+          IF (field(1)%ndim==2) THEN
+            status = NF90_DEF_VAR(ncid,TRIM(ADJUSTL(field(1)%name)),NF90_DOUBLE,(/ cellId /),fieldId(nf))
+          ELSE IF (field(1)%ndim==3) THEN
+            status = NF90_DEF_VAR(ncid,TRIM(ADJUSTL(field(1)%name)),NF90_DOUBLE,(/ cellId, levId /),fieldId(nf))
+          ELSE IF (field(1)%ndim==4) THEN
+            status = NF90_DEF_VAR(ncid,TRIM(ADJUSTL(field(1)%name)),NF90_DOUBLE,(/ cellId, levId,nqId /),fieldId(nf))
+          ENDIF
+          status = NF90_PUT_ATT(ncid,FieldId(nf),"coordinates","lon lat")
+        ELSE IF (field(1)%field_type==field_U) THEN
+          IF (field(1)%ndim==2) THEN
+            status = NF90_DEF_VAR(ncid,TRIM(ADJUSTL(field(1)%name)),NF90_DOUBLE,(/ edgeId /),fieldId(nf))
+          ELSE IF (field(1)%ndim==3) THEN
+            status = NF90_DEF_VAR(ncid,TRIM(ADJUSTL(field(1)%name)),NF90_DOUBLE,(/ edgeId, levId /),fieldId(nf))
+          ELSE IF (field(1)%ndim==4) THEN
+            status = NF90_DEF_VAR(ncid,TRIM(ADJUSTL(field(1)%name)),NF90_DOUBLE,(/ edgeId, levId, nqId /),fieldId(nf))
+          ENDIF
+        ENDIF
+      ENDDO
+          
+      
+      status = NF90_ENDDEF(ncid)
+      
+      ALLOCATE(lon(ncell_glo),lat(ncell_glo),bounds_lon(0:nvert-1,ncell_glo),bounds_lat(0:nvert-1,ncell_glo))
+      DO ind=1,ndomain_glo
+        d=>domain_glo(ind)
+        DO j=d%jj_begin,d%jj_end
+          DO i=d%ii_begin,d%ii_end
+             ind_glo=d%assign_cell_glo(i,j)
+             CALL xyz2lonlat(d%xyz(:,i,j),lon(ind_glo),lat(ind_glo))
+             lon(ind_glo)=lon(ind_glo)*180/Pi
+             lat(ind_glo)=lat(ind_glo)*180/Pi
+             DO k=0,5
+                 CALL xyz2lonlat(d%vertex(:,k,i,j),bounds_lon(k,ind_glo), bounds_lat(k,ind_glo))
+                 bounds_lat(k,ind_glo)=bounds_lat(k,ind_glo)*180/Pi
+                 bounds_lon(k,ind_glo)=bounds_lon(k,ind_glo)*180/Pi
+             ENDDO
+          ENDDO
+        ENDDO
+      ENDDO
+
+      status=NF90_PUT_VAR(ncid,lonid,REAL(lon,r8),start=(/ 1 /),count=(/ ncell_glo /))
+      status=NF90_PUT_VAR(ncid,latid,REAL(lat,r8),start=(/ 1 /),count=(/ ncell_glo /))
+      status=NF90_PUT_VAR(ncid,bounds_lonId,REAL(bounds_lon,r8),start=(/ 1,1 /),count=(/ nvert,ncell_glo /))
+      status=NF90_PUT_VAR(ncid,bounds_latId,REAL(bounds_lat,r8),start=(/ 1,1 /),count=(/ nvert,ncell_glo /))
+    ENDIF
+
+    DO nf=1,nfield
+      field=>field_array(nf)%field
+      CALL write_restart_field(field,fieldId(nf),ncid)
+    ENDDO
+          
+!          status = NF90_DEF_VAR(ncid,TRIM(ADJUSTL(field(1)%name),NF90_DOUBLE,(/ ncellId /),fieldId(nf))
+!        ELSE IF (field(1)%ndim==3) THEN
+!          status = NF90_DEF_VAR(ncid,TRIM(ADJUSTL(field(1)%name),NF90_DOUBLE,(/ ncellId, levId /),fieldId(nf))
+!        ENDIF
+!      ENDDO
+
+
+    IF (is_mpi_root) THEN
+      status = NF90_CLOSE(ncid)      
+    ENDIF
+!$OMP END MASTER
+  
+  END SUBROUTINE write_restart
+  
+  SUBROUTINE write_restart_field(field,fieldId,ncid)
+  USE prec
+  USE metric
+  USE field_mod
+  USE domain_mod
+  USE netcdf_mod
+  USE mpipara
+  USE getin_mod
+  USE spherical_geom_mod
+  USE transfert_mod
+  IMPLICIT NONE
+    TYPE(t_field),POINTER :: field(:)
+    INTEGER,INTENT(IN)     :: fieldId
+    INTEGER,INTENT(IN)     :: ncid
+
+    TYPE(t_domain),POINTER :: d
+    TYPE(t_field),POINTER :: field_glo(:)
+    REAL(rstd),ALLOCATABLE :: global_field2d(:)
+    REAL(rstd),ALLOCATABLE :: global_field3d(:,:)
+    REAL(rstd),ALLOCATABLE :: global_field4d(:,:,:)
+    INTEGER :: i,j,ij,k,e,ind,ind_glo
+    INTEGER :: ndim, field_type
+    INTEGER :: status
+    
+      ndim=field(1)%ndim
+      field_Type= field(1)%field_type
+      
+      IF (is_mpi_root) THEN
+ 
+        IF (ndim==2) THEN
+          CALL allocate_field_glo(field_glo,field(1)%field_type,field(1)%data_type,name=field(1)%name)
+        ELSE IF (ndim==3) THEN
+          CALL allocate_field_glo(field_glo,field(1)%field_type,field(1)%data_type,field(1)%dim3,name=field(1)%name)
+        ELSE IF (ndim==4) THEN
+          CALL allocate_field_glo(field_glo,field(1)%field_type,field(1)%data_type,field(1)%dim3,field(1)%dim4,name=field(1)%name)
+        ENDIF
+      ENDIF
+      
+      CALL gather_field(field,field_glo)
+      
+
+      IF (is_mpi_root) THEN
+
+        IF (field_type==field_T) THEN
+          IF (ndim==2) THEN
+            ALLOCATE(global_field2d(ncell_glo))
+            DO ind=1,ndomain_glo
+              d=>domain_glo(ind)
+              DO j=d%jj_begin,d%jj_end
+                DO i=d%ii_begin,d%ii_end
+                  IF (d%own(i,j)) THEN 
+                    ij=(j-1)*d%iim+i
+                    ind_glo=d%assign_cell_glo(i,j)
+                    global_field2d(ind_glo)=field_glo(ind)%rval2d(ij)
+                  ENDIF 
+                ENDDO
+              ENDDO
+            ENDDO
+            status=NF90_PUT_VAR(ncid,fieldid,global_field2d,start=(/ 1 /),count=(/ ncell_glo /))
+          
+          ELSE IF (ndim==3) THEN
+            ALLOCATE(global_field3d(ncell_glo,llm))
+            DO ind=1,ndomain_glo
+              d=>domain_glo(ind)
+              DO j=d%jj_begin,d%jj_end
+                DO i=d%ii_begin,d%ii_end
+                  IF (d%own(i,j)) THEN 
+                    ij=(j-1)*d%iim+i
+                    ind_glo=d%assign_cell_glo(i,j)
+                    global_field3d(ind_glo,:)=field_glo(ind)%rval3d(ij,:)
+                  ENDIF
+                ENDDO
+              ENDDO
+            ENDDO
+            status=NF90_PUT_VAR(ncid,fieldid,global_field3d,start=(/ 1,1 /),count=(/ ncell_glo,llm /))
+          ELSE IF (ndim==4) THEN
+            ALLOCATE(global_field4d(ncell_glo,llm,nqtot))
+            DO ind=1,ndomain_glo
+              d=>domain_glo(ind)
+              DO j=d%jj_begin,d%jj_end
+                DO i=d%ii_begin,d%ii_end
+                  IF (d%own(i,j)) THEN 
+                    ij=(j-1)*d%iim+i
+                    ind_glo=d%assign_cell_glo(i,j)
+                    global_field4d(ind_glo,:,:)=field_glo(ind)%rval4d(ij,:,:)
+                  ENDIF
+                ENDDO
+              ENDDO
+            ENDDO
+            status=NF90_PUT_VAR(ncid,fieldid,global_field4d,start=(/ 1,1,1 /),count=(/ ncell_glo,llm,nqtot /))
+          ENDIF
+        
+        ELSE IF (field_type==field_U) THEN
+        
+          IF (ndim==2) THEN
+            ALLOCATE(global_field2d(3*ncell_glo))
+            DO ind=1,ndomain_glo
+              d=>domain_glo(ind)
+              DO j=d%jj_begin,d%jj_end
+                DO i=d%ii_begin,d%ii_end
+                  DO k=0,5
+                   IF (d%edge_assign_domain(k,i,j)==ind .AND. d%edge_assign_i(k,i,j)==i .AND. d%edge_assign_j(k,i,j)==j .AND. d%edge_assign_pos(k,i,j)==k) THEN
+                       ij=(j-1)*d%iim+i
+                      ind_glo=d%assign_cell_glo(i,j)
+                      e=cell_glo(ind_glo)%edge(MOD(k+d%delta(i,j)+6,6))  
+                      global_field2d(ind_glo)=d%edge_assign_sign(k,i,j)*field_glo(ind)%rval2d(ij+d%u_pos(k))
+                    ENDIF
+                  ENDDO
+                ENDDO
+              ENDDO
+            ENDDO
+            status=NF90_PUT_VAR(ncid,fieldid,REAL(global_field2d,r8),start=(/ 1 /),count=(/ 3*ncell_glo /))
+          ELSE IF (ndim==3) THEN
+            ALLOCATE(global_field3d(3*ncell_glo,llm))
+            DO ind=1,ndomain_glo
+              d=>domain_glo(ind)
+              DO j=d%jj_begin,d%jj_end
+                DO i=d%ii_begin,d%ii_end
+                  DO k=0,5
+                   IF (d%edge_assign_domain(k,i,j)==ind .AND. d%edge_assign_i(k,i,j)==i .AND. d%edge_assign_j(k,i,j)==j .AND. d%edge_assign_pos(k,i,j)==k) THEN
+                       ij=(j-1)*d%iim+i
+                      ind_glo=d%assign_cell_glo(i,j)
+                      e=cell_glo(ind_glo)%edge(MOD(k+d%delta(i,j)+6,6))  
+                      global_field3d(e,:)=d%edge_assign_sign(k,i,j)*field_glo(ind)%rval3d(ij+d%u_pos(k+1),:)
+                    ENDIF
+                  ENDDO
+                ENDDO
+              ENDDO
+            ENDDO
+            status=NF90_PUT_VAR(ncid,fieldid,global_field3d,start=(/ 1,1 /),count=(/ 3*ncell_glo,llm /))
+          ELSE IF (ndim==4) THEN
+            ALLOCATE(global_field4d(3*ncell_glo,llm,nqtot))
+            DO ind=1,ndomain_glo
+              d=>domain_glo(ind)
+              DO j=d%jj_begin,d%jj_end
+                DO i=d%ii_begin,d%ii_end
+                  DO k=0,5
+                    IF (d%edge_assign_domain(k,i,j)==ind .AND. d%edge_assign_i(k,i,j)==i .AND. d%edge_assign_j(k,i,j)==j .AND. d%edge_assign_pos(k,i,j)==k) THEN
+                      ij=(j-1)*d%iim+i
+                      ind_glo=d%assign_cell_glo(i,j)
+                      e=cell_glo(ind_glo)%edge(MOD(k+d%delta(i,j)+6,6))  
+                      global_field4d(e,:,:)=d%edge_assign_sign(k,i,j)*field_glo(ind)%rval4d(ij+d%u_pos(k+1),:,:)
+                    ENDIF
+                  ENDDO
+                ENDDO
+              ENDDO
+            ENDDO
+            status=NF90_PUT_VAR(ncid,fieldid,global_field3d,start=(/ 1,1,1 /),count=(/ 3*ncell_glo,llm,nqtot /))
+          ENDIF
+
+        ENDIF
+        
+        CALL deallocate_field_glo(field_glo)
+      
+      ENDIF
+      
+      
+  END SUBROUTINE write_restart_field
+
+
+  SUBROUTINE read_start(field0 ,field1 ,field2 ,field3 ,field4 ,field5 ,field6 ,field7 ,field8 ,field9,   &
+                          field10,field11,field12,field13,field14,field15,field16,field17,field18,field19 )
+  USE prec
+  USE metric
+  USE field_mod
+  USE domain_mod
+  USE netcdf_mod
+  USE mpipara
+  USE getin_mod
+  USE spherical_geom_mod
+  USE transfert_mod
+ 
+  IMPLICIT NONE
+  TYPE(t_field),POINTER,OPTIONAL,DIMENSION(:) :: field0 ,field1 ,field2 ,field3 ,field4 ,field5 ,field6 ,field7 ,field8 ,field9
+  TYPE(t_field),POINTER,OPTIONAL,DIMENSION(:) :: field10,field11,field12,field13,field14,field15,field16,field17,field18,field19
+
+  TYPE(t_field_array) :: field_array(20)
+  INTEGER             :: nfield
+  INTEGER             :: fieldId(20)
+   
+  TYPE(t_domain),POINTER :: d
+  TYPE(t_field),POINTER :: field_glo(:)
+  TYPE(t_field),POINTER :: field(:)
+  
+  CHARACTER(LEN=255) :: start_file_name
+  INTEGER,PARAMETER  :: nvert=6
+  INTEGER    ::  ncid, cellId, levId, edgeId,  vertid, lonId, latId, bounds_lonId, bounds_latId
+  INTEGER    :: ind,ind_glo,i,j,k,nf
+  INTEGER    :: status
+  REAL(rstd),ALLOCATABLE :: lon(:),lat(:),bounds_lon(:,:),bounds_lat(:,:)
+   
+    start_file_name="start"
+    CALL getin("start_file_name",start_file_name)
+
+!$OMP MASTER
+
+    nfield=0
+    IF (PRESENT(field0))  THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field0  ; ENDIF
+    IF (PRESENT(field1))  THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field1  ; ENDIF
+    IF (PRESENT(field2))  THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field2  ; ENDIF
+    IF (PRESENT(field3))  THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field3  ; ENDIF
+    IF (PRESENT(field4))  THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field4  ; ENDIF
+    IF (PRESENT(field5))  THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field5  ; ENDIF
+    IF (PRESENT(field6))  THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field6  ; ENDIF
+    IF (PRESENT(field7))  THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field7  ; ENDIF
+    IF (PRESENT(field8))  THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field8  ; ENDIF
+    IF (PRESENT(field9))  THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field9  ; ENDIF
+    IF (PRESENT(field10)) THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field10 ; ENDIF
+    IF (PRESENT(field11)) THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field11 ; ENDIF
+    IF (PRESENT(field12)) THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field12 ; ENDIF
+    IF (PRESENT(field13)) THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field13 ; ENDIF
+    IF (PRESENT(field14)) THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field14 ; ENDIF
+    IF (PRESENT(field15)) THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field15 ; ENDIF
+    IF (PRESENT(field16)) THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field16 ; ENDIF
+    IF (PRESENT(field17)) THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field17 ; ENDIF
+    IF (PRESENT(field18)) THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field18 ; ENDIF
+    IF (PRESENT(field19)) THEN ; nfield=nfield+1 ; field_array(nfield)%field=>field19 ; ENDIF
+    
+      
+
+    IF (is_mpi_root) THEN
+      status = NF90_OPEN(TRIM(ADJUSTL(start_file_name))//'.nc', NF90_NOWRITE, ncid)
+    ENDIF
+   
+    DO nf=1,nfield
+      field=>field_array(nf)%field
+      status = nf90_inq_varid(ncid, TRIM(ADJUSTL(field(1)%name)), fieldId(nf))
+      CALL read_start_field(field,fieldId(nf),ncid)
+    ENDDO
+
+
+    IF (is_mpi_root) THEN
+      status = NF90_CLOSE(ncid)      
+    ENDIF
+!$OMP END MASTER
+  
+  END SUBROUTINE read_start
+
+
+  SUBROUTINE read_start_field(field,fieldId,ncid)
+  USE prec
+  USE metric
+  USE field_mod
+  USE domain_mod
+  USE netcdf_mod
+  USE mpipara
+  USE getin_mod
+  USE spherical_geom_mod
+  USE transfert_mod
+  IMPLICIT NONE
+    TYPE(t_field),POINTER :: field(:)
+    INTEGER,INTENT(IN)     :: fieldId
+    INTEGER,INTENT(IN)     :: ncid
+
+    TYPE(t_domain),POINTER :: d
+    TYPE(t_field),POINTER :: field_glo(:)
+    REAL(rstd),ALLOCATABLE :: global_field2d(:)
+    REAL(rstd),ALLOCATABLE :: global_field3d(:,:)
+    REAL(rstd),ALLOCATABLE :: global_field4d(:,:,:)
+    INTEGER :: i,j,ij,k,e,ind,ind_glo
+    INTEGER :: ndim, field_type
+    INTEGER :: status
+    
+      ndim=field(1)%ndim
+      field_Type= field(1)%field_type
+      
+      IF (is_mpi_root) THEN
+ 
+        IF (ndim==2) THEN
+          CALL allocate_field_glo(field_glo,field(1)%field_type,field(1)%data_type,name=field(1)%name)
+        ELSE IF (ndim==3) THEN
+          CALL allocate_field_glo(field_glo,field(1)%field_type,field(1)%data_type,field(1)%dim3,name=field(1)%name)
+        ELSE IF (ndim==4) THEN
+          CALL allocate_field_glo(field_glo,field(1)%field_type,field(1)%data_type,field(1)%dim3,field(1)%dim4,name=field(1)%name)
+        ENDIF
+      ENDIF
+      
+      IF (is_mpi_root) THEN
+
+        IF (field_type==field_T) THEN
+          IF (ndim==2) THEN
+            ALLOCATE(global_field2d(ncell_glo))
+            status=NF90_GET_VAR(ncid,fieldid, global_field2d, start=(/ 1 /), count=(/ ncell_glo /))
+            DO ind=1,ndomain_glo
+              d=>domain_glo(ind)
+              DO j=d%jj_begin,d%jj_end
+                DO i=d%ii_begin,d%ii_end
+                    ij=(j-1)*d%iim+i
+                    ind_glo=d%assign_cell_glo(i,j)
+                    field_glo(ind)%rval2d(ij)=global_field2d(ind_glo)
+                ENDDO
+              ENDDO
+            ENDDO
+          
+          ELSE IF (ndim==3) THEN
+            ALLOCATE(global_field3d(ncell_glo,llm))
+            status=NF90_GET_VAR(ncid,fieldid,global_field3d,start=(/ 1,1 /),count=(/ ncell_glo,llm /))
+            DO ind=1,ndomain_glo
+              d=>domain_glo(ind)
+              DO j=d%jj_begin,d%jj_end
+                DO i=d%ii_begin,d%ii_end
+                  ij=(j-1)*d%iim+i
+                  ind_glo=d%assign_cell_glo(i,j)
+                  field_glo(ind)%rval3d(ij,:) = global_field3d(ind_glo,:)
+                ENDDO
+              ENDDO
+            ENDDO
+          ELSE IF (ndim==4) THEN
+            ALLOCATE(global_field4d(ncell_glo,llm,nqtot))
+            status=NF90_GET_VAR(ncid,fieldid,global_field4d,start=(/ 1,1,1 /),count=(/ ncell_glo,llm,nqtot /))
+            DO ind=1,ndomain_glo
+              d=>domain_glo(ind)
+              DO j=d%jj_begin,d%jj_end
+                DO i=d%ii_begin,d%ii_end
+                  ij=(j-1)*d%iim+i
+                  ind_glo=d%assign_cell_glo(i,j)
+                  field_glo(ind)%rval4d(ij,:,:) = global_field4d(ind_glo,:,:)
+                ENDDO
+              ENDDO
+            ENDDO
+          ENDIF
+        
+        ELSE IF (field_type==field_U) THEN
+        
+          IF (ndim==2) THEN
+            ALLOCATE(global_field2d(3*ncell_glo))
+            status=NF90_GET_VAR(ncid,fieldid,global_field2d,start=(/ 1 /),count=(/ 3*ncell_glo /))
+
+            DO ind=1,ndomain_glo
+              d=>domain_glo(ind)
+              DO j=d%jj_begin,d%jj_end
+                DO i=d%ii_begin,d%ii_end
+                  DO k=0,5
+                    ij=(j-1)*d%iim+i
+                    ind_glo=d%assign_cell_glo(i,j)
+                    e=cell_glo(ind_glo)%edge(MOD(k+d%delta(i,j)+6,6))  
+                    field_glo(ind)%rval2d(ij+d%u_pos(k))= global_field2d(ind_glo)*d%edge_assign_sign(k,i,j)
+                  ENDDO
+                ENDDO
+              ENDDO
+            ENDDO
+          ELSE IF (ndim==3) THEN
+            ALLOCATE(global_field3d(3*ncell_glo,llm))
+            status=NF90_GET_VAR(ncid,fieldid,global_field3d,start=(/ 1,1 /),count=(/ 3*ncell_glo,llm /))
+            DO ind=1,ndomain_glo
+              d=>domain_glo(ind)
+              DO j=d%jj_begin,d%jj_end
+                DO i=d%ii_begin,d%ii_end
+                  DO k=0,5
+                    ij=(j-1)*d%iim+i
+                    ind_glo=d%assign_cell_glo(i,j)
+                    e=cell_glo(ind_glo)%edge(MOD(k+d%delta(i,j)+6,6))  
+                    field_glo(ind)%rval3d(ij+d%u_pos(k+1),:)=global_field3d(e,:)*d%edge_assign_sign(k,i,j)
+                  ENDDO
+                ENDDO
+              ENDDO
+            ENDDO
+          ELSE IF (ndim==4) THEN
+            ALLOCATE(global_field4d(3*ncell_glo,llm,nqtot))
+            status=NF90_GET_VAR(ncid,fieldid,global_field4d,start=(/ 1,1,1 /),count=(/ 3*ncell_glo,llm,nqtot /))
+            DO ind=1,ndomain_glo
+              d=>domain_glo(ind)
+              DO j=d%jj_begin,d%jj_end
+                DO i=d%ii_begin,d%ii_end
+                  DO k=0,5
+                    ij=(j-1)*d%iim+i
+                    ind_glo=d%assign_cell_glo(i,j)
+                    e=cell_glo(ind_glo)%edge(MOD(k+d%delta(i,j)+6,6))  
+                    field_glo(ind)%rval4d(ij+d%u_pos(k+1),:,:)=global_field4d(e,:,:)*d%edge_assign_sign(k,i,j)
+                  ENDDO
+                ENDDO
+              ENDDO
+            ENDDO
+          ENDIF
+
+        ENDIF
+      ENDIF
+      
+      CALL scatter_field(field_glo,field)
+        
+      IF (is_mpi_root) THEN
+        CALL deallocate_field_glo(field_glo)
+      ENDIF
+      
+      
+  END SUBROUTINE read_start_field      
+    
+END MODULE restart_mod
+  
Index: codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/timeloop_gcm.f90
===================================================================
--- codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/timeloop_gcm.f90	(revision 259)
+++ codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/timeloop_gcm.f90	(revision 260)
@@ -61,5 +61,5 @@
     CALL allocate_field(f_theta_rhodzm1,field_t,type_real,llm,name='theta_rhodzm1')
 ! Tracers
-    CALL allocate_field(f_q,field_t,type_real,llm,nqtot)
+    CALL allocate_field(f_q,field_t,type_real,llm,nqtot,'q')
     CALL allocate_field(f_rhodz,field_t,type_real,llm,name='rhodz')
 ! Mass fluxes
@@ -155,4 +155,5 @@
   USE xios_mod
   USE output_field_mod
+  USE write_etat0_mod
   IMPLICIT NONE  
     REAL(rstd),POINTER :: q(:,:,:)
@@ -170,4 +171,9 @@
     INTEGER :: stop_clock
     INTEGER :: rate_clock
+    
+    
+!    CALL write_etat0(f_ps, f_phis,f_theta_rhodz,f_u,f_q) 
+!    CALL read_start(f_ps,f_mass,f_phis,f_theta_rhodz,f_u,f_q) 
+!    CALL write_restart(f_ps,f_mass,f_phis,f_theta_rhodz,f_u,f_q) 
     
     CALL caldyn_BC(f_phis, f_wflux) ! set constant values in first/last interfaces
@@ -242,5 +248,5 @@
     END DO
 
-    IF (MOD(it+1,itau_dissip)==0) THEN
+    IF (MOD(it,itau_dissip)==0) THEN
 !         CALL send_message(f_ps,req_ps)
 !         CALL wait_message(req_ps)  
@@ -263,5 +269,5 @@
     END IF
 
-    IF(MOD(it+1,itau_adv)==0) THEN
+    IF(MOD(it,itau_adv)==0) THEN
 
        CALL advect_tracer(f_hfluxt,f_wfluxt,f_u, f_q,f_rhodz)  ! update q and rhodz after RK step
@@ -282,10 +288,12 @@
 
 
-    IF (MOD(it+1,itau_physics)==0) THEN
+    IF (MOD(it,itau_physics)==0) THEN
       CALL physics(it,f_phis, f_ps, f_theta_rhodz, f_u, f_wflux, f_q)
     ENDIF
     
   ENDDO
-     
+
+  CALL write_etat0(f_ps, f_phis,f_theta_rhodz,f_u,f_q) 
+
   CALL check_conserve(f_ps,f_dps,f_u,f_theta_rhodz,f_phis,it)  
 
@@ -295,5 +303,5 @@
     
   IF (mpi_rank==0) THEN 
-    PRINT *,"Time elapsed : ",(stop_clock-start_clock)*1./rate_clock
+    PRINT *,"Time elapsed : ",(stop_clock-start_clock)*1./rate_clock 
   ENDIF  
 !$OMP END MASTER 
Index: codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/transfert.F90
===================================================================
--- codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/transfert.F90	(revision 259)
+++ codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/transfert.F90	(revision 260)
@@ -3,10 +3,10 @@
 #ifdef CPP_USING_MPI
   USE transfert_mpi_mod, ONLY : init_transfert, transfert_request=>transfert_request_mpi, req_i1,req_e1_vect, &
-                                req_e1_scal, req_i0, req_e0_vect, req_e0_scal, request_add_point, create_request, gather_field, &
+                                req_e1_scal, req_i0, req_e0_vect, req_e0_scal, request_add_point, create_request, gather_field, scatter_field, &
                                 t_message,init_message=>init_message_mpi,transfert_message=>transfert_message_mpi,  &
                                 send_message=>send_message_mpi,test_message=>test_message_mpi,wait_message=>wait_message_mpi,barrier
 #else 
   USE transfert_mpi_mod, ONLY : init_transfert, transfert_request=>transfert_request_seq, req_i1,req_e1_vect, &
-                                req_e1_scal,req_i0, req_e0_vect, req_e0_scal, request_add_point, create_request, gather_field, &
+                                req_e1_scal,req_i0, req_e0_vect, req_e0_scal, request_add_point, create_request, gather_field, scatter_field,&
                                 t_message,init_message=>init_message_seq,transfert_message=>transfert_message_seq,  &
                                 send_message=>send_message_seq,test_message=>test_message_seq,wait_message=>wait_message_seq,barrier
Index: codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/transfert_mpi.f90
===================================================================
--- codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/transfert_mpi.f90	(revision 259)
+++ codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/transfert_mpi.f90	(revision 260)
@@ -1646,4 +1646,78 @@
   END SUBROUTINE gather_field
 
+
+  SUBROUTINE scatter_field(field_glo,field_loc)
+  USE field_mod
+  USE domain_mod
+  USE mpi_mod
+  USE mpipara
+  IMPLICIT NONE
+    TYPE(t_field),POINTER :: field_glo(:)
+    TYPE(t_field),POINTER :: field_loc(:)
+    INTEGER, ALLOCATABLE :: mpi_req(:)
+    INTEGER, ALLOCATABLE :: status(:,:)
+    INTEGER :: ireq,nreq
+    INTEGER :: ind_glo,ind_loc    
+  
+    IF (.NOT. using_mpi) THEN
+    
+      DO ind_loc=1,ndomain
+        IF (field_loc(ind_loc)%ndim==2) field_loc(ind_loc)%rval2d=field_glo(ind_loc)%rval2d
+        IF (field_loc(ind_loc)%ndim==3) field_loc(ind_loc)%rval3d=field_glo(ind_loc)%rval3d
+        IF (field_loc(ind_loc)%ndim==4) field_loc(ind_loc)%rval4d=field_glo(ind_loc)%rval4d
+      ENDDO
+    
+    ELSE
+          
+      nreq=ndomain
+      IF (mpi_rank==0) nreq=nreq+ndomain_glo 
+      ALLOCATE(mpi_req(nreq))
+      ALLOCATE(status(MPI_STATUS_SIZE,nreq))
+    
+    
+      ireq=0
+      IF (mpi_rank==0) THEN
+        DO ind_glo=1,ndomain_glo
+          ireq=ireq+1
+
+          IF (field_glo(ind_glo)%ndim==2) THEN
+            CALL MPI_ISEND(field_glo(ind_glo)%rval2d,size(field_glo(ind_glo)%rval2d) , MPI_REAL8 ,   &
+                         domglo_rank(ind_glo),domglo_loc_ind(ind_glo), comm_icosa, mpi_req(ireq), ierr)
+   
+          ELSE IF (field_glo(ind_glo)%ndim==3) THEN
+            CALL MPI_ISEND(field_glo(ind_glo)%rval3d,size(field_glo(ind_glo)%rval3d) , MPI_REAL8 ,   &
+                         domglo_rank(ind_glo),domglo_loc_ind(ind_glo), comm_icosa, mpi_req(ireq), ierr)
+
+          ELSE IF (field_glo(ind_glo)%ndim==4) THEN
+            CALL MPI_ISEND(field_glo(ind_glo)%rval4d,size(field_glo(ind_glo)%rval4d) , MPI_REAL8 ,   &
+                         domglo_rank(ind_glo),domglo_loc_ind(ind_glo), comm_icosa, mpi_req(ireq), ierr)
+          ENDIF
+         
+        ENDDO
+      ENDIF
+  
+      DO ind_loc=1,ndomain
+        ireq=ireq+1
+
+        IF (field_loc(ind_loc)%ndim==2) THEN
+          CALL MPI_IRECV(field_loc(ind_loc)%rval2d,size(field_loc(ind_loc)%rval2d) , MPI_REAL8 ,   &
+                         0, ind_loc, comm_icosa, mpi_req(ireq), ierr)
+        ELSE IF (field_loc(ind_loc)%ndim==3) THEN
+          CALL MPI_IRECV(field_loc(ind_loc)%rval3d,size(field_loc(ind_loc)%rval3d) , MPI_REAL8 ,   &
+                         0, ind_loc, comm_icosa, mpi_req(ireq), ierr)
+        ELSE IF (field_loc(ind_loc)%ndim==4) THEN
+          CALL MPI_IRECV(field_loc(ind_loc)%rval4d,size(field_loc(ind_loc)%rval4d) , MPI_REAL8 ,   &
+                         0, ind_loc, comm_icosa, mpi_req(ireq), ierr)
+        ENDIF
+      
+      ENDDO
+   
+      CALL MPI_WAITALL(nreq,mpi_req,status,ierr)
+
+    ENDIF
+        
+  END SUBROUTINE scatter_field
+
+
    
   SUBROUTINE trace_in
Index: codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/wind.f90
===================================================================
--- codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/wind.f90	(revision 259)
+++ codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/wind.f90	(revision 260)
@@ -24,4 +24,24 @@
   END SUBROUTINE un2ulonlat
 
+  SUBROUTINE ulonlat2un(f_ulon, f_ulat,f_u)
+  USE icosa
+  IMPLICIT NONE
+    TYPE(t_field), POINTER :: f_ulon(:), f_ulat(:) ! IN : velocity reconstructed at hexagons
+    TYPE(t_field), POINTER :: f_u(:) ! OUT  : normal velocity components on edges
+    
+    REAL(rstd),POINTER :: u(:,:),  ulon(:,:), ulat(:,:)
+    INTEGER :: ind
+
+    DO ind=1,ndomain
+       IF (.NOT. assigned_domain(ind)) CYCLE
+       CALL swap_dimensions(ind)
+       CALL swap_geometry(ind)
+       u=f_u(ind)
+       ulon=f_ulon(ind)
+       ulat=f_ulat(ind)
+       CALL compute_ulonlat2un(ulon, ulat,u)
+    END DO
+
+  END SUBROUTINE ulonlat2un
  
   SUBROUTINE compute_wind_centered(ue,ucenter)
@@ -298,4 +318,52 @@
  END SUBROUTINE compute_wind_centered_lonlat_compound
 
+ SUBROUTINE compute_wind_centered_from_wind_lonlat_centered(ulon, ulat,uc)
+  USE icosa  
+    
+  IMPLICIT NONE
+  REAL(rstd) :: ulon(iim*jjm,llm)
+  REAL(rstd) :: ulat(iim*jjm,llm)
+  REAL(rstd) :: uc(iim*jjm,3,llm)
+
+  INTEGER :: i,j,ij,l     
+    
+  
+    DO l=1,llm
+      DO j=jj_begin,jj_end
+        DO i=ii_begin,ii_end
+          ij=(j-1)*iim+i
+          uc(ij,:,l)=ulon(ij,l)*elon_i(ij,:)+ulat(ij,l)*elat_i(ij,:)
+        ENDDO
+      ENDDO
+    ENDDO
+ 
+ END SUBROUTINE compute_wind_centered_from_wind_lonlat_centered
+
+
+
+ SUBROUTINE compute_wind_perp_from_wind_centered(uc,un)
+  USE icosa  
+    
+  IMPLICIT NONE
+  REAL(rstd),INTENT(IN)   :: uc(iim*jjm,3,llm)
+  REAL(rstd),INTENT(OUT)  :: un(3*iim*jjm,llm)
+
+  INTEGER :: i,j,ij,l     
+    
+  
+    DO l=1,llm
+      DO j=jj_begin,jj_end
+        DO i=ii_begin,ii_end
+          ij=(j-1)*iim+i
+          un(ij+u_right,l) = sum(0.5*(uc(ij,:,l) + uc(ij+t_right,:,l))*ep_e(ij+u_right,:))
+          un(ij+u_lup,l) = sum(0.5*(uc(ij,:,l) + uc(ij+t_lup,:,l))*ep_e(ij+u_lup,:))
+          un(ij+u_ldown,l) = sum(0.5*(uc(ij,:,l) + uc(ij+t_ldown,:,l))*ep_e(ij+u_ldown,:))
+         ENDDO
+      ENDDO
+    ENDDO
+ 
+ END SUBROUTINE compute_wind_perp_from_wind_centered
+
+
  SUBROUTINE compute_un2ulonlat(un, ulon, ulat)
   USE icosa  
@@ -313,3 +381,19 @@
  END SUBROUTINE compute_un2ulonlat
 
+ SUBROUTINE compute_ulonlat2un(ulon, ulat,un)
+  USE icosa  
+    
+  IMPLICIT NONE
+  REAL(rstd),INTENT(IN) :: ulon(iim*jjm,llm)
+  REAL(rstd),INTENT(IN) :: ulat(iim*jjm,llm)
+  REAL(rstd),INTENT(OUT)  :: un(3*iim*jjm,llm)
+
+  REAL(rstd)             :: uc(iim*jjm,3,llm)
+    
+    CALL compute_wind_centered_from_wind_lonlat_centered(ulon, ulat, uc)  
+    CALL compute_wind_perp_from_wind_centered(uc, un)
+ 
+ END SUBROUTINE compute_ulonlat2un
+
+
 END MODULE wind_mod
Index: codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/write_etat0.f90
===================================================================
--- codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/write_etat0.f90	(revision 260)
+++ codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/write_etat0.f90	(revision 260)
@@ -0,0 +1,36 @@
+MODULE write_etat0_mod
+
+
+
+CONTAINS
+
+  SUBROUTINE write_etat0(f_ps,f_phis,f_theta_rhodz,f_u, f_q)
+  USE icosa
+  USE restart_mod
+  USE wind_mod
+  USE write_field
+  IMPLICIT NONE
+    TYPE(t_field),POINTER :: f_ps(:)
+    TYPE(t_field),POINTER :: f_phis(:)
+    TYPE(t_field),POINTER :: f_theta_rhodz(:)
+    TYPE(t_field),POINTER :: f_u(:)
+    TYPE(t_field),POINTER :: f_q(:)
+  
+    TYPE(t_field),POINTER,SAVE :: f_ulon(:)
+    TYPE(t_field),POINTER,SAVE :: f_ulat(:)
+    
+    
+    CALL allocate_field(f_ulon,field_t,type_real,llm,name='ulon')
+    CALL allocate_field(f_ulat,field_t,type_real,llm,name='ulat')
+
+    CALL transfert_request(f_u,req_e1_vect)
+    CALL un2ulonlat(f_u, f_ulon, f_ulat)
+    
+    CALL write_restart(f_ps,f_phis,f_theta_rhodz,f_u, f_ulon, f_ulat, f_q)
+
+    CALL deallocate_field(f_ulon)
+    CALL deallocate_field(f_ulat)
+    
+  END SUBROUTINE write_etat0
+    
+END MODULE write_etat0_mod
