Index: /branches/nemo_v3_3_beta/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/cpp_ORCA2_OFF_PISCES.fcm
===================================================================
--- /branches/nemo_v3_3_beta/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/cpp_ORCA2_OFF_PISCES.fcm	(revision 2443)
+++ /branches/nemo_v3_3_beta/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/cpp_ORCA2_OFF_PISCES.fcm	(revision 2444)
@@ -1,1 +1,1 @@
-bld::tool::fppkeys key_trabbl key_vectopt_loop key_orca_r2 key_dynspg_flt key_ldfslp key_traldf_c2d key_traldf_eiv key_zdftke key_zdfddm key_top key_offline key_pisces key_dtatrc key_diatrc key_iomput key_nproci=1 key_nprocj=1
+bld::tool::fppkeys key_trabbl key_vectopt_loop key_orca_r2 key_dynspg_flt key_ldfslp key_traldf_c2d key_traldf_eiv key_zdftke key_top key_offline key_pisces key_dtatrc key_diatrc key_iomput key_nproci=1 key_nprocj=1
Index: /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OFF_SRC/dommsk.F90
===================================================================
--- /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OFF_SRC/dommsk.F90	(revision 2443)
+++ /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OFF_SRC/dommsk.F90	(revision 2444)
@@ -1,32 +1,29 @@
 MODULE dommsk
-   !!==============================================================================
+   !!======================================================================
    !!                       ***  MODULE dommsk   ***
-   !! Ocean initialization : domain land/sea mask 
-   !!==============================================================================
+   !! Ocean initialization : domain land/sea masks, off-line case 
+   !!======================================================================
+   !! History :  3.3  ! 2010-10  (C. Ethe)  adapted from OPA_SRC/DOM/dommsk
+   !!----------------------------------------------------------------------
 
    !!----------------------------------------------------------------------
    !!   dom_msk        : compute land/ocean mask
    !!----------------------------------------------------------------------
-   !! * Modules used
    USE oce             ! ocean dynamics and tracers
    USE dom_oce         ! ocean space and time domain
    USE in_out_manager  ! I/O manager
-   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
-   USE lib_mpp
 
    IMPLICIT NONE
    PRIVATE
 
-   !! * Routine accessibility
-   PUBLIC dom_msk        ! routine called by inidom.F90
+   PUBLIC   dom_msk    ! routine called by inidom.F90
 
-   !! * Module variables
 #if defined key_degrad
    !! ------------------------------------------------
    !! Degradation method
    !! --------------------------------------------------
-   REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jpk) :: &
-      facvol  !! volume for degraded regions
+   REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jpk) ::   facvol  !! volume for degraded regions
 #endif
+
    !! * Substitutions
 #  include "vectopt_loop_substitute.h90"
@@ -34,7 +31,6 @@
    !! NEMO/OFF 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
    
@@ -43,130 +39,49 @@
       !!                 ***  ROUTINE dom_msk  ***
       !!
-      !! ** Purpose :   Compute land/ocean mask arrays at tracer points, hori-
-      !!      zontal velocity points (u & v), vorticity points (f) and baro-
-      !!      tropic stream function  points (b).
-      !!        Set mbathy to the number of non-zero w-levels of a water column
-      !!      (if island in the domain (lk_isl=T), this is done latter in
-      !!      routine solver_init)
+      !! ** Purpose :   Off-line case: defines the interior domain T-mask.
       !!
-      !! ** Method  :   The ocean/land mask is computed from the basin bathy-
-      !!      metry in level (mbathy) which is defined or read in dommba.
-      !!      mbathy equals 0 over continental T-point, -n over the nth 
-      !!      island T-point, and the number of ocean level over the ocean.
+      !! ** Method  :   The interior ocean/land mask is computed from tmask
+      !!              setting to zero the duplicated row and lines due to
+      !!              MPP exchange halos, est-west cyclic and north fold
+      !!              boundary conditions.
       !!
-      !!      At a given position (ji,jj,jk) the ocean/land mask is given by:
-      !!      t-point : 0. IF mbathy( ji ,jj) =< 0
-      !!                1. IF mbathy( ji ,jj) >= jk
-      !!      u-point : 0. IF mbathy( ji ,jj)  or mbathy(ji+1, jj ) =< 0
-      !!                1. IF mbathy( ji ,jj) and mbathy(ji+1, jj ) >= jk.
-      !!      v-point : 0. IF mbathy( ji ,jj)  or mbathy( ji ,jj+1) =< 0
-      !!                1. IF mbathy( ji ,jj) and mbathy( ji ,jj+1) >= jk.
-      !!      f-point : 0. IF mbathy( ji ,jj)  or mbathy( ji ,jj+1)
-      !!                   or mbathy(ji+1,jj)  or mbathy(ji+1,jj+1) =< 0
-      !!                1. IF mbathy( ji ,jj) and mbathy( ji ,jj+1)
-      !!                and mbathy(ji+1,jj) and mbathy(ji+1,jj+1) >= jk.
-      !!      b-point : the same definition as for f-point of the first ocean
-      !!                level (surface level) but with 0 along coastlines.
-      !!
-      !!        The lateral friction is set through the value of fmask along
-      !!      the coast and topography. This value is defined by shlat, a
-      !!      namelist parameter:
-      !!         shlat = 0, free slip  (no shear along the coast)
-      !!         shlat = 2, no slip  (specified zero velocity at the coast)
-      !!         0 < shlat < 2, partial slip   | non-linear velocity profile
-      !!         2 < shlat, strong slip        | in the lateral boundary layer
-      !!
-      !!      N.B. If nperio not equal to 0, the land/ocean mask arrays
-      !!      are defined with the proper value at lateral domain boundaries,
-      !!      but bmask. indeed, bmask defined the domain over which the
-      !!      barotropic stream function is computed. this domain cannot
-      !!      contain identical columns because the matrix associated with
-      !!      the barotropic stream function equation is then no more inverti-
-      !!      ble. therefore bmask is set to 0 along lateral domain boundaries
-      !!      even IF nperio is not zero.
-      !!
-      !!      In case of open boundaries (lk_obc=T):
-      !!        - tmask is set to 1 on the points to be computed bay the open
-      !!          boundaries routines.
-      !!        - bmask is  set to 0 on the open boundaries.
-      !!
-      !!      Set mbathy to the number of non-zero w-levels of a water column
-      !!                  mbathy = min( mbathy, 1 ) + 1
-      !!      (note that the minimum value of mbathy is 2).
-      !!
-      !! ** Action :
-      !!                     tmask    : land/ocean mask at t-point (=0. or 1.)
-      !!                     umask    : land/ocean mask at u-point (=0. or 1.)
-      !!                     vmask    : land/ocean mask at v-point (=0. or 1.)
-      !!                     fmask    : land/ocean mask at f-point (=0. or 1.)
-      !!                          =shlat along lateral boundaries
-      !!                     bmask    : land/ocean mask at barotropic stream
-      !!                          function point (=0. or 1.) and set to
-      !!                          0 along lateral boundaries
-      !!                   mbathy   : number of non-zero w-levels 
-      !!
-      !! History :
-      !!        !  87-07  (G. Madec)  Original code
-      !!        !  91-12  (G. Madec)
-      !!        !  92-06  (M. Imbard)
-      !!        !  93-03  (M. Guyon)  symetrical conditions (M. Guyon)
-      !!        !  96-01  (G. Madec)  suppression of common work arrays
-      !!        !  96-05  (G. Madec)  mask computed from tmask and sup-
-      !!                 pression of the double computation of bmask
-      !!        !  97-02  (G. Madec)  mesh information put in domhgr.F
-      !!        !  97-07  (G. Madec)  modification of mbathy and fmask
-      !!        !  98-05  (G. Roullet)  free surface
-      !!        !  00-03  (G. Madec)  no slip accurate
-      !!        !  01-09  (J.-M. Molines)  Open boundaries
-      !!   8.5  !  02-08  (G. Madec)  F90: Free form and module
+      !! ** Action :   tmask_i  : interiorland/ocean mask at t-point
+      !!               tpol     : ???
       !!----------------------------------------------------------------------
-      !! *Local declarations
-      INTEGER  ::   ji, jk     ! dummy loop indices
-      INTEGER  ::   iif, iil, ijf, ijl
-      INTEGER, DIMENSION(jpi,jpj) ::  imsk
-
+      INTEGER  ::   ji, jk                   ! dummy loop indices
+      INTEGER  ::   iif, iil, ijf, ijl       ! local integers
+      INTEGER, DIMENSION(jpi,jpj) ::  imsk   ! 2D workspace
       !!---------------------------------------------------------------------
-      
-
-
+      !
       ! Interior domain mask (used for global sum)
       ! --------------------
-
       tmask_i(:,:) = tmask(:,:,1)
-      iif = jpreci                         ! ???
+      iif = jpreci                        ! thickness of exchange halos in i-axis
       iil = nlci - jpreci + 1
-      ijf = jprecj                         ! ???
+      ijf = jprecj                        ! thickness of exchange halos in j-axis
       ijl = nlcj - jprecj + 1
-
-      tmask_i( 1 :iif,   :   ) = 0.e0      ! first columns
-      tmask_i(iil:jpi,   :   ) = 0.e0      ! last  columns (including mpp extra columns)
-      tmask_i(   :   , 1 :ijf) = 0.e0      ! first rows
-      tmask_i(   :   ,ijl:jpj) = 0.e0      ! last  rows (including mpp extra rows)
-
-
-      ! north fold mask
-      tpol(1:jpiglo) = 1.e0 
-      IF( jperio == 3 .OR. jperio == 4 ) THEN      ! T-point pivot
-         tpol(jpiglo/2+1:jpiglo) = 0.e0
-      ENDIF
-      IF( jperio == 5 .OR. jperio == 6 ) THEN      ! F-point pivot
-         tpol(     1    :jpiglo) = 0.e0
-      ENDIF
-
+      !
+      tmask_i( 1 :iif,   :   ) = 0._wp    ! first columns
+      tmask_i(iil:jpi,   :   ) = 0._wp    ! last  columns (including mpp extra columns)
+      tmask_i(   :   , 1 :ijf) = 0._wp    ! first rows
+      tmask_i(   :   ,ijl:jpj) = 0._wp    ! last  rows (including mpp extra rows)
+      !
+      !                                   ! north fold mask
+      tpol(1:jpiglo) = 1._wp
+      !                                
+      IF( jperio == 3 .OR. jperio == 4 )   tpol(jpiglo/2+1:jpiglo) = 0._wp    ! T-point pivot
+      IF( jperio == 5 .OR. jperio == 6 )   tpol(     1    :jpiglo) = 0._wp    ! F-point pivot
       IF( jperio == 3 .OR. jperio == 4 ) THEN      ! T-point pivot: only half of the nlcj-1 row
-         if (mjg(ijl-1) == jpjglo-1) then
-         DO ji = iif+1, iil-1
-            tmask_i(ji,ijl-1) = tmask_i(ji,ijl-1) * tpol(mig(ji))
-         END DO
-         endif
+         IF( mjg(ijl-1) == jpjglo-1 ) THEN
+            DO ji = iif+1, iil-1
+               tmask_i(ji,ijl-1) = tmask_i(ji,ijl-1) * tpol(mig(ji))
+            END DO
+         ENDIF
       ENDIF 
-
-      ! Control print
-      ! -------------
-      IF( nprint == 1 .AND. lwp ) THEN
+      !
+      IF( nprint == 1 .AND. lwp ) THEN    ! Control print
          imsk(:,:) = INT( tmask_i(:,:) )
          WRITE(numout,*) ' tmask_i : '
-         CALL prihin( imsk(:,:), jpi, jpj, 1, jpi, 1,   &
-               &                           1, jpj, 1, 1, numout)
+         CALL prihin( imsk(:,:), jpi, jpj, 1, jpi, 1, 1, jpj, 1, 1, numout)
          WRITE (numout,*)
          WRITE (numout,*) ' dommsk: tmask for each level'
@@ -174,13 +89,12 @@
          DO jk = 1, jpk
             imsk(:,:) = INT( tmask(:,:,jk) )
-
             WRITE(numout,*)
             WRITE(numout,*) ' level = ',jk
