Index: /branches/2011/dev_MERCATOR_2011_MERGE/DOC/TexFiles/Chapters/Chap_DIA.tex
===================================================================
--- /branches/2011/dev_MERCATOR_2011_MERGE/DOC/TexFiles/Chapters/Chap_DIA.tex	(revision 3050)
+++ /branches/2011/dev_MERCATOR_2011_MERGE/DOC/TexFiles/Chapters/Chap_DIA.tex	(revision 3051)
@@ -681,4 +681,95 @@
 numeric of the code, so that the trajectories never intercept the bathymetry. 
 
+\subsubsection{ Input data: initial coordinates }
+
+Initial coordinates can be given with Ariane Tools convention ( IJK coordinates ,(\np{ln\_ariane}=true) )
+or with longitude and latitude.
+
+
+In case of Ariane convention, input filename is \np{"init\_float\_ariane"}. Its format is:
+
+\texttt{ I J K nisobfl itrash itrash }
+
+\noindent with: 
+
+ - I,J,K  : indexes of initial position
+
+ - nisobfl: 0 for an isobar float, 1 for a float following the w velocity  
+
+ - itrash : set to zero; it is a dummy variable to respect Ariane Tools convention
+
+ - itrash :set to zero; it is a dummy variable to respect Ariane Tools convention
+
+\noindent Example:\\
+\noindent \texttt{ 100.00000  90.00000  -1.50000 1.00000   0.00000}\\
+\texttt{ 102.00000  90.00000  -1.50000 1.00000   0.00000}\\
+\texttt{ 104.00000  90.00000  -1.50000 1.00000   0.00000}\\
+\texttt{ 106.00000  90.00000  -1.50000 1.00000   0.00000}\\
+\texttt{ 108.00000  90.00000  -1.50000 1.00000   0.00000}\\
+
+
+In the other case ( longitude and latitude ), input filename is \np{"init\_float"}. Its format is:
+
+\texttt{ Long Lat depth nisobfl ngrpfl itrash}
+
+\noindent with:
+
+ - Long, Lat, depth  : Longitude, latitude, depth
+
+ - nisobfl: 0 for an isobar float, 1 for a float following the w velocity
+
+ - ngrpfl : number to identify searcher group
+
+ - itrash :set to 1; it is a dummy variable.
+
+\noindent Example:
+
+\noindent\texttt{  20.0 0.0 0.0 0 1 1 }\\
+\texttt{ -21.0 0.0 0.0 0 1 1 }\\
+\texttt{ -22.0 0.0 0.0 0 1 1 }\\
+\texttt{ -23.0 0.0 0.0 0 1 1 }\\
+\texttt{ -24.0 0.0 0.0 0 1 1 }\\
+
+\np{jpnfl} is the total number of floats during the run.
+When initial positions are read in a restart file ( \np{ln\_rstflo= .TRUE.} ),  \np{jpnflnewflo}
+can be added in the initialization file. 
+
+\subsubsection{ Output data }
+
+\np{nn\_writefl} is the frequency of writing in float output file and \np{nn\_stockfl} 
+is the frequency of creation of the float restart file.
+
+Output data can be written in ascii files (\np{ln\_flo\_ascii = .TRUE.} ). In that case, 
+output filename is \np{is trajec\_float}.
+
+Another possiblity of writing format is Netcdf (\np{ln\_flo\_ascii = .FALSE.} ). There are 2 possibilities:
+
+ - if (\key{iomput}) is used, outputs are selected in  \np{iodef.xml}. Here it is an example of specification 
+   to put in files description section:
+
+\vspace{-30pt}
+\begin{alltt}  {{\scriptsize
+\begin{verbatim}
+
+     <group id="1d\_grid\_T" name="auto" description="ocean T grid variables" >   }
+       <file id="floats"  description="floats variables"> }\\
+           <field ref="traj\_lon"   name="floats\_longitude"   freq\_op="86400" />}
+           <field ref="traj\_lat"   name="floats\_latitude"    freq\_op="86400" />}
+           <field ref="traj\_dep"   name="floats\_depth"       freq\_op="86400" />}
+           <field ref="traj\_temp"  name="floats\_temperature" freq\_op="86400" />}
+           <field ref="traj\_salt"  name="floats\_salinity"    freq\_op="86400" />}
+           <field ref="traj\_dens"  name="floats\_density"     freq\_op="86400" />}
+           <field ref="traj\_group" name="floats\_group"       freq\_op="86400" />}
+       </file>}
+  </group>}
+
+\end{verbatim}
+}}\end{alltt}
+
+
+ -  if (\key{iomput}) is not used, a file called \np{trajec\_float.nc} will be created by IOIPSL library.
+
+
+
 See also \href{http://stockage.univ-brest.fr/~grima/Ariane/}{here} the web site describing 
 the off-line use of this marvellous diagnostic tool.
Index: /branches/2011/dev_MERCATOR_2011_MERGE/DOC/TexFiles/Namelist/namflo
===================================================================
--- /branches/2011/dev_MERCATOR_2011_MERGE/DOC/TexFiles/Namelist/namflo	(revision 3050)
+++ /branches/2011/dev_MERCATOR_2011_MERGE/DOC/TexFiles/Namelist/namflo	(revision 3051)
@@ -2,4 +2,6 @@
 &namflo       !   float parameters                                      ("key_float")
 !-----------------------------------------------------------------------
+   jpnfl      = 1          !  total number of floats during the run
+   jpnnewflo  = 0          !  number of floats for the restart
    ln_rstflo  = .false.    !  float restart (T) or not (F)
    nn_writefl =      75    !  frequency of writing in float output file 
@@ -8,3 +10,5 @@
    ln_flork4  = .false.    !  trajectories computed with a 4th order Runge-Kutta (T)
                            !  or computed with Blanke' scheme (F)
+   ln_ariane  = .true.     !  Input with Ariane tool convention(T)
+   ln_ascii   = .true.     !  Output with Ariane tool netcdf convention(T) or ascii file (F)
 /
Index: /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/CONFIG/GYRE/EXP00/iodef.xml
===================================================================
--- /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/CONFIG/GYRE/EXP00/iodef.xml	(revision 3050)
+++ /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/CONFIG/GYRE/EXP00/iodef.xml	(revision 3051)
@@ -206,4 +206,16 @@
       </group>
 
+      <!-- variables available with key_float -->
+      <group id="floatvar" axis_ref="nfloat" grid_ref="scalarpoint" zoom_ref="1point">
+        <field id="traj_lon"   description="floats longitude"   unit="deg"  operation="inst(X)" />
+        <field id="traj_lat"   description="floats latitude"    unit="deg"   />
+        <field id="traj_dep"   description="floats depth"       unit="m"     />
+        <field id="traj_temp"  description="floats temperature" unit="degC"  />
+        <field id="traj_salt"  description="floats salinity"    unit="psu"   />
+        <field id="traj_dens"  description="floats density"     unit="kg/m3" />
+        <field id="traj_group" description="floats group"       unit="none"  />
+      </group>
+
+
     </field_definition>
 
@@ -286,4 +298,15 @@
         </file>
 
+        <!-- variables available with key_float, instantaneous fields -->
+        <file id="floats"  description="floats variables">
+            <field ref="traj_lon"   name="floats_longitude"   freq_op="432000" />
+            <field ref="traj_lat"   name="floats_latitude"    freq_op="432000" />
+            <field ref="traj_dep"   name="floats_depth"       freq_op="432000" />
+            <field ref="traj_temp"  name="floats_temperature" freq_op="432000" />
+            <field ref="traj_salt"  name="floats_salinity"    freq_op="432000" />
+            <field ref="traj_dens"  name="floats_density"     freq_op="432000" />
+            <field ref="traj_group" name="floats_group"       freq_op="432000" />
+        </file>
+
       </group>
 
@@ -330,4 +353,5 @@
      <axis id="depthv" description="Vertical V levels" unit="m" positive=".false." />
      <axis id="depthw" description="Vertical W levels" unit="m" positive=".false." />
+     <axis id="nfloat" description="Number of float"   unit="no unit" positive=".false." />
      <axis id="none" description="axe non defini" unit="none" size="1" />
   </axis_definition> 
Index: /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/CONFIG/GYRE/EXP00/namelist
===================================================================
--- /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/CONFIG/GYRE/EXP00/namelist	(revision 3050)
+++ /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/CONFIG/GYRE/EXP00/namelist	(revision 3051)
@@ -772,4 +772,6 @@
 &namflo       !   float parameters                                      ("key_float")
 !-----------------------------------------------------------------------
+   jpnfl      = 1          !  total number of floats during the run
+   jpnnewflo  = 0          !  number of floats for the restart
    ln_rstflo  = .false.    !  float restart (T) or not (F)
    nn_writefl =      75    !  frequency of writing in float output file 
@@ -778,4 +780,6 @@
    ln_flork4  = .false.    !  trajectories computed with a 4th order Runge-Kutta (T)
                            !  or computed with Blanke' scheme (F)
+   ln_ariane  = .true.     !  Input with Ariane tool convention(T) 
+   ln_ascii   = .true.     !  Output with Ariane tool netcdf convention(F) or ascii file (T)
 /
 !-----------------------------------------------------------------------
Index: /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef.xml
===================================================================
--- /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef.xml	(revision 3050)
+++ /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef.xml	(revision 3051)
@@ -276,6 +276,18 @@
       </group>
 
+
+      <!-- variables available with key_float -->
+      <group id="floatvar" axis_ref="nfloat" grid_ref="scalarpoint" zoom_ref="1point">
+        <field id="traj_lon"   description="floats longitude"   unit="deg"   operation="inst(X)" />
+        <field id="traj_lat"   description="floats latitude"    unit="deg"   operation="inst(X)"  />
+        <field id="traj_dep"   description="floats depth"       unit="m"     operation="inst(X)"  />
+        <field id="traj_temp"  description="floats temperature" unit="degC"  operation="inst(X)"  />
+        <field id="traj_salt"  description="floats salinity"    unit="psu"   operation="inst(X)"  />
+        <field id="traj_dens"  description="floats density"     unit="kg/m3" operation="inst(X)"  />
+        <field id="traj_group" description="floats group"       unit="none"  operation="inst(X)"  />
+      </group>
+
     </field_definition>
-    
+
     <!-- 
 ============================================================================================================
@@ -336,6 +348,14 @@
 	</group>
 
-
-
+        <!-- variables available with key_float, instantaneous fields -->
+        <file id="floats"  description="floats variables">
+            <field ref="traj_lon"   name="floats_longitude"   freq_op="86400" />
+            <field ref="traj_lat"   name="floats_latitude"    freq_op="86400" />
+            <field ref="traj_dep"   name="floats_depth"       freq_op="86400" />
+            <field ref="traj_temp"  name="floats_temperature" freq_op="86400" />
+            <field ref="traj_salt"  name="floats_salinity"    freq_op="86400" />
+            <field ref="traj_dens"  name="floats_density"     freq_op="86400" />
+            <field ref="traj_group" name="floats_group"       freq_op="86400" />
+        </file>
 
       </group>
@@ -459,8 +479,9 @@
     
     <axis_definition>  
-      <axis id="deptht" description="Vertical T levels" unit="m" positive=".false." />
-      <axis id="depthu" description="Vertical U levels" unit="m" positive=".false." />
-      <axis id="depthv" description="Vertical V levels" unit="m" positive=".false." />
-      <axis id="depthw" description="Vertical W levels" unit="m" positive=".false." />
+      <axis id="deptht" description="Vertical T levels" unit="m"       positive=".false." />
+      <axis id="depthu" description="Vertical U levels" unit="m"       positive=".false." />
+      <axis id="depthv" description="Vertical V levels" unit="m"       positive=".false." />
+      <axis id="depthw" description="Vertical W levels" unit="m"       positive=".false." />
+      <axis id="nfloat" description="Number of float"   unit="no unit" positive=".false." />
       <axis id="none" description="axe non defini" unit="none" size="1" />
     </axis_definition> 
Index: /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist
===================================================================
--- /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist	(revision 3050)
+++ /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist	(revision 3051)
@@ -772,4 +772,6 @@
 &namflo       !   float parameters                                      ("key_float")
 !-----------------------------------------------------------------------
+   jpnfl      = 1          !  total number of floats during the run
+   jpnnewflo  = 0          !  number of floats for the restart
    ln_rstflo  = .false.    !  float restart (T) or not (F)
    nn_writefl =      75    !  frequency of writing in float output file 
@@ -778,4 +780,6 @@
    ln_flork4  = .false.    !  trajectories computed with a 4th order Runge-Kutta (T)
                            !  or computed with Blanke' scheme (F)
+   ln_ariane  = .true.     !  Input with Ariane tool convention(T)
+   ln_ascii   = .true.     !  Output with Ariane tool netcdf convention(F) or ascii file (T)
 /
 !-----------------------------------------------------------------------
Index: /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist
===================================================================
--- /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist	(revision 3050)
+++ /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist	(revision 3051)
@@ -764,4 +764,6 @@
 &namflo       !   float parameters                                      ("key_float")
 !-----------------------------------------------------------------------
+   jpnfl      = 1          !  total number of floats during the run
+   jpnnewflo  = 0          !  number of floats for the restart
    ln_rstflo  = .false.    !  float restart (T) or not (F)
    nn_writefl =      75    !  frequency of writing in float output file 
@@ -771,4 +773,6 @@
                            !  or computed with Blanke' scheme (F)
                            !  or computed with Blanke' scheme (F)
+   ln_ariane  = .true.     !  Input with Ariane tool convention(T) 
+   ln_ascii   = .true.     !  Output with Ariane tool netcdf convention(T) or ascii file (F)
 /
 !-----------------------------------------------------------------------
Index: /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/CONFIG/POMME/EXP00/namelist
===================================================================
--- /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/CONFIG/POMME/EXP00/namelist	(revision 3050)
+++ /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/CONFIG/POMME/EXP00/namelist	(revision 3051)
@@ -777,4 +777,6 @@
 &namflo       !   float parameters                                      ("key_float")
 !-----------------------------------------------------------------------
+   jpnfl      = 1          !  total number of floats during the run
+   jpnnewflo  = 0          !  number of floats for the restart
    ln_rstflo  = .false.    !  float restart (T) or not (F)
    nn_writefl =      75    !  frequency of writing in float output file 
@@ -783,4 +785,6 @@
    ln_flork4  = .false.    !  trajectories computed with a 4th order Runge-Kutta (T)
                            !  or computed with Blanke' scheme (F)
+   ln_ariane  = .true.     !  Input with Ariane tool convention(T) 
+   ln_ascii   = .true.     !  Output with Ariane tool netcdf convention(T) or ascii file (F)
 /
 !-----------------------------------------------------------------------
Index: /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/NEMO/OPA_SRC/FLO/flo4rk.F90
===================================================================
--- /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/NEMO/OPA_SRC/FLO/flo4rk.F90	(revision 3050)
+++ /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/NEMO/OPA_SRC/FLO/flo4rk.F90	(revision 3051)
@@ -52,8 +52,19 @@
       !!
       INTEGER ::  jfl, jind           ! dummy loop indices
-      REAL(wp), DIMENSION(jpnfl)   ::   zgifl , zgjfl , zgkfl    ! index RK  positions
-      REAL(wp), DIMENSION(jpnfl)   ::   zufl  , zvfl  , zwfl     ! interpolated velocity at the float position 
-      REAL(wp), DIMENSION(jpnfl,4) ::   zrkxfl, zrkyfl, zrkzfl   ! RK coefficients
+      INTEGER ::  ierror              ! error value
+
+      REAL(wp), ALLOCATABLE, DIMENSION(:)   ::   zgifl , zgjfl , zgkfl    ! index RK  positions
+      REAL(wp), ALLOCATABLE, DIMENSION(:)   ::   zufl  , zvfl  , zwfl     ! interpolated velocity at the float position 
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zrkxfl, zrkyfl, zrkzfl   ! RK coefficients
       !!---------------------------------------------------------------------
+
+      ALLOCATE (  zgifl(jpnfl)  ,  zgjfl(jpnfl)  ,  zgkfl(jpnfl)   , &
+                   zufl(jpnfl)  ,   zvfl(jpnfl)  ,   zwfl(jpnfl)   , &        
+                 zrkxfl(jpnfl,4), zrkyfl(jpnfl,4), zrkzfl(jpnfl,4) , STAT=ierror )
+      !
+      IF( ierror /= 0 ) THEN
+         WRITE(numout,*) 'flo_4rk: allocation of workspace arrays failed'
+      ENDIF
+
     
       IF( kt == nit000 ) THEN
@@ -145,4 +156,8 @@
          END DO
       END DO
+      !
+      DEALLOCATE( zgifl  , zgjfl  , zgkfl  )
+      DEALLOCATE( zufl   , zvfl   , zwfl   )
+      DEALLOCATE( zrkxfl , zrkyfl , zrkzfl )
       !
    END SUBROUTINE flo_4rk
Index: /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/NEMO/OPA_SRC/FLO/flo_oce.F90
===================================================================
--- /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/NEMO/OPA_SRC/FLO/flo_oce.F90	(revision 3050)
+++ /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/NEMO/OPA_SRC/FLO/flo_oce.F90	(revision 3051)
@@ -24,24 +24,28 @@
    !! float parameters
    !! ----------------
-   INTEGER, PUBLIC, PARAMETER ::   jpnfl     = 23                  !: total number of floats during the run
-   INTEGER, PUBLIC, PARAMETER ::   jpnnewflo =  0                  !: number of floats added in a new run
-   INTEGER, PUBLIC, PARAMETER ::   jpnrstflo = jpnfl - jpnnewflo   !: number of floats for the restart
+   INTEGER, PUBLIC ::   jpnfl       !: total number of floats during the run
+   INTEGER, PUBLIC ::   jpnnewflo   !: number of floats added in a new run
+   INTEGER, PUBLIC ::   jpnrstflo   !: number of floats for the restart
 
    !! float variables
    !! ---------------
-   INTEGER , PUBLIC, DIMENSION(jpnfl) ::   nisobfl   !: =0 for a isobar float , =1 for a float following the w velocity
-   INTEGER , PUBLIC, DIMENSION(jpnfl) ::   ngrpfl    !: number to identify searcher group
+   INTEGER , PUBLIC, ALLOCATABLE, DIMENSION(:) ::   nisobfl   !: =0 for a isobar float , =1 for a float following the w velocity
+   INTEGER , PUBLIC, ALLOCATABLE, DIMENSION(:) ::   ngrpfl    !: number to identify searcher group
+   INTEGER , PUBLIC, ALLOCATABLE, DIMENSION(:) ::   nfloat    !: number to identify searcher group
 
-   REAL(wp), PUBLIC, DIMENSION(jpnfl) ::   flxx , flyy , flzz    !: long, lat, depth of float (decimal degree, m >0)
-   REAL(wp), PUBLIC, DIMENSION(jpnfl) ::   tpifl, tpjfl, tpkfl   !: (i,j,k) indices of float position
+   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:) ::   flxx , flyy , flzz    !: long, lat, depth of float (decimal degree, m >0)
+   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:) ::   tpifl, tpjfl, tpkfl   !: (i,j,k) indices of float position
 
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   wb   !: vertical velocity at previous time step (m s-1).
    
