Index: trunk/NEMOGCM/NEMO/SAS_SRC/daymod.F90
===================================================================
--- trunk/NEMOGCM/NEMO/SAS_SRC/daymod.F90	(revision 5930)
+++ trunk/NEMOGCM/NEMO/SAS_SRC/daymod.F90	(revision 6140)
@@ -20,5 +20,5 @@
    !!
    !!   we suppose that the time step is deviding the number of second of in a day
-   !!             ---> MOD( rday, rdttra(1) ) == 0
+   !!             ---> MOD( rday, rdt ) == 0
    !!
    !!           ----------- WARNING -----------
@@ -76,12 +76,12 @@
             &           'You must do a restart at higher frequency (or remove this stop and recompile the code in I8)' )
       ENDIF
-      ! all calendar staff is based on the fact that MOD( rday, rdttra(1) ) == 0
-      IF( MOD( rday     , rdttra(1) ) /= 0. )   CALL ctl_stop( 'the time step must devide the number of second of in a day' )
-      IF( MOD( rday     , 2.        ) /= 0. )   CALL ctl_stop( 'the number of second of in a day must be an even number'    )
-      IF( MOD( rdttra(1), 2.        ) /= 0. )   CALL ctl_stop( 'the time step (in second) must be an even number'           )
-      nsecd   = NINT(rday           )
-      nsecd05 = NINT(0.5 * rday     )
-      ndt     = NINT(      rdttra(1))
-      ndt05   = NINT(0.5 * rdttra(1))
+      ! all calendar staff is based on the fact that MOD( rday, rdt ) == 0
+      IF( MOD( rday , rdt ) /= 0. )   CALL ctl_stop( 'the time step must devide the number of second of in a day' )
+      IF( MOD( rday , 2.  ) /= 0. )   CALL ctl_stop( 'the number of second of in a day must be an even number'    )
+      IF( MOD( rdt  , 2.  ) /= 0. )   CALL ctl_stop( 'the time step (in second) must be an even number'           )
+      nsecd   = NINT(rday         )
+      nsecd05 = NINT(0.5 * rday   )
+      ndt     = NINT(      rdt    )
+      ndt05   = NINT(0.5 * rdt    )
 
       ! ==> clem: here we read the ocean restart for the date (only if it exists)
@@ -224,6 +224,6 @@
       nsec_week  = nsec_week  + ndt
       nsec_day   = nsec_day   + ndt                
-      adatrj  = adatrj  + rdttra(1) / rday
-      fjulday = fjulday + rdttra(1) / rday
+      adatrj  = adatrj  + rdt / rday
+      fjulday = fjulday + rdt / rday
       IF( ABS(fjulday - REAL(NINT(fjulday),wp)) < zprec )   fjulday = REAL(NINT(fjulday),wp)   ! avoid truncation error
       IF( ABS(adatrj  - REAL(NINT(adatrj ),wp)) < zprec )   adatrj  = REAL(NINT(adatrj ),wp)   ! avoid truncation error
@@ -340,5 +340,5 @@
                ! parameters correspondting to nit000 - 1 (as we start the step loop with a call to day)
                ndastp = ndate0 - 1     ! ndate0 read in the namelist in dom_nam, we assume that we start run at 00:00
-               adatrj = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday
+               adatrj = ( REAL( nit000-1, wp ) * rdt ) / rday
                ! note this is wrong if time step has changed during run
             ENDIF
@@ -346,5 +346,5 @@
             ! parameters correspondting to nit000 - 1 (as we start the step loop with a call to day)
             ndastp = ndate0 - 1        ! ndate0 read in the namelist in dom_nam, we assume that we start run at 00:00
-            adatrj = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday
+            adatrj = ( REAL( nit000-1, wp ) * rdt ) / rday
          ENDIF
          IF( ABS(adatrj  - REAL(NINT(adatrj),wp)) < 0.1 / rday )   adatrj = REAL(NINT(adatrj),wp)   ! avoid truncation error
Index: trunk/NEMOGCM/NEMO/SAS_SRC/diawri.F90
===================================================================
--- trunk/NEMOGCM/NEMO/SAS_SRC/diawri.F90	(revision 5930)
+++ trunk/NEMOGCM/NEMO/SAS_SRC/diawri.F90	(revision 6140)
@@ -36,5 +36,4 @@
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
    USE in_out_manager  ! I/O manager
-   USE diadimg         ! dimg direct access file format output
    USE diaar5, ONLY :   lk_diaar5
    USE iom
@@ -61,6 +60,4 @@
 
    !! * Substitutions
-#  include "zdfddm_substitute.h90"
-#  include "domzgr_substitute.h90"
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
@@ -81,15 +78,8 @@
   END FUNCTION dia_wri_alloc
 