-            CALL prihin( imsk(:,:), jpi, jpj, 1, jpi, 1,   &
-               &                              1, jpj, 1, 1, numout)
+            CALL prihin( imsk(:,:), jpi, jpj, 1, jpi, 1, 1, jpj, 1, 1, numout)
          END DO
       ENDIF
-
+      !
    END SUBROUTINE dom_msk
 
+   !!======================================================================
 END MODULE dommsk
Index: /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OFF_SRC/domrea.F90
===================================================================
--- /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OFF_SRC/domrea.F90	(revision 2443)
+++ /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OFF_SRC/domrea.F90	(revision 2444)
@@ -11,14 +11,12 @@
    !!                         = 3  :   mesh_hgr, mesh_zgr and mask
    !!----------------------------------------------------------------------
-   !! * Modules used
    USE dom_oce         ! ocean space and time domain
-   USE dommsk  
-   USE in_out_manager
+   USE dommsk          ! domain: masks
+   USE in_out_manager  ! I/O manager
 
    IMPLICIT NONE
    PRIVATE
 
-   !! * Accessibility
-   PUBLIC dom_rea        ! routine called by inidom.F90
+   PUBLIC   dom_rea    ! routine called by inidom.F90
    !!----------------------------------------------------------------------
    !! NEMO/OFF 3.3 , NEMO Consortium (2010)
@@ -29,8 +27,7 @@
 CONTAINS
 
-#if ( defined key_mpp_mpi || defined key_mpp_shmem ) && defined key_dimgout
+#if   defined key_mpp_mpi   &&   defined key_dimgout
    !!----------------------------------------------------------------------
    !!   'key_mpp_mpi'     OR
-   !!   'key_mpp_shmem'
    !!   'key_dimgout' :         each processor makes its own direct access file 
    !!                      use build_nc_meshmask off line to retrieve 
@@ -38,5 +35,4 @@
    !!----------------------------------------------------------------------
 #  include "domrea_dimg.h90"
-
 
 #else
@@ -67,34 +63,18 @@
       !!      meshmask.nc  : domain size, horizontal grid-point position,
       !!                     masks, depth and vertical scale factors
+      !!----------------------------------------------------------------------
+      USE iom
       !!
-      !! History :
-      !!        !  97-02  (G. Madec)  Original code
-      !!        !  99-11  (M. Imbard)  NetCDF FORMAT with IOIPSL
-      !!   9.0  !  02-08  (G. Madec)  F90 and several file
-      !!        !  06-07  (C. Ethe )  Use of iom module
+      INTEGER  ::   ji, jj, jk   ! dummy loop indices
+      INTEGER  ::   ik, inum0 , inum1 , inum2 , inum3 , inum4   ! local integers
+      REAL(wp) ::   zrefdep         ! local real
+      REAL(wp), DIMENSION(jpi,jpj) ::   zprt   ! 2D workspace
       !!----------------------------------------------------------------------
-      !! * Modules used
-      USE iom
-
-      !! * Local declarations
-      INTEGER  ::   ji, jj, jk
-      INTEGER  ::                & !!! * temprary units for :
-         inum0 ,                 &  ! 'mesh_mask.nc' file
-         inum1 ,                 &  ! 'mesh.nc'      file
-         inum2 ,                 &  ! 'mask.nc'      file
-         inum3 ,                 &  ! 'mesh_hgr.nc'  file
-         inum4                      ! 'mesh_zgr.nc'  file
- 
-      REAL(wp), DIMENSION(jpi,jpj) :: zprt
-      REAL(wp) ::   zrefdep         ! depth of the reference level (~10m)
-      INTEGER  :: ik
-      !!----------------------------------------------------------------------
-
-       IF(lwp) WRITE(numout,*)
-       IF(lwp) WRITE(numout,*) 'dom_rea : read NetCDF mesh and mask information file(s)'
-       IF(lwp) WRITE(numout,*) '~~~~~~~'
-
-
-      zprt(:,:) = 0.
+
+      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) 'dom_rea : read NetCDF mesh and mask information file(s)'
+      IF(lwp) WRITE(numout,*) '~~~~~~~'
+
+      zprt(:,:) = 0._wp
 
       SELECT CASE (nmsh)
@@ -180,5 +160,5 @@
          DO jj = 1, jpj
             DO ji = 1, jpi
-               mbathy(ji,jj) = MAX( zprt(ji,jj) * tmask(ji,jj,1), 1. ) + 1
+               mbathy(ji,jj) = MAX( zprt(ji,jj) * tmask(ji,jj,1), 1._wp ) + 1
             ENDDO
          ENDDO
@@ -262,5 +242,5 @@
 !!gm BUG in s-coordinate this does not work!
       ! deepest/shallowest W level Above/Below ~10m
-      zrefdep = 10. - ( 0.1*MINVAL(e3w_0) )                          ! ref. depth with tolerance (10% of minimum layer thickness)
+      zrefdep = 10._wp - ( 0.1_wp * MINVAL(e3w_0) )                  ! ref. depth with tolerance (10% of minimum layer thickness)
       nlb10 = MINLOC( gdepw_0, mask = gdepw_0 > zrefdep, dim = 1 )   ! shallowest W level Below ~10m
       nla10 = nlb10 - 1                                              ! deepest    W level Above ~10m
@@ -308,23 +288,22 @@
 
       DO jk = 1, jpk
-         IF( e3w_0(jk) <= 0. .OR. e3t_0(jk) <= 0. ) CALL ctl_stop ( ' e3w_0 or e3t_0 =< 0 ' )
-         IF( gdepw_0(jk) < 0. .OR. gdept_0(jk) < 0.) CALL ctl_stop( ' gdepw_0 or gdept_0 < 0 ' )
+         IF( e3w_0  (jk) <= 0._wp .OR. e3t_0  (jk) <= 0._wp )   CALL ctl_stop( ' e3w_0 or e3t_0 =< 0 ' )
+         IF( gdepw_0(jk) <  0._wp .OR. gdept_0(jk) <  0._wp )   CALL ctl_stop( ' gdepw_0 or gdept_0 < 0 ' )
       END DO
-
-         !                                     ! ============================
-         !                                     !        close the files 
-         !                                     ! ============================
-         SELECT CASE ( nmsh )
-            CASE ( 1 )                
-               CALL iom_close( inum0 )
-            CASE ( 2 )
-               CALL iom_close( inum1 )
-               CALL iom_close( inum2 )
-            CASE ( 3 )
-               CALL iom_close( inum2 )
-               CALL iom_close( inum3 )
-               CALL iom_close( inum4 )
-         END SELECT
-
+      !                                     ! ============================
+      !                                     !        close the files 
+      !                                     ! ============================
+      SELECT CASE ( nmsh )
+         CASE ( 1 )                
+            CALL iom_close( inum0 )
+         CASE ( 2 )
+            CALL iom_close( inum1 )
+            CALL iom_close( inum2 )
+         CASE ( 3 )
+            CALL iom_close( inum2 )
+            CALL iom_close( inum3 )
+            CALL iom_close( inum4 )
+      END SELECT
+      !
    END SUBROUTINE dom_rea
 