-   !                                            !!! * namelist namflo : langrangian floats *
-   LOGICAL, PUBLIC  ::   ln_rstflo  = .FALSE.    !: T/F float restart 
-   LOGICAL, PUBLIC  ::   ln_argo    = .FALSE.    !: T/F argo type floats
-   LOGICAL, PUBLIC  ::   ln_flork4  = .FALSE.    !: T/F 4th order Runge-Kutta
-   INTEGER, PUBLIC  ::   nn_writefl = 150        !: frequency of float output file 
-   INTEGER, PUBLIC  ::   nn_stockfl = 450        !: frequency of float restart file
+   !                                                 !!! * namelist namflo : langrangian floats *
+   LOGICAL, PUBLIC  ::   ln_rstflo      = .FALSE.    !: T/F float restart 
+   LOGICAL, PUBLIC  ::   ln_argo        = .FALSE.    !: T/F argo type floats
+   LOGICAL, PUBLIC  ::   ln_flork4      = .FALSE.    !: T/F 4th order Runge-Kutta
+   LOGICAL, PUBLIC  ::   ln_ariane      = .FALSE.    !: handle ariane input/output convention
+   LOGICAL, PUBLIC  ::   ln_flo_ascii   = .FALSE.    !: write in ascii (T) or in Netcdf (F)
+
+   INTEGER, PUBLIC  ::   nn_writefl     = 150        !: frequency of float output file 
+   INTEGER, PUBLIC  ::   nn_stockfl     = 450        !: frequency of float restart file
 
    !!----------------------------------------------------------------------
@@ -56,5 +60,7 @@
       !!                 ***  FUNCTION flo_oce_alloc  ***
       !!----------------------------------------------------------------------
-      ALLOCATE( wb(jpi,jpj,jpk)   , STAT=flo_oce_alloc )
+      ALLOCATE( wb(jpi,jpj,jpk) , nfloat(jpnfl) , nisobfl(jpnfl) , ngrpfl(jpnfl) , &
+                flxx(jpnfl)     , flyy(jpnfl)   , flzz(jpnfl)    ,                 & 
+                tpifl(jpnfl)    , tpjfl(jpnfl)  , tpkfl(jpnfl)   , STAT=flo_oce_alloc )
       !
       IF( lk_mpp             )   CALL mpp_sum ( flo_oce_alloc )
Index: /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/NEMO/OPA_SRC/FLO/floats.F90
===================================================================
--- /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/NEMO/OPA_SRC/FLO/floats.F90	(revision 3050)
+++ /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/NEMO/OPA_SRC/FLO/floats.F90	(revision 3051)
@@ -19,4 +19,5 @@
    USE flodom          ! initialisation Module 
    USE flowri          ! float output                     (flo_wri routine)
+   USE florst          ! float restart                    (flo_rst routine)
    USE flo4rk          ! Trajectories, Runge Kutta scheme (flo_4rk routine)
    USE floblk          ! Trajectories, Blanke scheme      (flo_blk routine)
@@ -56,6 +57,7 @@
       IF( lk_mpp )   CALL mppsync   ! synchronization of all the processor
       !
-      IF( kt == nit000 .OR. MOD( kt, nn_writefl ) == 0 )   CALL flo_wri( kt )      ! trajectories file 
-      IF( kt == nitend .OR. MOD( kt, nn_stockfl ) == 0 )   CALL flo_wri( kt )      ! restart file 
+      CALL flo_wri( kt )      ! trajectories ouput 
+      !
+      CALL flo_rst( kt )      ! trajectories restart
       !
       wb(:,:,:) = wn(:,:,:)         ! Save the old vertical velocity field
@@ -70,5 +72,7 @@
       !! ** Purpose :   Read the namelist of floats
       !!----------------------------------------------------------------------
-      NAMELIST/namflo/ ln_rstflo, nn_writefl, nn_stockfl, ln_argo, ln_flork4 
+      INTEGER :: jfl
+      !
+      NAMELIST/namflo/ jpnfl, jpnnewflo, ln_rstflo, nn_writefl, nn_stockfl, ln_argo, ln_flork4, ln_ariane, ln_flo_ascii
       !!---------------------------------------------------------------------
       !
@@ -83,9 +87,14 @@
          WRITE(numout,*)
          WRITE(numout,*) '         Namelist floats :'
-         WRITE(numout,*) '            restart                          ln_rstflo  = ', ln_rstflo
-         WRITE(numout,*) '            frequency of float output file   nn_writefl = ', nn_writefl
-         WRITE(numout,*) '            frequency of float restart file  nn_stockfl = ', nn_stockfl
-         WRITE(numout,*) '            Argo type floats                 ln_argo    = ', ln_argo
-         WRITE(numout,*) '            Computation of T trajectories    ln_flork4  = ', ln_flork4
+         WRITE(numout,*) '            number of floats                      jpnfl        = ', jpnfl
+         WRITE(numout,*) '            number of new floats                  jpnflnewflo  = ', jpnnewflo
+         WRITE(numout,*) '            restart                               ln_rstflo    = ', ln_rstflo
+         WRITE(numout,*) '            frequency of float output file        nn_writefl   = ', nn_writefl
+         WRITE(numout,*) '            frequency of float restart file       nn_stockfl   = ', nn_stockfl
+         WRITE(numout,*) '            Argo type floats                      ln_argo      = ', ln_argo
+         WRITE(numout,*) '            Computation of T trajectories         ln_flork4    = ', ln_flork4
+         WRITE(numout,*) '            Use of ariane convention              ln_ariane    = ', ln_ariane
+         WRITE(numout,*) '            ascii output (T) or netcdf output (F) ln_flo_ascii = ', ln_flo_ascii
+
       ENDIF
       !