-#if defined key_dimgout
-   !!----------------------------------------------------------------------
-   !!   'key_dimgout'                                      DIMG output file
-   !!----------------------------------------------------------------------
-#   include "diawri_dimg.h90"
-
-#else
    !!----------------------------------------------------------------------
    !!   Default option                                   NetCDF output file
    !!----------------------------------------------------------------------
-# if defined key_iomput
+#if defined key_iomput
    !!----------------------------------------------------------------------
    !!   'key_iomput'                                        use IOM library
@@ -106,6 +96,5 @@
       !! ** Method  :  use iom_put
       !!----------------------------------------------------------------------
-      !!
-      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index
+      INTEGER, INTENT(in) ::   kt   ! ocean time-step index
       !!----------------------------------------------------------------------
       ! 
@@ -140,5 +129,5 @@
       INTEGER  ::   ierr                                     ! error code return from allocation
       INTEGER  ::   iimi, iima, ipk, it, itmod, ijmi, ijma   ! local integers
-      REAL(wp) ::   zsto, zout, zmax, zjulian, zdt           ! local scalars
+      REAL(wp) ::   zsto, zout, zmax, zjulian                ! local scalars
       !!----------------------------------------------------------------------
       ! 
@@ -159,18 +148,16 @@
 
       ! Define frequency of output and means
-      zdt = rdt
-      IF( nacc == 1 ) zdt = rdtmin
       IF( ln_mskland )   THEN   ;   clop = "only(x)"   ! put 1.e+20 on land (very expensive!!)
       ELSE                      ;   clop = "x"         ! no use of the mask value (require less cpu time)
       ENDIF
 #if defined key_diainstant
-      zsto = nwrite * zdt
+      zsto = nwrite * rdt
       clop = "inst("//TRIM(clop)//")"
 #else
-      zsto=zdt
+      zsto=rdt
       clop = "ave("//TRIM(clop)//")"
 #endif
-      zout = nwrite * zdt
-      zmax = ( nitend - nit000 + 1 ) * zdt
+      zout = nwrite * rdt
+      zmax = ( nitend - nit000 + 1 ) * rdt
 
       ! Define indices of the horizontal output zoom and vertical limit storage
@@ -214,5 +201,5 @@
          CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,           &  ! Horizontal grid: glamt and gphit
             &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       &
-            &          nit000-1, zjulian, zdt, nh_T, nid_T, domain_id=nidom, snc4chunks=snc4set )
+            &          nit000-1, zjulian, rdt, nh_T, nid_T, domain_id=nidom, snc4chunks=snc4set )
          CALL histvert( nid_T, "deptht", "Vertical T levels",      &  ! Vertical grid: gdept
             &           "m", ipk, gdept_1d, nz_T, "down" )
@@ -226,5 +213,5 @@
          CALL histbeg( clhstnam, jpi, glamu, jpj, gphiu,           &  ! Horizontal grid: glamu and gphiu
             &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       &
-            &          nit000-1, zjulian, zdt, nh_U, nid_U, domain_id=nidom, snc4chunks=snc4set )
+            &          nit000-1, zjulian, rdt, nh_U, nid_U, domain_id=nidom, snc4chunks=snc4set )
          CALL histvert( nid_U, "depthu", "Vertical U levels",      &  ! Vertical grid: gdept
             &           "m", ipk, gdept_1d, nz_U, "down" )
@@ -238,5 +225,5 @@
          CALL histbeg( clhstnam, jpi, glamv, jpj, gphiv,           &  ! Horizontal grid: glamv and gphiv
             &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       &
-            &          nit000-1, zjulian, zdt, nh_V, nid_V, domain_id=nidom, snc4chunks=snc4set )
+            &          nit000-1, zjulian, rdt, nh_V, nid_V, domain_id=nidom, snc4chunks=snc4set )
          CALL histvert( nid_V, "depthv", "Vertical V levels",      &  ! Vertical grid : gdept
             &          "m", ipk, gdept_1d, nz_V, "down" )
@@ -334,6 +321,4 @@
       !
    END SUBROUTINE dia_wri
-# endif
-
 #endif
 
@@ -358,5 +343,5 @@
       INTEGER  ::   id_i , nz_i, nh_i       
       INTEGER, DIMENSION(1) ::   idex             ! local workspace
-      REAL(wp) ::   zsto, zout, zmax, zjulian, zdt
+      REAL(wp) ::   zsto, zout, zmax, zjulian
       !!----------------------------------------------------------------------
       ! 
@@ -369,9 +354,8 @@
       clname = cdfile_name
       IF( .NOT. Agrif_Root() ) clname = TRIM(Agrif_CFixed())//'_'//TRIM(clname)