Index: anches/nemo_v3_3_beta/NEMOGCM/NEMO/OFF_SRC/domrea_dimg.h90
===================================================================
--- /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OFF_SRC/domrea_dimg.h90	(revision 2443)
+++ 	(revision )
@@ -1,410 +1,0 @@
-   SUBROUTINE dom_rea
-      !!----------------------------------------------------------------------
-      !!                  ***  ROUTINE dom_rea  ***   'key_mpp'
-      !!
-      !! ** Purpose :   READ the direct access files which contains all the
-      !!      ocean domain informations (mesh and mask arrays). These
-      !!      files are used for visualisation (SAXO software) and
-      !!      diagnostic computation.
-      !!
-      !! ** Method  :   READ in a file all the arrays generated in routines
-      !!      domhgr, domzgr, and dommsk. Note: the file contain depends on
-      !!      the vertical coord. used (z-coord, partial steps, s-coord)
-      !!    For mpp output direct access files are used and each processor
-      !!    uses a record range. Off line program (build_nc_meshmask) can be used
-      !!    to reconstruct the Netcdf files
-      !!                    nmsh = 1  :   'mesh_mask.nc' file
-      !!                         = 2  :   'mesh.nc' and mask.nc' files
-      !!                         = 3  :   'mesh_hgr.nc', 'mesh_zgr.nc' and
-      !!                                  'mask.nc' files
-      !!      For huge size domain, use option 2 or 3 depending on your
-      !!      vertical coordinate.
-      !!
-      !! ** output file :
-      !!      meshmask.nc  : domain size, horizontal grid-point position,
-      !!                     masks, depth and vertical scale factors
-      !!
-      !! History :
-      !!        !  97-02  (G. Madec)  Original code
-      !!        !  99-11  (M. Imbard)  NetCDF FORMAT with IOIPSL
-      !!   9.0  !  02-08  (G. Madec)  F90 and several file
-      !!        !  04-01  (J.M. Molines) MPP i/o
-      !!----------------------------------------------------------------------
-      !!   OPA 9.0 , LOCEAN-IPSL  (2005)
-      !!   $Id$
-      !!   This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt
-      !!----------------------------------------------------------------------
-      !! * Modules used
-      USE lib_mpp
-      USE dom_oce         ! ocean space and time domain
-
-      !! * Local declarations
-      !! * Local declarations
-      INTEGER  ::                & !!! * temprary units for :
-         inum0 ,                 &  ! 'mesh_mask.nc' file
-         inum1 ,                 &  ! 'mesh.nc'      file
-         inum2 ,                 &  ! 'mask.nc'      file
-         inum3 ,                 &  ! 'mesh_hgr.nc'  file
-         inum4                      ! 'mesh_zgr.nc'  file
-      INTEGER  ::   itime           !  output from restini ???
-      INTEGER  ::   irecl8, irec    ! Record length (bytes) for output file 
-      INTEGER  ::   jk              ! loop index
-      INTEGER  ::   ios1, ios2
-      INTEGER, DIMENSION(11:15)  :: irecv ! index of this array will be inumxxx
-      REAL(wp) ::   zdate0
-      REAL(wp), DIMENSION(jpi,jpj) ::   &
-         zprt                       ! temporary array for bathymetry
-
-      CHARACTER (len=21) ::      &
-         clnam0 = 'mesh_mask',   &  ! filename (mesh and mask informations)
-         clnam1 = 'mesh'     ,   &  ! filename (mesh informations)
-         clnam2 = 'mask'     ,   &  ! filename (mask informations)
-         clnam3 = 'mesh_hgr' ,   &  ! filename (horizontal mesh informations)
-         clnam4 = 'mesh_zgr'        ! filename (vertical   mesh informations)
-      !!----------------------------------------------------------------------
-
-       IF(lwp) WRITE(numout,*)
-       IF(lwp) WRITE(numout,*) 'dom_rea : read direct access  mesh and mask information files'
-       IF(lwp) WRITE(numout,*) '~~~~~~~'
-
-       inum0 = 11
-       irecl8 = jpi*jpj*wp
-       ios1 = 0 ; ios2 = 0
-       IF (ln_zps ) ios1= 1 
-       IF (ln_sco ) ios2= 1
-   
-       SELECT CASE (nmsh )
-          !                                    !==============================
-          CASE ( 1 )                           !  read 'mesh_mask' file
-             !                                 !==============================
-             IF (lwp) WRITE(numout,*) '          one file in "mesh_mask.dimgproc '
-             OPEN(inum0,FILE=trim(clnam0)//'.mpp', &
-                & FORM='UNFORMATTED', ACCESS='DIRECT', RECL = irecl8 )
-             IF (lwp )READ(inum0,REC=1 ) irecl8, nmsh, ios1,ios2 , &
-            &  ndastp, adatrj, jpi,jpj,jpk,  &
-            &  jpni,jpnj,jpnij,jpiglo,jpjglo, &
-            &  nlcit,nlcjt, nldit, nldjt, nleit, nlejt, nimppt, njmppt
-
-             inum2 = inum0
-             inum3 = inum0
-             inum4 = inum0
-
-            !                                  ! ============================
-         CASE ( 2 )                            !  read 'mesh' and
-            !                                  !         'mask' files
-            !                                  ! ============================
-
-            IF(lwp) WRITE(numout,*) '          two files in "mesh" and "mask" '
-            inum1 = 12
-            inum2 = 13
-            OPEN(inum1,FILE=trim(clnam1)//'.mpp', &
-                & FORM='UNFORMATTED', ACCESS='DIRECT', RECL = irecl8 )
-             IF (lwp) READ(inum1,REC=1 ) irecl8, nmsh, ios1,ios2 , &
-            &  ndastp, adatrj, jpi,jpj,jpk,  &
-            &  jpni,jpnj,jpnij,jpiglo,jpjglo, &
-            &  nlcit,nlcjt, nldit, nldjt, nleit, nlejt, nimppt, njmppt
-
-             inum3 = inum1
-             inum4 = inum1
-            OPEN(inum2,FILE=trim(clnam2)//'.mpp', &
-                & FORM='UNFORMATTED', ACCESS='DIRECT', RECL = irecl8 )
-             IF (lwp) READ(inum2,REC=1 ) irecl8, nmsh, ios1,ios2 , &
-            &  ndastp, adatrj, jpi,jpj,jpk,  &
-            &  jpni,jpnj,jpnij,jpiglo,jpjglo, &
-            &  nlcit,nlcjt, nldit, nldjt, nleit, nlejt, nimppt, njmppt
-
-            !                                  ! ============================
-         CASE ( 3 )                            !  read 'mesh_hgr'
-            !                                  !         'mesh_zgr' and
-            !                                  !         'mask'     files
-            !                                  ! ============================
-
-            IF(lwp) WRITE(numout,*) '          three files in "mesh_hgr" , mesh_zgr" and "mask" '
-            inum3 = 14
-            inum2 = 13
-            inum4 = 15
-
-            OPEN(inum3,FILE=trim(clnam3)//'.mpp', &
-                & FORM='UNFORMATTED', ACCESS='DIRECT', RECL = irecl8 )
-             IF (lwp) READ(inum3,REC=1 ) irecl8, nmsh, ios1,ios2 , &
-            &  ndastp, adatrj, jpi,jpj,jpk,  &
-            &  jpni,jpnj,jpnij,jpiglo,jpjglo, &
-            &  nlcit,nlcjt, nldit, nldjt, nleit, nlejt, nimppt, njmppt
-
-            OPEN(inum2,FILE=trim(clnam2)//'.mpp', &
-                & FORM='UNFORMATTED', ACCESS='DIRECT', RECL = irecl8 )
-             IF (lwp) READ(inum2,REC=1 ) irecl8, nmsh, ios1,ios2 , &
-            &  ndastp, adatrj, jpi,jpj,jpk,  &
-            &  jpni,jpnj,jpnij,jpiglo,jpjglo, &
-            &  nlcit,nlcjt, nldit, nldjt, nleit, nlejt, nimppt, njmppt
-
-            OPEN(inum4,FILE=trim(clnam4)//'.mpp', &
-                & FORM='UNFORMATTED', ACCESS='DIRECT', RECL = irecl8 )
-             IF (lwp) READ(inum4,REC=1 ) irecl8, nmsh, ios1,ios2 , &
-            &  ndastp, adatrj, jpi,jpj,jpk,  &
-            &  jpni,jpnj,jpnij,jpiglo,jpjglo, &
-            &  nlcit,nlcjt, nldit, nldjt, nleit, nlejt, nimppt, njmppt
-         
-         END SELECT
-       
-         irecv(:) = 2
-         ! tmask
-         DO jk=1,jpk
-             irec=irecv(inum2) + (jk -1 ) + jpk * (narea - 1 )
-             READ(inum2,REC=irec) tmask(:,:,jk)
-         END DO
-         irecv(inum2) = irecv(inum2) + jpk * jpnij 
-         !
-         ! umask
-         DO jk=1,jpk
-             irec=irecv(inum2) + (jk -1 ) + jpk * (narea - 1 )
-             READ(inum2,REC=irec) umask(:,:,jk)
-         END DO
-         irecv(inum2) = irecv(inum2) + jpk * jpnij 
-         !
-         ! vmask
-         DO jk=1,jpk
-             irec=irecv(inum2) + (jk -1 ) + jpk * (narea - 1 )
-             READ(inum2,REC=irec) vmask(:,:,jk)
-         END DO
-         irecv(inum2) = irecv(inum2) + jpk * jpnij 
-         !
-         ! fmask
-         DO jk=1,jpk
-             irec=irecv(inum2) + (jk -1 ) + jpk * (narea - 1 )
-             READ(inum2,REC=irec) fmask(:,:,jk)
-         END DO
-         irecv(inum2) = irecv(inum2) + jpk * jpnij 
-         !
-         ! glam
-         irec = irecv(inum3) + (narea - 1 )
-         READ(inum3,REC=irec) glamt(:,:)
-         irecv(inum3) = irecv(inum3) + jpnij 
-       
-         irec = irecv(inum3) + (narea - 1 )
-         READ(inum3,REC=irec) glamu(:,:)
-         irecv(inum3) = irecv(inum3) + jpnij 
-
-         irec = irecv(inum3) + (narea - 1 )
-         READ(inum3,REC=irec) glamv(:,:)
-         irecv(inum3) = irecv(inum3) + jpnij 
-
-         irec = irecv(inum3) + (narea - 1 )
-         READ(inum3,REC=irec) glamf(:,:)
-         irecv(inum3) = irecv(inum3) + jpnij 
-         !
-         ! gphi
-         irec = irecv(inum3) + (narea - 1 )
-         READ(inum3,REC=irec) gphit(:,:)
-         irecv(inum3) = irecv(inum3) + jpnij 
-       
-         irec = irecv(inum3) + (narea - 1 )
-         READ(inum3,REC=irec) gphiu(:,:)
-         irecv(inum3) = irecv(inum3) + jpnij 
-
-         irec = irecv(inum3) + (narea - 1 )
-         READ(inum3,REC=irec) gphiv(:,:)
-         irecv(inum3) = irecv(inum3) + jpnij 
-
-         irec = irecv(inum3) + (narea - 1 )
-         READ(inum3,REC=irec) gphif(:,:)
-         irecv(inum3) = irecv(inum3) + jpnij 
-         !
-         ! e1
-         irec = irecv(inum3) + (narea - 1 )
-         READ(inum3,REC=irec) e1t(:,:)
-         irecv(inum3) = irecv(inum3) + jpnij 
-       
-         irec = irecv(inum3) + (narea - 1 )
-         READ(inum3,REC=irec) e1u(:,:)
-         irecv(inum3) = irecv(inum3) + jpnij 
-
-         irec = irecv(inum3) + (narea - 1 )
-         READ(inum3,REC=irec) e1v(:,:)
-         irecv(inum3) = irecv(inum3) + jpnij 
-
-         irec = irecv(inum3) + (narea - 1 )
-         READ(inum3,REC=irec) e1f(:,:)
-         irecv(inum3) = irecv(inum3) + jpnij 
-         !
-         ! e2
-         irec = irecv(inum3) + (narea - 1 )
-         READ(inum3,REC=irec) e2t(:,:)
-         irecv(inum3) = irecv(inum3) + jpnij 
-       
-         irec = irecv(inum3) + (narea - 1 )
-         READ(inum3,REC=irec) e2u(:,:)
-         irecv(inum3) = irecv(inum3) + jpnij 
-
-         irec = irecv(inum3) + (narea - 1 )
-         READ(inum3,REC=irec) e2v(:,:)
-         irecv(inum3) = irecv(inum3) + jpnij 
-
-         irec = irecv(inum3) + (narea - 1 )
-         READ(inum3,REC=irec) e2f(:,:)
-         irecv(inum3) = irecv(inum3) + jpnij 
-         !
-         ! ff
-         irec = irecv(inum3) + (narea - 1 )
-         READ(inum3,REC=irec) ff(:,:)
-         irecv(inum3) = irecv(inum3) + jpnij 
-         !
-         ! mbathy
-         !       note that mbathy has been modified in dommsk or in solver.
-         !       it is the number of non-zero "w" levels in the water, and the minimum
-         !       value (on land) is 2. We define zprt as the number of "T" points in the ocean
-         !       at any location, and zero on land.
-         !
-         irec = irecv(inum4) + (narea - 1 )
-         READ(inum4,REC=irec) zprt(:,:)
-         irecv(inum4) = irecv(inum4) + jpnij 
-
-          mbathy=zprt*tmask(:,:,1)+1
-
-          IF( ln_sco ) THEN                                         ! s-coordinate
-             !
-             ! hbat
-             irec = irecv(inum4) + (narea - 1 )
-             READ(inum4,REC=irec) hbatt(:,:)
-             irecv(inum4) = irecv(inum4) + jpnij 
-             
-             irec = irecv(inum4) + (narea - 1 )
-             READ(inum4,REC=irec) hbatu(:,:)
-             irecv(inum4) = irecv(inum4) + jpnij 
-             
-             irec = irecv(inum4) + (narea - 1 )
-             READ(inum4,REC=irec) hbatv(:,:)
-             irecv(inum4) = irecv(inum4) + jpnij 
-             
-             irec = irecv(inum4) + (narea - 1 )
-             READ(inum4,REC=irec) hbatf(:,:)
-             irecv(inum4) = irecv(inum4) + jpnij 
-             !
-             ! gsig and esig ( as vectors of jpk per record )
-             irec =  irecv(inum4) + (narea - 1 )
-             READ(inum4,REC=irec) gsigt(:)
-             irecv(inum4) = irecv(inum4) + jpnij 
-             
-             irec =  irecv(inum4) + (narea - 1 )
-             READ(inum4,REC=irec) gsigw(:)
-             irecv(inum4) = irecv(inum4) + jpnij 
-             
-             irec =  irecv(inum4) + (narea - 1 )
-             READ(inum4,REC=irec) gsi3w(:)
-             irecv(inum4) = irecv(inum4) + jpnij 
-             
-             irec =  irecv(inum4) + (narea - 1 )
-             READ(inum4,REC=irec) esigt(:)
-             irecv(inum4) = irecv(inum4) + jpnij 
-             
-             irec =  irecv(inum4) + (narea - 1 )
-             READ(inum4,REC=irec) esigw(:)
-             irecv(inum4) = irecv(inum4) + jpnij 
-
-             ! e3 (3D)
-             DO jk=1,jpk
-                irec =  irecv(inum4) + (jk -1 ) + jpk * (narea - 1 )
-                READ(inum4,REC=irec) e3t(:,:,jk)
-             ENDIF
-             irecv(inum4) = irecv(inum4) + jpk * jpnij 
-             
-             DO jk=1,jpk
-                irec =  irecv(inum4) + (jk -1 ) + jpk * (narea - 1 )
-                READ(inum4,REC=irec) e3u(:,:,jk)
-             ENDIF
-             irecv(inum4) = irecv(inum4) + jpk * jpnij 
-             
-             DO jk=1,jpk
-                irec =  irecv(inum4) + (jk -1 ) + jpk * (narea - 1 )
-                READ(inum4,REC=irec) e3v(:,:,jk)
-             ENDIF
-             irecv(inum4) = irecv(inum4) + jpk * jpnij 
-             
-             DO jk=1,jpk
-                irec =  irecv(inum4) + (jk -1 ) + jpk * (narea - 1 )
-                READ(inum4,REC=irec) e3w(:,:,jk)
-             ENDIF
-             irecv(inum4) = irecv(inum4) + jpk * jpnij 
-
-             ! gdep
-             irec =  irecv(inum4) + (narea - 1 )
-             READ(inum4,REC=irec) gdept_0(:)
-             irecv(inum4) = irecv(inum4) + jpnij 
-             
-             irec =  irecv(inum4) + (narea - 1 )
-             READ(inum4,REC=irec) gdepw_0(:)
-             irecv(inum4) = irecv(inum4) + jpnij 
-             !
-          ENDIF
-             
-          IF( ln_zps ) THEN
-             !
-             ! hdep
-             irec = irecv(inum4) + (narea - 1 )
-             READ(inum4,REC=irec) hdept(:,:)
-             irecv(inum4) = irecv(inum4) + jpnij 
-             
-             irec = irecv(inum4) + (narea - 1 )
-             READ(inum4,REC=irec) hdepw(:,:)
-             irecv(inum4) = irecv(inum4) + jpnij 
-             !
-             ! e3t_ps (3D)
-             DO jk=1,jpk
-                irec=irecv(inum4) + (jk -1 ) + jpk * (narea - 1 )
-                READ(inum4,REC=irec) e3t(:,:,jk)
-             END DO
-             irecv(inum4) = irecv(inum4) + jpk * jpnij 
-             
-             ! e3u_ps e3v_ps e3w_ps (3D)
-             DO jk=1,jpk
-                irec=irecv(inum4) + (jk -1 ) + jpk * (narea - 1 )
-                READ(inum4,REC=irec) e3u(:,:,jk)
-             END DO
-             irecv(inum4) = irecv(inum4) + jpk * jpnij 
-             
-             DO jk=1,jpk
-                irec=irecv(inum4) + (jk -1 ) + jpk * (narea - 1 )
-                READ(inum4,REC=irec) e3v(:,:,jk)
-             END DO
-             irecv(inum4) = irecv(inum4) + jpk * jpnij 
-             
-             DO jk=1,jpk
-                irec=irecv(inum4) + (jk -1 ) + jpk * (narea - 1 )
-                READ(inum4,REC=irec) e3w(:,:,jk)
-             END DO
-             irecv(inum4) = irecv(inum4) + jpk * jpnij 
-             ! 
-             ! 
-             ! gdep
-             irec =  irecv(inum4) + (narea - 1 )
-             READ(inum4,REC=irec) gdept_0(:)
-             irecv(inum4) = irecv(inum4) + jpnij 
-             
-             irec =  irecv(inum4) + (narea - 1 )
-             READ(inum4,REC=irec) gdepw_0(:)
-             irecv(inum4) = irecv(inum4) + jpnij 
-             !
-             ! e3
-             irec =  irecv(inum4) + (narea - 1 )
-             READ(inum4,REC=irec) e3t_0(:)
-             irecv(inum4) = irecv(inum4) + jpnij 
-             
-             irec =  irecv(inum4) + (narea - 1 )
-             READ(inum4,REC=irec) e3w_0(:)
-          ENDIF
-         !                                     ! ============================
-         !                                     !        close the files
-         !                                     ! ============================
-         SELECT CASE ( nmsh )
-            CASE ( 1 )
-               CLOSE ( inum0 )
-            CASE ( 2 )
-               CLOSE ( inum1 )
-               CLOSE ( inum2 )
-            CASE ( 3 )
-               CLOSE ( inum2 )
-               CLOSE ( inum3 )
-               CLOSE ( inum4 )
-         END SELECT
-
-   END SUBROUTINE dom_rea
Index: /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OFF_SRC/dtadyn.F90
===================================================================
--- /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OFF_SRC/dtadyn.F90	(revision 2443)
+++ /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OFF_SRC/dtadyn.F90	(revision 2444)
@@ -2,6 +2,16 @@
    !!======================================================================
    !!                       ***  MODULE  dtadyn  ***