@@ -93,6 +102,19 @@
       IF( flo_oce_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'flo_init : unable to allocate arrays' )
       !
+      !                             ! allocate flodom arrays
+      IF( flo_dom_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'flo_dom : unable to allocate arrays' )
+      !
       !                             ! allocate flowri arrays
       IF( flo_wri_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'flo_wri : unable to allocate arrays' )
+      !
+      !                             ! allocate florst arrays
+      IF( flo_rst_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'flo_rst : unable to allocate arrays' )
+      !
+      !memory allocation 
+      jpnrstflo = jpnfl-jpnnewflo
+
+      !vertical axe for netcdf IOM ouput
+      DO jfl=1,jpnfl ; nfloat(jfl)=jfl ; ENDDO
+
       !
       CALL flo_dom                  ! compute/read initial position of floats
Index: /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/NEMO/OPA_SRC/FLO/flodom.F90
===================================================================
--- /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/NEMO/OPA_SRC/FLO/flodom.F90	(revision 3050)
+++ /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/NEMO/OPA_SRC/FLO/flodom.F90	(revision 3051)
@@ -4,5 +4,7 @@
    !! Ocean floats :   domain
    !!======================================================================
-   !! History :  OPA  ! 1998-07 (Y.Drillet, CLIPPER)  Original code
+   !! History :  OPA          ! 1998-07 (Y.Drillet, CLIPPER)  Original code
+   !!            NEMO_3.3.1   ! 2011-09 (C.Bricaud,S.Law-Chune Mercator-Ocean): 
+                              ! add Ariane convention, Comsecitc changes
    !!----------------------------------------------------------------------
 #if   defined key_floats   ||   defined key_esopa
@@ -10,7 +12,9 @@
    !!   'key_floats'                                     float trajectories
    !!----------------------------------------------------------------------
-   !!   flo_dom        : initialization of floats
-   !!   findmesh       : compute index of position 
-   !!   dstnce         : compute distance between face mesh and floats 
+   !!   flo_dom               : initialization of floats
+   !!   add_new_floats        : add new floats (long/lat/depth)
+   !!   add_new_ariane_floats : add new floats with araine convention (i/j/k)
+   !!   findmesh              : compute index of position 
+   !!   dstnce                : compute distance between face mesh and floats 
    !!----------------------------------------------------------------------
    USE oce             ! ocean dynamics and tracers
@@ -23,5 +27,14 @@
    PRIVATE
 
-   PUBLIC   flo_dom    ! routine called by floats.F90
+   PUBLIC   flo_dom         ! routine called by floats.F90
+   PUBLIC   flo_dom_alloc   ! Routine called in floats.F90
+
+   CHARACTER (len=21) ::  clname1 = 'init_float'              ! floats initialisation filename
+   CHARACTER (len=21) ::  clname2 = 'init_float_ariane'       ! ariane floats initialisation filename
+
+
+   INTEGER , ALLOCATABLE, DIMENSION(:) ::   iimfl, ijmfl, ikmfl       ! index mesh of floats
+   INTEGER , ALLOCATABLE, DIMENSION(:) ::   idomfl, ivtest, ihtest    !   -     
+   REAL(wp), ALLOCATABLE, DIMENSION(:) ::   zgifl, zgjfl,  zgkfl      ! distances in indexes
 
    !! * Substitutions
@@ -43,12 +56,6 @@
       !!               the longitude (degree) and the depth (m).
       !!----------------------------------------------------------------------      
-      LOGICAL  ::   llinmesh
-      INTEGER  ::   ji, jj, jk   ! DO loop index on 3 directions
-      INTEGER  ::   jfl, jfl1    ! number of floats   
-      INTEGER  ::   inum         ! logical unit for file read
-      INTEGER, DIMENSION(jpnfl) ::   iimfl, ijmfl, ikmfl       ! index mesh of floats
-      INTEGER, DIMENSION(jpnfl) ::   idomfl,  ivtest, ihtest   !   -             -
-      REAL(wp) ::   zdxab, zdyad
-      REAL(wp), DIMENSION(jpnnewflo+1)  :: zgifl, zgjfl,  zgkfl
+      INTEGER            ::   jfl    ! dummy loop  
+      INTEGER            ::   inum   ! logical unit for file read
       !!---------------------------------------------------------------------
       
@@ -59,12 +66,17 @@
       IF(lwp) WRITE(numout,*) '           jpnfl = ',jpnfl
       
-      IF(ln_rstflo) THEN
+      !-------------------------!
+      ! FLOAT RESTART FILE READ !
+      !-------------------------!
+      IF( ln_rstflo )THEN
+
          IF(lwp) WRITE(numout,*) '        float restart file read'
          
          ! open the restart file 
+         !----------------------
          CALL ctl_opn( inum, 'restart_float', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp )
 
          ! read of the restart file
-         READ(inum) ( tpifl  (jfl), jfl=1, jpnrstflo),   & 
+         READ(inum,*)   ( tpifl  (jfl), jfl=1, jpnrstflo),   & 
                         ( tpjfl  (jfl), jfl=1, jpnrstflo),   &
                         ( tpkfl  (jfl), jfl=1, jpnrstflo),   &
@@ -74,260 +86,186 @@
 
          ! if we want a  surface drift  ( like PROVOR floats )
-         IF( ln_argo ) THEN
-            DO jfl = 1, jpnrstflo
-               nisobfl(jfl) = 0
-            END DO
-         ENDIF
-
-         IF(lwp) WRITE(numout,*)' flo_dom: END of florstlec'
+         IF( ln_argo ) nisobfl(1:jpnrstflo) = 0
          
          ! It is possible to add new floats.          
-         IF(lwp) WRITE(numout,*)' flo_dom:jpnfl jpnrstflo ',jpnfl,jpnrstflo
-         IF( jpnfl > jpnrstflo ) THEN
-            ! open the init file 
-            CALL ctl_opn( inum, 'init_float', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp )
-            DO jfl = jpnrstflo+1, jpnfl
-               READ(inum,*) flxx(jfl),flyy(jfl),flzz(jfl), nisobfl(jfl),ngrpfl(jfl),jfl1
-            END DO
-            CLOSE(inum)
-            IF(lwp) WRITE(numout,*)' flodom: END reading init_float file'
+         !---------------------------------
+         IF( jpnfl > jpnrstflo )THEN
+
+            IF(lwp) WRITE(numout,*) '        add new floats'
+
+            IF( ln_ariane )THEN  !Add new floats with ariane convention
+                CALL flo_add_new_ariane_floats(jpnrstflo+1,jpnfl) 
+            ELSE                 !Add new floats with long/lat convention
+                CALL flo_add_new_floats(jpnrstflo+1,jpnfl)
+            ENDIF
+         ENDIF
+
+      !--------------------------------------!
+      ! FLOAT INITILISATION: NO RESTART FILE !
+      !--------------------------------------!
+      ELSE    !ln_rstflo
+
+         IF( ln_ariane )THEN       !Add new floats with ariane convention
+            CALL flo_add_new_ariane_floats(1,jpnfl)
+         ELSE                      !Add new floats with long/lat convention
+            CALL flo_add_new_floats(1,jpnfl)
+         ENDIF
+
+      ENDIF
             
-            ! Test to find the grid point coordonate with the geographical position            
-            DO jfl = jpnrstflo+1, jpnfl
-               ihtest(jfl) = 0
-               ivtest(jfl) = 0
-               ikmfl(jfl) = 0
+   END SUBROUTINE flo_dom
+
+   SUBROUTINE flo_add_new_floats(kfl_start, kfl_end)
+      !! -------------------------------------------------------------
+      !!                 ***  SUBROUTINE add_new_arianefloats  ***
+      !!          
+      !! ** Purpose :   
+      !!
+      !!       First initialisation of floats
+      !!       the initials positions of floats are written in a file
+      !!       with a variable to know if it is a isobar float a number 
+      !!       to identified who want the trajectories of this float and 
+      !!       an index for the number of the float         
+      !!       open the init file 
+      !!               
+      !! ** Method  : 
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT(in) :: kfl_start, kfl_end
+      !!
+      INTEGER           :: inum ! file unit
+      INTEGER           :: jfl,ji, jj, jk ! dummy loop indices
+      INTEGER           :: itrash         ! trash var for reading
+      INTEGER           :: ifl            ! number of floats to read
+      REAL(wp)          :: zdxab, zdyad
+      LOGICAL           :: llinmesh
+      CHARACTER(len=80) :: cltmp
+      !!---------------------------------------------------------------------
+      ifl = kfl_end-kfl_start+1
+
+      ! we get the init values 
+      !-----------------------
+      CALL ctl_opn( inum , clname1, 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp )
+      DO jfl = kfl_start,kfl_end
+         READ(inum,*) flxx(jfl),flyy(jfl),flzz(jfl), nisobfl(jfl),ngrpfl(jfl),itrash
+         if(lwp)write(numout,*)'read:',jfl,flxx(jfl),flyy(jfl),flzz(jfl), nisobfl(jfl),ngrpfl(jfl),itrash ; call flush(numout)
+      END DO
+      CLOSE(inum)
+            
+      ! Test to find the grid point coordonate with the geographical position            
+      !----------------------------------------------------------------------
+      DO jfl = kfl_start,kfl_end
+         ihtest(jfl) = 0
+         ivtest(jfl) = 0
+         ikmfl(jfl) = 0
 # if   defined key_mpp_mpi
-               DO ji = MAX(nldi,2), nlei
-                  DO jj = MAX(nldj,2), nlej   ! NO vector opt.
-# else
-               DO ji = 2, jpi
-                  DO jj = 2, jpj   ! NO vector opt.
+         DO ji = MAX(nldi,2), nlei
+            DO jj = MAX(nldj,2), nlej   ! NO vector opt.
+# else         
+         DO ji = 2, jpi
+            DO jj = 2, jpj   ! NO vector opt.
 # endif                     
-                     ! For each float we find the indexes of the mesh                      
-                     CALL findmesh(glamf(ji-1,jj-1),gphif(ji-1,jj-1),   &
-                                   glamf(ji-1,jj  ),gphif(ji-1,jj  ),   &
-                                   glamf(ji  ,jj  ),gphif(ji  ,jj  ),   &
-                                   glamf(ji  ,jj-1),gphif(ji  ,jj-1),   &
-                                   flxx(jfl)       ,flyy(jfl)       ,   &
-                                   glamt(ji  ,jj  ),gphit(ji  ,jj  ), llinmesh)
-                     IF(llinmesh) THEN
-                        iimfl(jfl) = ji
-                        ijmfl(jfl) = jj
-                        ihtest(jfl) = ihtest(jfl)+1
-                        DO jk = 1, jpk-1
-                           IF( (fsdepw(ji,jj,jk) <= flzz(jfl)) .AND. (fsdepw(ji,jj,jk+1) > flzz(jfl)) ) THEN
-                              ikmfl(jfl) = jk
-                              ivtest(jfl) = ivtest(jfl) + 1
-                           ENDIF
-                        END DO
+               ! For each float we find the indexes of the mesh                      
+               CALL flo_findmesh(glamf(ji-1,jj-1),gphif(ji-1,jj-1),   &
+                                 glamf(ji-1,jj  ),gphif(ji-1,jj  ),   &
+                                 glamf(ji  ,jj  ),gphif(ji  ,jj  ),   &
+                                 glamf(ji  ,jj-1),gphif(ji  ,jj-1),   &
+                                 flxx(jfl)       ,flyy(jfl)       ,   &
+                                 glamt(ji  ,jj  ),gphit(ji  ,jj  ), llinmesh)
+               IF( llinmesh )THEN
+                  iimfl(jfl) = ji
+                  ijmfl(jfl) = jj
+                  ihtest(jfl) = ihtest(jfl)+1
+                  DO jk = 1, jpk-1
+                     IF( (fsdepw(ji,jj,jk) <= flzz(jfl)) .AND. (fsdepw(ji,jj,jk+1) > flzz(jfl)) ) THEN
+                        ikmfl(jfl) = jk
+                        ivtest(jfl) = ivtest(jfl) + 1
                      ENDIF
                   END DO