-      zdt  = rdt
       zsto = rdt
       clop = "inst(x)"           ! no use of the mask value (require less cpu time)
       zout = rdt
-      zmax = ( nitend - nit000 + 1 ) * zdt
+      zmax = ( nitend - nit000 + 1 ) * rdt
 
       IF(lwp) WRITE(numout,*)
@@ -388,5 +372,5 @@
       zjulian = zjulian - adatrj   !   set calendar origin to the beginning of the experiment
       CALL histbeg( clname, jpi, glamt, jpj, gphit,   &
-          1, jpi, 1, jpj, nit000-1, zjulian, zdt, nh_i, id_i, domain_id=nidom, snc4chunks=snc4set ) ! Horizontal grid : glamt and gphit
+          1, jpi, 1, jpj, nit000-1, zjulian, rdt, nh_i, id_i, domain_id=nidom, snc4chunks=snc4set ) ! Horizontal grid : glamt and gphit
       CALL histvert( id_i, "deptht", "Vertical T levels",   &    ! Vertical grid : gdept
           "m", jpk, gdept_1d, nz_i, "down")
@@ -431,5 +415,5 @@
       ! -----------------
       CALL histclo( id_i )
-#if ! defined key_iomput && ! defined key_dimgout
+#if ! defined key_iomput
       IF( ninist /= 1  ) THEN
          CALL histclo( nid_T )
Index: trunk/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90
===================================================================
--- trunk/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90	(revision 5930)
+++ trunk/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90	(revision 6140)
@@ -184,5 +184,5 @@
       NAMELIST/namctl/ ln_ctl  , nn_print, nn_ictls, nn_ictle,   &
          &             nn_isplt, nn_jsplt, nn_jctls, nn_jctle,   &
-         &             nn_bench, nn_timing
+         &             nn_bench, nn_timing, nn_diacfl
       NAMELIST/namcfg/ cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, &
          &             jpizoom, jpjzoom, jperio, ln_use_jattr
Index: trunk/NEMOGCM/NEMO/SAS_SRC/sbcssm.F90
===================================================================
--- trunk/NEMOGCM/NEMO/SAS_SRC/sbcssm.F90	(revision 5930)
+++ trunk/NEMOGCM/NEMO/SAS_SRC/sbcssm.F90	(revision 6140)
@@ -88,9 +88,9 @@
          ssu_m(:,:) = sf_ssm_3d(jf_usp)%fnow(:,:,1) * umask(:,:,1)    ! u-velocity
          ssv_m(:,:) = sf_ssm_3d(jf_vsp)%fnow(:,:,1) * vmask(:,:,1)    ! v-velocity 
-         IF( lk_vvl )   e3t_m(:,:) = sf_ssm_3d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1)    ! v-velocity 
+         IF( .NOT.ln_linssh )   e3t_m(:,:) = sf_ssm_3d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1)    ! v-velocity 
       ELSE
          ssu_m(:,:) = sf_ssm_2d(jf_usp)%fnow(:,:,1) * umask(:,:,1)    ! u-velocity
          ssv_m(:,:) = sf_ssm_2d(jf_vsp)%fnow(:,:,1) * vmask(:,:,1)    ! v-velocity 
-         IF( lk_vvl )   e3t_m(:,:) = sf_ssm_2d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1)    ! v-velocity 
+         IF( .NOT.ln_linssh )   e3t_m(:,:) = sf_ssm_2d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1)    ! v-velocity 
       ENDIF
       !
@@ -115,6 +115,6 @@
          CALL prt_ctl(tab2d_1=ssv_m, clinfo1=' ssv_m   - : ', mask1=vmask, ovlap=1   )
          CALL prt_ctl(tab2d_1=ssh_m, clinfo1=' ssh_m   - : ', mask1=tmask, ovlap=1   )
-         IF( lk_vvl      )   CALL prt_ctl(tab2d_1=ssh_m, clinfo1=' e3t_m   - : ', mask1=tmask, ovlap=1   )
-         IF( ln_read_frq )   CALL prt_ctl(tab2d_1=frq_m, clinfo1=' frq_m   - : ', mask1=tmask, ovlap=1   )
+         IF( .NOT.ln_linssh )   CALL prt_ctl(tab2d_1=ssh_m, clinfo1=' e3t_m   - : ', mask1=tmask, ovlap=1   )
+         IF( ln_read_frq    )   CALL prt_ctl(tab2d_1=frq_m, clinfo1=' frq_m   - : ', mask1=tmask, ovlap=1   )
       ENDIF
       !
@@ -125,6 +125,6 @@
          CALL iom_put( 'sss_m', sss_m )
          CALL iom_put( 'ssh_m', ssh_m )