-   !! OFFLINE : interpolation of the physical fields
-   !!=====================================================================
+   !! Off-line : interpolation of the physical fields
+   !!======================================================================
+   !! History :   OPA  ! 1992-01 (M. Imbard) Original code
+   !!             8.0  ! 1998-04 (L.Bopp MA Foujols) slopes for isopyc. 
+   !!              -   ! 1998-05 (L. Bopp) read output of coupled run
+   !!             8.2  ! 2001-01 (M. Levy et M. Benjelloul) add netcdf FORMAT
+   !!   NEMO      1.0  ! 2005-03 (O. Aumont and A. El Moussaoui) F90
+   !!              -   ! 2005-12 (C. Ethe) Adapted for DEGINT
+   !!             3.0  ! 2007-06 (C. Ethe) use of iom module
+   !!              -   ! 2007-09  (C. Ethe)  add swap_dyn_data
+   !!             3.3  ! 2010-11 (C. Ethe) Full reorganization of the off-line: phasing with the on-line
+   !!----------------------------------------------------------------------
 
    !!----------------------------------------------------------------------
@@ -9,91 +19,73 @@
    !!   dta_dyn      : Interpolation of the fields
    !!----------------------------------------------------------------------
-   !! * Modules used
    USE oce             ! ocean dynamics and tracers variables
-   USE dom_oce         ! ocean space and time domain variables
-   USE zdf_oce         ! ocean vertical physics
-   USE in_out_manager  ! I/O manager
+   USE c1d             ! 1D configuration: lk_c1d
+   USE dom_oce         ! ocean domain: variables
+   USE zdf_oce         ! ocean vertical physics: variables
+   USE sbc_oce         ! surface module: variables
    USE phycst          ! physical constants
-   USE sbc_oce
-   USE trabbl
-   USE ldfslp
+   USE trabbl          ! active tracer: bottom boundary layer
+   USE ldfslp          ! lateral diffusion: iso-neutral slopes
    USE ldfeiv          ! eddy induced velocity coef. 
    USE ldftra_oce      ! ocean tracer   lateral physics
-   USE zdfmxl
-   USE eosbn2
-   USE zdfddm          ! vertical  physics: double diffusion
+   USE zdfmxl          ! vertical physics: mixed layer depth
+   USE eosbn2          ! equation of state - Brunt Vaisala frequency
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
-   USE zpshde
+   USE zpshde          ! z-coord. with partial steps: horizontal derivatives
+   USE in_out_manager  ! I/O manager
+   USE iom             ! I/O library
    USE lib_mpp         ! distributed memory computing library
-   USE c1d
 
    IMPLICIT NONE
    PRIVATE
 
-   !! *  Routine accessibility
-   PUBLIC dta_dyn_init   ! called by opa.F90
-   PUBLIC dta_dyn        ! called by step.F90
-
-   LOGICAL , PUBLIC :: &
-      lperdyn = .TRUE. , & ! boolean for periodic fields or not
-      lfirdyn = .TRUE.     ! boolean for the first call or not
-
-   INTEGER , PUBLIC :: &
-      ndtadyn = 73 ,  & ! Number of dat in one year
-      ndtatot = 73 ,  & ! Number of data in the input field
-      nsptint = 1       ! type of spatial interpolation
-
-   CHARACTER(len=45)  ::  &
-      cfile_grid_T = 'dyna_grid_T.nc', &   !: name of the grid_T file
-      cfile_grid_U = 'dyna_grid_U.nc', &   !: name of the grid_U file
-      cfile_grid_V = 'dyna_grid_V.nc', &   !: name of the grid_V file
-      cfile_grid_W = 'dyna_grid_W.nc'      !: name of the grid_W file
+   PUBLIC   dta_dyn_init   ! called by opa.F90
+   PUBLIC   dta_dyn        ! called by step.F90
+
+   LOGICAL, PUBLIC ::   lperdyn = .TRUE.   !: boolean for periodic fields or not
+   LOGICAL, PUBLIC ::   lfirdyn = .TRUE.   !: boolean for the first call or not
+
+   INTEGER, PUBLIC ::   ndtadyn = 73       !: Number of dat in one year
+   INTEGER, PUBLIC ::   ndtatot = 73       !: Number of data in the input field
+   INTEGER, PUBLIC ::   nsptint = 1        !: type of spatial interpolation
+
+   CHARACTER(len=45) ::   cfile_grid_T = 'dyna_grid_T.nc'   ! name of the grid_T file
+   CHARACTER(len=45) ::   cfile_grid_U = 'dyna_grid_U.nc'   ! name of the grid_U file
+   CHARACTER(len=45) ::   cfile_grid_V = 'dyna_grid_V.nc'   ! name of the grid_V file
+   CHARACTER(len=45) ::   cfile_grid_W = 'dyna_grid_W.nc'   ! name of the grid_W file
    
-   REAL(wp)      ::   &
-      rnspdta  ,       &  !: number of time step per 2 consecutives data
-      rnspdta2            !: rnspdta * 0.5
-
-   INTEGER ::     &
-      ndyn1, ndyn2 , &
-      nlecoff = 0  , & ! switch for the first read
-      numfl_t, numfl_u, &
-      numfl_v, numfl_w
-
-   REAL(wp), DIMENSION(jpi,jpj,jpk,2) ::   &
-      tdta   ,   & ! temperature at two consecutive times
-      sdta   ,   & ! salinity at two consecutive times
-      udta   ,   & ! zonal velocity at two consecutive times
-      vdta   ,   & ! meridional velocity at two consecutive times
-      wdta   ,   & ! vertical velocity at two consecutive times
-      avtdta       ! vertical diffusivity coefficient
-
-   REAL(wp), DIMENSION(jpi,jpj,2) ::       &
-      hmlddta,   & ! mixed layer depth at two consecutive times
-      wspddta,   & ! wind speed at two consecutive times
-      frlddta,   & ! sea-ice fraction at two consecutive times
-      empdta ,   & ! E-P at two consecutive times
-      qsrdta       ! short wave heat flux at two consecutive times
-
+   REAL(wp) ::   rnspdta    ! number of time step per 2 consecutives data
+   REAL(wp) ::   rnspdta2   ! rnspdta * 0.5
+
+   INTEGER ::   ndyn1, ndyn2    !
+   INTEGER ::   nlecoff = 0     ! switch for the first read
+   INTEGER ::   numfl_t, numfl_u, numfl_v, numfl_w
+
+   REAL(wp), DIMENSION(jpi,jpj,jpk,2) ::   tdta       ! temperature at two consecutive times
+   REAL(wp), DIMENSION(jpi,jpj,jpk,2) ::   sdta       ! salinity at two consecutive times
+   REAL(wp), DIMENSION(jpi,jpj,jpk,2) ::   udta       ! zonal velocity at two consecutive times
+   REAL(wp), DIMENSION(jpi,jpj,jpk,2) ::   vdta       ! meridional velocity at two consecutive times
+   REAL(wp), DIMENSION(jpi,jpj,jpk,2) ::   wdta       ! vertical velocity at two consecutive times
+   REAL(wp), DIMENSION(jpi,jpj,jpk,2) ::   avtdta     ! vertical diffusivity coefficient
+
+   REAL(wp), DIMENSION(jpi,jpj    ,2) ::   hmlddta    ! mixed layer depth at two consecutive times
+   REAL(wp), DIMENSION(jpi,jpj    ,2) ::   wspddta    ! wind speed at two consecutive times
+   REAL(wp), DIMENSION(jpi,jpj    ,2) ::   frlddta    ! sea-ice fraction at two consecutive times
+   REAL(wp), DIMENSION(jpi,jpj    ,2) ::   empdta     ! E-P at two consecutive times
+   REAL(wp), DIMENSION(jpi,jpj    ,2) ::   qsrdta     ! short wave heat flux at two consecutive times
 #if defined key_ldfslp
-   REAL(wp), DIMENSION(jpi,jpj,jpk,2) ::   &
-      uslpdta ,  & ! zonal isopycnal slopes
-      vslpdta ,  & ! meridional isopycnal slopes
-      wslpidta , & ! zonal diapycnal slopes
-      wslpjdta     ! meridional diapycnal slopes
-#endif
-
+   REAL(wp), DIMENSION(jpi,jpj,jpk,2) ::   uslpdta    ! zonal isopycnal slopes
+   REAL(wp), DIMENSION(jpi,jpj,jpk,2) ::   vslpdta    ! meridional isopycnal slopes
+   REAL(wp), DIMENSION(jpi,jpj,jpk,2) ::   wslpidta   ! zonal diapycnal slopes
+   REAL(wp), DIMENSION(jpi,jpj,jpk,2) ::   wslpjdta   ! meridional diapycnal slopes
+#endif
 #if ! defined key_degrad &&  defined key_traldf_c2d && defined key_traldf_eiv 
-   REAL(wp), DIMENSION(jpi,jpj,2) ::   &
-      aeiwdta      ! G&M coefficient
-#endif
-
+   REAL(wp), DIMENSION(jpi,jpj    ,2) ::   aeiwdta    ! G&M coefficient
+#endif
 #if defined key_degrad
-   REAL(wp), DIMENSION(jpi,jpj,jpk,2) ::   &
-      ahtudta, ahtvdta, ahtwdta  !  Lateral diffusivity
+   REAL(wp), DIMENSION(jpi,jpj,jpk,2) ::   ahtudta, ahtvdta, ahtwdta   ! Lateral diffusivity
 # if defined key_traldf_eiv