-               END DO
-               IF(lwp) WRITE(numout,*)'   flo_dom: END findmesh'
-               
-               ! If the float is in a mesh computed by an other processor we put iimfl=ijmfl=-1               
-               IF( ihtest(jfl) ==  0 ) THEN
-                  iimfl(jfl) = -1
-                  ijmfl(jfl) = -1
                ENDIF
             END DO
+         END DO
+
+         ! If the float is in a mesh computed by an other processor we put iimfl=ijmfl=-1               
+         IF( ihtest(jfl) ==  0 ) THEN
+            iimfl(jfl) = -1
+            ijmfl(jfl) = -1
+         ENDIF
+      END DO
+
+      !Test if each float is in one and only one proc
+      !----------------------------------------------
+      IF( lk_mpp )   THEN 
+         CALL mpp_sum(ihtest,jpnfl)
+         CALL mpp_sum(ivtest,jpnfl)
+      ENDIF
+      DO jfl = kfl_start,kfl_end
+
+         IF( (ihtest(jfl) > 1 ) .OR. ( ivtest(jfl) > 1) ) THEN
+             WRITE(cltmp,'(A10,i4.4,A20)' )'THE FLOAT',jfl,' IS NOT IN ONLY ONE MESH'
+             CALL ctl_stop('STOP',TRIM(cltmp) )
+         ENDIF
+         IF( (ihtest(jfl) == 0) ) THEN
+             WRITE(cltmp,'(A10,i4.4,A20)' )'THE FLOAT',jfl,' IS IN NO MESH'
+             CALL ctl_stop('STOP',TRIM(cltmp) )
+         ENDIF
+      END DO
+
+      ! We compute the distance between the float and the face of the mesh            
+      !-------------------------------------------------------------------
+      DO jfl = kfl_start,kfl_end
+
+         ! Made only if the float is in the domain of the processor              
+         IF( (iimfl(jfl) >= 0) .AND. (ijmfl(jfl) >= 0) ) THEN
+
+            ! TEST TO KNOW IF THE FLOAT IS NOT INITIALISED IN THE COAST
+            idomfl(jfl) = 0
+            IF( tmask(iimfl(jfl),ijmfl(jfl),ikmfl(jfl)) == 0. ) idomfl(jfl) = 1
+
+            ! Computation of the distance between the float and the faces of the mesh
+            !            zdxab
+            !             .
+            !        B----.---------C
+            !        |    .         |
+            !        |<------>flo   |
+            !        |        ^     |
+            !        |        |.....|....zdyad
+            !        |        |     |
+            !        A--------|-----D
+            !
+            zdxab = flo_dstnce( flxx(jfl), flyy(jfl), glamf(iimfl(jfl)-1,ijmfl(jfl)-1), flyy(jfl) )
+            zdyad = flo_dstnce( flxx(jfl), flyy(jfl), flxx(jfl), gphif(iimfl(jfl)-1,ijmfl(jfl)-1) )
+
+            ! Translation of this distances (in meter) in indexes
+            zgifl(jfl)= (iimfl(jfl)-0.5) + zdxab/e1u(iimfl(jfl)-1,ijmfl(jfl)) + (mig(1)-jpizoom)
+            zgjfl(jfl)= (ijmfl(jfl)-0.5) + zdyad/e2v(iimfl(jfl),ijmfl(jfl)-1) + (mjg(1)-jpjzoom)
+            zgkfl(jfl) = (( fsdepw(iimfl(jfl),ijmfl(jfl),ikmfl(jfl)+1) - flzz(jfl) )* ikmfl(jfl))   &
+               &                 / (  fsdepw(iimfl(jfl),ijmfl(jfl),ikmfl(jfl)+1)                              &
+               &                    - fsdepw(iimfl(jfl),ijmfl(jfl),ikmfl(jfl) ) )                             &
+               &                 + (( flzz(jfl)-fsdepw(iimfl(jfl),ijmfl(jfl),ikmfl(jfl)) ) *(ikmfl(jfl)+1))   &
+               &                 / (  fsdepw(iimfl(jfl),ijmfl(jfl),ikmfl(jfl)+1)                              &
+               &                    - fsdepw(iimfl(jfl),ijmfl(jfl),ikmfl(jfl)) )
+         ELSE
+            zgifl(jfl) = 0.e0
+            zgjfl(jfl) = 0.e0
+            zgkfl(jfl) = 0.e0
+         ENDIF
+
+      END DO
+                  
+      ! The sum of all the arrays zgifl, zgjfl, zgkfl give 3 arrays with the positions of all the floats.
+      IF( lk_mpp )   THEN 
+         CALL mpp_sum( zgjfl, ifl )   ! sums over the global domain
+         CALL mpp_sum( zgkfl, ifl )
+      ENDIF
             
-            ! A zero in the sum of the arrays "ihtest" and "ivtest"             
-# if   defined key_mpp_mpi
-            CALL mpp_sum(ihtest,jpnfl)
-            CALL mpp_sum(ivtest,jpnfl)
-# endif 
-            DO jfl = jpnrstflo+1, jpnfl
-               IF( (ihtest(jfl) > 1 ) .OR. ( ivtest(jfl) > 1) ) THEN
-                  IF(lwp) WRITE(numout,*) 'THE FLOAT',jfl,' IS NOT IN ONLY ONE MESH'
-                  STOP
-               ENDIF
-               IF( (ihtest(jfl) == 0) ) THEN
-                  IF(lwp) WRITE(numout,*)'THE FLOAT',jfl,' IS IN NO MESH'
-                  STOP
-               ENDIF
-            END DO
-            
-            ! We compute the distance between the float and the face of the mesh            
-            DO jfl = jpnrstflo+1, jpnfl               
-               ! Made only if the float is in the domain of the processor              
-               IF( (iimfl(jfl) >= 0) .AND. (ijmfl(jfl) >= 0) ) THEN
-                  
-                  ! TEST TO KNOW IF THE FLOAT IS NOT INITIALISED IN THE COAST
-                  
-                  idomfl(jfl) = 0
-                  IF( tmask(iimfl(jfl),ijmfl(jfl),ikmfl(jfl)) == 0. ) idomfl(jfl) = 1
-                                           
-                  ! Computation of the distance between the float and the faces of the mesh
-                  !            zdxab
-                  !             .
-                  !        B----.---------C
-                  !        |    .         |
-                  !        |<------>flo   |
-                  !        |        ^     |
-                  !        |        |.....|....zdyad
-                  !        |        |     |
-                  !        A--------|-----D
-                  !
-             
-                  zdxab = dstnce( flxx(jfl), flyy(jfl), glamf(iimfl(jfl)-1,ijmfl(jfl)-1), flyy(jfl) )
-                  zdyad = dstnce( flxx(jfl), flyy(jfl), flxx(jfl), gphif(iimfl(jfl)-1,ijmfl(jfl)-1) )
-                  
-                  ! Translation of this distances (in meter) in indexes
-                  
-                  zgifl(jfl-jpnrstflo)= (iimfl(jfl)-0.5) + zdxab/e1u(iimfl(jfl)-1,ijmfl(jfl)) + (mig(1)-jpizoom)
-                  zgjfl(jfl-jpnrstflo)= (ijmfl(jfl)-0.5) + zdyad/e2v(iimfl(jfl),ijmfl(jfl)-1) + (mjg(1)-jpjzoom)
-                  zgkfl(jfl-jpnrstflo) = (( fsdepw(iimfl(jfl),ijmfl(jfl),ikmfl(jfl)+1) - flzz(jfl) )* ikmfl(jfl))   &
-                     &                 / (  fsdepw(iimfl(jfl),ijmfl(jfl),ikmfl(jfl)+1)                              &
-                     &                    - fsdepw(iimfl(jfl),ijmfl(jfl),ikmfl(jfl) ) )                             &
-                     &                 + (( flzz(jfl)-fsdepw(iimfl(jfl),ijmfl(jfl),ikmfl(jfl)) ) *(ikmfl(jfl)+1))   &
-                     &                 / (  fsdepw(iimfl(jfl),ijmfl(jfl),ikmfl(jfl)+1)                              &
-                     &                    - fsdepw(iimfl(jfl),ijmfl(jfl),ikmfl(jfl)) )
-               ELSE
-                  zgifl(jfl-jpnrstflo) = 0.e0
-                  zgjfl(jfl-jpnrstflo) = 0.e0
-                  zgkfl(jfl-jpnrstflo) = 0.e0
-               ENDIF
-            END DO
-            
-            ! The sum of all the arrays zgifl, zgjfl, zgkfl give 3 arrays with the positions of all the floats.
-            IF( lk_mpp )   THEN
-               CALL mpp_sum( zgjfl, jpnnewflo )   ! sums over the global domain
-               CALL mpp_sum( zgkfl, jpnnewflo )
-               IF(lwp) WRITE(numout,*) (zgifl(jfl),jfl=1,jpnnewflo)
-               IF(lwp) WRITE(numout,*) (zgjfl(jfl),jfl=1,jpnnewflo)
-               IF(lwp) WRITE(numout,*) (zgkfl(jfl),jfl=1,jpnnewflo) 
-            ENDIF
-           
-            DO jfl = jpnrstflo+1, jpnfl
-               tpifl(jfl) = zgifl(jfl-jpnrstflo)
-               tpjfl(jfl) = zgjfl(jfl-jpnrstflo)
-               tpkfl(jfl) = zgkfl(jfl-jpnrstflo)
-            END DO
-         ENDIF
-      ELSE
-         IF(lwp) WRITE(numout,*) '                     init_float read '
-         
-         ! First initialisation of floats
-         ! the initials positions of floats are written in a file
-         ! with a variable to know if it is a isobar float a number 
-         ! to identified who want the trajectories of this float and 
-         ! an index for the number of the float         
-         ! open the init file 
-         CALL ctl_opn( inum, 'init_float', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp )
-         READ(inum) (flxx(jfl)   , jfl=1, jpnfl),   &
-                    (flyy(jfl)   , jfl=1, jpnfl),   &
-                    (flzz(jfl)   , jfl=1, jpnfl),   &
-                    (nisobfl(jfl), jfl=1, jpnfl),   &
-                    (ngrpfl(jfl) , jfl=1, jpnfl)
-         CLOSE(inum)
-            
-         ! Test to find the grid point coordonate with the geographical position         
-         DO jfl = 1, jpnfl
-            ihtest(jfl) = 0
-            ivtest(jfl) = 0
-            ikmfl(jfl) = 0
-# if   defined key_mpp_mpi
-            DO ji = MAX(nldi,2), nlei
-               DO jj = MAX(nldj,2), nlej   ! NO vector opt.
-# else
-            DO ji = 2, jpi
-               DO jj = 2, jpj   ! NO vector opt.
-# endif                  
-                  ! for each float we find the indexes of the mesh 
-                  
-                  CALL findmesh(glamf(ji-1,jj-1),gphif(ji-1,jj-1),   &
-                                glamf(ji-1,jj  ),gphif(ji-1,jj  ),   &
-                                glamf(ji  ,jj  ),gphif(ji  ,jj  ),   &
-                                glamf(ji  ,jj-1),gphif(ji  ,jj-1),   &
-                                flxx(jfl)       ,flyy(jfl)       ,   &
-                                glamt(ji  ,jj  ),gphit(ji  ,jj  ), llinmesh)
-                  IF(llinmesh) THEN
-                     iimfl(jfl)  = ji
-                     ijmfl(jfl)  = jj
-                     ihtest(jfl) = ihtest(jfl)+1
-                     DO jk = 1, jpk-1
-                        IF( (fsdepw(ji,jj,jk) <= flzz(jfl)) .AND. (fsdepw(ji,jj,jk+1) >  flzz(jfl)) ) THEN
-                           ikmfl(jfl)  = jk
-                           ivtest(jfl) = ivtest(jfl) + 1
-                        ENDIF
-                     END DO
-                  ENDIF
-               END DO
-            END DO
-            
-            ! If the float is in a mesh computed by an other processor we put iimfl=ijmfl=-1            
-            IF( ihtest(jfl) == 0 ) THEN
-               iimfl(jfl) = -1
-               ijmfl(jfl) = -1
-            ENDIF
-         END DO
-         
-         ! A zero in the sum of the arrays "ihtest" and "ivtest"          
-         IF( lk_mpp )   CALL mpp_sum(ihtest,jpnfl)   ! sums over the global domain
-         IF( lk_mpp )   CALL mpp_sum(ivtest,jpnfl)
-
-         DO jfl = 1, jpnfl
-            IF( (ihtest(jfl) > 1 ) .OR. ( ivtest(jfl) > 1 )) THEN
-               IF(lwp) WRITE(numout,*) 'THE FLOAT',jfl,' IS NOT IN ONLY ONE MESH'
-            ENDIF
-            IF( ihtest(jfl) == 0 ) THEN 
-               IF(lwp) WRITE(numout,*)'THE FLOAT',jfl,' IS IN NO MESH'
-            ENDIF
-         END DO
-        
-         ! We compute the distance between the float and the face of  the mesh         
-         DO jfl = 1, jpnfl
-            ! Made only if the float is in the domain of the processor
-            IF( (iimfl(jfl) >= 0 ) .AND. ( ijmfl(jfl) >= 0 ) ) THEN
-               
-               ! TEST TO KNOW IF THE FLOAT IS NOT INITIALISED IN THE COAST
-               
-               idomfl(jfl) = 0
-               IF( tmask(iimfl(jfl),ijmfl(jfl),ikmfl(jfl)) == 0. ) idomfl(jfl)=1
-               
-               ! Computation of the distance between the float
-               ! and the faces of the mesh
-               !            zdxab
-               !             .
-               !        B----.---------C
-               !        |    .         |
-               !        |<------>flo   |
-               !        |        ^     |
-               !        |        |.....|....zdyad
-               !        |        |     |
-               !        A--------|-----D
-               
-               zdxab = dstnce(flxx(jfl),flyy(jfl),glamf(iimfl(jfl)-1,ijmfl(jfl)-1),flyy(jfl))                
-               zdyad = dstnce(flxx(jfl),flyy(jfl),flxx(jfl),gphif(iimfl(jfl)-1,ijmfl(jfl)-1))
-               
-               ! Translation of this distances (in meter) in indexes
-               
-               tpifl(jfl) = (iimfl(jfl)-0.5)+zdxab/ e1u(iimfl(jfl)-1,ijmfl(jfl))+(mig(1)-jpizoom)
-               tpjfl(jfl) = (ijmfl(jfl)-0.5)+zdyad/ e2v(iimfl(jfl),ijmfl(jfl)-1)+(mjg(1)-jpjzoom)
-               tpkfl(jfl) = (fsdepw(iimfl(jfl),ijmfl(jfl),ikmfl(jfl)+1) - flzz(jfl))*(ikmfl(jfl))                     &
-                          / (fsdepw(iimfl(jfl),ijmfl(jfl),ikmfl(jfl)+1) - fsdepw(iimfl(jfl),ijmfl(jfl),ikmfl(jfl)))   &
-                          + (flzz(jfl) - fsdepw(iimfl(jfl),ijmfl(jfl),ikmfl(jfl)))*(ikmfl(jfl)+1)                     &
-                          / (fsdepw(iimfl(jfl),ijmfl(jfl),ikmfl(jfl)+1) - fsdepw(iimfl(jfl),ijmfl(jfl),ikmfl(jfl)))
-            ELSE
-               tpifl (jfl) = 0.e0
-               tpjfl (jfl) = 0.e0
-               tpkfl (jfl) = 0.e0
-               idomfl(jfl) = 0
-            ENDIF
-         END DO
-         
-         ! The sum of all the arrays tpifl, tpjfl, tpkfl give 3 arrays with the positions of all the floats. 
-         IF( lk_mpp )   CALL mpp_sum( tpifl , jpnfl )   ! sums over the global domain
-         IF( lk_mpp )   CALL mpp_sum( tpjfl , jpnfl )
-         IF( lk_mpp )   CALL mpp_sum( tpkfl , jpnfl )
-         IF( lk_mpp )   CALL mpp_sum( idomfl, jpnfl )
-      ENDIF
-            
-      ! Print the initial positions of the floats
+      DO jfl = kfl_start,kfl_end
+         tpifl(jfl) = zgifl(jfl)
+         tpjfl(jfl) = zgjfl(jfl)
+         tpkfl(jfl) = zgkfl(jfl)
+      END DO
+
+      ! WARNING : initial position not in the sea         
       IF( .NOT. ln_rstflo ) THEN 