-         IF( lk_vvl      )   CALL iom_put( 'e3t_m', e3t_m )
-         IF( ln_read_frq )   CALL iom_put( 'frq_m', frq_m )
+         IF( .NOT.ln_linssh )   CALL iom_put( 'e3t_m', e3t_m )
+         IF( ln_read_frq    )   CALL iom_put( 'frq_m', frq_m )
       ENDIF
       !
@@ -216,10 +216,10 @@
       IF( ln_3d_uve ) THEN
          jf_usp = 1 ; jf_vsp = 2 ; jf_e3t = 3      ! define 3D fields index
-         nfld_3d  = 2 + COUNT( (/lk_vvl/) )        ! number of 3D fields to read
+         nfld_3d  = 2 + COUNT( (/.NOT.ln_linssh/) )        ! number of 3D fields to read
          nfld_2d  = 3 + COUNT( (/ln_read_frq/) )   ! number of 2D fields to read
       ELSE
-         jf_usp = 4 ; jf_vsp = 5 ; jf_e3t = 6 ; jf_frq = 6 + COUNT( (/lk_vvl/) )   ! update 2D fields index
+         jf_usp = 4 ; jf_vsp = 5 ; jf_e3t = 6 ; jf_frq = 6 + COUNT( (/.NOT.ln_linssh/) )   ! update 2D fields index
          nfld_3d  = 0                                                              ! no 3D fields to read
-         nfld_2d  = 5 + COUNT( (/lk_vvl/) ) + COUNT( (/ln_read_frq/) )             ! number of 2D fields to read
+         nfld_2d  = 5 + COUNT( (/.NOT.ln_linssh/) ) + COUNT( (/ln_read_frq/) )             ! number of 2D fields to read
       ENDIF
 
@@ -231,5 +231,5 @@
          slf_3d(jf_usp) = sn_usp
          slf_3d(jf_vsp) = sn_vsp
-         IF( lk_vvl )   slf_3d(jf_e3t) = sn_e3t
+         IF( .NOT.ln_linssh )   slf_3d(jf_e3t) = sn_e3t
       ENDIF
 
@@ -243,5 +243,5 @@
          IF( .NOT. ln_3d_uve ) THEN
             slf_2d(jf_usp) = sn_usp ; slf_2d(jf_vsp) = sn_vsp
-            IF( lk_vvl )   slf_2d(jf_e3t) = sn_e3t
+            IF( .NOT.ln_linssh )   slf_2d(jf_e3t) = sn_e3t
          ENDIF
       ENDIF
Index: trunk/NEMOGCM/NEMO/SAS_SRC/step.F90
===================================================================
--- trunk/NEMOGCM/NEMO/SAS_SRC/step.F90	(revision 5930)
+++ trunk/NEMOGCM/NEMO/SAS_SRC/step.F90	(revision 6140)
@@ -16,29 +16,24 @@
    USE oce              ! ocean dynamics and tracers variables
    USE dom_oce          ! ocean space and time domain variables 
-   USE in_out_manager   ! I/O manager
-   USE sbc_oce
-   USE sbccpl
-   USE iom              !
-   USE lbclnk
-#if defined key_iomput
-   USE xios
-#endif
-
    USE daymod           ! calendar                         (day     routine)
-
+   USE sbc_oce          ! surface boundary condition: fields
    USE sbcmod           ! surface boundary condition       (sbc     routine)
    USE sbcrnf           ! surface boundary condition: runoff variables
-
+   USE sbccpl           ! surface boundary condition: coupled interface
    USE eosbn2           ! equation of state                (eos_bn2 routine)
-
    USE diawri           ! Standard run outputs             (dia_wri routine)
-   USE stpctl           ! time stepping control            (stp_ctl routine)
-   USE prtctl           ! Print control                    (prt_ctl routine)
-
-   USE timing           ! Timing            
-
    USE bdy_par          ! clem: mandatory for LIM3
 #if defined key_bdy
    USE bdydta           ! clem: mandatory for LIM3
+#endif
+   USE stpctl           ! time stepping control            (stp_ctl routine)
+   !
+   USE in_out_manager   ! I/O manager
+   USE prtctl           ! Print control                    (prt_ctl routine)
+   USE iom              !
+   USE lbclnk           !
+   USE timing           ! Timing            
+#if defined key_iomput
+   USE xios
 #endif
 
@@ -46,9 +41,6 @@
    PRIVATE
 
-   PUBLIC   stp   ! called by opa.F90
+   PUBLIC   stp   ! called by nemogcm.F90
 
-   !! * Substitutions
-#  include "domzgr_substitute.h90"
-#  include "zdfddm_substitute.h90"
    !!----------------------------------------------------------------------
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