-   REAL(wp), DIMENSION(jpi,jpj,jpk,2) ::   &
-      aeiudta, aeivdta, aeiwdta  ! G&M coefficient
+   REAL(wp), DIMENSION(jpi,jpj,jpk,2) ::   aeiudta, aeivdta, aeiwdta   ! G&M coefficient
 # endif
-
 #endif
 
@@ -104,7 +96,6 @@
    !! NEMO/OFF 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -113,37 +104,23 @@
       !!                  ***  ROUTINE dta_dyn  ***
       !!
-      !! ** Purpose : Prepares dynamics and physics fields from an 
-      !!              OPA9 simulation  for an off-line simulation
-      !!               for passive tracer
+      !! ** Purpose :   Prepares dynamics and physics fields from an NEMO run
+      !!              for an off-line simulation of passive tracers
       !!
       !! ** Method : calculates the position of DATA to read READ DATA 
       !!             (example month changement) computes slopes IF needed
       !!             interpolates DATA IF needed
-      !!
-      !! ** History :
-      !!   ! original  : 92-01 (M. Imbard: sub domain)
-      !!   ! addition  : 98-04 (L.Bopp MA Foujols: slopes for isopyc.) 
-      !!   ! addition  : 98-05 (L. Bopp read output of coupled run)
-      !!   ! addition  : 05-03 (O. Aumont and A. El Moussaoui) F90
-      !!   ! addition  : 05-12 (C. Ethe) Adapted for DEGINT
-      !!----------------------------------------------------------------------
-      !! * Arguments
-      INTEGER, INTENT( in ) ::   kt       ! ocean time-step index
-
-      !! * Local declarations
-      INTEGER ::   iper, iperm1, iswap, izt   
-
-      REAL(wp) :: zt
-      REAL(wp) :: zweigh
-      !!----------------------------------------------------------------------
-
-      zt       = ( FLOAT (kt) + rnspdta2 ) / rnspdta
-      izt      = INT( zt )
-      zweigh   = zt - FLOAT( INT(zt) )
-
-      IF( lperdyn ) THEN
-         iperm1 = MOD( izt, ndtadyn )
-      ELSE
-         iperm1 = MOD( izt, ndtatot - 1 ) + 1
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT(in) ::   kt   ! ocean time-step index
+      !!
+      INTEGER  ::   iper, iperm1, iswap, izt   ! local integers 
+      REAL(wp) ::   zt, zweigh                 ! local scalars
+      !!----------------------------------------------------------------------
+
+      zt     = ( REAL(kt,wp) + rnspdta2 ) / rnspdta
+      izt    = INT( zt )
+      zweigh = zt - REAL( INT(zt), wp )
+
+      IF( lperdyn ) THEN   ;   iperm1 = MOD( izt, ndtadyn )
+      ELSE                 ;   iperm1 = MOD( izt, ndtatot - 1 ) + 1
       ENDIF
 
@@ -154,7 +131,6 @@
           ELSE 
               IF( lfirdyn ) THEN 
-                  IF (lwp) WRITE (numout,*) & 
-                      &   ' dynamic file is not periodic with or without interpolation  &
-                      &   we take the first value for the previous period iperm1 = 0  '
+                  IF(lwp) WRITE (numout,*) 'dta_dyn:  dynamic file is not periodic with or without interpolation    &
+                     &                                we take the first value for the previous period iperm1 = 0  '
               END IF
           END IF 
@@ -167,23 +143,21 @@
 
       IF( lfirdyn ) THEN
-         ! store the information of the period read
-         ndyn1 = iperm1
+         ndyn1 = iperm1         ! store the information of the period read
          ndyn2 = iper
          
-         IF (lwp) THEN
-            WRITE (numout,*) ' dynamics data read for the period ndyn1 =',ndyn1, &
-               &             ' and for the period ndyn2 = ',ndyn2
+         IF(lwp) THEN
+            WRITE (numout,*) ' dynamics data read for the period ndyn1 =', ndyn1,   &
+               &             ' and for the period ndyn2 = ', ndyn2
             WRITE (numout,*) ' time step is : ', kt
-            WRITE (numout,*) ' we have ndtadyn = ',ndtadyn,' records in the dynamic file for one year'
+            WRITE (numout,*) ' we have ndtadyn = ', ndtadyn, ' records in the dynamic file for one year'
          END IF
          !
-         IF( iperm1 /= 0 ) THEN         ! data read for the iperm1 period
-            CALL dynrea( kt, iperm1 ) 
-         ELSE 
-            CALL dynrea( kt, 1 )
-         ENDIF
+!!gm simplier:                        CALL dynrea( kt, MAX( 1, iperm1) )
+           CALL dynrea( kt, MAX( 1, iperm1) )
+!!         IF( iperm1 /= 0 ) THEN   ;   CALL dynrea( kt, iperm1 )      ! data read for the iperm1 period
+!!         ELSE                     ;   CALL dynrea( kt, 1      )
+!!         ENDIF
          
-         IF( lk_ldfslp .AND. .NOT. lk_c1d ) THEN
-            ! Computes slopes. Caution : here tsn and avt are used as workspace
+         IF( lk_ldfslp .AND. .NOT. lk_c1d ) THEN      ! Computes slopes (here tsn and avt are used as workspace)
             tsn (:,:,:,jp_tem) = tdta  (:,:,:,2)
             tsn (:,:,:,jp_sal) = sdta  (:,:,:,2)
@@ -195,6 +169,6 @@
                &   CALL zps_hde( kt, jpts, tsn, gtsu, gtsv,  &  ! Partial steps: before Horizontal DErivative
                &                           rhd, gru , grv   )    ! of t, s, rd at the bottom ocean level
-                   CALL zdf_mxl( kt )              ! mixed layer depth
-                   CALL ldf_slp( kt, rhd, rn2 )
+            CALL zdf_mxl( kt )           ! mixed layer depth
+            CALL ldf_slp( kt, rhd, rn2 )
          
             uslpdta (:,:,:,2) = uslp (:,:,:)
@@ -203,26 +177,23 @@
             wslpjdta(:,:,:,2) = wslpj(:,:,:)
          END IF
-         
-         ! swap from record 2 to 1
-         CALL swap_dyn_data
-         
+         !
+         CALL swap_dyn_data            ! swap from record 2 to 1
+         !
          iswap = 1        !  indicates swap
-         
-         CALL dynrea( kt, iper )    ! data read for the iper period
-         
-         IF( lk_ldfslp .AND. .NOT. lk_c1d ) THEN
-            ! Computes slopes. Caution : here tsn and avt are used as workspace
+         !
+         CALL dynrea( kt, iper )       ! data read for the iper period
+         !
+         IF( lk_ldfslp .AND. .NOT. lk_c1d ) THEN      ! Computes slopes (here tsn and avt are used as workspace)
             tsn (:,:,:,jp_tem) = tdta  (:,:,:,2)
             tsn (:,:,:,jp_sal) = sdta  (:,:,:,2)
             avt(:,:,:)         = avtdta(:,:,:,2)
-         
-            CALL eos( tsn, rhd, rhop )   ! Time-filtered in situ density 
-            CALL bn2( tsn, rn2 )         ! before Brunt-Vaisala frequency
-            IF( ln_zps )   &
-               &   CALL zps_hde( kt, jpts, tsn, gtsu, gtsv,  &  ! Partial steps: before Horizontal DErivative
-               &                           rhd, gru , grv   )    ! of t, s, rd at the bottom ocean level
-                   CALL zdf_mxl( kt )              ! mixed layer depth
-                   CALL ldf_slp( kt, rhd, rn2 )
-
+            !
+                           CALL eos( tsn, rhd, rhop )                   ! now in situ density 
+                           CALL bn2( tsn, rn2 )                         ! now Brunt-Vaisala frequency
+            IF( ln_zps )   CALL zps_hde( kt, jpts, tsn, gtsu, gtsv,  &  ! Partial steps: before Horizontal DErivative
+               &                                   rhd, gru , grv   )   ! of t, s, rd at the bottom ocean level
+                           CALL zdf_mxl( kt )                           ! mixed layer depth
+                           CALL ldf_slp( kt, rhd, rn2 )                 ! slope of iso-neutral surfaces
+            !
             uslpdta (:,:,:,2) = uslp (:,:,:)
             vslpdta (:,:,:,2) = vslp (:,:,:)
@@ -231,5 +202,5 @@
          END IF
          !
-         lfirdyn=.FALSE.    ! trace the first call
+         lfirdyn = .FALSE.    ! trace the first call
       ENDIF
       !
@@ -238,7 +209,7 @@
       !
       IF( iperm1 /= ndyn1 ) THEN 
-
-         IF( iperm1 == 0. ) THEN
-            IF (lwp) THEN
+         !
+         IF( iperm1 == 0 ) THEN
+            IF(lwp) THEN
                WRITE (numout,*) ' dynamic file is not periodic with periodic interpolation'
                WRITE (numout,*) ' we take the last value for the last period '
@@ -249,26 +220,23 @@
          ENDIF
          !
-         ! We have to prepare a new read of data : swap from record 2 to 1
-         !
-         CALL swap_dyn_data
-
-         iswap = 1        !  indicates swap
-         
+         CALL swap_dyn_data         ! We have to prepare a new read of data : swap from record 2 to 1
+         !
+         iswap = 1                  !  indicates swap
+         !
          CALL dynrea( kt, iper )    ! data read for the iper period
-
+         !
          IF( lk_ldfslp .AND. .NOT. lk_c1d ) THEN
             ! Computes slopes. Caution : here tsn and avt are used as workspace
-            tsn (:,:,:,jp_tem) = tdta  (:,:,:,2)
-            tsn (:,:,:,jp_sal) = sdta  (:,:,:,2)
-            avt(:,:,:)         = avtdta(:,:,:,2)
-         
-            CALL eos( tsn, rhd, rhop )   ! Time-filtered in situ density 
-            CALL bn2( tsn, rn2 )         ! before Brunt-Vaisala frequency
-            IF( ln_zps )   &
-               &   CALL zps_hde( kt, jpts, tsn, gtsu, gtsv,  &  ! Partial steps: before Horizontal DErivative
-               &                           rhd, gru , grv   )    ! of t, s, rd at the bottom ocean level
-                   CALL zdf_mxl( kt )              ! mixed layer depth
-                   CALL ldf_slp( kt, rhd, rn2 )
-
+            tsn(:,:,:,jp_tem) = tdta  (:,:,:,2)
+            tsn(:,:,:,jp_sal) = sdta  (:,:,:,2)
+            avt(:,:,:)        = avtdta(:,:,:,2)
+            !
+                           CALL eos( tsn, rhd, rhop )                   ! now in situ density 
+                           CALL bn2( tsn, rn2 )                         ! now Brunt-Vaisala frequency
+            IF( ln_zps )   CALL zps_hde( kt, jpts, tsn, gtsu, gtsv,  &  ! Partial steps: before Horizontal DErivative
+               &                                   rhd, gru , grv   )   ! of t, s, rd at the bottom ocean level
+            CALL zdf_mxl( kt )                                          ! mixed layer depth
+            CALL ldf_slp( kt, rhd, rn2 )                                ! slope of iso-neutral surfaces
+            !
             uslpdta (:,:,:,2) = uslp (:,:,:)
             vslpdta (:,:,:,2) = vslp (:,:,:)
@@ -276,12 +244,11 @@
             wslpjdta(:,:,:,2) = wslpj(:,:,:)
          END IF
-       
-         ! store the information of the period read
-         ndyn1 = ndyn2
+         !
+         ndyn1 = ndyn2         ! store the information of the period read
          ndyn2 = iper
-
-         IF (lwp) THEN
-            WRITE (numout,*) ' dynamics data read for the period ndyn1 =',ndyn1, &
-               &             ' and for the period ndyn2 = ',ndyn2
+         !
+         IF(lwp) THEN
+            WRITE (numout,*) ' dynamics data read for the period ndyn1 =', ndyn1,   &
+               &             ' and for the period ndyn2 = ', ndyn2
             WRITE (numout,*) ' time step is : ', kt
          END IF
@@ -292,32 +259,28 @@
       !----------------------------------------     
 