-         ! WARNING : initial position not in the sea         
-         DO jfl = 1, jpnfl
+         DO jfl =  kfl_start,kfl_end
             IF( idomfl(jfl) == 1 ) THEN
                IF(lwp) WRITE(numout,*)'*****************************'
@@ -341,10 +279,82 @@
       ENDIF
 
-   END SUBROUTINE flo_dom
-
-
-   SUBROUTINE findmesh( pax, pay, pbx, pby,   &
-                        pcx, pcy, pdx, pdy,   &
-                        px  ,py  ,ptx, pty, ldinmesh )
+   END SUBROUTINE flo_add_new_floats
+
+   SUBROUTINE flo_add_new_ariane_floats(kfl_start, kfl_end)
+      !! -------------------------------------------------------------
+      !!                 ***  SUBROUTINE add_new_arianefloats  ***
+      !!          
+      !! ** Purpose :   
+      !!       First initialisation of floats with ariane convention
+      !!       
+      !!       The indexes are read directly from file (warning ariane
+      !!       convention, are refered to 
+      !!       U,V,W grids - and not T-) 
+      !!       The isobar advection is managed with the sign of tpkfl ( >0 -> 3D
+      !!       advection, <0 -> 2D) 
+      !!       Some variables are not read, as - gl         : time index; 4th
+      !!       column        
+      !!                                       - transport  : transport ; 5th
+      !!                                       column
+      !!       and paste in the jtrash var
+      !!       At the end, ones need to replace the indexes on T grid
+      !!       RMQ : there is no float groups identification !
+      !!
+      !!               
+      !! ** Method  : 
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT(in) :: kfl_start, kfl_end
+      !!
+      INTEGER  :: inum         ! file unit
+      INTEGER  :: ierr, ifl
+      INTEGER  :: jfl, jfl1    ! dummy loop indices
+      INTEGER  :: itrash       ! trash var for reading  
+      CHARACTER(len=80) :: cltmp
+
+      !!----------------------------------------------------------------------
+      nisobfl(kfl_start:kfl_end) = 1 ! we assume that by default we want 3D advection
+
+      ifl = kfl_end - kfl_start + 1  ! number of floats to read  
+
+      ! we check that the number of floats in the init_file are consistant with the namelist
+      IF( lwp ) THEN
+
+         jfl1=0
+         ierr=0
+         CALL ctl_opn( inum, clname2, 'OLD', 'FORMATTED', 'SEQUENTIAL',  1, numout, .TRUE., 1 )
+         DO WHILE (ierr .EQ. 0)
+            jfl1=jfl1+1
+            READ(inum,*, iostat=ierr)
+         END DO
+         CLOSE(inum)
+         IF( (jfl1-1) .NE. ifl )THEN 
+            WRITE(cltmp,'(A25,A20,A3,i4.4,A10,i4.4)')"the number of floats in ",TRIM(clname2), &
+                                                     " = ",jfl1," is not equal to jfl= ",ifl
+            CALL ctl_stop('STOP',TRIM(cltmp) )
+         ENDIF
+
+      ENDIF
+            
+      ! we get the init values 
+      CALL ctl_opn( inum, clname2, 'OLD', 'FORMATTED', 'SEQUENTIAL', 1, numout, .TRUE., 1 )
+      DO jfl = kfl_start, kfl_end
+          READ(inum,*) tpifl(jfl),tpjfl(jfl),tpkfl(jfl),itrash, itrash
+              
+          IF ( tpkfl(jfl) .LT. 0. ) nisobfl(jfl) = 0 !set the 2D advection according to init_float
+          ngrpfl(jfl)=jfl
+      END DO
+
+      ! conversion from ariane index to T grid index
+      tpkfl(kfl_start:kfl_end) = abs(tpkfl)-0.5 ! reversed vertical axis
+      tpifl(kfl_start:kfl_end) = tpifl+0.5
+      tpjfl(kfl_start:kfl_end) = tpjfl+0.5
+
+
+   END SUBROUTINE flo_add_new_ariane_floats
+
+
+   SUBROUTINE flo_findmesh( pax, pay, pbx, pby,   &
+                            pcx, pcy, pdx, pdy,   &
+                            px  ,py  ,ptx, pty, ldinmesh )
       !! -------------------------------------------------------------
       !!                ***  ROUTINE findmesh  ***
@@ -402,8 +412,8 @@
       ENDIF
       !
-   END SUBROUTINE findmesh
-
-
-   FUNCTION dstnce( pla1, phi1, pla2, phi2 )
+   END SUBROUTINE flo_findmesh
+
+
+   FUNCTION flo_dstnce( pla1, phi1, pla2, phi2 )
       !! -------------------------------------------------------------
       !!                 ***  Function dstnce  ***
@@ -415,10 +425,10 @@
       REAL(wp), INTENT(in) ::   pla1, phi1, pla2, phi2   ! ???
       !!
-      REAL(wp) ::   dly1, dly2, dlx1, dlx2, dlx, dls, dld, dpi
-      REAL(wp) ::   dstnce
+      REAL(wp) :: dly1, dly2, dlx1, dlx2, dlx, dls, dld, dpi
+      REAL(wp) :: flo_dstnce
       !!---------------------------------------------------------------------
       !
-      dpi  = 2.* ASIN(1.)
-      dls  = dpi / 180.
+      dpi  = 2._wp * ASIN(1._wp)
+      dls  = dpi / 180._wp
       dly1 = phi1 * dls
       dly2 = phi2 * dls
@@ -428,12 +438,26 @@
       dlx = SIN(dly1) * SIN(dly2) + COS(dly1) * COS(dly2) * COS(dlx2-dlx1)
       !
-      IF( ABS(dlx) > 1.0 ) dlx = 1.0
-      !
-      dld = ATAN(DSQRT( ( 1-dlx )/( 1+dlx ) )) * 222.24 / dls
-      dstnce = dld * 1000.
-      !
-   END FUNCTION dstnce
-
-#  else
+      IF( ABS(dlx) > 1.0_wp ) dlx = 1.0_wp
+      !
+      dld = ATAN(DSQRT( 1._wp * ( 1._wp-dlx )/( 1._wp+dlx ) )) * 222.24_wp / dls
+      flo_dstnce = dld * 1000._wp
+      !
+   END FUNCTION flo_dstnce
+
+   INTEGER FUNCTION flo_dom_alloc()
+      !!----------------------------------------------------------------------
+      !!                 ***  FUNCTION flo_dom_alloc  ***
+      !!----------------------------------------------------------------------
+
+      ALLOCATE( iimfl(jpnfl) , ijmfl(jpnfl) , ikmfl(jpnfl) ,                          &  
+                idomfl(jpnfl), ivtest(jpnfl), ihtest(jpnfl),                 &
+                zgifl(jpnfl) , zgjfl(jpnfl) , zgkfl(jpnfl)   , STAT=flo_dom_alloc )
+      !
+      IF( lk_mpp             )   CALL mpp_sum ( flo_dom_alloc )
+      IF( flo_dom_alloc /= 0 )   CALL ctl_warn('flo_dom_alloc: failed to allocate arrays')
+   END FUNCTION flo_dom_alloc
+
+
+#else
    !!----------------------------------------------------------------------
    !!   Default option                                         Empty module
@@ -441,4 +465,5 @@
 CONTAINS
    SUBROUTINE flo_dom                 ! Empty routine
+         WRITE(*,*) 'flo_dom: : You should not have seen this print! error?'
    END SUBROUTINE flo_dom
 #endif