-      IF( nsptint == 0 ) THEN   
-         ! No spatial interpolation, data are probably correct
-         ! We have to initialize data if we have changed the period         
-         CALL assign_dyn_data          
-      ELSE IF( nsptint == 1 ) THEN
-         ! linear interpolation
+      IF( nsptint == 0 ) THEN          ! No space interpolation, data are probably correct
+         !                             ! We have to initialize data if we have changed the period         
+         CALL assign_dyn_data
+      ELSEIF( nsptint == 1 ) THEN      ! linear interpolation
          CALL linear_interp_dyn_data( zweigh )
-      ELSE 
-         ! other interpolation
+      ELSE                             ! other interpolation
          WRITE (numout,*) ' this kind of interpolation do not exist at the moment : we stop'
          STOP 'dtadyn'         
       END IF
-      
-      ! In any case, we need rhop
-      CALL eos( tsn, rhd, rhop ) 
-      
+      !
+      CALL eos( tsn, rhd, rhop )       ! In any case, we need rhop
+      !
 #if ! defined key_degrad && defined key_traldf_c2d
-      ! In case of 2D varying coefficients, we need aeiv and aeiu
+      !                                ! In case of 2D varying coefficients, we need aeiv and aeiu
       IF( lk_traldf_eiv )   CALL dta_eiv( kt )      ! eddy induced velocity coefficient
 #endif
-
-      ! Compute bbl coefficients if needed
-      IF( lk_trabbl .AND. .NOT. lk_c1d ) THEN
+      !
+      IF( lk_trabbl .AND. .NOT. lk_c1d ) THEN       ! Compute bbl coefficients if needed
          tsb(:,:,:,:) = tsn(:,:,:,:)
          CALL bbl( kt, 'TRC')
       END IF
-   
+      !
    END SUBROUTINE dta_dyn
+
 
    SUBROUTINE dynrea( kt, kenr )
@@ -327,42 +290,22 @@
       !! ** Purpose : READ dynamics fiels from OPA9 netcdf output
       !! 
-      !! ** Method : READ the kenr records of DATA and store in
-      !!             in udta(...,2), ....  
-      !! 
-      !! ** History : additions : M. Levy et M. Benjelloul jan 2001 
-      !!              (netcdf FORMAT) 
-      !!              05-03 (O. Aumont and A. El Moussaoui) F90
-      !!              06-07 : (C. Ethe) use of iom module
-      !!----------------------------------------------------------------------
-      !! * Modules used
-      USE iom
-
-      !! * Arguments
-      INTEGER, INTENT( in ) ::   kt, kenr       ! time index
-      !! * Local declarations
+      !! ** Method : READ the kenr records of DATA and store in udta(...,2), ....  
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT(in) ::   kt, kenr   ! time index
+      !!
       INTEGER ::  jkenr
-
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   &
-        zu, zv, zw, zt, zs, zavt ,   &     ! 3-D dynamical fields
-        zhdiv                              ! horizontal divergence
-
-      REAL(wp), DIMENSION(jpi,jpj) :: &
-         zemp, zqsr, zmld, zice, zwspd, &
-         ztaux, ztauy
-
+      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zu, zv, zw, zt, zs, zavt , zhdiv              ! 3D workspace
+      REAL(wp), DIMENSION(jpi,jpj)     ::   zemp, zqsr, zmld, zice, zwspd, ztaux, ztauy   ! 2D workspace
 #if ! defined key_degrad && defined key_traldf_c2d && defined key_traldf_eiv
       REAL(wp), DIMENSION(jpi,jpj) :: zaeiw 
 #endif
-
 #if defined key_degrad
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   &
-      zahtu, zahtv, zahtw  !  Lateral diffusivity
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zahtu, zahtv, zahtw  !  Lateral diffusivity
 # if defined key_traldf_eiv
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   &
-      zaeiu, zaeiv, zaeiw  ! G&M coefficient
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zaeiu, zaeiv, zaeiw  ! G&M coefficient
 # endif
 #endif
-
-      !---------------------------------------------------------------
+      !!----------------------------------------------------------------------
+
       ! 0. Initialization
       
@@ -374,6 +317,6 @@
       IF(lwp) THEN
          WRITE(numout,*)
-         WRITE(numout,*) 'Dynrea : reading dynamical fields, kenr = ', jkenr
-         WRITE(numout,*) ' ~~~~~~~'
+         WRITE(numout,*) 'Dynrea : read dynamical fields, kenr = ', jkenr
+         WRITE(numout,*) '~~~~~~~'
 #if defined key_degrad
          WRITE(numout,*) ' Degraded fields'
@@ -415,9 +358,9 @@
       CALL wzv( zu, zv, zw, zhdiv )
 
-# if defined key_zdfddm
-      CALL iom_get( numfl_w, jpdom_data, 'voddmavs', zavt (:,:,:), jkenr )
-#else
-      CALL iom_get( numfl_w, jpdom_data, 'votkeavt', zavt (:,:,:), jkenr )
-#endif 
+      IF( iom_varid( numfl_w, 'voddmavs', ldstop = .FALSE. ) > 0 ) THEN          ! avs exist: it is used
+         CALL iom_get( numfl_w, jpdom_data, 'voddmavs', zavt (:,:,:), jkenr )
+      ELSE                                                                       ! no avs: use avt
+         CALL iom_get( numfl_w, jpdom_data, 'votkeavt', zavt (:,:,:), jkenr )
+      ENDIF
 
 #if ! defined key_degrad && defined key_traldf_c2d && defined key_traldf_eiv 
@@ -473,7 +416,8 @@
          CALL iom_close ( numfl_w )
       ENDIF
-      
+      !      
    END SUBROUTINE dynrea
 
+
    SUBROUTINE dta_dyn_init
       !!----------------------------------------------------------------------
@@ -483,17 +427,7 @@
       !!
       !! ** Method :
-      !!
-      !! History :
-      !!    ! original  : 92-01 (M. Imbard: sub domain)
-      !!    ! 98-04 (L.Bopp MA Foujols: slopes for isopyc.)
-      !!    ! 98-05 (L. Bopp read output of coupled run)
-      !!    ! 05-03 (O. Aumont and A. El Moussaoui) F90
-      !!----------------------------------------------------------------------
-      !! * Modules used
-
-      !! * Local declarations
-
+      !!----------------------------------------------------------------------
       REAL(wp) ::   znspyr   !: number of time step per year
-
+      !!
       NAMELIST/namdyn/ ndtadyn, ndtatot, nsptint, lperdyn,  &
       &                cfile_grid_T, cfile_grid_U, cfile_grid_V, cfile_grid_W
@@ -503,9 +437,8 @@
       ! ======================================
 
-      ! Read Namelist namdyn : Lateral physics on tracers
-      REWIND( numnam )
+      REWIND( numnam )              ! Read Namelist namdyn : Lateral physics on tracers
       READ  ( numnam, namdyn )
 
-      IF(lwp) THEN
+      IF(lwp) THEN                  ! control print
          WRITE(numout,*)
          WRITE(numout,*) 'namdyn : offline dynamical selection'
@@ -524,13 +457,14 @@
          WRITE(numout,*) ' '
       ENDIF
-
+      !
       znspyr   = nyear_len(1) * rday / rdt  
       rnspdta  = znspyr / FLOAT( ndtadyn )
       rnspdta2 = rnspdta * 0.5 
-
+      !
       CALL dta_dyn( nit000 )
-
+      !
    END SUBROUTINE dta_dyn_init
 
+
    SUBROUTINE wzv( pu, pv, pw, phdiv )
       !!----------------------------------------------------------------------
@@ -539,29 +473,20 @@
       !! ** Purpose :   Compute the now vertical velocity after the array swap
       !!
-      !! ** Method  :
-      !! ** Method  : - Divergence:
-      !!      - compute the now divergence given by :
-      !!         * z-coordinate
+      !! ** Method  : - compute the now divergence given by :
+      !!         * z-coordinate ONLY !!!!
       !!         hdiv = 1/(e1t*e2t) [ di(e2u  u) + dj(e1v  v) ]
       !!     - Using the incompressibility hypothesis, the vertical
       !!      velocity is computed by integrating the horizontal divergence
       !!      from the bottom to the surface.
-      !!        The boundary conditions are w=0 at the bottom (no flux) and,
-      !!      in regid-lid case, w=0 at the sea surface.
-      !!
-      !!
-      !! History :
-      !!   9.0  !  02-07  (G. Madec)  Vector optimization
-      !!----------------------------------------------------------------------
-      !! * Arguments
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( in  )   :: pu, pv    !:  horizontal velocities
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( out )   :: pw        !:  verticla velocity
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( inout ) :: phdiv     !:  horizontal divergence
-
-      !! * Local declarations
+      !!        The boundary conditions are w=0 at the bottom (no flux).
+      !!----------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in   ) :: pu, pv    !:  horizontal velocities
+      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(  out) :: pw        !:  verticla velocity
+      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: phdiv     !:  horizontal divergence
+      !!
       INTEGER  ::  ji, jj, jk
       REAL(wp) ::  zu, zu1, zv, zv1, zet
-
-
+      !!----------------------------------------------------------------------
+      !
       ! Computation of vertical velocity using horizontal divergence
       phdiv(:,:,:) = 0.
@@ -577,17 +502,15 @@
             END DO
          END DO
-      ENDDO
-
-      ! Lateral boundary conditions on phdiv
-      CALL lbc_lnk( phdiv, 'T', 1. )
-
-
+      END DO
+      CALL lbc_lnk( phdiv, 'T', 1. )      ! Lateral boundary conditions on phdiv
+      !
       ! computation of vertical velocity from the bottom
-      pw(:,:,jpk) = 0.
+      pw(:,:,jpk) = 0._wp
       DO jk = jpkm1, 1, -1
          pw(:,:,jk) = pw(:,:,jk+1) - fse3t(:,:,jk) * phdiv(:,:,jk)
       END DO
-
+      !
    END SUBROUTINE wzv
+
 
    SUBROUTINE dta_eiv( kt )
@@ -600,15 +523,10 @@
       !! ** Method : Specific to the offline model. Computes the horizontal
       !!             values from the vertical value
-      !!
-      !! History :
-      !!   9.0  !  06-03  (O. Aumont)  Free form, F90
-      !!----------------------------------------------------------------------
-      !! * Arguments
+      !!----------------------------------------------------------------------
       INTEGER, INTENT( in ) ::   kt     ! ocean time-step inedx
-
-      !! * Local declarations
+      !!
       INTEGER ::   ji, jj           ! dummy loop indices
       !!----------------------------------------------------------------------
-
+      !
       IF( kt == nit000 ) THEN
          IF(lwp) WRITE(numout,*)
@@ -616,5 +534,5 @@
          IF(lwp) WRITE(numout,*) '~~~~~~~'
       ENDIF
-
+      !
       ! Average the diffusive coefficient at u- v- points
       DO jj = 2, jpjm1
@@ -624,10 +542,8 @@
          END DO
       END DO
-
-      ! lateral boundary condition on aeiu, aeiv
-      CALL lbc_lnk( aeiu, 'U', 1. )
-      CALL lbc_lnk( aeiv, 'V', 1. )
-
+      CALL lbc_lnk( aeiu, 'U', 1. )   ;   CALL lbc_lnk( aeiv, 'V', 1. )    ! lateral boundary condition
+      !
    END SUBROUTINE dta_eiv
+
 
    SUBROUTINE tau2wnd( ptaux, ptauy, pwspd )
@@ -639,13 +555,11 @@
       !! ** Method  : |tau|=rhoa*Cd*|U|^2
       !!---------------------------------------------------------------------
-      !! * Arguments
-      REAL(wp), DIMENSION(jpi,jpj), INTENT( in  ) ::  &
-         ptaux, ptauy                              !: wind stress in i-j direction resp.
-      REAL(wp), DIMENSION(jpi,jpj), INTENT( out ) ::  &
-         pwspd                                     !: wind speed 
-      REAL(wp) ::   zrhoa  = 1.22         ! Air density kg/m3
-      REAL(wp) ::   zcdrag = 1.5e-3       ! drag coefficient
-      REAL(wp) ::   ztx, zty, ztau, zcoef ! temporary variables
-      INTEGER  ::   ji, jj                ! dummy indices
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) ::   ptaux, ptauy   ! wind stress in i-j direction resp.
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(  out) ::   pwspd          ! wind speed
+      !! 
+      REAL(wp) ::   zrhoa  = 1.22_wp       ! Air density kg/m3
+      REAL(wp) ::   zcdrag = 1.5e-3_wp     ! drag coefficient
+      REAL(wp) ::   ztx, zty, ztau, zcoef  ! temporary variables
+      INTEGER  ::   ji, jj                 ! dummy indices
       !!---------------------------------------------------------------------
       zcoef = 1. / ( zrhoa * zcdrag )