Index: /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/NEMO/OPA_SRC/FLO/florst.F90
===================================================================
--- /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/NEMO/OPA_SRC/FLO/florst.F90	(revision 3051)
+++ /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/NEMO/OPA_SRC/FLO/florst.F90	(revision 3051)
@@ -0,0 +1,150 @@
+MODULE florst
+   !!======================================================================
+   !!                       ***  MODULE  florst  ***
+   !!
+   !!
+   !! write floats restart files
+   !!
+   !!======================================================================
+   !!  History :
+   !!    8.0  !  99-09  (Y. Drillet)    : Original code
+   !!         !  00-06  (J.-M. Molines) : Profiling floats for CLS 
+   !!    8.5  !  02-10  (A. Bozec)  F90 : Free form and module
+   !!    3.2  !  10-08  (slaw, cbricaud): netcdf outputs and others 
+   !!----------------------------------------------------------------------
+#if   defined key_floats   ||   defined key_esopa
+   !!----------------------------------------------------------------------
+   !!   'key_floats'                                     float trajectories
+   !!----------------------------------------------------------------------
+
+   !! * Modules used
+   USE flo_oce         ! ocean drifting floats
+   USE dom_oce         ! ocean space and time domain
+   USE lib_mpp         ! distribued memory computing library
+   USE in_out_manager  ! I/O manager
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC flo_rst         ! routine called by floats.F90
+   PUBLIC flo_rst_alloc   ! routine called by floats.F90
+
+   INTEGER, ALLOCATABLE, DIMENSION(:) :: iperproc   ! 1D workspace
+
+   !! * Substitutions
+#  include "domzgr_substitute.h90"
+   !!----------------------------------------------------------------------
+   !! NEMO/OPA 3.2 , LODYC-IPSL  (2009)
+   !! $Header:
+   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   INTEGER FUNCTION flo_rst_alloc()
+      !!-------------------------------------------------------------------
+      !!                ***  FUNCTION flo_rst_alloc  ***
+      !!-------------------------------------------------------------------
+      ALLOCATE( iperproc(jpnij), STAT=flo_rst_alloc )
+      !  
+      IF( lk_mpp             )   CALL mpp_sum ( flo_rst_alloc )
+      IF( flo_rst_alloc /= 0 )   CALL ctl_warn('flo_rst_alloc: failed to allocate arrays.')
+   END FUNCTION flo_rst_alloc
+
+
+   SUBROUTINE flo_rst( kt )
+      !!---------------------------------------------------------------------
+      !!                  ***  ROUTINE flo_rst ***
+      !!             
+      !! ** Purpose :  
+      !!             
+      !!    
+      !!      
+      !! ** Method  :   The frequency of  ??? is nwritefl
+      !!      
+      !!----------------------------------------------------------------------
+      !! * Arguments
+      INTEGER  :: kt                            ! time step
+
+      !! * Local declarations
+      CHARACTER (len=80)       :: clname             ! restart filename
+      INTEGER                  :: ic , jc , jpn ,jfl ! temporary integer
+      INTEGER                  :: inum               ! temporary logical unit for restart file
+      !!----------------------------------------------------------------------
+
+      IF(  ( MOD(kt,nn_stockfl) == 0 ) .OR. ( kt == nitend )  )THEN      
+
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) 'flo_rst : write in  restart_float file '
+            WRITE(numout,*) '~~~~~~~    '
+         ENDIF
+
+         ! file is opened and closed every time it is used.
+
+         clname = 'restart.float.'
+         ic = 1
+         DO jc = 1, 16
+            IF( cexper(jc:jc) /= ' ' ) ic = jc
+         END DO
+         clname = clname(1:14)//cexper(1:ic)
+         ic = 1
+         DO jc = 1, 48
+            IF( clname(jc:jc) /= ' ' ) ic = jc
+         END DO
+
+         inum=0
+         IF( lwp )THEN
+            CALL ctl_opn( inum, clname, 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
+            REWIND inum
+         ENDIF
+         !
+         DO jpn = 1, jpnij
+            iperproc(jpn) = 0
+         END DO
+         !
+         IF(lwp) THEN
+            REWIND(inum)
+            WRITE (inum,*) tpifl,tpjfl,tpkfl,nisobfl,ngrpfl
+            CLOSE (inum)
+         ENDIF
+         !
+         ! Compute the number of trajectories for each processor
+         !
+         IF( lk_mpp ) THEN
+            DO jfl = 1, jpnfl
+               IF( (INT(tpifl(jfl)) >= (mig(nldi)-jpizoom+1)) .AND.   &
+                  &(INT(tpifl(jfl)) <= (mig(nlei)-jpizoom+1)) .AND.   &
+                  &(INT(tpjfl(jfl)) >= (mjg(nldj)-jpjzoom+1)) .AND.   &
+                  &(INT(tpjfl(jfl)) <= (mjg(nlej)-jpjzoom+1)) ) THEN
+                  iperproc(narea) = iperproc(narea)+1
+               ENDIF
+            END DO
+            CALL mpp_sum( iperproc, jpnij )
+            !
+            IF(lwp) THEN
+               WRITE(numout,*) 'DATE',adatrj
+               DO jpn = 1, jpnij
+                  IF( iperproc(jpn) /= 0 ) THEN
+                     WRITE(numout,*)'PROCESSOR',jpn-1,'compute',iperproc(jpn), 'trajectories.'
+                  ENDIF
+               END DO
+            ENDIF
+         ENDIF
+
+      ENDIF
+
+   END SUBROUTINE flo_rst
+
+
+#  else
+   !!----------------------------------------------------------------------
+   !!   Default option                                         Empty module
+   !!----------------------------------------------------------------------
+CONTAINS
+   SUBROUTINE flo_rst                 ! Empty routine
+   END SUBROUTINE flo_rst
+#endif
+
+   !!=======================================================================
+END MODULE florst
Index: /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/NEMO/OPA_SRC/FLO/flowri.F90
===================================================================
--- /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/NEMO/OPA_SRC/FLO/flowri.F90	(revision 3050)
+++ /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/NEMO/OPA_SRC/FLO/flowri.F90	(revision 3051)
@@ -2,9 +2,15 @@
    !!======================================================================
    !!                       ***  MODULE  flowri  ***
-   !! lagrangian floats :   outputs
+   !!
+   !! write floats trajectory in ascii                    ln_flo_ascii = T
+   !!                      or in netcdf ( IOM or IOSPSL ) ln_flo_ascii = F           
+   !! 
+   !!
    !!======================================================================
-   !! History :   OPA  ! 1999-09  (Y. Drillet)  Original code
-   !!                  ! 2000-06  (J.-M. Molines)  Profiling floats for CLS 
-   !!   NEMO      1.0  ! 2002-11  (G. Madec, A. Bozec)  F90: Free form and module
+   !!  History :
+   !!    8.0  !  99-09  (Y. Drillet)    : Original code
+   !!         !  00-06  (J.-M. Molines) : Profiling floats for CLS 
+   !!    8.5  !  02-10  (A. Bozec)  F90 : Free form and module
+   !!    3.2  !  10-08  (slaw, cbricaud): netcdf outputs and others 
    !!----------------------------------------------------------------------
 #if   defined key_floats   ||   defined key_esopa
@@ -12,6 +18,6 @@
    !!   'key_floats'                                     float trajectories
    !!----------------------------------------------------------------------
-   !!    flowri     : write trajectories of floats in file 
-   !!----------------------------------------------------------------------
+
+   !! * Modules used
    USE flo_oce         ! ocean drifting floats
    USE oce             ! ocean dynamics and tracers
@@ -19,297 +25,268 @@
    USE lib_mpp         ! distribued memory computing library
    USE in_out_manager  ! I/O manager
+   USE phycst          ! physic constants
+   USE dianam          ! build name of file (routine)
+   USE ioipsl
+   USE iom             ! I/O library
+
 
    IMPLICIT NONE
    PRIVATE
 
-   PUBLIC   flo_wri         ! routine called by floats.F90
-   PUBLIC   flo_wri_alloc   ! routine called by floats.F90
-
-   INTEGER ::   jfl      ! number of floats
-   INTEGER ::   numflo   ! logical unit for drifting floats
+   PUBLIC flo_wri         ! routine called by floats.F90
+   PUBLIC flo_wri_alloc   ! routine called by floats.F90
+
+   INTEGER :: jfl                            ! number of floats
+   CHARACTER (len=80)  :: clname             ! netcdf output filename
 
    ! Following are only workspace arrays but shape is not (jpi,jpj) and
    ! therefore make them module arrays rather than replacing with wrk_nemo
    ! member arrays.
-   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ztemp, zsal   ! 2D workspace
+   REAL(wp), ALLOCATABLE, DIMENSION(:) ::   zlon , zlat, zdep   ! 2D workspace
+   REAL(wp), ALLOCATABLE, DIMENSION(:) ::   ztem , zsal, zrho   ! 2D workspace
 
    !! * Substitutions
 #  include "domzgr_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
-   !! $Id$ 
-   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
+   !! NEMO/OPA 3.2 , LODYC-IPSL  (2009)
+   !! $Header:
+   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
+   !!----------------------------------------------------------------------
+
 CONTAINS
 
-   INTEGER FUNCTION flo_wri_alloc
+   INTEGER FUNCTION flo_wri_alloc()
       !!-------------------------------------------------------------------
       !!                ***  FUNCTION flo_wri_alloc  ***
       !!-------------------------------------------------------------------
-      ALLOCATE( ztemp(jpk,jpnfl) , zsal(jpk,jpnfl) , STAT=flo_wri_alloc)
-      !
+      ALLOCATE( ztem(jpnfl) , zsal(jpnfl) , zrho(jpnfl) , &
+                zlon(jpnfl) , zlat(jpnfl) , zdep(jpnfl) , STAT=flo_wri_alloc)
+      !  
       IF( lk_mpp             )   CALL mpp_sum ( flo_wri_alloc )
       IF( flo_wri_alloc /= 0 )   CALL ctl_warn('flo_wri_alloc: failed to allocate arrays.')
    END FUNCTION flo_wri_alloc
 
-
    SUBROUTINE flo_wri( kt )
-      !!-------------------------------------------------------------------
-      !!                  ***  ROUTINE flo_wri  ***
+      !!---------------------------------------------------------------------
+      !!                  ***  ROUTINE flo_wri ***
       !!             
-      !! ** Purpose :   Write position of floats in "trajec_float" file
-      !!      and the temperature and salinity at this position
+      !! ** Purpose :   Write position of floats in "trajec_float.nc",according
+      !!                to ARIANE TOOLS (http://stockage.univ-brest.fr/~grima/Ariane/ )  n
+      !!                nomenclature
+      !!    
       !!      
-      !! ** Method  :   The frequency is nn_writefl
+      !! ** Method  :   The frequency of  ??? is nwritefl
+      !!      
       !!----------------------------------------------------------------------
-      INTEGER ::   kt   ! time step
-      !!
-      CHARACTER (len=21) ::  clname
-      INTEGER ::   inum   ! temporary logical unit for restart file
-      INTEGER ::   iafl, ibfl, icfl, ia1fl, ib1fl, ic1fl, jfl, irecflo
-      INTEGER ::   iafloc, ibfloc, ia1floc, ib1floc, iafln, ibfln
-      INTEGER  ::    ic, jc , jpn
-      INTEGER, DIMENSION ( jpnij )  ::   iproc
-      REAL(wp) ::   zafl, zbfl, zcfl, zdtj
-      REAL(wp) ::   zxxu, zxxu_01,zxxu_10, zxxu_11
-      !!---------------------------------------------------------------------
+      !! * Arguments
+      INTEGER  :: kt                               ! time step
+
+      !! * Local declarations
+      INTEGER  :: iafl , ibfl , icfl             ! temporary integer
+      INTEGER  :: ia1fl, ib1fl, ic1fl            !   "
+      INTEGER  :: iafloc,ibfloc,ia1floc,ib1floc  !   "
+      INTEGER  :: irec, irecflo
+
+      REAL(wp) :: zafl,zbfl,zcfl                 ! temporary real
+      REAL(wp) :: ztime                          !   "
+
+      INTEGER, DIMENSION(2)          :: icount
+      INTEGER, DIMENSION(2)          :: istart
+      INTEGER, DIMENSION(1)          :: ish
+      INTEGER, DIMENSION(2)          :: ish2
+      !!----------------------------------------------------------------------
       
-      IF( kt == nit000 .OR. MOD( kt,nn_writefl) == 0 ) THEN 
-
-         ! header of output floats file
-      
-         IF(lwp) THEN
-            WRITE(numout,*)
-            WRITE(numout,*) 'flo_wri : write in trajec_float file '
-            WRITE(numout,*) '~~~~~~~    '
-         ENDIF
-
-         ! open the file numflo 
-         CALL ctl_opn( numflo, 'trajec_float', 'REPLACE', 'UNFORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
-
-         IF( kt == nit000 ) THEN
-            irecflo = NINT( (nitend-nit000) / FLOAT(nn_writefl) )
-            IF(lwp) WRITE(numflo)cexper,no,irecflo,jpnfl,nn_writefl
-         ENDIF
-         zdtj = rdt / 86400._wp
-
-         ! translation of index position in geographical position
+      !-----------------------------------------------------
+      ! I- Save positions, temperature, salinty and density 
+      !-----------------------------------------------------
+      zlon(:)=0.0 ; zlat(:)=0.0 ; zdep(:)=0.0 
+      ztem(:)=0.0 ; zsal(:)=0.0 ; zrho(:)=0.0 
+
+      DO jfl = 1, jpnfl
+
+         iafl  = INT (tpifl(jfl))            ! I-index of the nearest point before
+         ibfl  = INT (tpjfl(jfl))            ! J-index of the nearest point before
+         icfl  = INT (tpkfl(jfl))            ! K-index of the nearest point before
+         ia1fl = iafl + 1                    ! I-index of the nearest point after
+         ib1fl = ibfl + 1                    ! J-index of the nearest point after
+         ic1fl = icfl + 1                    ! K-index of the nearest point after
+         zafl  = tpifl(jfl) - REAL(iafl,wp)  ! distance  ?????
+         zbfl  = tpjfl(jfl) - REAL(ibfl,wp)  ! distance  ?????
+         zcfl  = tpkfl(jfl) - REAL(icfl,wp)  ! distance  ?????
 
          IF( lk_mpp ) THEN
-            DO jfl = 1, jpnfl
-               iafl  = INT ( tpifl(jfl) )
-               ibfl  = INT ( tpjfl(jfl) )
-               icfl  = INT ( tpkfl(jfl) )
-               iafln = NINT( tpifl(jfl) )
-               ibfln = NINT( tpjfl(jfl) )
-               ia1fl = iafl + 1
-               ib1fl = ibfl + 1
-               ic1fl = icfl + 1
-               zafl  = tpifl(jfl) - FLOAT( iafl )
-               zbfl  = tpjfl(jfl) - FLOAT( ibfl )
-               zcfl  = tpkfl(jfl) - FLOAT( icfl )
-               IF(   iafl >= mig(nldi)-jpizoom+1 .AND. iafl <= mig(nlei)-jpizoom+1 .AND.   &
-                  &  ibfl >= mjg(nldj)-jpjzoom+1 .AND. ibfl <= mjg(nlej)-jpjzoom+1       ) THEN
-
-                  ! local index
-
-                  iafloc  = iafl -(mig(1)-jpizoom+1) + 1
-                  ibfloc  = ibfl -(mjg(1)-jpjzoom+1) + 1
-                  ia1floc = iafloc + 1
-                  ib1floc = ibfloc + 1
-
-                  flyy(jfl) = (1.-zafl)*(1.-zbfl)*gphit(iafloc ,ibfloc ) + (1.-zafl) * zbfl * gphit(iafloc ,ib1floc)   &
-                     &      +     zafl *(1.-zbfl)*gphit(ia1floc,ibfloc ) +     zafl  * zbfl * gphit(ia1floc,ib1floc)
-                  flxx(jfl) = (1.-zafl)*(1.-zbfl)*glamt(iafloc ,ibfloc ) + (1.-zafl) * zbfl * glamt(iafloc ,ib1floc)   &
-                     &      +     zafl *(1.-zbfl)*glamt(ia1floc,ibfloc ) +     zafl  * zbfl * glamt(ia1floc,ib1floc)
-                  flzz(jfl) = (1.-zcfl)*fsdepw(iafloc,ibfloc,icfl ) + zcfl * fsdepw(iafloc,ibfloc,ic1fl)
-
-                  ! Change  by Alexandra Bozec et Jean-Philippe Boulanger
-                  ! We save  the instantaneous profile of T and S of the column     
-                  ! ztemp(jfl)=tn(iafloc,ibfloc,icfl)
-                  ! zsal(jfl)=sn(iafloc,ibfloc,icfl)
-                  ztemp(1:jpk,jfl) = tn(iafloc,ibfloc,1:jpk)
-                  zsal (1:jpk,jfl) = sn(iafloc,ibfloc,1:jpk)            
-               ELSE
-                  flxx(jfl) = 0.
-                  flyy(jfl) = 0.
-                  flzz(jfl) = 0.
-                  ztemp(1:jpk,jfl) = 0.
-                  zsal (1:jpk,jfl) = 0.
-               ENDIF
-            END DO
-
-            CALL mpp_sum( flxx, jpnfl )   ! sums over the global domain
-            CALL mpp_sum( flyy, jpnfl )
-            CALL mpp_sum( flzz, jpnfl )
-            ! these 2 lines have accendentaly been removed from ATL6-V8 run hence
-            ! giving 0 salinity and temperature on the float trajectory
-!bug RB
-!compilation failed in mpp
-!            CALL mpp_sum( ztemp, jpk*jpnfl )
-!            CALL mpp_sum( zsal , jpk*jpnfl )
-
-         ELSE
-            DO jfl = 1, jpnfl
-               iafl  = INT (tpifl(jfl))
-               ibfl  = INT (tpjfl(jfl))
-               icfl  = INT (tpkfl(jfl))
-               iafln = NINT(tpifl(jfl))
-               ibfln = NINT(tpjfl(jfl))
-               ia1fl = iafl+1
-               ib1fl = ibfl+1
-               ic1fl = icfl+1
-               zafl  = tpifl(jfl) - FLOAT(iafl)
-               zbfl  = tpjfl(jfl) - FLOAT(ibfl)
-               zcfl  = tpkfl(jfl) - FLOAT(icfl)
-               iafloc  = iafl
-               ibfloc  = ibfl
+               
+            iafloc = mi1( iafl )
+            ibfloc = mj1( ibfl )
+ 
+            IF( nldi <= iafloc .AND. iafloc <= nlei .AND. &
+              & nldj <= ibfloc .AND. ibfloc <= nlej       ) THEN 
+
+               !the float is inside of current proc's area
                ia1floc = iafloc + 1
                ib1floc = ibfloc + 1
-               !
-               flyy(jfl) = (1.-zafl)*(1.-zbfl)*gphit(iafloc ,ibfloc ) + (1.-zafl) * zbfl * gphit(iafloc ,ib1floc)   &
-                         +     zafl *(1.-zbfl)*gphit(ia1floc,ibfloc ) +     zafl  * zbfl * gphit(ia1floc,ib1floc)
-               flxx(jfl) = (1.-zafl)*(1.-zbfl)*glamt(iafloc ,ibfloc ) + (1.-zafl) * zbfl * glamt(iafloc ,ib1floc)   &
-                         +     zafl *(1.-zbfl)*glamt(ia1floc,ibfloc ) +     zafl  * zbfl * glamt(ia1floc,ib1floc)
-               flzz(jfl) = (1.-zcfl)*fsdepw(iafloc,ibfloc,icfl ) + zcfl * fsdepw(iafloc,ibfloc,ic1fl)
-               !ALEX
-               ! Astuce pour ne pas avoir des flotteurs qui se baladent sur IDL
-               zxxu_11 = glamt(iafloc ,ibfloc )
-               zxxu_10 = glamt(iafloc ,ib1floc)
-               zxxu_01 = glamt(ia1floc,ibfloc )
-               zxxu    = glamt(ia1floc,ib1floc)
-
-               IF( iafloc == 52 )  zxxu_10 = -181
-               IF( iafloc == 52 )  zxxu_11 = -181
-               flxx(jfl)=(1.-zafl)*(1.-zbfl)* zxxu_11 + (1.-zafl)*    zbfl * zxxu_10   &
-                        +    zafl *(1.-zbfl)* zxxu_01 +     zafl *    zbfl * zxxu
-               !ALEX         
-               ! Change  by Alexandra Bozec et Jean-Philippe Boulanger
-               ! We save  the instantaneous profile of T and S of the column     
-               !     ztemp(jfl)=tn(iafloc,ibfloc,icfl)
-               !     zsal(jfl)=sn(iafloc,ibfloc,icfl)
-               ztemp(1:jpk,jfl) = tn(iafloc,ibfloc,1:jpk)
-               zsal (1:jpk,jfl) = sn(iafloc,ibfloc,1:jpk)
-            END DO
+     
+               !save position of the float
+               zlat(jfl) = (1.-zafl)*(1.-zbfl)*gphit(iafloc ,ibfloc ) + (1.-zafl) * zbfl * gphit(iafloc ,ib1floc)   &
+                     +     zafl *(1.-zbfl)*gphit(ia1floc,ibfloc ) +     zafl  * zbfl * gphit(ia1floc,ib1floc)   
+               zlon(jfl) = (1.-zafl)*(1.-zbfl)*glamt(iafloc ,ibfloc ) + (1.-zafl) * zbfl * glamt(iafloc ,ib1floc)   &
+                     +     zafl *(1.-zbfl)*glamt(ia1floc,ibfloc ) +     zafl  * zbfl * glamt(ia1floc,ib1floc)
+               zdep(jfl) = (1.-zcfl)*fsdepw(iafloc,ibfloc,icfl ) + zcfl * fsdepw(iafloc,ibfloc,ic1fl)     
+
+               !save temperature, salinity and density at this position
+               ztem(jfl) = tn(iafloc,ibfloc,icfl)
+               zsal (jfl) = sn(iafloc,ibfloc,icfl)
+               zrho (jfl) = (rhd(iafloc,ibfloc,icfl)+1)*rau0
+
+            ENDIF
+
+         ELSE  ! mono proc case  
+
+            iafloc  = iafl
+            ibfloc  = ibfl
+            ia1floc = iafloc + 1
+            ib1floc = ibfloc + 1
+
+            !save position of the float               
+            zlat(jfl) = (1.-zafl)*(1.-zbfl)*gphit(iafloc ,ibfloc ) + (1.-zafl) * zbfl * gphit(iafloc ,ib1floc)   &
+                      +     zafl *(1.-zbfl)*gphit(ia1floc,ibfloc ) +     zafl  * zbfl * gphit(ia1floc,ib1floc)
+            zlon(jfl) = (1.-zafl)*(1.-zbfl)*glamt(iafloc ,ibfloc ) + (1.-zafl) * zbfl * glamt(iafloc ,ib1floc)   &
+                      +     zafl *(1.-zbfl)*glamt(ia1floc,ibfloc ) +     zafl  * zbfl * glamt(ia1floc,ib1floc)
+            zdep(jfl) = (1.-zcfl)*fsdepw(iafloc,ibfloc,icfl ) + zcfl * fsdepw(iafloc,ibfloc,ic1fl)
+
+            ztem(jfl) = tn(iafloc,ibfloc,icfl)
+            zsal(jfl) = sn(iafloc,ibfloc,icfl)
+            zrho(jfl) = (rhd(iafloc,ibfloc,icfl)+1)*rau0
+          
          ENDIF
 
-         !
-         WRITE(numflo) flxx,flyy,flzz,nisobfl,ngrpfl,ztemp,zsal, FLOAT(ndastp)
-      !!
-      !! case when profiles are dumped. In order to save memory, dumps are
-      !! done level by level.
-      !      IF (mod(kt,nflclean) == 0.) THEN
-      !!     IF ( nwflo == nwprofil ) THEN
-      !        DO jk = 1,jpk
-      !         DO jfl=1,jpnfl
-      !         iafl= INT(tpifl(jfl))
-      !         ibfl=INT(tpjfl(jfl))
-      !         iafln=NINT(tpifl(jfl))
-      !         ibfln=NINT(tpjfl(jfl))
-      !# if defined key_mpp_mpi   
-      !        IF ( (iafl >= (mig(nldi)-jpizoom+1)) .AND.
-      !     $       (iafl <= (mig(nlei)-jpizoom+1)) .AND.
-      !     $       (ibfl >= (mjg(nldj)-jpjzoom+1)) .AND.
-      !     $       (ibfl <= (mjg(nlej)-jpjzoom+1)) ) THEN
-      !!
-      !! local index
-      !!
-      !         iafloc=iafln-(mig(1)-jpizoom+1)+1
-      !         ibfloc=ibfln-(mjg(1)-jpjzoom+1)+1
-      !!         IF (jk == 1 ) THEN
-      !!      PRINT *,'<<<>>> ',jfl,narea, iafloc ,ibfloc, iafln, ibfln,adatrj
-      !!         ENDIF
-      !# else
-      !         iafloc=iafln
-      !         ibfloc=ibfln
-      !# endif
-      !         ztemp(jfl)=tn(iafloc,ibfloc,jk)
-      !         zsal(jfl)=sn(iaflo!,ibfloc,jk)
-      !# if defined key_mpp_mpi   
-      !        ELSE
-      !         ztemp(jfl) = 0.
-      !         zsal(jfl) = 0.
-      !        ENDIF
-      !# endif
-      !! ... next float
-      !        END DO
-      !      IF( lk_mpp )   CALL mpp_sum( ztemp, jpnfl )
-      !      IF( lk_mpp )   CALL mpp_sum( zsal , jpnfl )
-      !
-      !      IF (lwp) THEN 
-      !         WRITE(numflo) ztemp, zsal
-      !      ENDIF
-      !! ... next level jk
-      !      END DO
-      !! ... reset nwflo to 0 for ALL processors, if profile has been written
-      !!       nwflo = 0
-      !      ENDIF
-      !!
-      !      CALL flush (numflo)
-      !! ... time of dumping floats
-      !!      END IF
+      END DO ! loop on float
+
+      !Only proc 0 writes all positions : SUM of positions on all procs
+      IF( lk_mpp ) THEN
+         CALL mpp_sum( zlon, jpnfl )   ! sums over the global domain
+         CALL mpp_sum( zlat, jpnfl )   ! sums over the global domain
+         CALL mpp_sum( zdep, jpnfl )   ! sums over the global domain
+         CALL mpp_sum( ztem, jpnfl )   ! sums over the global domain
+         CALL mpp_sum( zsal, jpnfl )   ! sums over the global domain
+         CALL mpp_sum( zrho, jpnfl )   ! sums over the global domain
       ENDIF
-      
-      IF( (MOD(kt,nn_stockfl) == 0) .OR. ( kt == nitend ) ) THEN 
-         ! Writing the restart file 
-         IF(lwp) THEN
-            WRITE(numout,*)
-            WRITE(numout,*) 'flo_wri : write in  restart_float file '
-            WRITE(numout,*) '~~~~~~~    '
+
+
+      !-------------------------------------!
+      ! II- WRITE WRITE WRITE WRITE WRITE   !
+      !-------------------------------------!
+
+      !--------------------------!
+      ! II-1 Write in ascii file !
+      !--------------------------!
+
+      IF( ln_flo_ascii )THEN
+
+         IF( ( kt == nn_it000 .OR. MOD( kt,nn_writefl)== 0 ) .AND. lwp )THEN
+
+            !II-1-a Open ascii file
+            !----------------------
+            IF( kt == nn_it000 ) THEN
+               CALL ctl_opn( numflo, 'trajec_float', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
+               irecflo = NINT( (nitend-nn_it000) / FLOAT(nn_writefl) )
+               WRITE(numflo,*)cexper,no,irecflo,jpnfl,nn_writefl
+            ENDIF
+
+            !II-1-b Write in ascii file
+            !-----------------------------
+            WRITE(numflo,*) zlon,zlat,zdep,nisobfl,ngrpfl,ztem,zsal, FLOAT(ndastp)
+
+
+            !II-1-c Close netcdf file
+            !-------------------------
+            IF( kt == nitend )   CLOSE( numflo )
+
          ENDIF
 
-         ! file is opened and closed every time it is used.
-
-         clname = 'restart.float.'
-         ic = 1
-         DO jc = 1, 16
-            IF( cexper(jc:jc) /= ' ' ) ic = jc
-         END DO
-         clname = clname(1:14)//cexper(1:ic)
-         ic = 1
-         DO jc = 1, 48
-            IF( clname(jc:jc) /= ' ' ) ic = jc
-         END DO
-
-         CALL ctl_opn( inum, clname, 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
-         REWIND inum
-         !
-         DO jpn = 1, jpnij
-            iproc(jpn) = 0
-         END DO
-         !
-         IF(lwp) THEN
-            REWIND(inum)
-            WRITE (inum) tpifl,tpjfl,tpkfl,nisobfl,ngrpfl
-            CLOSE (inum) 
+      !-----------------------------------------------------
+      ! II-2 Write in netcdf file
+      !-----------------------------------------------------
+
+      ELSE
+
+      !II-2-a Write with IOM
+      !----------------------
+
+#if defined key_iomput
+         CALL iom_put( "traj_lon"     , zlon )
+         CALL iom_put( "traj_lat"     , zlat )
+         CALL iom_put( "traj_dep"     , zdep )
+         CALL iom_put( "traj_temp"    , ztem )
+         CALL iom_put( "traj_salt"    , zsal  )
+         CALL iom_put( "traj_dens"    , zrho )
+         CALL iom_put( "traj_group"   , REAL(ngrpfl,wp) )
+#else
+
+      !II-2-b Write with IOIPSL
+      !------------------------
+
+         IF( ( kt == nn_it000 .OR. MOD( kt,nn_writefl)== 0 ) .AND. lwp )THEN
+
+
+            !II-2-b-1 Open netcdf file
+            !-------------------------
+            IF( kt==nn_it000 )THEN   ! Create and open
+
+               CALL dia_nam( clname, nn_writefl, 'trajec_float' )
+               clname=TRIM(clname)//".nc"
+
+               CALL fliocrfd( clname , (/ 'ntraj' , 't' /), (/ jpnfl , -1  /) , numflo )
+   
+               CALL fliodefv( numflo, 'traj_lon'    , (/1,2/), v_t=flio_r8, long_name="Longitude"           , units="degrees_east"  )
+               CALL fliodefv( numflo, 'traj_lat'    , (/1,2/), v_t=flio_r8, long_name="Latitude"            , units="degrees_north" )
+               CALL fliodefv( numflo, 'traj_depth'  , (/1,2/), v_t=flio_r8, long_name="Depth"               , units="meters" )
+               CALL fliodefv( numflo, 'time_counter', (/2/)  , v_t=flio_r8, long_name="Time axis"           & 
+                         & , units="seconds since start of the run " )
+               CALL fliodefv( numflo, 'traj_temp'   , (/1,2/), v_t=flio_r8, long_name="Temperature"         , units="C" )
+               CALL fliodefv( numflo, 'traj_salt'   , (/1,2/), v_t=flio_r8, long_name="Salinity"            , units="PSU" )
+               CALL fliodefv( numflo, 'traj_dens'   , (/1,2/), v_t=flio_r8, long_name="Density"             , units="kg/m3" )
+               CALL fliodefv( numflo, 'traj_group'  , (/1/)  , v_t=flio_r8, long_name="number of the group" , units="no unit" )
+
+               CALL flioputv( numflo , 'traj_group' , REAL(ngrpfl,wp) )
+  
+            ELSE  ! Re-open
+       
+               CALL flioopfd( TRIM(clname), numflo , "WRITE" )
+
+            ENDIF
+
+            !II-2-b-2 Write in  netcdf file
+            !-------------------------------
+            irec =  INT( (kt-nn_it000+1)/nn_writefl ) +1
+            ztime = ( kt-nn_it000 + 1 ) * rdt
+
+            CALL flioputv( numflo , 'time_counter', ztime , start=(/irec/) )
+
+            DO jfl = 1, jpnfl
+
+               istart = (/jfl,irec/)
+               icfl   = INT( tpkfl(jfl) )            ! K-index of the nearest point before
+
+               CALL flioputv( numflo , 'traj_lon'    , zlon(jfl)        , start=istart )
+               CALL flioputv( numflo , 'traj_lat'    , zlat(jfl)        , start=istart )  
+               CALL flioputv( numflo , 'traj_depth'  , zdep(jfl)        , start=istart )  
+               CALL flioputv( numflo , 'traj_temp'   , ztemp(icfl,jfl)  , start=istart )  
+               CALL flioputv( numflo , 'traj_salt'   , zsal(icfl,jfl)   , start=istart )  
+               CALL flioputv( numflo , 'traj_dens'   , zrho(icfl,jfl)   , start=istart )  
+
+            ENDDO
+
+            !II-2-b-3 Close netcdf file
+            !---------------------------
+            CALL flioclo( numflo )
+
          ENDIF
-         !
-         ! Compute the number of trajectories for each processor
-         !
-         IF( lk_mpp ) THEN
-            DO jfl = 1, jpnfl
-               IF( (INT(tpifl(jfl)) >= (mig(nldi)-jpizoom+1)) .AND.   &
-                  &(INT(tpifl(jfl)) <= (mig(nlei)-jpizoom+1)) .AND.   &
-                  &(INT(tpjfl(jfl)) >= (mjg(nldj)-jpjzoom+1)) .AND.   &
-                  &(INT(tpjfl(jfl)) <= (mjg(nlej)-jpjzoom+1)) ) THEN
-                  iproc(narea) = iproc(narea)+1
-               ENDIF
-            END DO
-            CALL mpp_sum( iproc, jpnij )
-            !
-            IF(lwp) THEN 
-               WRITE(numout,*) 'DATE',adatrj
-               DO jpn = 1, jpnij
-                  IF( iproc(jpn) /= 0 ) THEN
-                     WRITE(numout,*)'PROCESSOR',jpn-1,'compute',iproc(jpn), 'trajectories.'
-                  ENDIF
-               END DO
-            ENDIF
-         ENDIF
-      ENDIF 
-
-      IF( kt == nitend )   CLOSE( numflo ) 
-      !
+
+#endif
+      ENDIF ! netcdf writing
+   
    END SUBROUTINE flo_wri
+
 
 #  else
@@ -321,5 +298,5 @@
    END SUBROUTINE flo_wri
 #endif
-   
-   !!======================================================================
+
+   !!=======================================================================
 END MODULE flowri
Index: /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90
===================================================================
--- /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90	(revision 3050)
+++ /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90	(revision 3051)
@@ -115,4 +115,5 @@
    INTEGER ::   numdct_heat =   -1      !: logical unit for heat    transports output
    INTEGER ::   numdct_salt =   -1      !: logical unit for salt    transports output
+   INTEGER ::   numfl      =   -1      !: logical unit for floats ascii output
 
    !!----------------------------------------------------------------------
Index: /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90
===================================================================
--- /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90	(revision 3050)
+++ /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90	(revision 3051)
@@ -19,4 +19,5 @@
    !!--------------------------------------------------------------------
    USE dom_oce         ! ocean space and time domain
+   USE flo_oce         ! floats module declarations
    USE lbclnk          ! lateal boundary condition / mpp exchanges
    USE iom_def         ! iom variables definitions
@@ -48,5 +49,5 @@
    PRIVATE iom_rp0d, iom_rp1d, iom_rp2d, iom_rp3d
    PRIVATE iom_g0d, iom_g1d, iom_g2d, iom_g3d, iom_get_123d
-   PRIVATE iom_p2d, iom_p3d
+   PRIVATE iom_p1d, iom_p2d, iom_p3d
 #if defined key_iomput
    PRIVATE set_grid
@@ -63,5 +64,5 @@
    END INTERFACE
   INTERFACE iom_put
-     MODULE PROCEDURE iom_p0d, iom_p2d, iom_p3d
+     MODULE PROCEDURE iom_p0d, iom_p1d, iom_p2d, iom_p3d
   END INTERFACE
 #if defined key_iomput
@@ -115,4 +116,7 @@
       CALL event__set_vert_axis( "depthv", gdept_0 )
       CALL event__set_vert_axis( "depthw", gdepw_0 )
+#if defined key_floats
+      CALL event__set_vert_axis( "nfloat", REAL(nfloat,wp)  )
+#endif
       
       ! automatic definitions of some of the xml attributs
@@ -961,4 +965,16 @@
 #endif
    END SUBROUTINE iom_p0d
+
+   SUBROUTINE iom_p1d( cdname, pfield1d )
+      CHARACTER(LEN=*)          , INTENT(in) ::   cdname
+      REAL(wp),     DIMENSION(:), INTENT(in) ::   pfield1d
+      INTEGER :: jpz
+#if defined key_iomput
+      jpz=SIZE(pfield1d)
+      CALL event__write_field3D( cdname, RESHAPE( (/pfield1d/), (/1,1,jpz/) ) )
+#else
+      IF( .FALSE. )   WRITE(numout,*) cdname, pfield1d   ! useless test to avoid compilation warnings
+#endif
+   END SUBROUTINE iom_p1d
 
    SUBROUTINE iom_p2d( cdname, pfield2d )
Index: /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
===================================================================
--- /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 3050)
+++ /branches/2011/dev_MERCATOR_2011_MERGE/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 3051)
@@ -342,6 +342,6 @@
 #endif
       !                                     ! Diagnostics
+      IF( lk_floats     )   CALL     flo_init   ! drifting Floats
                             CALL     iom_init   ! iom_put initialization
-      IF( lk_floats     )   CALL     flo_init   ! drifting Floats
       IF( lk_diaar5     )   CALL dia_ar5_init   ! ar5 diag
                             CALL dia_ptr_init   ! Poleward TRansports initialization