@@ -661,7 +575,8 @@
       END DO
       CALL lbc_lnk( pwspd(:,:), 'T', 1. )
-
+      !
    END SUBROUTINE tau2wnd
 
+
    SUBROUTINE swap_dyn_data
       !!----------------------------------------------------------------------
@@ -669,10 +584,6 @@
       !!
       !! ** Purpose :   swap array data
-      !!
-      !! History :
-      !!   9.0  !  07-09  (C. Ethe)
-      !!----------------------------------------------------------------------
-
-
+      !!----------------------------------------------------------------------
+      !
       ! swap from record 2 to 1
       tdta   (:,:,:,1) = tdta   (:,:,:,2)
@@ -709,6 +620,7 @@
 #  endif
 #endif
-
+      !
    END SUBROUTINE swap_dyn_data
+
 
    SUBROUTINE assign_dyn_data
@@ -728,9 +640,4 @@
       vn (:,:,:) = vdta  (:,:,:,2)
       wn (:,:,:) = wdta  (:,:,:,2)
-
-#if defined key_zdfddm
-      avs(:,:,:)   = avtdta (:,:,:,2)
-#endif
-
       
 #if defined key_ldfslp && ! defined key_c1d
@@ -761,20 +668,17 @@
       aeiw(:,:,:) = aeiwdta(:,:,:,2)
 #  endif
-      
-#endif
-      
+#endif
+      !
    END SUBROUTINE assign_dyn_data
 
+
    SUBROUTINE linear_interp_dyn_data( pweigh )
       !!----------------------------------------------------------------------
-      !!                    ***  ROUTINE linear_interp_dyn_data  ***
+      !!               ***  ROUTINE linear_interp_dyn_data  ***
       !!
       !! ** Purpose :   linear interpolation of data
-      !!
-      !!----------------------------------------------------------------------
-      !! * Argument
-      REAL(wp), INTENT( in ) ::   pweigh       ! weigh
-
-      !! * Local declarations
+      !!----------------------------------------------------------------------
+      REAL(wp), INTENT(in) ::   pweigh   ! weigh
+      !!
       REAL(wp) :: zweighm1
       !!----------------------------------------------------------------------
@@ -789,9 +693,4 @@
       vn (:,:,:) = zweighm1 * vdta  (:,:,:,1) + pweigh * vdta  (:,:,:,2)
       wn (:,:,:) = zweighm1 * wdta  (:,:,:,1) + pweigh * wdta  (:,:,:,2)
-
-#if defined key_zdfddm
-      avs(:,:,:)   = zweighm1 * avtdta (:,:,:,1) + pweigh * avtdta (:,:,:,2)
-#endif
-
       
 #if defined key_ldfslp && ! defined key_c1d
@@ -823,6 +722,7 @@
 #  endif
 #endif
-      
+      !      
    END SUBROUTINE linear_interp_dyn_data
 
+   !!======================================================================
 END MODULE dtadyn
Index: /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OFF_SRC/istate.F90
===================================================================
--- /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OFF_SRC/istate.F90	(revision 2443)
+++ /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OFF_SRC/istate.F90	(revision 2444)
@@ -2,23 +2,19 @@
    !!======================================================================
    !!                     ***  MODULE  istate  ***
-   !! Ocean state   :  initial state setting
+   !! Ocean state   :  initial state setting, off-line case
    !!=====================================================================
+   !! History :  3.3  ! 2010-10  (C. Ethe)  original code
+   !!----------------------------------------------------------------------
 
    !!----------------------------------------------------------------------
-   !!   istate_init   : initial state setting
+   !!   istate_init   : initial state set to zero
    !!----------------------------------------------------------------------
-   !! * Modules used
    USE oce             ! ocean dynamics and active tracers 
    USE dom_oce         ! ocean space and time domain 
-   USE ldftra_oce      ! ocean active tracers: lateral physics
-   USE zdf_oce         ! ocean vertical physics
-   USE in_out_manager  ! I/O manager
-   USE phycst          ! physical constants
 
    IMPLICIT NONE
    PRIVATE
 
-   !! * Routine accessibility
-   PUBLIC istate_init   ! routine called by step.F90
+   PUBLIC   istate_init   ! routine called by step.F90
 
    !! * Substitutions
@@ -28,7 +24,6 @@
    !! NEMO/OFF 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!---------------------------------------------------------------------
 CONTAINS
 
@@ -37,33 +32,18 @@
       !!                   ***  ROUTINE istate_init  ***
       !! 
-      !! ** Purpose :   Initialization of the dynamics and tracers.
-      !!
-      !! ** Method  :
-      !!
-      !! History :
-      !!   4.0  !  91-03  ()  Original code
-      !!        !  91-11  (G. Madec)
-      !!   9.0  !  03-09  (G. Madec)  F90: Free form, modules, orthogonality
+      !! ** Purpose :   Initialization to zero of the dynamics and tracers.
       !!----------------------------------------------------------------------
-      !! * Local declarations
-      !!----------------------------------------------------------------------
-
-
-      ! Initialization to zero
-      ! ----------------------
-
-      !     before fields       !       now fields        !      after fields       !
-      ;   un   (:,:,:) = 0.e0   ;   ua   (:,:,:) = 0.e0
-      ;   vn   (:,:,:) = 0.e0   ;   va   (:,:,:) = 0.e0
-      ;                         ;   wn   (:,:,:) = 0.e0   
-      ;   hdivn(:,:,:) = 0.e0   ;
-
-      ;   tsn  (:,:,:,:) = 0.e0 
-
+      !
+      !     now fields         !     after fields      !
+      un   (:,:,:)   = 0._wp   ;   ua(:,:,:) = 0._wp   !
+      vn   (:,:,:)   = 0._wp   ;   va(:,:,:) = 0._wp   !
+      wn   (:,:,:)   = 0._wp   !                       !
+      hdivn(:,:,:)   = 0._wp   !                       !
+      tsn  (:,:,:,:) = 0._wp   !                       !
+      !
       rhd  (:,:,:) = 0.e0
       rhop (:,:,:) = 0.e0
       rn2  (:,:,:) = 0.e0 
-
-
+      !
    END SUBROUTINE istate_init
 
Index: /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OFF_SRC/opa.F90
===================================================================
--- /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OFF_SRC/opa.F90	(revision 2443)
+++ /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OFF_SRC/opa.F90	(revision 2444)
@@ -1,24 +1,24 @@
 MODULE opa
-   !!==============================================================================
+   !!======================================================================
    !!                       ***  MODULE opa   ***
-   !! Ocean system   : OPA ocean dynamics (including on-line tracers and sea-ice)
-   !!==============================================================================
-
-   !!----------------------------------------------------------------------
-   !!   opa_model      : solve ocean dynamics, tracer and/or sea-ice
-   !!----------------------------------------------------------------------
-   !! * Modules used
+   !! Off-line Ocean   : passive tracer evolution, dynamics read in files
+   !!======================================================================
+   !! History :  3.3  ! 2010-05  (C. Ethe)  Full reorganization of the off-line: phasing with the on-line
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   opa_model      : off-line: solve ocean tracer only
+   !!   opa_init       : initialization of the opa model
+   !!   opa_ctl        : initialisation of algorithm flag 
+   !!   opa_closefile  : close remaining files
+   !!----------------------------------------------------------------------
    USE dom_oce         ! ocean space domain variables
    USE oce             ! dynamics and tracers variables
-   USE in_out_manager  ! I/O manager
-   USE lib_mpp         ! distributed memory computing
-
+   USE c1d             ! 1D configuration
    USE domcfg          ! domain configuration               (dom_cfg routine)
-   USE mppini          ! shared/distributed memory setting (mpp_init routine)
    USE domain          ! domain initialization             (dom_init routine)
    USE istate          ! initial state setting          (istate_init routine)
    USE eosbn2          ! equation of state            (eos bn2 routine)
-
-   ! ocean physics
+   !              ! ocean physics
    USE ldftra          ! lateral diffusivity setting    (ldf_tra_init routine)
    USE ldfslp          ! slopes of neutral surfaces     (ldf_slp_init routine)
@@ -26,20 +26,17 @@
    USE trabbl          ! bottom boundary layer          (tra_bbl_init routine)
    USE zpshde          ! partial step: hor. derivative  (zps_hde_init routine)
-   USE zdfini
-   USE zdfddm
-   USE zdfkpp
-
+   USE zdfini          ! vertical physics: initialization
    USE phycst          ! physical constant                  (par_cst routine)
    USE dtadyn          ! Lecture and Interpolation of the dynamical fields
    USE trcini          ! Initilization of the passive tracers
-   USE stpctl
    USE daymod          ! calendar                         (day     routine)
    USE trcstp          ! passive tracer time-stepping      (trc_stp routine)
    USE dtadyn          ! Lecture and interpolation of the dynamical fields
    USE stpctl          ! time stepping control            (stp_ctl routine)
-
-   USE c1d             ! 1D configuration
-
-   USE iom
+   !              ! I/O & MPP
+   USE iom             ! I/O library
+   USE in_out_manager  ! I/O manager
+   USE mppini          ! shared/distributed memory setting (mpp_init routine)
+   USE lib_mpp         ! distributed memory computing
 #if defined key_iomput
    USE  mod_ioclient
@@ -48,18 +45,14 @@
    IMPLICIT NONE
    PRIVATE
-
-   !! * Module variables
-   CHARACTER (len=64) ::        &
-      cform_aaa="( /, 'AAAAAAAA', / ) "     ! flag for output listing
-
-   !! * Routine accessibility
-   PUBLIC opa_model      ! called by model.F90
-   PUBLIC opa_init
+   
+   PUBLIC   opa_model   ! called by model.F90
+
+   CHARACTER (len=64) ::   cform_aaa="( /, 'AAAAAAAA', / ) "   ! flag for output listing
+
    !!----------------------------------------------------------------------
    !! NEMO/OFF 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -72,9 +65,9 @@
       !!
       !! ** Method  : - model general initialization
-      !!              - launch the time-stepping (stp routine)
-      !!
-      !! References :
-      !!      Madec, Delecluse,Imbard, and Levy, 1997: reference manual.
-      !!              internal report, IPSL.
+      !!              - launch the time-stepping (dta_dyn and trc_stp)
+      !!              - finalize the run by closing files and communications
+      !!
+      !! References : Madec, Delecluse,Imbard, and Levy, 1997:  internal report, IPSL.
+      !!              Madec, 2008, internal report, IPSL.
       !!----------------------------------------------------------------------
       INTEGER :: istp, indic       ! time step index
@@ -89,21 +82,24 @@
       IF( lk_mpp )   CALL mpp_max( nstop )
 
+      !                            !-----------------------!
+      !                            !==   time stepping   ==!
+      !                            !-----------------------!
       istp = nit000
          !
-      DO WHILE ( istp <= nitend .AND. nstop == 0 )
-         !
-         IF( istp /= nit000 )   CALL day      ( istp )   ! Calendar (day was already called at nit000 in day_init)
-                                CALL iom_setkt( istp )   ! say to iom that we are at time step kstp
-                                CALL dta_dyn  ( istp )   ! Interpolation of the dynamical fields
-                                CALL trc_stp  ( istp )   ! time-stepping
-                                CALL stp_ctl  ( istp, indic )   ! Time loop: control and print
+      DO WHILE ( istp <= nitend .AND. nstop == 0 )    ! time stepping
+         !
+         IF( istp /= nit000 )   CALL day      ( istp )         ! Calendar (day was already called at nit000 in day_init)
+                                CALL iom_setkt( istp )         ! say to iom that we are at time step kstp
+                                CALL dta_dyn  ( istp )         ! Interpolation of the dynamical fields
+                                CALL trc_stp  ( istp )         ! time-stepping
+                                CALL stp_ctl  ( istp, indic )  ! Time loop: control and print
          istp = istp + 1
          IF( lk_mpp )   CALL mpp_max( nstop )
       END DO
-      !                                     ! ========= !
-      !                                     !  Job end  !
-      !                                     ! ========= !
-
-      IF(lwp) WRITE(numout,cform_aaa)       ! Flag AAAAAAA
+
+      !                            !------------------------!
+      !                            !==  finalize the run  ==!
+      !                            !------------------------!
+      IF(lwp) WRITE(numout,cform_aaa)                 ! Flag AAAAAAA
 
       IF( nstop /= 0 .AND. lwp ) THEN                 ! error print
@@ -111,7 +107,7 @@
          WRITE(numout,*) nstop, ' error have been found'
       ENDIF
-
+      !
       CALL opa_closefile
-
+      !
       IF( lk_mpp )   CALL mppstop                          ! Close all files (mpp)
       !
@@ -123,42 +119,13 @@
       !!                     ***  ROUTINE opa_init ***
       !!
-      !! ** Purpose :   opa solves the primitive equations on an orthogonal 
-      !!      curvilinear mesh on the sphere.
-      !!
-      !! ** Method  : - model general initialization
-      !!
-      !! References :
-      !!      Madec, Delecluse,Imbard, and Levy, 1997: reference manual.
-      !!              internal report, IPSL.
-      !!
-      !! History :
-      !!   4.0  !  90-10  (C. Levy, G. Madec)  Original code
-      !!   7.0  !  91-11  (M. Imbard, C. Levy, G. Madec)
-      !!   7.1  !  93-03  (M. Imbard, C. Levy, G. Madec, O. Marti,
-      !!                   M. Guyon, A. Lazar, P. Delecluse, C. Perigaud,
-      !!                   G. Caniaux, B. Colot, C. Maes ) release 7.1 
-      !!        !  92-06  (L.Terray) coupling implementation
-      !!        !  93-11  (M.A. Filiberti) IGLOO sea-ice 
-      !!   8.0  !  96-03  (M. Imbard, C. Levy, G. Madec, O. Marti,
-      !!                   M. Guyon, A. Lazar, P. Delecluse, L.Terray,
-      !!                   M.A. Filiberti, J. Vialar, A.M. Treguier,
-      !!                   M. Levy)  release 8.0
-      !!   8.1  !  97-06  (M. Imbard, G. Madec)
-      !!   8.2  !  99-11  (M. Imbard, H. Goosse)  LIM sea-ice model 
-      !!        !  99-12  (V. Thierry, A-M. Treguier, M. Imbard, M-A. Foujols)  OPEN-MP 
-      !!        !  00-07  (J-M Molines, M. Imbard)  Open Boundary Conditions  (CLIPPER)
-      !!   9.0  !  02-08  (G. Madec)  F90: Free form and modules
-      !!----------------------------------------------------------------------
-      !! * Local declarations
-#if defined key_oasis3 || defined key_oasis4 || defined key_iomput
-      INTEGER :: ilocal_comm
-#endif
-      CHARACTER(len=80),dimension(10) ::   cltxt = ''
-      INTEGER                         ::   ji   ! local loop indices
+      !! ** Purpose :   initialization of the opa model in off-line mode
+      !!----------------------------------------------------------------------
+      INTEGER ::   ji            ! dummy loop indices
+      INTEGER ::   ilocal_comm   ! local integer
+      CHARACTER(len=80), DIMENSION(10) ::   cltxt = ''
       !!
       NAMELIST/namctl/ ln_ctl  , nn_print, nn_ictls, nn_ictle,   &
          &             nn_isplt, nn_jsplt, nn_jctls, nn_jctle, nn_bench
       !!----------------------------------------------------------------------
-
       !
       !                             ! open Namelist file     
@@ -171,19 +138,8 @@
       !                             !--------------------------------------------!
 #if defined key_iomput
-# if defined key_oasis3 || defined key_oasis4   
-      CALL cpl_prism_init( ilocal_comm )      ! nemo local communicator given by oasis
-      CALL init_ioclient()                    ! io_server will get its communicators (if needed) from oasis (we don't see it)
-# else
       CALL init_ioclient( ilocal_comm )       ! nemo local communicator (used or not) given by the io_server
-# endif
       narea = mynode( cltxt, ilocal_comm )    ! Nodes selection
-
 #else
-# if defined key_oasis3 || defined key_oasis4   
-      CALL cpl_prism_init( ilocal_comm )      ! nemo local communicator given by oasis
-      narea = mynode( cltxt, ilocal_comm )    ! Nodes selection (control print return in cltxt)
-# else
       narea = mynode( cltxt )                 ! Nodes selection (control print return in cltxt)
-# endif
 #endif
       narea = narea + 1                       ! mynode return the rank of proc (0 --> jpnij -1 )
@@ -199,5 +155,5 @@
          WRITE(numout,*) '                       NEMO team'
          WRITE(numout,*) '            Ocean General Circulation Model'
-         WRITE(numout,*) '                  version 3.2  (2009) '
+         WRITE(numout,*) '                  version 3.3  (2010) '
          WRITE(numout,*)
          WRITE(numout,*)
@@ -208,22 +164,16 @@
          !
       ENDIF
-
-      CALL opa_flg                          ! Control prints & Benchmark
-
-      !                                     ! ============================== !
-      !                                     !  Model general initialization  !
-      !                                     ! ============================== !
-
-      IF(lwp) WRITE(numout,cform_aaa)       ! Flag AAAAAAA
-
-                                            ! Domain decomposition
-                                            ! Domain decomposition
+      !                             !--------------------------------!
+      !                             !  Model general initialization  !
+      !                             !--------------------------------!
+
+      CALL opa_ctl                           ! Control prints & Benchmark
+
+      !                                      ! Domain decomposition
       IF( jpni*jpnj == jpnij ) THEN   ;   CALL mpp_init      ! standard cutting out
       ELSE                            ;   CALL mpp_init2     ! eliminate land processors
       ENDIF
-
-
-
-      !                                     ! General initialization
+      !
+      !                                      ! General initialization
                             CALL     phy_cst    ! Physical constants
                             CALL     eos_init   ! Equation of state
@@ -235,6 +185,4 @@
 
       !                                     ! Ocean physics
-      IF( lk_zdfddm .AND. .NOT. lk_zdfkpp )   &
-         &                  CALL zdf_ddm_init   ! double diffusive mixing
 #if ! defined key_degrad
                             CALL ldf_tra_init   ! Lateral ocean tracer physics
@@ -253,19 +201,18 @@
 
       IF(lwp) WRITE(numout,cform_aaa)       ! Flag AAAAAAA
-
+      !
    END SUBROUTINE opa_init
 
-   SUBROUTINE opa_flg
-      !!----------------------------------------------------------------------
-      !!                     ***  ROUTINE opa  ***
-      !!
-      !! ** Purpose :   Initialise logical flags that control the choice of
-      !!              some algorithm or control print
-      !!
-      !! ** Method  : - print namctl information
-      !!              - Read in namilist namflg logical flags
-      !!----------------------------------------------------------------------
-
-      IF(lwp) THEN                 ! Parameter print
+
+   SUBROUTINE opa_ctl
+      !!----------------------------------------------------------------------
+      !!                     ***  ROUTINE opa_ctl  ***
+      !!
+      !! ** Purpose :   control print setting 
+      !!
+      !! ** Method  : - print namctl information and check some consistencies
+      !!----------------------------------------------------------------------
+      !
+      IF(lwp) THEN                  ! Parameter print
          WRITE(numout,*)
          WRITE(numout,*) 'opa_flg: Control prints & Benchmark'
@@ -282,5 +229,5 @@
          WRITE(numout,*) '      benchmark parameter (0/1)       nn_bench   = ', nn_bench
       ENDIF
-
+      !
       nprint    = nn_print          ! convert DOCTOR namelist names into OLD names
       nictls    = nn_ictls
@@ -291,5 +238,5 @@
       jsplt     = nn_jsplt
       nbench    = nn_bench
-      !                           ! Parameter control
+      !                             ! Parameter control
       !
       IF( ln_ctl ) THEN                 ! sub-domain area indices for the control prints
@@ -329,5 +276,5 @@
          ENDIF
       ENDIF
-
+      !
       IF( nbench == 1 )   THEN            ! Benchmark 
          SELECT CASE ( cp_cfg )
@@ -338,10 +285,10 @@
       ENDIF
       !
-      IF( lk_c1d .AND. .NOT. lk_iomput )  &
-        CALL ctl_stop( ' The 1D vertical configuration must be used in conjunction',   &
-            &          ' with the IOM Input/Output manager. Compile with key_iomput enabled' )
-      !
-
-   END SUBROUTINE opa_flg
+      IF( lk_c1d .AND. .NOT.lk_iomput )   CALL ctl_stop( 'opa_ctl: The 1D configuration must be used ',   &
+         &                                               'with the IOM Input/Output manager. '        ,   &
+         &                                               'Compile with key_iomput enabled' )
+      !
+   END SUBROUTINE opa_ctl
+
 
    SUBROUTINE opa_closefile
@@ -350,24 +297,15 @@
       !!
       !! ** Purpose :   Close the files
-      !!
-      !! ** Method  :
-      !!
-      !! History :
-      !!   9.0  !  05-01  (O. Le Galloudec)  Original code
-      !!----------------------------------------------------------------------
-      !!----------------------------------------------------------------------
-
+      !!----------------------------------------------------------------------
+      !
       IF ( lk_mpp ) CALL mppsync
-
-      ! 1. Unit close
-      ! -------------
-
-      CLOSE( numnam )           ! namelist
-      CLOSE( numout )           ! standard model output file
-
-      IF(lwp) CLOSE( numstp )   ! time-step file
-
-      CALL iom_close            ! close all input/output files
-
+      !
+      CALL iom_close                                 ! close all input/output files managed by iom_*
+      !
+      IF( numstp     /= -1 )   CLOSE( numstp     )   ! time-step file
+      IF( numnam     /= -1 )   CLOSE( numnam     )   ! oce namelist
+      IF( numout     /=  6 )   CLOSE( numout     )   ! standard model output file
+      numout = 6                                     ! redefine numout in case it is used after this point...
+      !
    END SUBROUTINE opa_closefile
 
Index: /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OFF_SRC/stpctl.F90
===================================================================
--- /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OFF_SRC/stpctl.F90	(revision 2443)
+++ /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OFF_SRC/stpctl.F90	(revision 2444)
@@ -2,5 +2,5 @@
    !!======================================================================
    !!                       ***  MODULE  stpctl  ***
-   !! Ocean run control :  gross check of the ocean time stepping
+   !! Ocean run control :  Off-line case, only save the time step in numstp
    !!======================================================================
    !! History :  OPA  ! 1991-03  (G. Madec) Original code
@@ -23,11 +23,11 @@
    PRIVATE
 
-   PUBLIC stp_ctl           ! routine called by step.F90
+   PUBLIC   stp_ctl    ! routine called by opa.F90
+   
    !!----------------------------------------------------------------------
    !! NEMO/OFF 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -39,13 +39,11 @@
       !!
       !! ** Method  : - Save the time step in numstp
-      !!              - Print it each 50 time steps
       !!
       !! ** Actions :   'time.step' file containing the last ocean time-step
-      !!                
       !!----------------------------------------------------------------------
-      INTEGER, INTENT( in ) ::   kt         ! ocean time-step index
-      INTEGER, INTENT( inout ) ::   kindic  ! indicator of solver convergence
+      INTEGER, INTENT(in   ) ::   kt      ! ocean time-step index
+      INTEGER, INTENT(inout) ::   kindic  ! indicator of solver convergence
       !!----------------------------------------------------------------------
-
+      !
       IF( kt == nit000 .AND. lwp ) THEN
          WRITE(numout,*)
@@ -55,8 +53,7 @@
          CALL ctl_opn( numstp, 'time.step', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea )
       ENDIF
-
+      !
       IF(lwp) WRITE ( numstp, '(1x, i8)' )   kt      !* save the current time step in numstp
       IF(lwp) REWIND( numstp )                       !  --------------------------
-
       !
    END SUBROUTINE stp_ctl
