Index: branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/MY_SRC/usrdef_hgr.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/MY_SRC/usrdef_hgr.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/MY_SRC/usrdef_hgr.F90	(revision 9124)
@@ -20,5 +20,4 @@
    USE in_out_manager  ! I/O manager
    USE lib_mpp         ! MPP library
-   USE timing          ! Timing
    
    IMPLICIT NONE
@@ -67,6 +66,4 @@
       !!-------------------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('usr_def_hgr')
-      !
       IF(lwp) WRITE(numout,*)
       IF(lwp) WRITE(numout,*) 'usr_def_hgr : LOCK_EXCHANGE configuration bassin'
@@ -107,6 +104,4 @@
       pff_t(:,:) = 0._wp
       !
-      IF( nn_timing == 1 )  CALL timing_stop('usr_def_hgr')
-      !
    END SUBROUTINE usr_def_hgr
 
Index: branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/OVERFLOW/MY_SRC/usrdef_hgr.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/OVERFLOW/MY_SRC/usrdef_hgr.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/OVERFLOW/MY_SRC/usrdef_hgr.F90	(revision 9124)
@@ -20,5 +20,4 @@
    USE in_out_manager  ! I/O manager
    USE lib_mpp         ! MPP library
-   USE timing          ! Timing
    
    IMPLICIT NONE
@@ -67,6 +66,4 @@
       !!-------------------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('usr_def_hgr')
-      !
       IF(lwp) WRITE(numout,*)
       IF(lwp) WRITE(numout,*) 'usr_def_hgr : OVERFLOW configuration bassin'
@@ -107,6 +104,4 @@
       pff_t(:,:) = 0._wp
       !
-      IF( nn_timing == 1 )  CALL timing_stop('usr_def_hgr')
-      !
    END SUBROUTINE usr_def_hgr
 
Index: branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/SAS_BIPER/MY_SRC/usrdef_hgr.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/SAS_BIPER/MY_SRC/usrdef_hgr.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/SAS_BIPER/MY_SRC/usrdef_hgr.F90	(revision 9124)
@@ -20,5 +20,4 @@
    USE in_out_manager  ! I/O manager
    USE lib_mpp         ! MPP library
-   USE timing          ! Timing
    
    IMPLICIT NONE
@@ -29,5 +28,5 @@
    !!----------------------------------------------------------------------
    !! NEMO/OPA 4.0 , NEMO Consortium (2016)
-   !! $Id$ 
+   !! $Id:$ 
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
@@ -68,6 +67,4 @@
       REAL(wp) ::   ztj, zuj, zvj, zfj   !   -      -
       !!-------------------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )  CALL timing_start('usr_def_hgr')
       !
       IF(lwp) WRITE(numout,*)
@@ -152,7 +149,5 @@
       pff_t(:,:) = 0._wp
       !
-      IF( nn_timing == 1 )  CALL timing_stop('usr_def_hgr')
-      !
-      END SUBROUTINE usr_def_hgr
+   END SUBROUTINE usr_def_hgr
 
    !!======================================================================
Index: branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/SAS_BIPER/MY_SRC/usrdef_zgr.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/SAS_BIPER/MY_SRC/usrdef_zgr.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/SAS_BIPER/MY_SRC/usrdef_zgr.F90	(revision 9124)
@@ -20,6 +20,4 @@
    USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
    USE lib_mpp        ! distributed memory computing library
-   USE wrk_nemo       ! Memory allocation
-   USE timing         ! Timing
 
    IMPLICIT NONE
Index: branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/VORTEX/MY_SRC/usrdef_hgr.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/VORTEX/MY_SRC/usrdef_hgr.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/VORTEX/MY_SRC/usrdef_hgr.F90	(revision 9124)
@@ -20,5 +20,4 @@
    USE in_out_manager  ! I/O manager
    USE lib_mpp         ! MPP library
-   USE timing          ! Timing
    
    IMPLICIT NONE
@@ -66,6 +65,4 @@
       REAL(wp) ::   zti, zui, ztj, zvj   ! local scalars
       !!-------------------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )  CALL timing_start('usr_def_hgr')
       !
       IF(lwp) WRITE(numout,*)
@@ -129,7 +126,5 @@
       pff_t(:,:) = zf0 + zbeta * pphit(:,:) * 1.e+3
       !
-      IF( nn_timing == 1 )  CALL timing_stop('usr_def_hgr')
-      !
-      END SUBROUTINE usr_def_hgr
+   END SUBROUTINE usr_def_hgr
 
    !!======================================================================
Index: branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/VORTEX/MY_SRC/usrdef_zgr.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/VORTEX/MY_SRC/usrdef_zgr.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/VORTEX/MY_SRC/usrdef_zgr.F90	(revision 9124)
@@ -24,5 +24,4 @@
    USE lib_mpp        ! distributed memory computing library
    USE wrk_nemo       ! Memory allocation
-   USE timing         ! Timing
 
    IMPLICIT NONE
@@ -131,6 +130,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('zgr_z')
-      !
       zd = 5000._wp/FLOAT(jpkm1)
       !
@@ -168,6 +165,4 @@
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('zgr_z')
-      !
    END SUBROUTINE zgr_z
 
@@ -226,6 +221,4 @@
       INTEGER  ::   jk
       !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )  CALL timing_start('zgr_zco')
       !
       DO jk = 1, jpk
@@ -241,6 +234,4 @@
       END DO
       !
-      IF( nn_timing == 1 )  CALL timing_stop('zgr_zco')
-      !
    END SUBROUTINE zgr_zco
 
Index: branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/WAD/MY_SRC/bdyini.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/WAD/MY_SRC/bdyini.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/WAD/MY_SRC/bdyini.F90	(revision 9124)
@@ -30,5 +30,4 @@
    USE iom            ! I/O
    USE wrk_nemo       ! Memory Allocation
-   USE timing         ! Timing
 
    IMPLICIT NONE
@@ -46,4 +45,5 @@
    INTEGER, DIMENSION(jp_nseg) ::   jpjnob, jpindt, jpinft, npckgn   !
    INTEGER, DIMENSION(jp_nseg) ::   jpjsob, jpisdt, jpisft, npckgs   !
+
    !!----------------------------------------------------------------------
    !! NEMO/OPA 3.7 , NEMO Consortium (2015)
@@ -75,6 +75,4 @@
       INTEGER  ::   ios                 ! Local integer output status for namelist read
       !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )   CALL timing_start('bdy_init')
 
       ! ------------------------
@@ -114,7 +112,6 @@
       ENDIF
       !
-      IF( nn_timing == 1 )   CALL timing_stop('bdy_init')
-      !
    END SUBROUTINE bdy_init
+
    
    SUBROUTINE bdy_segs
@@ -159,6 +156,4 @@
       INTEGER  ::   ios                 ! Local integer output status for namelist read
       !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )   CALL timing_start('bdy_segs')
       !
       cgrid = (/'t','u','v'/)
@@ -1325,7 +1320,6 @@
       CALL wrk_dealloc(jpi,jpj,   zfmask ) 
       !
-      IF( nn_timing == 1 )   CALL timing_stop('bdy_segs')
-      !
    END SUBROUTINE bdy_segs
+
 
    SUBROUTINE bdy_ctl_seg
Index: branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/WAD/MY_SRC/domain.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/WAD/MY_SRC/domain.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/WAD/MY_SRC/domain.F90	(revision 9124)
@@ -46,5 +46,4 @@
    USE lib_mpp        ! distributed memory computing library
    USE wrk_nemo       ! Memory Allocation
-   USE timing         ! Timing
 
    IMPLICIT NONE
@@ -82,6 +81,4 @@
       REAL(wp), DIMENSION(jpi,jpj) ::   z1_hu_0, z1_hv_0
       !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )   CALL timing_start('dom_init')
       !
       IF(lwp) THEN         ! Ocean domain Parameters (control print)
@@ -198,6 +195,4 @@
       !
       IF( ln_write_cfg )   CALL cfg_write         ! create the configuration file
-      !
-      IF( nn_timing == 1 )   CALL timing_stop('dom_init')
       !
    END SUBROUTINE dom_init
Index: branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/WAD/MY_SRC/usrdef_hgr.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/WAD/MY_SRC/usrdef_hgr.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/WAD/MY_SRC/usrdef_hgr.F90	(revision 9124)
@@ -20,5 +20,4 @@
    USE in_out_manager  ! I/O manager
    USE lib_mpp         ! MPP library
-   USE timing          ! Timing
    
    IMPLICIT NONE
@@ -67,6 +66,4 @@
       !!-------------------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('usr_def_hgr')
-      !
       IF(lwp) WRITE(numout,*)
       IF(lwp) WRITE(numout,*) 'usr_def_hgr : WAD_TEST_CASES configuration basin'
@@ -107,6 +104,4 @@
       pff_t(:,:) = 0._wp
       !
-      IF( nn_timing == 1 )  CALL timing_stop('usr_def_hgr')
-      !
    END SUBROUTINE usr_def_hgr
 
Index: branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/WAD/MY_SRC/usrdef_zgr.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/WAD/MY_SRC/usrdef_zgr.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/CONFIG/TEST_CASES/WAD/MY_SRC/usrdef_zgr.F90	(revision 9124)
@@ -25,5 +25,4 @@
    USE lib_mpp        ! distributed memory computing library
    USE wrk_nemo       ! Memory allocation
-   USE timing         ! Timing
 
    IMPLICIT NONE
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icealb.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icealb.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icealb.F90	(revision 9124)
@@ -112,5 +112,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )   CALL timing_start('icealb')
+      IF( ln_timing )   CALL timing_start('icealb')
       !
       z1_href_pnd = 0.05
@@ -173,5 +173,5 @@
       palb_cs(:,:,:) = palb_os(:,:,:) - ( - 0.1010 * palb_os(:,:,:) * palb_os(:,:,:) + 0.1933 * palb_os(:,:,:) - 0.0148 )
       !
-      IF( nn_timing == 1 )   CALL timing_stop('icealb')
+      IF( ln_timing )   CALL timing_stop('icealb')
       !
    END SUBROUTINE ice_alb
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icecor.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icecor.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icecor.F90	(revision 9124)
@@ -57,6 +57,6 @@
       !!----------------------------------------------------------------------
       ! controls
-      IF( nn_timing == 1 )   CALL timing_start('icecor')                                                             ! timing
-      IF( ln_icediachk   )   CALL ice_cons_hsm(0, 'icecor', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft) ! conservation
+      IF( ln_timing    )   CALL timing_start('icecor')                                                             ! timing
+      IF( ln_icediachk )   CALL ice_cons_hsm(0, 'icecor', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft) ! conservation
       !
       IF( kt == nit000 .AND. lwp .AND. kn == 2 ) THEN
@@ -178,5 +178,5 @@
       IF( ln_ctl         )   CALL ice_prt3D   ('icecor')                                                             ! prints
       IF( ln_icectl .AND. kn == 2 )   CALL ice_prt( kt, iiceprt, jiceprt, 2, ' - Final state - ' )                   ! prints
-      IF( nn_timing == 1 )   CALL timing_stop ('icecor')                                                             ! timing
+      IF( ln_timing      )   CALL timing_stop ('icecor')                                                             ! timing
       !
    END SUBROUTINE ice_cor
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icedia.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icedia.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icedia.F90	(revision 9124)
@@ -72,5 +72,5 @@
       REAL(wp)   ::   zdiff_vol, zdiff_sal, zdiff_tem  
       !!---------------------------------------------------------------------------
-      IF( nn_timing == 1 )   CALL timing_start('ice_dia')
+      IF( ln_timing )   CALL timing_start('ice_dia')
 
       IF( kt == nit000 .AND. lwp ) THEN
@@ -156,5 +156,5 @@
       IF( lrst_ice )   CALL ice_dia_rst( 'WRITE', kt_ice )
       !
-      IF( nn_timing == 1 )   CALL timing_stop('ice_dia')
+      IF( ln_timing )   CALL timing_stop('ice_dia')
       !
    END SUBROUTINE ice_dia
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icedyn.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icedyn.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icedyn.F90	(revision 9124)
@@ -72,5 +72,5 @@
       !!--------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )   CALL timing_start('icedyn')
+      IF( ln_timing )   CALL timing_start('icedyn')
       !
       IF( kt == nit000 .AND. lwp ) THEN
@@ -123,7 +123,8 @@
       END SELECT
       !
-      IF( nn_timing == 1 )   CALL timing_stop('icedyn')
+      IF( ln_timing )   CALL timing_stop('icedyn')
       !
    END SUBROUTINE ice_dyn
+
 
    SUBROUTINE Hbig( phmax )
@@ -171,4 +172,5 @@
    END SUBROUTINE Hbig
 
+
    SUBROUTINE Hpiling
       !!-------------------------------------------------------------------
@@ -221,5 +223,5 @@
       REWIND( numnam_ice_cfg )         ! Namelist namdyn in configuration namelist : Ice dynamics
       READ  ( numnam_ice_cfg, namdyn, IOSTAT = ios, ERR = 902 )
-902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdyn in configuration namelist', lwp )
+902   IF( ios >  0 ) CALL ctl_nam ( ios , 'namdyn in configuration namelist', lwp )
       IF(lwm) WRITE ( numoni, namdyn )
       !
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icedyn_adv.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icedyn_adv.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icedyn_adv.F90	(revision 9124)
@@ -70,5 +70,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('icedyn_adv')
+      IF( ln_timing )   CALL timing_start('icedyn_adv')
       !
       IF( kt == nit000 .AND. lwp ) THEN
@@ -112,7 +112,7 @@
 
       ! controls
-      IF( ln_icediachk   )   CALL ice_cons_hsm(1, 'icedyn_adv', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft) ! conservation
-      IF( ln_icectl      )   CALL ice_prt     (kt, iiceprt, jiceprt,-1, ' - ice dyn & trp - ')                           ! prints
-      IF( nn_timing == 1 )   CALL timing_stop ('icedyn_adv')                                                             ! timing
+      IF( ln_icediachk )   CALL ice_cons_hsm(1, 'icedyn_adv', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft) ! conservation
+      IF( ln_icectl    )   CALL ice_prt     (kt, iiceprt, jiceprt,-1, ' - ice dyn & trp - ')                           ! prints
+      IF( ln_timing    )   CALL timing_stop ('icedyn_adv')                                                             ! timing
       !
    END SUBROUTINE ice_dyn_adv
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icedyn_rdgrft.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icedyn_rdgrft.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icedyn_rdgrft.F90	(revision 9124)
@@ -138,6 +138,6 @@
       !!-------------------------------------------------------------------
       ! controls
-      IF( nn_timing == 1 )   CALL timing_start('icedyn_rdgrft')                                                             ! timing
-      IF( ln_icediachk   )   CALL ice_cons_hsm(0, 'icedyn_rdgrft', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft) ! conservation
+      IF( ln_timing    )   CALL timing_start('icedyn_rdgrft')                                                             ! timing
+      IF( ln_icediachk )   CALL ice_cons_hsm(0, 'icedyn_rdgrft', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft) ! conservation
 
       IF( kt == nit000 ) THEN
@@ -338,7 +338,7 @@
 
       ! controls
-      IF( ln_icediachk   )   CALL ice_cons_hsm(1, 'icedyn_rdgrft', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft) ! conservation
-      IF( ln_ctl         )   CALL ice_prt3D   ('icedyn_rdgrft')                                                             ! prints
-      IF( nn_timing == 1 )   CALL timing_stop ('icedyn_rdgrft')                                                             ! timing
+      IF( ln_icediachk )   CALL ice_cons_hsm(1, 'icedyn_rdgrft', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft) ! conservation
+      IF( ln_ctl       )   CALL ice_prt3D   ('icedyn_rdgrft')                                                             ! prints
+      IF( ln_timing    )   CALL timing_stop ('icedyn_rdgrft')                                                             ! timing
       !
    END SUBROUTINE ice_dyn_rdgrft
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icedyn_rhg.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icedyn_rhg.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icedyn_rhg.F90	(revision 9124)
@@ -62,6 +62,6 @@
       !!--------------------------------------------------------------------
       ! controls
-      IF( nn_timing == 1 )   CALL timing_start('icedyn_rhg')                                                             ! timing
-      IF( ln_icediachk   )   CALL ice_cons_hsm(0, 'icedyn_rhg', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft) ! conservation
+      IF( ln_timing    )   CALL timing_start('icedyn_rhg')                                                             ! timing
+      IF( ln_icediachk )   CALL ice_cons_hsm(0, 'icedyn_rhg', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft) ! conservation
       !
       IF( kt == nit000 .AND. lwp ) THEN
@@ -87,9 +87,10 @@
       !
       ! controls
-      IF( ln_icediachk   )   CALL ice_cons_hsm(1, 'icedyn_rhg', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft) ! conservation
-      IF( ln_ctl         )   CALL ice_prt3D   ('icedyn_rhg')                                                             ! prints
-      IF( nn_timing == 1 )   CALL timing_stop ('icedyn_rhg')                                                             ! timing
+      IF( ln_icediachk )   CALL ice_cons_hsm(1, 'icedyn_rhg', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft) ! conservation
+      IF( ln_ctl       )   CALL ice_prt3D   ('icedyn_rhg')                                                             ! prints
+      IF( ln_timing    )   CALL timing_stop ('icedyn_rhg')                                                             ! timing
       !
    END SUBROUTINE ice_dyn_rhg
+
 
    SUBROUTINE ice_dyn_rhg_init
@@ -116,5 +117,5 @@
       REWIND( numnam_ice_cfg )         ! Namelist namdyn_rhg in configuration namelist : Ice dynamics
       READ  ( numnam_ice_cfg, namdyn_rhg, IOSTAT = ios, ERR = 902 )
-902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdyn_rhg in configuration namelist', lwp )
+902   IF( ios >  0 ) CALL ctl_nam ( ios , 'namdyn_rhg in configuration namelist', lwp )
       IF(lwm) WRITE ( numoni, namdyn_rhg )
       !
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/iceforcing.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/iceforcing.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/iceforcing.F90	(revision 9124)
@@ -62,5 +62,5 @@
       !!-------------------------------------------------------------------
 
-      IF( nn_timing == 1 )   CALL timing_start('ice_forcing')
+      IF( ln_timing )   CALL timing_start('ice_forcing')
 
       IF( kt == nit000 .AND. lwp ) THEN
@@ -87,5 +87,5 @@
       ENDIF
 
-      IF( nn_timing == 1 )   CALL timing_stop('ice_forcing')
+      IF( ln_timing )   CALL timing_stop('ice_forcing')
       !
    END SUBROUTINE ice_forcing_tau
@@ -120,5 +120,5 @@
       !!--------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )   CALL timing_start('ice_forcing_flx')
+      IF( ln_timing )   CALL timing_start('ice_forcing_flx')
 
       IF( kt == nit000 .AND. lwp ) THEN
@@ -165,5 +165,5 @@
       ENDIF
       !
-      IF( nn_timing == 1 )   CALL timing_stop('ice_forcing_flx')
+      IF( ln_timing )   CALL timing_stop('ice_forcing_flx')
       !
    END SUBROUTINE ice_forcing_flx
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icestp.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icestp.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icestp.F90	(revision 9124)
@@ -102,5 +102,5 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )   CALL timing_start('ice_stp')
+      IF( ln_timing )   CALL timing_start('ice_stp')
       !
       !                                      !-----------------------!
@@ -201,5 +201,5 @@
 !!gm   remark, the ocean-ice stress is not saved in ice diag call above .....  find a solution!!!
       !
-      IF( nn_timing == 1 )   CALL timing_stop('ice_stp')
+      IF( ln_timing )   CALL timing_stop('ice_stp')
       !
    END SUBROUTINE ice_stp
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icethd.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icethd.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icethd.F90	(revision 9124)
@@ -98,6 +98,6 @@
       !!-------------------------------------------------------------------
       ! controls
-      IF( nn_timing == 1 )   CALL timing_start('icethd')                                                             ! timing
-      IF( ln_icediachk   )   CALL ice_cons_hsm(0, 'icethd', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft) ! conservation
+      IF( ln_timing    )   CALL timing_start('icethd')                                                             ! timing
+      IF( ln_icediachk )   CALL ice_cons_hsm(0, 'icethd', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft) ! conservation
 
       IF( kt == nit000 .AND. lwp ) THEN
@@ -271,12 +271,12 @@
       !                                                    !     & make sure at_i=SUM(a_i) & ato_i=1 where at_i=0
       !                   
-      IF( jpl > 1 )        CALL ice_itd_rem( kt )          ! --- Transport ice between thickness categories --- !
-      !
-      IF( ln_icedO )       CALL ice_thd_do                 ! --- frazil ice growing in leads --- !
+      IF( jpl > 1      )   CALL ice_itd_rem( kt )          ! --- Transport ice between thickness categories --- !
+      !
+      IF( ln_icedO     )   CALL ice_thd_do                 ! --- frazil ice growing in leads --- !
       !
       ! controls
-      IF( ln_icectl      )   CALL ice_prt    (kt, iiceprt, jiceprt, 1, ' - ice thermodyn. - ') ! prints
-      IF( ln_ctl         )   CALL ice_prt3D  ('icethd')                                        ! prints
-      IF( nn_timing == 1 )   CALL timing_stop('icethd')                                        ! timing
+      IF( ln_icectl )   CALL ice_prt    (kt, iiceprt, jiceprt, 1, ' - ice thermodyn. - ') ! prints
+      IF( ln_ctl    )   CALL ice_prt3D  ('icethd')                                        ! prints
+      IF( ln_timing )   CALL timing_stop('icethd')                                        ! timing
       !
    END SUBROUTINE ice_thd 
@@ -568,5 +568,5 @@
       REWIND( numnam_ice_cfg )              ! Namelist namthd in configuration namelist : Ice thermodynamics
       READ  ( numnam_ice_cfg, namthd, IOSTAT = ios, ERR = 902 )
-902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namthd in configuration namelist', lwp )
+902   IF( ios >  0 ) CALL ctl_nam ( ios , 'namthd in configuration namelist', lwp )
       IF(lwm) WRITE ( numoni, namthd )
       !
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icethd_zdf.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icethd_zdf.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icethd_zdf.F90	(revision 9124)
@@ -56,5 +56,5 @@
       !!              of vertical diffusion
       !!-------------------------------------------------------------------
-   
+      !
       SELECT CASE ( nice_zdf )      ! Choose the vertical heat diffusion solver
       !
@@ -77,5 +77,5 @@
          !
       END SELECT
-      
+      !
    END SUBROUTINE ice_thd_zdf
    
@@ -104,5 +104,5 @@
       REWIND( numnam_ice_cfg )              ! Namelist namthd_zdf in configuration namelist : Ice thermodynamics
       READ  ( numnam_ice_cfg, namthd_zdf, IOSTAT = ios, ERR = 902 )
-902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namthd_zdf in configuration namelist', lwp )
+902   IF( ios >  0 ) CALL ctl_nam ( ios , 'namthd_zdf in configuration namelist', lwp )
       IF(lwm) WRITE ( numoni, namthd_zdf )
       !
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/iceupdate.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/iceupdate.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/iceupdate.F90	(revision 9124)
@@ -105,5 +105,5 @@
       REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zalb_cs, zalb_os     ! 3D workspace
       !!---------------------------------------------------------------------
-      IF( nn_timing == 1 )  CALL timing_start('ice_update')
+      IF( ln_timing )   CALL timing_start('ice_update')
 
       IF( kt == nit000 .AND. lwp ) THEN
@@ -297,5 +297,5 @@
       IF( ln_icectl                      )   CALL ice_prt       (kt, iiceprt, jiceprt, 3, 'Final state ice_update') ! prints
       IF( ln_ctl                         )   CALL ice_prt3D     ('iceupdate')                                       ! prints
-      IF( nn_timing == 1                 )   CALL timing_stop   ('ice_update')                                      ! timing
+      IF( ln_timing                      )   CALL timing_stop   ('ice_update')                                      ! timing
       !
    END SUBROUTINE ice_update_flx
@@ -334,6 +334,5 @@
       REAL(wp) ::   zat_v, zvtau_ice, zv_t, zrhoco  !   -      -
       !!---------------------------------------------------------------------
-
-      IF( nn_timing == 1 )  CALL timing_start('ice_update_tau')
+      IF( ln_timing )   CALL timing_start('ice_update_tau')
 
       IF( kt == nit000 .AND. lwp ) THEN
@@ -381,5 +380,5 @@
       CALL lbc_lnk_multi( utau, 'U', -1., vtau, 'V', -1. )   ! lateral boundary condition
       !
-      IF( nn_timing == 1 )  CALL timing_stop('ice_update_tau')
+      IF( ln_timing )   CALL timing_stop('ice_update_tau')
       !  
    END SUBROUTINE ice_update_tau
@@ -400,5 +399,5 @@
       IF(lwp) WRITE(numout,*) 'ice_update_init: ???? '
       IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~~'
-
+      !
       !                                      ! allocate ice_update array
       IF( ice_update_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'ice_update_init : unable to allocate standard arrays' )
@@ -407,4 +406,5 @@
       !
    END SUBROUTINE ice_update_init
+
 
    SUBROUTINE update_rst( cdrw, kt )
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icewri.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icewri.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icewri.F90	(revision 9124)
@@ -58,5 +58,5 @@
       !!-------------------------------------------------------------------
 
-      IF( nn_timing == 1 )   CALL timing_start('icewri')
+      IF( ln_timing )   CALL timing_start('icewri')
 
       !----------------------------------------
@@ -220,5 +220,5 @@
 !!gm  idem for the ocean...  Ask Seb how to get read of ioipsl....
       !
-      IF( nn_timing == 1 )  CALL timing_stop('icewri')
+      IF( ln_timing )  CALL timing_stop('icewri')
       !
    END SUBROUTINE ice_wri
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OFF_SRC/dtadyn.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OFF_SRC/dtadyn.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OFF_SRC/dtadyn.F90	(revision 9124)
@@ -105,14 +105,11 @@
       !!             - interpolates data if needed
       !!----------------------------------------------------------------------
-      !
       USE oce, ONLY:  zhdivtr => ua
       INTEGER, INTENT(in) ::   kt   ! ocean time-step index
       INTEGER             ::   ji, jj, jk
       REAL(wp), POINTER, DIMENSION(:,:)   :: zemp
-      !
-      !!----------------------------------------------------------------------
-      
-      !
-      IF( nn_timing == 1 )  CALL timing_start( 'dta_dyn')
+      !!----------------------------------------------------------------------
+      !
+      IF( ln_timing )   CALL timing_start( 'dta_dyn')
       !
       nsecdyn = nsec_year + nsec1jan000   ! number of seconds between Jan. 1st 00h of nit000 year and the middle of time step
@@ -195,5 +192,5 @@
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop( 'dta_dyn')
+      IF( ln_timing )   CALL timing_stop( 'dta_dyn')
       !
    END SUBROUTINE dta_dyn
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90	(revision 9124)
@@ -130,5 +130,5 @@
       ENDIF
       !
-      IF( nn_timing == 1 )   CALL timing_finalize
+      IF( ln_timing )   CALL timing_finalize
       !
       CALL nemo_closefile
@@ -380,10 +380,4 @@
       isplt     = nn_isplt
       jsplt     = nn_jsplt
-!!gm to be remove at the end of the 2017 merge party
-      if( ln_timing ) then  ;  nn_timing = 1
-      else                  ;  nn_timing = 0
-      endif
-!!gm end
-
 
       IF(lwp) THEN                  ! control print
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/BDY/bdydta.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/BDY/bdydta.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/BDY/bdydta.F90	(revision 9124)
@@ -87,5 +87,5 @@
       !!---------------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )   CALL timing_start('bdy_dta')
+      IF( ln_timing )   CALL timing_start('bdy_dta')
       !
       ! Initialise data arrays once for all from initial conditions where required
@@ -395,5 +395,5 @@
       ENDIF
       !
-      IF( nn_timing == 1 ) CALL timing_stop('bdy_dta')
+      IF( ln_timing )   CALL timing_stop('bdy_dta')
       !
    END SUBROUTINE bdy_dta
@@ -441,6 +441,4 @@
       !!---------------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )   CALL timing_start('bdy_dta_init')
-      !
       IF(lwp) WRITE(numout,*)
       IF(lwp) WRITE(numout,*) 'bdy_dta_ini : initialization of data at the open boundaries'
@@ -827,6 +825,4 @@
       END DO ! jbdy 
       !
-      IF( nn_timing == 1 ) CALL timing_stop('bdy_dta_init')
-      !
    END SUBROUTINE bdy_dta_init
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/BDY/bdydyn.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/BDY/bdydyn.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/BDY/bdydyn.F90	(revision 9124)
@@ -17,5 +17,4 @@
    !!----------------------------------------------------------------------
    USE wrk_nemo        ! Memory Allocation
-   USE timing          ! Timing
    USE oce             ! ocean dynamics and tracers 
    USE dom_oce         ! ocean space and time domain
@@ -53,6 +52,4 @@
       REAL(wp), POINTER, DIMENSION(:,:) :: pua2d, pva2d     ! after barotropic velocities
       !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )   CALL timing_start('bdy_dyn')
       !
       ll_dyn2d = .true.
@@ -129,6 +126,4 @@
       CALL wrk_dealloc( jpi,jpj,  pua2d, pva2d ) 
       !
-      IF( nn_timing == 1 )   CALL timing_stop('bdy_dyn')
-      !
    END SUBROUTINE bdy_dyn
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/BDY/bdydyn2d.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/BDY/bdydyn2d.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/BDY/bdydyn2d.F90	(revision 9124)
@@ -14,5 +14,4 @@
    !!   bdy_ssh            : Duplicate sea level across open boundaries
    !!----------------------------------------------------------------------
-   USE timing          ! Timing
    USE oce             ! ocean dynamics and tracers 
    USE dom_oce         ! ocean space and time domain
@@ -95,6 +94,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 ) CALL timing_start('bdy_dyn2d_frs')
-      !
       igrd = 2                      ! Relaxation of zonal velocity
       DO jb = 1, idx%nblen(igrd)
@@ -115,7 +112,4 @@
       CALL lbc_bdy_lnk( pva2d, 'V', -1., ib_bdy)   ! Boundary points should be updated
       !
-      IF( nn_timing == 1 ) CALL timing_stop('bdy_dyn2d_frs')
-      !
-
    END SUBROUTINE bdy_dyn2d_frs
 
@@ -153,6 +147,4 @@
       REAL(wp) ::   zflag, z1_2                      !    "        "
       !!----------------------------------------------------------------------
-
-      IF( nn_timing == 1 ) CALL timing_start('bdy_dyn2d_fla')
 
       z1_2 = 0.5_wp
@@ -218,6 +210,4 @@
       CALL lbc_bdy_lnk( pva2d, 'V', -1., ib_bdy )   !
       !
-      IF( nn_timing == 1 ) CALL timing_stop('bdy_dyn2d_fla')
-      !
    END SUBROUTINE bdy_dyn2d_fla
 
@@ -244,6 +234,4 @@
       INTEGER  ::   ii, ij, iibm1, ijbm1                   ! indices
       !!----------------------------------------------------------------------
-
-      IF( nn_timing == 1 ) CALL timing_start('bdy_dyn2d_orlanski')
       !
       igrd = 2      ! Orlanski bc on u-velocity; 
@@ -258,7 +246,6 @@
       CALL lbc_bdy_lnk( pva2d, 'V', -1., ib_bdy )   !
       !
-      IF( nn_timing == 1 ) CALL timing_stop('bdy_dyn2d_orlanski')
-      !
    END SUBROUTINE bdy_dyn2d_orlanski
+
 
    SUBROUTINE bdy_ssh( zssh )
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/BDY/bdydyn3d.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/BDY/bdydyn3d.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/BDY/bdydyn3d.F90	(revision 9124)
@@ -80,6 +80,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 ) CALL timing_start('bdy_dyn3d_spe')
-      !
       igrd = 2                      ! Relaxation of zonal velocity
       DO jb = 1, idx%nblenrim(igrd)
@@ -104,7 +102,6 @@
       IF( kt == nit000 )   CLOSE( unit = 102 )
       !
-      IF( nn_timing == 1 ) CALL timing_stop('bdy_dyn3d_spe')
-      !
    END SUBROUTINE bdy_dyn3d_spe
+
 
    SUBROUTINE bdy_dyn3d_zgrad( idx, dta, kt , ib_bdy )
@@ -126,6 +123,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 ) CALL timing_start('bdy_dyn3d_zgrad')
-      !
       igrd = 2                      ! Copying tangential velocity into bdy points
       DO jb = 1, idx%nblenrim(igrd)
@@ -152,9 +147,8 @@
       CALL lbc_bdy_lnk( va, 'V', -1., ib_bdy )   
       !
-      IF( kt .eq. nit000 ) CLOSE( unit = 102 )
-
-      IF( nn_timing == 1 ) CALL timing_stop('bdy_dyn3d_zgrad')
-
+      IF( kt == nit000 )   CLOSE( unit = 102 )
+      !
    END SUBROUTINE bdy_dyn3d_zgrad
+
 
    SUBROUTINE bdy_dyn3d_zro( idx, dta, kt, ib_bdy )
@@ -174,6 +168,4 @@
       REAL(wp) ::   zwgt           ! boundary weight
       !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 ) CALL timing_start('bdy_dyn3d_zro')
       !
       igrd = 2                       ! Everything is at T-points here
@@ -199,6 +191,4 @@
       IF( kt == nit000 )   CLOSE( unit = 102 )
       !
-      IF( nn_timing == 1 )   CALL timing_stop('bdy_dyn3d_zro')
-      !
    END SUBROUTINE bdy_dyn3d_zro
 
@@ -225,6 +215,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 ) CALL timing_start('bdy_dyn3d_frs')
-      !
       igrd = 2                      ! Relaxation of zonal velocity
       DO jb = 1, idx%nblen(igrd)
@@ -250,6 +238,4 @@
       !
       IF( kt == nit000 )   CLOSE( unit = 102 )
-      !
-      IF( nn_timing == 1 )   CALL timing_stop('bdy_dyn3d_frs')
       !
    END SUBROUTINE bdy_dyn3d_frs
@@ -273,6 +259,4 @@
       INTEGER  ::   jb, igrd                               ! dummy loop indices
       !!----------------------------------------------------------------------
-
-      IF( nn_timing == 1 ) CALL timing_start('bdy_dyn3d_orlanski')
       !
       !! Note that at this stage the ub and ua arrays contain the baroclinic velocities. 
@@ -289,6 +273,4 @@
       CALL lbc_bdy_lnk( va, 'V', -1., ib_bdy )   
       !
-      IF( nn_timing == 1 ) CALL timing_stop('bdy_dyn3d_orlanski')
-      !
    END SUBROUTINE bdy_dyn3d_orlanski
 
@@ -309,5 +291,5 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )   CALL timing_start('bdy_dyn3d_dmp')
+      IF( ln_timing )   CALL timing_start('bdy_dyn3d_dmp')
       !
       DO ib_bdy=1, nb_bdy
@@ -339,7 +321,8 @@
       CALL lbc_lnk_multi( ua, 'U', -1.,  va, 'V', -1. )   ! Boundary points should be updated
       !
-      IF( nn_timing == 1 )   CALL timing_stop('bdy_dyn3d_dmp')
+      IF( ln_timing )   CALL timing_stop('bdy_dyn3d_dmp')
       !
    END SUBROUTINE bdy_dyn3d_dmp
+
 
    SUBROUTINE bdy_dyn3d_nmn( idx, ib_bdy )
@@ -357,6 +340,4 @@
       INTEGER  ::   jb, igrd                               ! dummy loop indices
       !!----------------------------------------------------------------------
-
-      IF( nn_timing == 1 ) CALL timing_start('bdy_dyn3d_nmn')
       !
       !! Note that at this stage the ub and ua arrays contain the baroclinic velocities. 
@@ -373,6 +354,4 @@
       CALL lbc_bdy_lnk( va, 'V', -1., ib_bdy )
       !
-      IF( nn_timing == 1 ) CALL timing_stop('bdy_dyn3d_nmn')
-      !
    END SUBROUTINE bdy_dyn3d_nmn
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/BDY/bdyice.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/BDY/bdyice.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/BDY/bdyice.F90	(revision 9124)
@@ -58,4 +58,6 @@
       !!----------------------------------------------------------------------
       !
+      IF( ln_timing )   CALL timing_start('bdy_ice')
+      !
       CALL ice_var_glo2eqv
       !
@@ -63,8 +65,6 @@
          !
          SELECT CASE( cn_ice_lim(ib_bdy) )
-         CASE('none')
-            CYCLE
-         CASE('frs')
-            CALL bdy_ice_frs( idx_bdy(ib_bdy), dta_bdy(ib_bdy), kt, ib_bdy )
+         CASE('none')   ;   CYCLE
+         CASE('frs' )   ;   CALL bdy_ice_frs( idx_bdy(ib_bdy), dta_bdy(ib_bdy), kt, ib_bdy )
          CASE DEFAULT
             CALL ctl_stop( 'bdy_ice : unrecognised option for open boundaries for ice fields' )
@@ -73,7 +73,9 @@
       END DO
       !
-                        CALL ice_var_zapsmall
-                        CALL ice_var_agg(1)
+      CALL ice_var_zapsmall
+      CALL ice_var_agg(1)
+      !
       IF( ln_icectl )   CALL ice_prt( kt, iiceprt, jiceprt, 1, ' - ice thermo bdy - ' )
+      IF( ln_timing )   CALL timing_stop('bdy_ice')
       !
    END SUBROUTINE bdy_ice
@@ -102,6 +104,4 @@
       REAL(wp) ::   ztmelts, zdh
       !!------------------------------------------------------------------------------
-      !
-      IF( ln_timing )   CALL timing_start('bdy_ice_frs')
       !
       jgrd = 1      ! Everything is at T-points here
@@ -255,6 +255,4 @@
       IF( jpl > 1 )   CALL ice_itd_reb( kt )
       !      
-      IF( ln_timing )   CALL timing_stop('bdy_ice_frs')
-      !
    END SUBROUTINE bdy_ice_frs
 
@@ -277,6 +275,4 @@
       REAL(wp) ::   zmsk1, zmsk2, zflag
       !!------------------------------------------------------------------------------
-      !
-      IF( ln_timing )   CALL timing_start('bdy_ice_dyn')
       !
       DO ib_bdy=1, nb_bdy
@@ -355,6 +351,4 @@
       END DO
       !
-      IF( ln_timing )   CALL timing_stop('bdy_ice_dyn')
-      !
     END SUBROUTINE bdy_ice_dyn
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/BDY/bdyini.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/BDY/bdyini.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/BDY/bdyini.F90	(revision 9124)
@@ -29,5 +29,4 @@
    USE lib_mpp        ! for mpp_sum  
    USE iom            ! I/O
-   USE timing         ! Timing
 
    IMPLICIT NONE
@@ -74,6 +73,4 @@
       INTEGER  ::   ios                 ! Local integer output status for namelist read
       !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )   CALL timing_start('bdy_init')
 
       ! ------------------------
@@ -112,6 +109,4 @@
          !
       ENDIF
-      !
-      IF( nn_timing == 1 )   CALL timing_stop('bdy_init')
       !
    END SUBROUTINE bdy_init
@@ -156,6 +151,4 @@
       INTEGER  ::   ios                 ! Local integer output status for namelist read
       !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )   CALL timing_start('bdy_segs')
       !
       cgrid = (/'t','u','v'/)
@@ -1314,6 +1307,4 @@
       IF( nb_bdy>0 )   DEALLOCATE( nbidta, nbjdta, nbrdta )
       !
-      IF( nn_timing == 1 )   CALL timing_stop('bdy_segs')
-      !
    END SUBROUTINE bdy_segs
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/BDY/bdylib.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/BDY/bdylib.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/BDY/bdylib.F90	(revision 9124)
@@ -18,5 +18,4 @@
    USE in_out_manager !
    USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
-   USE timing         ! Timing
 
    IMPLICIT NONE
@@ -51,6 +50,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 ) CALL timing_start('bdy_frs')
-      ! 
       igrd = 1                       ! Everything is at T-points here
       DO ib = 1, idx%nblen(igrd)
@@ -63,7 +60,6 @@
       END DO
       !
-      IF( nn_timing == 1 ) CALL timing_stop('bdy_frs')
-      !
    END SUBROUTINE bdy_frs
+
 
    SUBROUTINE bdy_spe( idx, pta, dta )
@@ -82,6 +78,4 @@
       INTEGER  ::   ii, ij         ! 2D addresses
       !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 ) CALL timing_start('bdy_spe')
       !
       igrd = 1                       ! Everything is at T-points here
@@ -94,7 +88,6 @@
       END DO
       !
-      IF( nn_timing == 1 ) CALL timing_stop('bdy_spe')
-      !
    END SUBROUTINE bdy_spe
+
 
    SUBROUTINE bdy_orl( idx, ptb, pta, dta, ll_npo )
@@ -115,13 +108,10 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 ) CALL timing_start('bdy_orl')
-      !
       igrd = 1                       ! Everything is at T-points here
       !
       CALL bdy_orlanski_3d( idx, igrd, ptb(:,:,:), pta(:,:,:), dta, ll_npo )
       !
-      IF( nn_timing == 1 ) CALL timing_stop('bdy_orl')
-      !
    END SUBROUTINE bdy_orl
+
 
    SUBROUTINE bdy_orlanski_2d( idx, igrd, phib, phia, phi_ext, ll_npo )
@@ -161,6 +151,4 @@
       REAL(wp), POINTER, DIMENSION(:,:)          :: pe_ydif    ! scale factors for y-derivatives
       !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )   CALL timing_start('bdy_orlanski_2d')
       !
       ! ----------------------------------!
@@ -279,6 +267,4 @@
       END DO
       !
-      IF( nn_timing == 1 )   CALL timing_stop('bdy_orlanski_2d')
-      !
    END SUBROUTINE bdy_orlanski_2d
 
@@ -320,6 +306,4 @@
       REAL(wp), POINTER, DIMENSION(:,:)          :: pe_ydif    ! scale factors for y-derivatives
       !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )   CALL timing_start('bdy_orlanski_3d')
       !
       ! ----------------------------------!
@@ -441,6 +425,4 @@
       END DO
       !
-      IF( nn_timing == 1 )   CALL timing_stop('bdy_orlanski_3d')
-      !
    END SUBROUTINE bdy_orlanski_3d
 
@@ -462,6 +444,4 @@
       INTEGER  ::   ii, ij, ip, jp   ! 2D addresses
       !!----------------------------------------------------------------------
-      !!
-      IF( nn_timing == 1 ) CALL timing_start('bdy_nmn')
       !
       SELECT CASE(igrd)
@@ -514,6 +494,4 @@
       END DO
       !
-      IF( nn_timing == 1 ) CALL timing_stop('bdy_nmn')
-      !
    END SUBROUTINE bdy_nmn
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/BDY/bdytides.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/BDY/bdytides.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/BDY/bdytides.F90	(revision 9124)
@@ -26,5 +26,4 @@
    USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
    USE wrk_nemo       ! Memory allocation
-   USE timing         ! timing
 
    IMPLICIT NONE
@@ -83,6 +82,4 @@
       NAMELIST/nambdy_tide/filtide, ln_bdytide_2ddta, ln_bdytide_conj
       !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )   CALL timing_start('bdytide_init')
       !
       IF (nb_bdy>0) THEN
@@ -270,6 +267,4 @@
       END DO ! loop on ib_bdy
       !
-      IF( nn_timing == 1 )   CALL timing_stop('bdytide_init')
-      !
    END SUBROUTINE bdytide_init
 
@@ -300,6 +295,4 @@
       REAL(wp), DIMENSION(jpmax_harmo) :: z_sist, z_cost
       !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )   CALL timing_start('bdytide_update')
       !
       ilen0(1) =  SIZE(td%ssh(:,1,1))
@@ -363,6 +356,4 @@
       END DO
       !
-      IF( nn_timing == 1 )   CALL timing_stop('bdytide_update')
-      !
    END SUBROUTINE bdytide_update
 
@@ -391,6 +382,4 @@
       REAL(wp) ::   z_arg, z_sarg, zramp, zoff, z_cost, z_sist      
       !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )   CALL timing_start('bdy_dta_tides')
       !
       lk_first_btstp=.TRUE.
@@ -485,6 +474,4 @@
          END IF
       END DO
-      !
-      IF( nn_timing == 1 ) CALL timing_stop('bdy_dta_tides')
       !
    END SUBROUTINE bdy_dta_tides
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/BDY/bdytra.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/BDY/bdytra.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/BDY/bdytra.F90	(revision 9124)
@@ -78,4 +78,5 @@
    END SUBROUTINE bdy_tra
 
+
    SUBROUTINE bdy_rnf( idx, pta, jpa )
       !!----------------------------------------------------------------------
@@ -96,6 +97,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )   CALL timing_start('bdy_rnf')
-      !
       igrd = 1                       ! Everything is at T-points here
       DO ib = 1, idx%nblenrim(igrd)
@@ -110,7 +109,6 @@
       END DO
       !
-      IF( nn_timing == 1 )   CALL timing_stop('bdy_rnf')
-      !
    END SUBROUTINE bdy_rnf
+
 
    SUBROUTINE bdy_tra_dmp( kt )
@@ -130,5 +128,5 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )   CALL timing_start('bdy_tra_dmp')
+      IF( ln_timing )   CALL timing_start('bdy_tra_dmp')
       !
       DO ib_bdy = 1, nb_bdy
@@ -149,5 +147,5 @@
       END DO
       !
-      IF( nn_timing == 1 )   CALL timing_stop('bdy_tra_dmp')
+      IF( ln_timing )   CALL timing_stop('bdy_tra_dmp')
       !
    END SUBROUTINE bdy_tra_dmp
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/BDY/bdyvol.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/BDY/bdyvol.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/BDY/bdyvol.F90	(revision 9124)
@@ -19,5 +19,4 @@
    USE in_out_manager ! I/O manager
    USE lib_mpp        ! for mppsum
-   USE timing         ! Timing
    USE lib_fortran    ! Fortran routines library
 
@@ -73,6 +72,4 @@
       TYPE(OBC_INDEX), POINTER :: idx
       !!-----------------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )   CALL timing_start('bdy_vol')
       !
       IF( ln_vol ) THEN
@@ -165,6 +162,4 @@
       END IF 
       !
-      IF( nn_timing == 1 )   CALL timing_stop('bdy_vol')
-      !
       END IF ! ln_vol
       !
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/C1D/domc1d.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/C1D/domc1d.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/C1D/domc1d.F90	(revision 9124)
@@ -18,5 +18,4 @@
    USE in_out_manager ! I/O manager (ctmp1)
    USE wrk_nemo                      ! Memory allocation
-   USE timing                        ! Timing
 
    IMPLICIT NONE
@@ -68,6 +67,4 @@
       !!----------------------------------------------------------------------
 
-      IF( nn_timing == 1 )   CALL timing_start('dom_c1d')
-
       REWIND( numnam_ref )              ! Namelist namdom in reference namelist : space & time domain (bathymetry, mesh, timestep)
       READ  ( numnam_ref, namdom, IOSTAT = ios, ERR = 901 )
@@ -198,6 +195,4 @@
       ENDIF
       !
-      IF( nn_timing == 1 )   CALL timing_stop('dom_c1d')
-      !
    END SUBROUTINE dom_c1d
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/C1D/dtauvd.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/C1D/dtauvd.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/C1D/dtauvd.F90	(revision 9124)
@@ -58,6 +58,4 @@
       NAMELIST/namc1d_uvd/ ln_uvd_init, ln_uvd_dyndmp, cn_dir, sn_ucur, sn_vcur
       !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )   CALL timing_start('dta_uvd_init')
       !
       ierr0 = 0   ;   ierr1 = 0   ;   ierr2 = 0  ;   ierr3 = 0
@@ -117,6 +115,4 @@
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('dta_uvd_init')
-      !
    END SUBROUTINE dta_uvd_init
 
@@ -146,5 +142,5 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )   CALL timing_start('dta_uvd')
+      IF( ln_timing )   CALL timing_start('dta_uvd')
       !
       CALL fld_read( kt, 1, sf_uvd )      !==   read U & V current data at time step kt   ==!
@@ -223,5 +219,5 @@
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('dta_uvd')
+      IF( ln_timing )   CALL timing_stop('dta_uvd')
       !
    END SUBROUTINE dta_uvd
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/C1D/dyndmp.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/C1D/dyndmp.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/C1D/dyndmp.F90	(revision 9124)
@@ -157,5 +157,5 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start( 'dyn_dmp' )
+      IF( ln_timing )   CALL timing_start( 'dyn_dmp' )
       !
       CALL wrk_alloc( jpi,jpj,jpk,2,   zuv_dta )
@@ -227,5 +227,5 @@
       CALL wrk_dealloc( jpi,jpj,jpk,2,   zuv_dta )
       !
-      IF( nn_timing == 1 )  CALL timing_stop( 'dyn_dmp')
+      IF( ln_timing )   CALL timing_stop( 'dyn_dmp')
       !
    END SUBROUTINE dyn_dmp
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/CRS/crsdomwri.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/CRS/crsdomwri.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/CRS/crsdomwri.F90	(revision 9124)
@@ -3,10 +3,5 @@
    !! Coarse Ocean initialization : write the coarse ocean domain mesh and mask files
    !!======================================================================
-   !! History :  OPA  ! 1997-02  (G. Madec)  Original code
-   !!            8.1  ! 1999-11  (M. Imbard)  NetCDF FORMAT with IOIPSL
-   !!   NEMO     1.0  ! 2002-08  (G. Madec)  F90 and several file
-   !!            3.0  ! 2008-01  (S. Masson) add dom_uniq_crs
-   !!            4.0  ! 2011-01  (A. R. Porter, STFC Daresbury) dynamical allocation
-   !!                 ! 2012-06  (J. Simeon, C. Calone, C Ethe )  Reduced and modified for coarse grid
+   !! History :  3.6   ! 2012-06  (J. Simeon, C. Calone, C Ethe )  from domwri, reduced and modified for coarse grid
    !!----------------------------------------------------------------------
 
@@ -25,6 +20,4 @@
    USE crslbclnk       ! crs mediator to lbclnk
    USE wrk_nemo        ! Working array
-
-
 
    IMPLICIT NONE
@@ -74,6 +67,4 @@
       REAL(wp), POINTER, DIMENSION(:,:  ) :: ze3tp, ze3wp
       !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )  CALL timing_start('crs_dom_wri')
       !
       CALL wrk_alloc( jpi_crs, jpj_crs,      zprt , zprw  )
@@ -302,7 +293,4 @@
       CALL wrk_dealloc( jpi_crs, jpj_crs, jpk, zdepu, zdepv )
       !
-      IF( nn_timing == 1 )  CALL timing_stop('crs_dom_wri')
-      !
-      
    END SUBROUTINE crs_dom_wri
 
@@ -327,6 +315,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('crs_dom_uniq_crs')
-      !
       CALL wrk_alloc( jpi_crs, jpj_crs, ztstref )
       !
@@ -347,7 +333,4 @@
       CALL wrk_dealloc( jpi_crs, jpj_crs, ztstref )
       !
-      IF( nn_timing == 1 )  CALL timing_stop('crs_dom_uniq_crs')
-      !
-      
    END SUBROUTINE dom_uniq_crs
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/CRS/crsfld.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/CRS/crsfld.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/CRS/crsfld.F90	(revision 9124)
@@ -64,5 +64,5 @@
       !!----------------------------------------------------------------------
       ! 
-      IF( nn_timing == 1 )   CALL timing_start('crs_fld')
+      IF( ln_timing )   CALL timing_start('crs_fld')
 
       ! Depth work arrrays
@@ -243,5 +243,5 @@
       CALL iom_swap( "nemo" )     ! return back on high-resolution grid
       !
-      IF( nn_timing == 1 )   CALL timing_stop('crs_fld')
+      IF( ln_timing )   CALL timing_stop('crs_fld')
       !
    END SUBROUTINE crs_fld
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/CRS/crsini.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/CRS/crsini.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/CRS/crsini.F90	(revision 9124)
@@ -23,5 +23,4 @@
    USE lib_mpp
    USE wrk_nemo 
-   USE timing                   ! Timing
 
    IMPLICIT NONE
@@ -78,6 +77,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('crs_init')
-      !
       IF(lwp) THEN
          WRITE(numout,*)
@@ -250,6 +247,4 @@
       CALL wrk_dealloc( jpi,jpj,jpk,   ze3t, ze3u, ze3v, ze3w )
       !
-      IF( nn_timing == 1 )  CALL timing_stop('crs_init')
-      !
    END SUBROUTINE crs_init
     
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DIA/diaar5.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DIA/diaar5.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DIA/diaar5.F90	(revision 9124)
@@ -13,13 +13,14 @@
    USE dom_oce        ! ocean space and time domain
    USE eosbn2         ! equation of state                (eos_bn2 routine)
-   USE lib_mpp        ! distribued memory computing library
-   USE iom            ! I/O manager library
-   USE timing         ! preformance summary
-   USE wrk_nemo       ! working arrays
-   USE fldread        ! type FLD_N
    USE phycst         ! physical constant
    USE in_out_manager  ! I/O manager
    USE zdfddm
    USE zdf_oce
+   !
+   USE lib_mpp        ! distribued memory computing library
+   USE iom            ! I/O manager library
+   USE fldread        ! type FLD_N
+   USE timing         ! preformance summary
+   USE wrk_nemo       ! working arrays
 
    IMPLICIT NONE
@@ -80,5 +81,5 @@
       REAL(wp), POINTER, DIMENSION(:,:,:,:) :: ztsn                       ! 4D workspace
       !!--------------------------------------------------------------------
-      IF( nn_timing == 1 )   CALL timing_start('dia_ar5')
+      IF( ln_timing )   CALL timing_start('dia_ar5')
  
       IF( kt == nit000 )     CALL dia_ar5_init
@@ -255,7 +256,8 @@
       ENDIF
       !
-      IF( nn_timing == 1 )   CALL timing_stop('dia_ar5')
+      IF( ln_timing )   CALL timing_stop('dia_ar5')
       !
    END SUBROUTINE dia_ar5
+
 
    SUBROUTINE dia_ar5_hst( ktra, cptr, pua, pva ) 
@@ -332,6 +334,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )   CALL timing_start('dia_ar5_init')
-      !
       l_ar5 = .FALSE.
       IF(   iom_use( 'voltot'  ) .OR. iom_use( 'sshtot'    )  .OR. iom_use( 'sshdyn' )  .OR.  & 
@@ -380,6 +380,4 @@
       ENDIF
       !
-      IF( nn_timing == 1 )   CALL timing_stop('dia_ar5_init')
-      !
    END SUBROUTINE dia_ar5_init
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DIA/diacfl.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DIA/diacfl.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DIA/diacfl.F90	(revision 9124)
@@ -60,5 +60,5 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )   CALL timing_start('dia_cfl')
+      IF( ln_timing )   CALL timing_start('dia_cfl')
       !
       !                       ! setup timestep multiplier to account for initial Eulerian timestep
@@ -138,5 +138,5 @@
       ENDIF
       !
-      IF( nn_timing == 1 )   CALL timing_stop('dia_cfl')
+      IF( ln_timing )   CALL timing_stop('dia_cfl')
       !
    END SUBROUTINE dia_cfl
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DIA/diadct.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DIA/diadct.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DIA/diadct.F90	(revision 9124)
@@ -37,5 +37,4 @@
    USE domvvl
    USE timing          ! preformance summary
-   USE wrk_nemo        ! working arrays
 
    IMPLICIT NONE
@@ -121,16 +120,16 @@
 
 
-  SUBROUTINE dia_dct_init
-     !!---------------------------------------------------------------------
-     !!               ***  ROUTINE diadct  ***  
-     !!
-     !!  ** Purpose: Read the namelist parameters
-     !!              Open output files
-     !!
-     !!---------------------------------------------------------------------
-     NAMELIST/namdct/nn_dct,nn_dctwri,nn_secdebug
-     INTEGER  ::   ios                 ! Local integer output status for namelist read
-
-     IF( nn_timing == 1 )   CALL timing_start('dia_dct_init')
+   SUBROUTINE dia_dct_init
+      !!---------------------------------------------------------------------
+      !!               ***  ROUTINE diadct  ***  
+      !!
+      !!  ** Purpose: Read the namelist parameters
+      !!              Open output files
+      !!
+      !!---------------------------------------------------------------------
+      INTEGER  ::   ios                 ! Local integer output status for namelist read
+      !!
+      NAMELIST/namdct/nn_dct,nn_dctwri,nn_secdebug
+      !!---------------------------------------------------------------------
 
      REWIND( numnam_ref )              ! Namelist namdct in reference namelist : Diagnostic: transport through sections
@@ -140,5 +139,5 @@
      REWIND( numnam_cfg )              ! Namelist namdct in configuration namelist : Diagnostic: transport through sections
      READ  ( numnam_cfg, namdct, IOSTAT = ios, ERR = 902 )
-902  IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdct in configuration namelist', lwp )
+902  IF( ios >  0 ) CALL ctl_nam ( ios , 'namdct in configuration namelist', lwp )
      IF(lwm) WRITE ( numond, namdct )
 
@@ -175,11 +174,9 @@
      transports_3d(:,:,:,:)=0.0 
      transports_2d(:,:,:)  =0.0 
-
-     IF( nn_timing == 1 )   CALL timing_stop('dia_dct_init')
      !
   END SUBROUTINE dia_dct_init
  
  
-  SUBROUTINE dia_dct(kt)
+  SUBROUTINE dia_dct( kt )
      !!---------------------------------------------------------------------
      !!               ***  ROUTINE diadct  ***  
@@ -198,22 +195,20 @@
      !!               Reinitialise all relevant arrays to zero 
      !!---------------------------------------------------------------------
-     INTEGER,INTENT(in)        ::kt
+     INTEGER, INTENT(in) ::   kt
      !
-     INTEGER             :: jsec,            &! loop on sections
-                            itotal            ! nb_sec_max*nb_type_class*nb_class_max
-     LOGICAL             :: lldebug =.FALSE.  ! debug a section  
-     
-     INTEGER , DIMENSION(1)             :: ish   ! tmp array for mpp_sum
-     INTEGER , DIMENSION(3)             :: ish2  !   "
-     REAL(wp), POINTER, DIMENSION(:)    :: zwork !   "  
-     REAL(wp), POINTER, DIMENSION(:,:,:):: zsum  !   "
+     INTEGER ::   jsec              ! loop on sections
+     INTEGER ::   itotal            ! nb_sec_max*nb_type_class*nb_class_max
+     LOGICAL ::   lldebug =.FALSE.  ! debug a section  
+     INTEGER              , DIMENSION(1)    ::   ish     ! work array for mpp_sum
+     INTEGER              , DIMENSION(3)    ::   ish2    !   "
+     REAL(wp), ALLOCATABLE, DIMENSION(:)    ::   zwork   !   "  
+     REAL(wp), ALLOCATABLE, DIMENSION(:,:,:)::   zsum    !   "
      !!---------------------------------------------------------------------    
      !
-     IF( nn_timing == 1 )   CALL timing_start('dia_dct')
+     IF( ln_timing )   CALL timing_start('dia_dct')
 
      IF( lk_mpp )THEN
         itotal = nb_sec_max*nb_type_class*nb_class_max
-        CALL wrk_alloc( itotal                                , zwork ) 
-        CALL wrk_alloc( nb_sec_max,nb_type_class,nb_class_max , zsum  )
+        ALLOCATE( zwork(itotal) , zsum(nb_sec_max,nb_type_class,nb_class_max) )
      ENDIF    
  
@@ -286,11 +281,11 @@
      IF( lk_mpp )THEN
         itotal = nb_sec_max*nb_type_class*nb_class_max
-        CALL wrk_dealloc( itotal                                , zwork ) 
-        CALL wrk_dealloc( nb_sec_max,nb_type_class,nb_class_max , zsum  )
+        DEALLOCATE( zwork , zsum  )
      ENDIF    
 
-     IF( nn_timing == 1 )   CALL timing_stop('dia_dct')
+     IF( ln_timing )   CALL timing_stop('dia_dct')
      !
   END SUBROUTINE dia_dct
+
 
   SUBROUTINE readsec 
@@ -304,21 +299,15 @@
      !!
      !!---------------------------------------------------------------------
-     !! * Local variables
      INTEGER :: iptglo , iptloc                               ! Global and local number of points for a section
      INTEGER :: isec, iiglo, ijglo, iiloc, ijloc,iost,i1 ,i2  ! temporary  integer
      INTEGER :: jsec, jpt                                     ! dummy loop indices
-
      INTEGER, DIMENSION(2) :: icoord 
-     CHARACTER(len=160)    :: clname                          !filename
+     LOGICAL               :: llbon, lldebug   ! local logical
+     CHARACTER(len=160)    :: clname           ! filename
      CHARACTER(len=200)    :: cltmp
-     CHARACTER(len=200)    :: clformat                        !automatic format
-     TYPE(POINT_SECTION),DIMENSION(nb_point_max)  ::coordtemp !contains listpoints coordinates 
-                                                              !read in the file
-     INTEGER, POINTER, DIMENSION(:) :: directemp              !contains listpoints directions
-                                                              !read in the files
-     LOGICAL :: llbon                                       ,&!local logical
-                lldebug                                       !debug the section
+     CHARACTER(len=200)    :: clformat                          !automatic format
+     TYPE(POINT_SECTION),DIMENSION(nb_point_max)  ::coordtemp   !contains listpoints coordinates read in the file
+     INTEGER, DIMENSION(nb_point_max) :: directemp              !contains listpoints directions read in the files
      !!-------------------------------------------------------------------------------------
-     CALL wrk_alloc( nb_point_max, directemp )
 
      !open input file
@@ -491,8 +480,7 @@
  
      nb_sec = jsec-1   !number of section read in the file
-
-     CALL wrk_dealloc( nb_point_max, directemp )
      !
   END SUBROUTINE readsec
+
 
   SUBROUTINE removepoints(sec,cdind,cdextr,ld_debug)
@@ -518,10 +506,8 @@
                 istart,iend      !first and last points selected in listpoint
      INTEGER :: jpoint           !loop on list points
-     INTEGER, POINTER, DIMENSION(:)   :: idirec !contains temporary sec%direction
-     INTEGER, POINTER, DIMENSION(:,:) :: icoord !contains temporary sec%listpoint
+     INTEGER, POINTER, DIMENSION(nb_point_max)   :: idirec !contains temporary sec%direction
+     INTEGER, POINTER, DIMENSION(2,nb_point_max) :: icoord !contains temporary sec%listpoint
      !----------------------------------------------------------------------------
-     CALL wrk_alloc(    nb_point_max, idirec )
-     CALL wrk_alloc( 2, nb_point_max, icoord )
-
+      !
      IF( ld_debug )WRITE(numout,*)'      -------------------------'
      IF( ld_debug )WRITE(numout,*)'      removepoints in listpoint'
@@ -571,10 +557,8 @@
         WRITE(numout,*)'      sec%direction after removepoints :',sec%direction(1:sec%nb_point)
      ENDIF
-
-     CALL wrk_dealloc(    nb_point_max, idirec )
-     CALL wrk_dealloc( 2, nb_point_max, icoord )
-  END SUBROUTINE removepoints
-
-  SUBROUTINE transport(sec,ld_debug,jsec)
+      !
+   END SUBROUTINE removepoints
+
+   SUBROUTINE transport(sec,ld_debug,jsec)
      !!-------------------------------------------------------------------------------------------
      !!                     ***  ROUTINE transport  ***
@@ -596,18 +580,13 @@
      !!
      !!-------------------------------------------------------------------------------------------
-     !! * Arguments
      TYPE(SECTION),INTENT(INOUT) :: sec
      LOGICAL      ,INTENT(IN)    :: ld_debug
      INTEGER      ,INTENT(IN)    :: jsec        ! numeric identifier of section
-    
-     !! * Local variables
-     INTEGER             :: jk, jseg, jclass,jl,                 &!loop on level/segment/classes/ice categories
-                            isgnu, isgnv                          ! 
-     REAL(wp)            :: zumid, zvmid,                        &!U/V velocity on a cell segment 
-                            zumid_ice, zvmid_ice,                &!U/V ice velocity 
-                            zTnorm                                !transport of velocity through one cell's sides 
-     REAL(wp)            :: ztn, zsn, zrhoi, zrhop, zsshn, zdep !temperature/salinity/potential density/ssh/depth at u/v point
-
-     TYPE(POINT_SECTION) :: k
+     !
+     INTEGER ::   jk, jseg, jclass,jl, isgnu, isgnv    ! loop on level/segment/classes/ice categories
+     REAL(wp)::   zumid, zvmid, zumid_ice, zvmid_ice   ! U/V ocean & ice velocity on a cell segment 
+     REAL(wp)::   zTnorm                               ! transport of velocity through one cell's sides 
+     REAL(wp)::   ztn, zsn, zrhoi, zrhop, zsshn, zdep  ! temperature/salinity/potential density/ssh/depth at u/v point
+     TYPE(POINT_SECTION) ::   k
       !!--------------------------------------------------------
       !
@@ -1008,7 +987,6 @@
      REAL(wp)              :: zslope             ! section's slope coeff
      !
-     REAL(wp), POINTER, DIMENSION(:):: zsumclasses ! 1D workspace 
+     REAL(wp), DIMENSION(nb_type_class)::   zsumclasses   ! 1D workspace 
      !!------------------------------------------------------------- 
-     CALL wrk_alloc(nb_type_class , zsumclasses )  
 
      zsumclasses(:)=0._wp
@@ -1121,6 +1099,4 @@
 118   FORMAT(I8,1X,I8,1X,I4,1X,A30,1X,f9.2,1X,I4,3X,A8,1X,2F12.4,5X,3F12.4)
 119   FORMAT(I8,1X,I8,1X,I4,1X,A30,1X,f9.2,1X,I4,3X,A8,1X,2F12.4,5X,3E15.6)
-
-      CALL wrk_dealloc(nb_type_class , zsumclasses )  
       !
    END SUBROUTINE dia_dct_wri
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DIA/diaharm.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DIA/diaharm.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DIA/diaharm.F90	(revision 9124)
@@ -22,5 +22,4 @@
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
    USE timing          ! preformance summary
-   USE wrk_nemo        ! working arrays
 
    IMPLICIT NONE
@@ -177,12 +176,12 @@
       REAL(wp) :: ztime, ztemp
       !!--------------------------------------------------------------------
-      IF( nn_timing == 1 )   CALL timing_start('dia_harm')
-
-      IF( kt == nit000 ) CALL dia_harm_init
-
+      IF( ln_timing )   CALL timing_start('dia_harm')
+      !
+      IF( kt == nit000 )   CALL dia_harm_init
+      !
       IF( kt >= nit000_han .AND. kt <= nitend_han .AND. MOD(kt,nstep_han) == 0 ) THEN
-
+         !
          ztime = (kt-nit000+1) * rdt 
-       
+         !
          nhc = 0
          DO jh = 1, nb_ana
@@ -191,5 +190,5 @@
                ztemp =(     MOD(jc,2) * ft(jh) *COS(ana_freq(jh)*ztime + vt(jh) + ut(jh))  &
                   &    +(1.-MOD(jc,2))* ft(jh) *SIN(ana_freq(jh)*ztime + vt(jh) + ut(jh)))
-
+                  !
                DO jj = 1,jpj
                   DO ji = 1,jpi
@@ -205,9 +204,9 @@
          !       
       END IF
-
-      IF ( kt == nitend_han )   CALL dia_harm_end
-
-      IF( nn_timing == 1 )   CALL timing_stop('dia_harm')
- 
+      !
+      IF( kt == nitend_han )   CALL dia_harm_end
+      !
+      IF( ln_timing )   CALL timing_stop('dia_harm')
+      !
    END SUBROUTINE dia_harm
 
@@ -225,9 +224,8 @@
       INTEGER :: ksp, kun, keq
       REAL(wp) :: ztime, ztime_ini, ztime_end
-      REAL(wp) :: X1,X2
-      REAL(wp), POINTER, DIMENSION(:,:,:,:) :: ana_amp
-      !!--------------------------------------------------------------------
-      CALL wrk_alloc( jpi , jpj , jpmax_harmo , 2 , ana_amp )
-
+      REAL(wp) :: X1, X2
+      REAL(wp), DIMENSION(jpi,jpj,jpmax_harmo,2) ::   ana_amp   ! workspace
+      !!--------------------------------------------------------------------
+      !
       IF(lwp) WRITE(numout,*)
       IF(lwp) WRITE(numout,*) 'anharmo_end: kt=nitend_han: Perform harmonic analysis'
@@ -364,7 +362,6 @@
          END DO
       END DO
-
+      !
       CALL dia_wri_harm ! Write results in files
-      CALL wrk_dealloc( jpi , jpj , jpmax_harmo , 2 , ana_amp )
       !
    END SUBROUTINE dia_harm_end
@@ -427,10 +424,8 @@
       INTEGER                         :: ji_sd, jj_sd, ji1_sd, ji2_sd, jk1_sd, jk2_sd
       REAL(wp)                        :: zval1, zval2, zx1
-      REAL(wp), POINTER, DIMENSION(:) :: ztmpx, zcol1, zcol2
-      INTEGER , POINTER, DIMENSION(:) :: ipos2, ipivot
+      REAL(wp), DIMENSION(jpincomax) :: ztmpx, zcol1, zcol2
+      INTEGER , DIMENSION(jpincomax) :: ipos2, ipivot
       !---------------------------------------------------------------------------------
-      CALL wrk_alloc( jpincomax , ztmpx , zcol1 , zcol2 )
-      CALL wrk_alloc( jpincomax , ipos2 , ipivot        )
-            
+      !            
       IF( init == 1 ) THEN
          IF( nsparse > jpdimsparse )   CALL ctl_stop( 'STOP', 'SUR_DETERMINE : nsparse .GT. jpdimsparse')
@@ -517,7 +512,4 @@
          ztmp7(ipos1(jj_sd))=ztmpx(jj_sd)
       END DO
-
-      CALL wrk_dealloc( jpincomax , ztmpx , zcol1 , zcol2 )
-      CALL wrk_dealloc( jpincomax , ipos2 , ipivot        )
       !
    END SUBROUTINE SUR_DETERMINE
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DIA/diahsb.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DIA/diahsb.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DIA/diahsb.F90	(revision 9124)
@@ -31,5 +31,4 @@
    USE lib_mpp         ! distributed memory computing library
    USE timing          ! preformance summary
-   USE wrk_nemo        ! work arrays
 
    IMPLICIT NONE
@@ -82,9 +81,7 @@
       REAL(wp)   ::   z_wn_trd_t , z_wn_trd_s     !    -     -
       REAL(wp)   ::   z_ssh_hc , z_ssh_sc         !    -     -
-      REAL(wp), DIMENSION(:,:), POINTER ::   z2d0, z2d1
-      !!---------------------------------------------------------------------------
-      IF( nn_timing == 1 )   CALL timing_start('dia_hsb')      
-      !
-      CALL wrk_alloc( jpi,jpj,   z2d0, z2d1 )
+      REAL(wp), DIMENSION(jpi,jpj) ::   z2d0, z2d1   ! 2D workspace
+      !!---------------------------------------------------------------------------
+      IF( ln_timing )   CALL timing_start('dia_hsb')      
       !
       tsn(:,:,:,1) = tsn(:,:,:,1) * tmask(:,:,:) ; tsb(:,:,:,1) = tsb(:,:,:,1) * tmask(:,:,:) ;
@@ -228,7 +225,5 @@
       IF( lrst_oce )   CALL dia_hsb_rst( kt, 'WRITE' )
       !
-      CALL wrk_dealloc( jpi,jpj,   z2d0, z2d1 )
-      !
-      IF( nn_timing == 1 )   CALL timing_stop('dia_hsb')
+      IF( ln_timing )   CALL timing_stop('dia_hsb')
       !
    END SUBROUTINE dia_hsb
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DIA/diahth.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DIA/diahth.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DIA/diahth.F90	(revision 9124)
@@ -104,5 +104,5 @@
       REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   zdelr      ! delta rho equivalent to deltaT = 0.2
       !!----------------------------------------------------------------------
-      IF( nn_timing == 1 )   CALL timing_start('dia_hth')
+      IF( ln_timing )   CALL timing_start('dia_hth')
 
       IF( kt == nit000 ) THEN
@@ -332,5 +332,5 @@
       CALL iom_put( "hc300", htc3 )      ! first 300m heat content
       !
-      IF( nn_timing == 1 )   CALL timing_stop('dia_hth')
+      IF( ln_timing )   CALL timing_stop('dia_hth')
       !
    END SUBROUTINE dia_hth
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DIA/diaptr.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DIA/diaptr.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DIA/diaptr.F90	(revision 9124)
@@ -37,5 +37,5 @@
    PUBLIC   ptr_sj         ! call by tra_ldf & tra_adv routines
    PUBLIC   ptr_sjk        ! 
-   PUBLIC   dia_ptr_init   ! call in step module
+   PUBLIC   dia_ptr_init   ! call in memogcm
    PUBLIC   dia_ptr        ! call in step module
    PUBLIC   dia_ptr_hst    ! called from tra_ldf/tra_adv routines
@@ -96,5 +96,5 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )   CALL timing_start('dia_ptr')
+      IF( ln_timing )   CALL timing_start('dia_ptr')
 
       !
@@ -373,5 +373,5 @@
       ENDIF
       !
-      IF( nn_timing == 1 )   CALL timing_stop('dia_ptr')
+      IF( ln_timing )   CALL timing_stop('dia_ptr')
       !
    END SUBROUTINE dia_ptr
@@ -457,4 +457,5 @@
       ! 
    END SUBROUTINE dia_ptr_init
+
 
    SUBROUTINE dia_ptr_hst( ktra, cptr, pva ) 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DIA/diatmb.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DIA/diatmb.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DIA/diatmb.F90	(revision 9124)
@@ -12,6 +12,4 @@
    USE in_out_manager  ! I/O units
    USE iom             ! I/0 library
-   USE wrk_nemo        ! working arrays
-
 
    IMPLICIT NONE
@@ -42,11 +40,11 @@
       !!----------------------------------------------------------------------
       !
-      REWIND ( numnam_ref )              ! Read Namelist nam_diatmb in reference namelist : TMB diagnostics
-      READ   ( numnam_ref, nam_diatmb, IOSTAT=ios, ERR= 901 )
+      REWIND( numnam_ref )              ! Read Namelist nam_diatmb in reference namelist : TMB diagnostics
+      READ  ( numnam_ref, nam_diatmb, IOSTAT=ios, ERR= 901 )
 901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_diatmb in reference namelist', lwp )
  
       REWIND( numnam_cfg )              ! Namelist nam_diatmb in configuration namelist  TMB diagnostics
       READ  ( numnam_cfg, nam_diatmb, IOSTAT = ios, ERR = 902 )
-902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_diatmb in configuration namelist', lwp )
+902   IF( ios >  0 ) CALL ctl_nam ( ios , 'nam_diatmb in configuration namelist', lwp )
       IF(lwm) WRITE ( numond, nam_diatmb )
 
@@ -72,10 +70,10 @@
       !!
       !!----------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi, jpj, jpk), INTENT(in   ) :: pfield   ! Input 3d field and mask
-      REAL(wp), DIMENSION(jpi, jpj,  3 ), INTENT(  out) :: ptmb     ! top, middle, bottom extracted from pfield
+      REAL(wp), DIMENSION(jpi, jpj, jpk), INTENT(in   ) ::   pfield   ! Input 3D field and mask
+      REAL(wp), DIMENSION(jpi, jpj,  3 ), INTENT(  out) ::   ptmb     ! top, middle, bottom extracted from pfield
       !
-      INTEGER  ::   ji, jj  ! Dummy loop indices
-      INTEGER  ::   itop, imid, ibot  ! local integers
-      REAL(wp) ::   zmdi = 1.e+20_wp  ! land value
+      INTEGER ::   ji, jj   ! Dummy loop indices
+      INTEGER ::   itop, imid, ibot   ! local integers
+      REAL(wp)::   zmdi = 1.e+20_wp   ! land value
       !!---------------------------------------------------------------------
       !
@@ -86,7 +84,7 @@
             imid =  itop + ( ibot - itop + 1 ) / 2    ! middle ocean          
             !                    
-            ptmb(ji,jj,1) = pfield(ji,jj,itop)*tmask(ji,jj,itop)  + zmdi*( 1._wp-tmask(ji,jj,itop) )
-            ptmb(ji,jj,2) = pfield(ji,jj,imid)*tmask(ji,jj,imid)  + zmdi*( 1._wp-tmask(ji,jj,imid) )
-            ptmb(ji,jj,3) = pfield(ji,jj,ibot)*tmask(ji,jj,ibot)  + zmdi*( 1._wp-tmask(ji,jj,ibot) )
+            ptmb(ji,jj,1) = pfield(ji,jj,itop)*tmask(ji,jj,itop) + zmdi*( 1._wp-tmask(ji,jj,itop) )
+            ptmb(ji,jj,2) = pfield(ji,jj,imid)*tmask(ji,jj,imid) + zmdi*( 1._wp-tmask(ji,jj,imid) )
+            ptmb(ji,jj,3) = pfield(ji,jj,ibot)*tmask(ji,jj,ibot) + zmdi*( 1._wp-tmask(ji,jj,ibot) )
          END DO
       END DO
@@ -105,39 +103,31 @@
       !!--------------------------------------------------------------------
       REAL(wp) ::   zmdi =1.e+20     ! land value
-      REAL(wp), POINTER, DIMENSION(:,:,:) :: zwtmb    ! workspace 
+      REAL(wp), DIMENSION(jpi,jpj,3) ::   zwtmb   ! workspace 
       !!--------------------------------------------------------------------
       !
-      IF (ln_diatmb) THEN
-         CALL wrk_alloc( jpi,jpj,3   , zwtmb )
-         CALL dia_calctmb(  tsn(:,:,:,jp_tem),zwtmb )
-         !ssh already output but here we output it masked
-         CALL iom_put( "sshnmasked" , sshn(:,:)*tmask(:,:,1) + zmdi*(1.0 - tmask(:,:,1)) )
-         CALL iom_put( "top_temp" , zwtmb(:,:,1) )    ! tmb Temperature
-         CALL iom_put( "mid_temp" , zwtmb(:,:,2) )    ! tmb Temperature
-         CALL iom_put( "bot_temp" , zwtmb(:,:,3) )    ! tmb Temperature
-!         CALL iom_put( "sotrefml" , hmld_tref(:,:) )    ! "T criterion Mixed Layer Depth
-
-         CALL dia_calctmb(  tsn(:,:,:,jp_sal),zwtmb )
-         CALL iom_put( "top_sal" , zwtmb(:,:,1) )    ! tmb Salinity 
-         CALL iom_put( "mid_sal" , zwtmb(:,:,2) )    ! tmb Salinity
-         CALL iom_put( "bot_sal" , zwtmb(:,:,3) )    ! tmb Salinity
-
-         CALL dia_calctmb(  un(:,:,:),zwtmb )
-         CALL iom_put( "top_u" , zwtmb(:,:,1) )    ! tmb  U Velocity
-         CALL iom_put( "mid_u" , zwtmb(:,:,2) )    ! tmb  U Velocity
-         CALL iom_put( "bot_u" , zwtmb(:,:,3) )    ! tmb  U Velocity
-!Called in  dynspg_ts.F90        CALL iom_put( "baro_u" , un_b )    ! Barotropic  U Velocity
-
-         CALL dia_calctmb(  vn(:,:,:),zwtmb )
-         CALL iom_put( "top_v" , zwtmb(:,:,1) )    ! tmb  V Velocity
-         CALL iom_put( "mid_v" , zwtmb(:,:,2) )    ! tmb  V Velocity
-         CALL iom_put( "bot_v" , zwtmb(:,:,3) )    ! tmb  V Velocity
-!Called in  dynspg_ts.F90       CALL iom_put( "baro_v" , vn_b )    ! Barotropic  V Velocity
-         CALL wrk_dealloc( jpi,jpj,3   , zwtmb )
-      ELSE
-         CALL ctl_warn('dia_tmb: tmb diagnostic is set to false you should not have seen this')
-      ENDIF
+      CALL dia_calctmb( tsn(:,:,:,jp_tem), zwtmb )
+      !ssh already output but here we output it masked
+      CALL iom_put( "sshnmasked", sshn(:,:)*tmask(:,:,1) + zmdi*(1.0 - tmask(:,:,1)) )
+      CALL iom_put( "top_temp"  , zwtmb(:,:,1) )    ! tmb Temperature
+      CALL iom_put( "mid_temp"  , zwtmb(:,:,2) )    ! tmb Temperature
+      CALL iom_put( "bot_temp"  , zwtmb(:,:,3) )    ! tmb Temperature
+      !
+      CALL dia_calctmb( tsn(:,:,:,jp_sal), zwtmb )
+      CALL iom_put( "top_sal"   , zwtmb(:,:,1) )    ! tmb Salinity 
+      CALL iom_put( "mid_sal"   , zwtmb(:,:,2) )    ! tmb Salinity
+      CALL iom_put( "bot_sal"   , zwtmb(:,:,3) )    ! tmb Salinity
+      !
+      CALL dia_calctmb( un(:,:,:), zwtmb )
+      CALL iom_put( "top_u"     , zwtmb(:,:,1) )    ! tmb  U Velocity
+      CALL iom_put( "mid_u"     , zwtmb(:,:,2) )    ! tmb  U Velocity
+      CALL iom_put( "bot_u"     , zwtmb(:,:,3) )    ! tmb  U Velocity
+      !
+      CALL dia_calctmb( vn(:,:,:), zwtmb )
+      CALL iom_put( "top_v"     , zwtmb(:,:,1) )    ! tmb  V Velocity
+      CALL iom_put( "mid_v"     , zwtmb(:,:,2) )    ! tmb  V Velocity
+      CALL iom_put( "bot_v"     , zwtmb(:,:,3) )    ! tmb  V Velocity
       !
    END SUBROUTINE dia_tmb
+
    !!======================================================================
 END MODULE diatmb
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90	(revision 9124)
@@ -126,5 +126,5 @@
       !!----------------------------------------------------------------------
       ! 
-      IF( nn_timing == 1 )   CALL timing_start('dia_wri')
+      IF( ln_timing )   CALL timing_start('dia_wri')
       ! 
       ! Output the initial state and forcings
@@ -402,5 +402,5 @@
       IF (ln_dia25h)   CALL dia_25h( kt )             ! 25h averaging
 
-      IF( nn_timing == 1 )   CALL timing_stop('dia_wri')
+      IF( ln_timing )   CALL timing_stop('dia_wri')
       !
    END SUBROUTINE dia_wri
@@ -438,5 +438,5 @@
       !!----------------------------------------------------------------------
       ! 
-      IF( nn_timing == 1 )   CALL timing_start('dia_wri')
+      IF( ln_timing )   CALL timing_start('dia_wri')
       !
       IF( ninist == 1 ) THEN     !==  Output the initial state and forcings  ==!
@@ -859,5 +859,5 @@
       ENDIF
       !
-      IF( nn_timing == 1 )   CALL timing_stop('dia_wri')
+      IF( ln_timing )   CALL timing_stop('dia_wri')
       !
    END SUBROUTINE dia_wri
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DIU/step_diu.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DIU/step_diu.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DIU/step_diu.F90	(revision 9124)
@@ -77,5 +77,5 @@
       &    qsr, qns, taum, rhop(:,:,1), rdt) 
 
-      IF(ln_diurnal_only) THEN
+      IF( ln_diurnal_only ) THEN
          IF( ln_diaobs )         CALL dia_obs( kstp )         ! obs-minus-model (assimilation) diagnostics (call after dynamics update)
      
@@ -86,5 +86,5 @@
          IF( lrst_oce         )   CALL rst_write    ( kstp )   ! write output ocean restart file
      
-         IF( nn_timing == 1 .AND.  kstp == nit000  )   CALL timing_reset 
+         IF( ln_timing .AND.  kstp == nit000  )   CALL timing_reset 
       ENDIF
        
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DOM/daymod.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DOM/daymod.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DOM/daymod.F90	(revision 9124)
@@ -284,5 +284,5 @@
    SUBROUTINE day_rst( kt, cdrw )
       !!---------------------------------------------------------------------
-      !!                   ***  ROUTINE ts_rst  ***
+      !!                   ***  ROUTINE day_rst  ***
       !!
       !!  ** Purpose : Read or write calendar in restart file:
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90	(revision 9124)
@@ -44,5 +44,4 @@
    USE lbclnk         ! ocean lateral boundary condition (or mpp link)
    USE lib_mpp        ! distributed memory computing library
-   USE timing         ! Timing
 
    IMPLICIT NONE
@@ -80,6 +79,4 @@
       REAL(wp), DIMENSION(jpi,jpj) ::   z1_hu_0, z1_hv_0
       !!----------------------------------------------------------------------
-      !
-      IF( ln_timing )   CALL timing_start('dom_init')
       !
       IF(lwp) THEN         ! Ocean domain Parameters (control print)
@@ -191,6 +188,4 @@
       !
       IF( ln_write_cfg )   CALL cfg_write         ! create the configuration file
-      !
-      IF( ln_timing )   CALL timing_stop('dom_init')
       !
    END SUBROUTINE dom_init
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DOM/dommsk.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DOM/dommsk.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DOM/dommsk.F90	(revision 9124)
@@ -26,9 +26,9 @@
    USE dom_oce        ! ocean space and time domain
    USE usrdef_fmask   ! user defined fmask
-   USE bdy_oce      
+   USE bdy_oce        ! open boundary
+   !
    USE in_out_manager ! I/O manager
    USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
    USE lib_mpp        ! Massively Parallel Processing library
-   USE timing         ! Timing
 
    IMPLICIT NONE
@@ -102,6 +102,4 @@
          &             ln_vol, nn_volctl, nn_rimwidth, nb_jpk_bdy
       !!---------------------------------------------------------------------
-      !
-      IF( ln_timing )   CALL timing_start('dom_msk')
       !
       REWIND( numnam_ref )              ! Namelist namlbc in reference namelist : Lateral momentum boundary condition
@@ -295,7 +293,4 @@
       CALL usr_def_fmask( cn_cfg, nn_cfg, fmask )
       !
-      !
-      IF( ln_timing )   CALL timing_stop('dom_msk')
-      !
    END SUBROUTINE dom_msk
    
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DOM/domngb.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DOM/domngb.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DOM/domngb.F90	(revision 9124)
@@ -14,5 +14,4 @@
    USE in_out_manager ! I/O manager
    USE lib_mpp        ! for mppsum
-   USE timing         ! Timing
 
    IMPLICIT NONE
@@ -48,6 +47,4 @@
       !!--------------------------------------------------------------------
       !
-      IF( ln_timing )   CALL timing_start('dom_ngb')
-      !
       zmask(:,:) = 0._wp
       ik = 1
@@ -77,6 +74,4 @@
       ENDIF
       !
-      IF( ln_timing )   CALL timing_stop('dom_ngb')
-      !
    END SUBROUTINE dom_ngb
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DOM/domvvl.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DOM/domvvl.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DOM/domvvl.F90	(revision 9124)
@@ -119,6 +119,4 @@
       REAL(wp)::   zcoef
       !!----------------------------------------------------------------------
-      !
-      IF( ln_timing )   CALL timing_start('dom_vvl_init')
       !
       IF(lwp) WRITE(numout,*)
@@ -239,6 +237,4 @@
          ENDIF
       ENDIF
-      !
-      IF( ln_timing )   CALL timing_stop('dom_vvl_init')
       !
    END SUBROUTINE dom_vvl_init
@@ -674,6 +670,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( ln_timing )   CALL timing_start('dom_vvl_interpol')
-      !
       IF(ln_wd_il) THEN
         zlnwd = 1.0_wp
@@ -761,6 +755,4 @@
       END SELECT
       !
-      IF( ln_timing )   CALL timing_stop('dom_vvl_interpol')
-      !
    END SUBROUTINE dom_vvl_interpol
 
@@ -784,6 +776,4 @@
       INTEGER ::   id1, id2, id3, id4, id5     ! local integers
       !!----------------------------------------------------------------------
-      !
-      IF( ln_timing )   CALL timing_start('dom_vvl_rst')
       !
       IF( TRIM(cdrw) == 'READ' ) THEN        ! Read/initialise 
@@ -957,6 +947,4 @@
       ENDIF
       !
-      IF( ln_timing )   CALL timing_stop('dom_vvl_rst')
-      !
    END SUBROUTINE dom_vvl_rst
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DOM/domwri.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DOM/domwri.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DOM/domwri.F90	(revision 9124)
@@ -24,5 +24,4 @@
    USE lbclnk          ! lateral boundary conditions - mpp exchanges
    USE lib_mpp         ! MPP library
-   USE timing          ! Timing
 
    IMPLICIT NONE
@@ -77,6 +76,4 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zdepu, zdepv   ! 3D workspace
       !!----------------------------------------------------------------------
-      !
-      IF( ln_timing )   CALL timing_start('dom_wri')
       !
       IF(lwp) WRITE(numout,*)
@@ -200,6 +197,4 @@
       !                                     ! ============================
       !
-      IF( ln_timing )   CALL timing_stop('dom_wri')
-      !
    END SUBROUTINE dom_wri
 
@@ -222,6 +217,4 @@
       REAL(wp), DIMENSION(jpi,jpj) ::   ztstref
       !!----------------------------------------------------------------------
-      !
-      IF( ln_timing )   CALL timing_start('dom_uniq')
       !
       ! build an array with different values for each element 
@@ -238,6 +231,4 @@
       ! fill only the inner part of the cpu with llbl converted into real 
       puniq(nldi:nlei,nldj:nlej) = REAL( COUNT( lldbl(nldi:nlei,nldj:nlej,:), dim = 3 ) , wp )
-      !
-      IF( ln_timing )   CALL timing_stop('dom_uniq')
       !
    END SUBROUTINE dom_uniq
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90	(revision 9124)
@@ -36,5 +36,4 @@
    USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
    USE lib_mpp        ! distributed memory computing library
-   USE timing         ! Timing
 
    IMPLICIT NONE
@@ -75,6 +74,4 @@
       REAL(wp) ::   zrefdep             ! depth of the reference level (~10m)
       !!----------------------------------------------------------------------
-      !
-      IF( ln_timing )   CALL timing_start('dom_zgr')
       !
       IF(lwp) THEN                     ! Control print
@@ -162,6 +159,4 @@
             &                          ' w ', MAXVAL(   e3w_0(:,:,:) )
       ENDIF
-      !
-      IF( ln_timing )   CALL timing_stop('dom_zgr')
       !
    END SUBROUTINE dom_zgr
@@ -285,6 +280,4 @@
       REAL(wp), DIMENSION(jpi,jpj) ::   zk   ! workspace
       !!----------------------------------------------------------------------
-      !
-      IF( ln_timing )   CALL timing_start('zgr_top_bot')
       !
       IF(lwp) WRITE(numout,*)
@@ -316,6 +309,4 @@
       zk(:,:) = REAL( mbkv(:,:), wp )   ;   CALL lbc_lnk( zk, 'V', 1. )   ;   mbkv(:,:) = MAX( INT( zk(:,:) ), 1 )
       !
-      IF( ln_timing )   CALL timing_stop('zgr_top_bot')
-      !
    END SUBROUTINE zgr_top_bot
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DOM/dtatsd.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DOM/dtatsd.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DOM/dtatsd.F90	(revision 9124)
@@ -22,5 +22,4 @@
    USE in_out_manager  ! I/O manager
    USE lib_mpp         ! MPP library
-   USE timing          ! Timing
 
    IMPLICIT NONE
@@ -61,6 +60,4 @@
       NAMELIST/namtsd/   ln_tsd_init, ln_tsd_tradmp, cn_dir, sn_tem, sn_sal
       !!----------------------------------------------------------------------
-      !
-      IF( ln_timing )   CALL timing_start('dta_tsd_init')
       !
       !  Initialisation
@@ -120,6 +117,4 @@
       ENDIF
       !
-      IF( ln_timing )   CALL timing_stop('dta_tsd_init')
-      !
    END SUBROUTINE dta_tsd_init
 
@@ -148,6 +143,4 @@
       REAL(wp), DIMENSION(jpk) ::  ztp, zsp   ! 1D workspace
       !!----------------------------------------------------------------------
-      !
-      IF( ln_timing )   CALL timing_start('dta_tsd')
       !
       CALL fld_read( kt, 1, sf_tsd )      !==   read T & S data at kt time step   ==!
@@ -256,6 +249,4 @@
       ENDIF
       !
-      IF( ln_timing )   CALL timing_stop('dta_tsd')
-      !
    END SUBROUTINE dta_tsd
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DOM/istate.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DOM/istate.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DOM/istate.F90	(revision 9124)
@@ -36,5 +36,4 @@
    USE lib_mpp         ! MPP library
    USE restart         ! restart
-   USE timing          ! Timing
 
    IMPLICIT NONE
@@ -63,6 +62,4 @@
 !!gm end
       !!----------------------------------------------------------------------
-      !
-      IF( ln_timing )   CALL timing_start('istate_init')
       !
       IF(lwp) WRITE(numout,*)
@@ -165,6 +162,4 @@
       vb_b(:,:) = vb_b(:,:) * r1_hv_b(:,:)
       !
-      IF( ln_timing )   CALL timing_stop('istate_init')
-      !
    END SUBROUTINE istate_init
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv_cen2.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv_cen2.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv_cen2.F90	(revision 9124)
@@ -20,5 +20,4 @@
    USE lib_mpp        ! MPP library
    USE prtctl         ! Print control
-   USE timing         ! Timing
 
    IMPLICIT NONE
@@ -53,6 +52,4 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk) ::  zfv_t, zfv_f, zfv_vw, zfv, zfw
       !!----------------------------------------------------------------------
-      !
-      IF( ln_timing )   CALL timing_start('dyn_adv_cen2')
       !
       IF( kt == nit000 .AND. lwp ) THEN
@@ -145,6 +142,4 @@
          &                       tab3d_2=va, clinfo2=           ' Va: ', mask2=vmask, clinfo3='dyn' )
       !
-      IF( ln_timing )   CALL timing_stop('dyn_adv_cen2')
-      !
    END SUBROUTINE dyn_adv_cen2
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv_ubs.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv_ubs.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv_ubs.F90	(revision 9124)
@@ -23,5 +23,4 @@
    USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
    USE lib_mpp        ! MPP library
-   USE timing         ! Timing
 
    IMPLICIT NONE
@@ -79,6 +78,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( ln_timing )   CALL timing_start('dyn_adv_ubs')
-      !
       IF( kt == nit000 ) THEN
          IF(lwp) WRITE(numout,*)
@@ -238,6 +235,4 @@
          &                       tab3d_2=va, clinfo2=           ' Va: ', mask2=vmask, clinfo3='dyn' )
       !
-      IF( ln_timing )   CALL timing_stop('dyn_adv_ubs')
-      !
    END SUBROUTINE dyn_adv_ubs
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/dynbfr.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/dynbfr.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/dynbfr.F90	(revision 9124)
@@ -21,5 +21,4 @@
    USE in_out_manager ! I/O manager
    USE prtctl         ! Print control
-   USE timing         ! Timing
 
    IMPLICIT NONE
@@ -56,6 +55,4 @@
       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   ztrdu, ztrdv
       !!---------------------------------------------------------------------
-      !
-      IF( ln_timing )   CALL timing_start('dyn_bfr')
       !
 !!gm bug : time step is only rdt (not 2 rdt if euler start !)
@@ -109,6 +106,4 @@
          &                       tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
       !
-      IF( ln_timing )   CALL timing_stop('dyn_bfr')
-      !
    END SUBROUTINE dyn_bfr
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_iso.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_iso.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_iso.F90	(revision 9124)
@@ -28,5 +28,4 @@
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
    USE prtctl          ! Print control
-   USE timing          ! Timing
 
    IMPLICIT NONE
@@ -114,6 +113,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( ln_timing )   CALL timing_start('dyn_ldf_iso')
-      !
       IF( kt == nit000 ) THEN
          IF(lwp) WRITE(numout,*)
@@ -399,7 +396,4 @@
       END DO                                           !   End of slab
       !                                                ! ===============
-      !
-      IF( ln_timing )   CALL timing_stop('dyn_ldf_iso')
-      !
    END SUBROUTINE dyn_ldf_iso
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_lap_blp.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_lap_blp.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_lap_blp.F90	(revision 9124)
@@ -19,5 +19,4 @@
    USE in_out_manager ! I/O manager
    USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
-   USE timing         ! Timing
 
    IMPLICIT NONE
@@ -65,6 +64,4 @@
       ENDIF
       !
-      IF( ln_timing )   CALL timing_start('dyn_ldf_lap')
-      !
       IF( kpass == 1 ) THEN   ;   zsign =  1._wp      ! bilaplacian operator require a minus sign
       ELSE                    ;   zsign = -1._wp      !  (eddy viscosity coef. >0)
@@ -105,6 +102,4 @@
       !                                                ! ===============
       !
-      IF( ln_timing )   CALL timing_stop('dyn_ldf_lap')
-      !
    END SUBROUTINE dyn_ldf_lap
 
@@ -130,6 +125,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( ln_timing )   CALL timing_start('dyn_ldf_blp')
-      !
       IF( kt == nit000 )  THEN
          IF(lwp) WRITE(numout,*)
@@ -147,6 +140,4 @@
       CALL dyn_ldf_lap( kt, zulap, zvlap, pua, pva, 2 )   ! rotated laplacian applied to zlap (output in pta)
       !
-      IF( ln_timing )   CALL timing_stop('dyn_ldf_blp')
-      !
    END SUBROUTINE dyn_ldf_blp
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg.F90	(revision 9124)
@@ -194,6 +194,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( ln_timing )   CALL timing_start('dyn_spg_init')
-      !
       REWIND( numnam_ref )              ! Namelist namdyn_spg in reference namelist : Free surface
       READ  ( numnam_ref, namdyn_spg, IOSTAT = ios, ERR = 901)
@@ -231,9 +229,5 @@
       IF( nspg == np_TS ) THEN   ! split-explicit scheme initialisation
          CALL dyn_spg_ts_init          ! do it first: set nn_baro used to allocate some arrays later on
-         IF( dyn_spg_ts_alloc() /= 0  )   CALL ctl_stop('STOP', 'dyn_spg_init: failed to allocate dynspg_ts  arrays' )
-         IF( neuler/=0 .AND. ln_bt_fw )   CALL ts_rst( nit000, 'READ' )
-      ENDIF
-      !
-      IF( ln_timing )   CALL timing_stop('dyn_spg_init')
+      ENDIF
       !
    END SUBROUTINE dyn_spg_init
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_exp.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_exp.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_exp.F90	(revision 9124)
@@ -23,10 +23,9 @@
    USE prtctl          ! Print control
    USE iom             ! I/O library
-   USE timing          ! Timing
 
    IMPLICIT NONE
    PRIVATE
 
-   PUBLIC   dyn_spg_exp   ! routine called by dynspg.F90 
+   PUBLIC   dyn_spg_exp   ! called in dynspg.F90 
 
    !! * Substitutions
@@ -61,6 +60,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( ln_timing )   CALL timing_start('dyn_spg_exp')
-      !
       IF( kt == nit000 ) THEN
          IF(lwp) WRITE(numout,*)
@@ -93,6 +90,4 @@
       ENDIF
       !
-      IF( ln_timing )   CALL timing_stop('dyn_spg_exp')
-      !
    END SUBROUTINE dyn_spg_exp
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_ts.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_ts.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_ts.F90	(revision 9124)
@@ -48,4 +48,5 @@
 #if defined key_agrif
    USE agrif_opa_interp ! agrif
+   USE agrif_oce
 #endif
 #if defined key_asminc   
@@ -59,31 +60,22 @@
    USE iom             ! IOM library
    USE restart         ! only for lrst_oce
-   USE timing          ! Timing    
    USE diatmb          ! Top,middle,bottom output
-#if defined key_agrif
-   USE agrif_opa_interp ! agrif
-   USE agrif_oce
-#endif
-#if defined key_asminc   
-   USE asminc          ! Assimilation increment
-#endif
 
    IMPLICIT NONE
    PRIVATE
 
-   PUBLIC dyn_spg_ts        ! routine called in dynspg.F90 
-   PUBLIC dyn_spg_ts_alloc  !    "      "     "    "
-   PUBLIC dyn_spg_ts_init   !    "      "     "    "
-   PUBLIC ts_rst            !    "      "     "    "
+   PUBLIC dyn_spg_ts        ! called by dyn_spg 
+   PUBLIC dyn_spg_ts_init   !    -    - dyn_spg_init
 
    !! Time filtered arrays at baroclinic time step:
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   un_adv , vn_adv   !: Advection vel. at "now" barocl. step
+   !
    INTEGER, SAVE :: icycle      ! Number of barotropic sub-steps for each internal step nn_baro <= 2.5 nn_baro
    REAL(wp),SAVE :: rdtbt       ! Barotropic time step
    !
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:)   ::   wgtbtp1, wgtbtp2   ! 1st & 2nd weights used in time filtering of barotropic fields
-   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::  zwz                 ! ff_f/h at F points
-   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::  ftnw, ftne          ! triad of coriolis parameter
-   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::  ftsw, ftse          ! (only used with een vorticity scheme)
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   zwz                ! ff_f/h at F points
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ftnw, ftne         ! triad of coriolis parameter
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ftsw, ftse         ! (only used with een vorticity scheme)
 
    REAL(wp) ::   r1_12 = 1._wp / 12._wp   ! local ratios
@@ -179,6 +171,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( ln_timing )   CALL timing_start('dyn_spg_ts')
-      !
       IF( ln_wd_il ) ALLOCATE( zcpx(jpi,jpj), zcpy(jpi,jpj) )
       !                                         !* Allocate temporary arrays
@@ -284,5 +274,5 @@
             zhf(:,:) = 0._wp
             
-!!gm  assume 0 in both cases (xhich is almost surely WRONG ! ) as hvatf has been removed 
+!!gm  assume 0 in both cases (which is almost surely WRONG ! ) as hvatf has been removed 
 !!gm    A priori a better value should be something like :
 !!gm          zhf(i,j) = masked sum of  ht(i,j) , ht(i+1,j) , ht(i,j+1) , (i+1,j+1) 
@@ -1263,5 +1253,4 @@
          CALL iom_put( "baro_v" , vn_b*vmask(:,:,1)+zmdi*(1-vmask(:,:,1 ) ) )  ! Barotropic  V Velocity
       ENDIF
-      IF( ln_timing )   CALL timing_stop('dyn_spg_ts')
       !
    END SUBROUTINE dyn_spg_ts
@@ -1487,4 +1476,10 @@
       ENDIF
       !
+      !                             ! Allocate time-splitting arrays
+      IF( dyn_spg_ts_alloc() /= 0    )   CALL ctl_stop('STOP', 'dyn_spg_init: failed to allocate dynspg_ts  arrays' )
+      !
+      !                             ! read restart when needed
+      IF( neuler /= 0 .AND. ln_bt_fw )   CALL ts_rst( nit000, 'READ' )
+      !
    END SUBROUTINE dyn_spg_ts_init
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/dynvor.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/dynvor.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/dynvor.F90	(revision 9124)
@@ -193,6 +193,4 @@
       REAL(wp), DIMENSION(jpi,jpj) ::   zwx, zwy, zwz   ! 2D workspace
       !!----------------------------------------------------------------------
-      !
-      IF( ln_timing )  CALL timing_start('vor_ene')
       !
       IF( kt == nit000 ) THEN
@@ -275,7 +273,4 @@
       END DO                                           !   End of slab
       !                                                ! ===============
-      !
-      IF( ln_timing )  CALL timing_stop('vor_ene')
-      !
    END SUBROUTINE vor_ene
 
@@ -310,6 +305,4 @@
       REAL(wp), DIMENSION(jpi,jpj) ::   zwx, zwy, zwz, zww   ! 2D workspace
       !!----------------------------------------------------------------------
-      !
-      IF( ln_timing )   CALL timing_start('vor_ens')
       !
       IF( kt == nit000 ) THEN
@@ -391,7 +384,4 @@
       END DO                                           !   End of slab
       !                                                ! ===============
-      !
-      IF( ln_timing )   CALL timing_stop('vor_ens')
-      !
    END SUBROUTINE vor_ens
 
@@ -426,6 +416,4 @@
       REAL(wp), DIMENSION(jpi,jpj)   :: ztnw, ztne, ztsw, ztse
       !!----------------------------------------------------------------------
-      !
-      IF( ln_timing )   CALL timing_start('vor_een')
       !
       IF( kt == nit000 ) THEN
@@ -552,7 +540,4 @@
       END DO                                           !   End of slab
       !                                                ! ===============
-      !
-      IF( ln_timing )   CALL timing_stop('vor_een')
-      !
    END SUBROUTINE vor_een
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/sshwzv.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/sshwzv.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/sshwzv.F90	(revision 9124)
@@ -207,5 +207,5 @@
 #endif 
       !
-      IF( nn_timing == 1 )  CALL timing_stop('wzv')
+      IF( ln_timing )   CALL timing_stop('wzv')
       !
    END SUBROUTINE wzv
@@ -236,5 +236,5 @@
       !!----------------------------------------------------------------------
       !
-      IF( ln_timing )  CALL timing_start('ssh_swp')
+      IF( ln_timing )   CALL timing_start('ssh_swp')
       !
       IF( kt == nit000 ) THEN
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/wet_dry.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/wet_dry.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DYN/wet_dry.F90	(revision 9124)
@@ -26,5 +26,5 @@
    USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
    USE lib_mpp        ! MPP library
-   USE timing         ! Timing
+   USE timing         ! timing of the main modules
 
    IMPLICIT NONE
@@ -71,9 +71,8 @@
       !! ** input   : - namwad namelist
       !!----------------------------------------------------------------------
-      !!
-      NAMELIST/namwad/ ln_wd_il, ln_wd_dl, rn_wdmin0, rn_wdmin1, rn_wdmin2, rn_wdld, &
-                     & nn_wdit, ln_wd_dl_bc, ln_wd_dl_rmp
-      INTEGER  ::   ios                 ! Local integer output status for namelist read
-      INTEGER  ::   ierr                ! Local integer status array allocation 
+      INTEGER  ::   ios, ierr   ! Local integer
+      !!
+      NAMELIST/namwad/ ln_wd_il, ln_wd_dl   , rn_wdmin0, rn_wdmin1, rn_wdmin2, rn_wdld,   &
+         &             nn_wdit , ln_wd_dl_bc, ln_wd_dl_rmp
       !!----------------------------------------------------------------------
       !
@@ -100,14 +99,13 @@
          WRITE(numout,*) '      T => baroclinic u,v=0 at dry pts: ln_wd_dl_bc = ', ln_wd_dl_bc     
          WRITE(numout,*) '      use a ramp for rwd limiter:  ln_wd_dl_rwd_rmp = ', ln_wd_dl_rmp
- 
       ENDIF
       IF( .NOT. ln_read_cfg ) THEN
          IF(lwp) WRITE(numout,*) '      No configuration file so seting ssh_ref to zero  '
-         ssh_ref=0.0
+         ssh_ref=0._wp
       ENDIF
 
-      r_rn_wdmin1=1/rn_wdmin1
+      r_rn_wdmin1 = 1 / rn_wdmin1
       ll_wd = .FALSE.
-      IF(ln_wd_il .OR. ln_wd_dl) THEN
+      IF( ln_wd_il .OR. ln_wd_dl ) THEN
          ll_wd = .TRUE.
          ALLOCATE( wdmask(jpi,jpj),   STAT=ierr )
@@ -144,8 +142,6 @@
       REAL(wp),  DIMENSION(jpi,jpj) ::   zflxu1 , zflxv1    ! local 2D workspace
       !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )  CALL timing_start('wad_lmt')
-      !
-       
+      IF( ln_timing )   CALL timing_start('wad_lmt')      !
+      !
       DO jk = 1, jpkm1
          un(:,:,jk) = un(:,:,jk) * zwdlmtu(:,:) 
@@ -153,41 +149,35 @@
       END DO
       jflag  = 0
-      zdepwd = 50._wp   !maximum depth on which that W/D could possibly happen
-
+      zdepwd = 50._wp      ! maximum depth on which that W/D could possibly happen
+      !
       zflxp(:,:)   = 0._wp
       zflxn(:,:)   = 0._wp
       zflxu(:,:)   = 0._wp
       zflxv(:,:)   = 0._wp
-
-      zwdlmtu(:,:)  = 1._wp
-      zwdlmtv(:,:)  = 1._wp
-       
-      ! Horizontal Flux in u and v direction
-      DO jk = 1, jpkm1  
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               zflxu(ji,jj) = zflxu(ji,jj) + e3u_n(ji,jj,jk) * un(ji,jj,jk) * umask(ji,jj,jk)
-               zflxv(ji,jj) = zflxv(ji,jj) + e3v_n(ji,jj,jk) * vn(ji,jj,jk) * vmask(ji,jj,jk)
-            END DO  
-         END DO  
-      END DO
-       
+      !
+      zwdlmtu(:,:) = 1._wp
+      zwdlmtv(:,:) = 1._wp
+      !
+      DO jk = 1, jpkm1     ! Horizontal Flux in u and v direction
+         zflxu(:,:) = zflxu(:,:) + e3u_n(:,:,jk) * un(:,:,jk) * umask(:,:,jk)
+         zflxv(:,:) = zflxv(:,:) + e3v_n(:,:,jk) * vn(:,:,jk) * vmask(:,:,jk)
+      END DO
       zflxu(:,:) = zflxu(:,:) * e2u(:,:)
       zflxv(:,:) = zflxv(:,:) * e1v(:,:)
-       
-      wdmask(:,:) = 1
+      !
+      wdmask(:,:) = 1._wp
       DO jj = 2, jpj
          DO ji = 2, jpi 
-
-            IF( tmask(ji, jj, 1) < 0.5_wp ) CYCLE              ! we don't care about land cells
-            IF( ht_0(ji,jj) - ssh_ref > zdepwd ) CYCLE   ! and cells which are unlikely to dry
-
-            zflxp(ji,jj) = max(zflxu(ji,jj), 0._wp) - min(zflxu(ji-1,jj),   0._wp) + &
-                         & max(zflxv(ji,jj), 0._wp) - min(zflxv(ji,  jj-1), 0._wp) 
-            zflxn(ji,jj) = min(zflxu(ji,jj), 0._wp) - max(zflxu(ji-1,jj),   0._wp) + &
-                         & min(zflxv(ji,jj), 0._wp) - max(zflxv(ji,  jj-1), 0._wp) 
-
+            !
+            IF( tmask(ji,jj,1)        < 0.5_wp )   CYCLE    ! we don't care about land cells
+            IF( ht_0(ji,jj) - ssh_ref > zdepwd )   CYCLE    ! and cells which are unlikely to dry
+            !
+            zflxp(ji,jj) = MAX( zflxu(ji,jj) , 0._wp ) - MIN( zflxu(ji-1,jj  ) , 0._wp )   &
+               &         + MAX( zflxv(ji,jj) , 0._wp ) - MIN( zflxv(ji,  jj-1) , 0._wp ) 
+            zflxn(ji,jj) = MIN( zflxu(ji,jj) , 0._wp ) - MAX( zflxu(ji-1,jj  ) , 0._wp )   &
+               &         + MIN( zflxv(ji,jj) , 0._wp ) - MAX( zflxv(ji,  jj-1) , 0._wp ) 
+            !
             zdep2 = ht_0(ji,jj) + sshb1(ji,jj) - rn_wdmin1
-            IF(zdep2 .le. 0._wp) THEN  !add more safty, but not necessary
+            IF( zdep2 <= 0._wp ) THEN     ! add more safty, but not necessary
                sshb1(ji,jj) = rn_wdmin1 - ht_0(ji,jj)
                IF(zflxu(ji,  jj) > 0._wp) zwdlmtu(ji  ,jj) = 0._wp
@@ -197,47 +187,42 @@
                wdmask(ji,jj) = 0._wp
             END IF
-         ENDDO
-      END DO
-
-
-! HPG limiter from jholt
+         END DO
+      END DO
+      !
+      !           ! HPG limiter from jholt
       wdramp(:,:) = min((ht_0(:,:) + sshb1(:,:) - rn_wdmin1)/(rn_wdmin0 - rn_wdmin1),1.0_wp)
-!jth assume don't need a lbc_lnk here
+      !jth assume don't need a lbc_lnk here
       DO jj = 1, jpjm1
          DO ji = 1, jpim1
-            wdrampu(ji,jj) = min(wdramp(ji,jj),wdramp(ji+1,jj))
-            wdrampv(ji,jj) = min(wdramp(ji,jj),wdramp(ji,jj+1))
+            wdrampu(ji,jj) = MIN( wdramp(ji,jj) , wdramp(ji+1,jj) )
+            wdrampv(ji,jj) = MIN( wdramp(ji,jj) , wdramp(ji,jj+1) )
          END DO
       END DO
-! end HPG limiter
-
-
-      
-        !! start limiter iterations 
-      DO jk1 = 1, nn_wdit + 1
-       
-          
+      !           ! end HPG limiter
+      !
+      !
+      DO jk1 = 1, nn_wdit + 1      !==  start limiter iterations  ==!
+         !
          zflxu1(:,:) = zflxu(:,:) * zwdlmtu(:,:)
          zflxv1(:,:) = zflxv(:,:) * zwdlmtv(:,:)
          jflag = 0     ! flag indicating if any further iterations are needed
-          
+         !
          DO jj = 2, jpj
             DO ji = 2, jpi 
-        
-               IF( tmask(ji, jj, 1) < 0.5_wp ) CYCLE 
-               IF( ht_0(ji,jj) > zdepwd )      CYCLE
-        
+               IF( tmask(ji, jj, 1) < 0.5_wp )   CYCLE 
+               IF( ht_0(ji,jj)      > zdepwd )   CYCLE
+               !
                ztmp = e1e2t(ji,jj)
-
-               zzflxp = max(zflxu1(ji,jj), 0._wp) - min(zflxu1(ji-1,jj),   0._wp) + &
-                      & max(zflxv1(ji,jj), 0._wp) - min(zflxv1(ji,  jj-1), 0._wp) 
-               zzflxn = min(zflxu1(ji,jj), 0._wp) - max(zflxu1(ji-1,jj),   0._wp) + &
-                      & min(zflxv1(ji,jj), 0._wp) - max(zflxv1(ji,  jj-1), 0._wp) 
-          
+               !
+               zzflxp = MAX( zflxu1(ji,jj) , 0._wp ) - MIN( zflxu1(ji-1,jj  ) , 0._wp)   &
+                  &   + MAX( zflxv1(ji,jj) , 0._wp ) - MIN( zflxv1(ji,  jj-1) , 0._wp) 
+               zzflxn = MIN( zflxu1(ji,jj) , 0._wp ) - MAX( zflxu1(ji-1,jj  ) , 0._wp)   &
+                  &   + MIN( zflxv1(ji,jj) , 0._wp ) - MAX( zflxv1(ji,  jj-1) , 0._wp) 
+               !
                zdep1 = (zzflxp + zzflxn) * z2dt / ztmp
                zdep2 = ht_0(ji,jj) + sshb1(ji,jj) - rn_wdmin1 - z2dt * sshemp(ji,jj)
-          
+               !
                IF( zdep1 > zdep2 ) THEN
-                  wdmask(ji, jj) = 0
+                  wdmask(ji, jj) = 0._wp
                   zcoef = ( ( zdep2 - rn_wdmin2 ) * ztmp - zzflxn * z2dt ) / ( zflxp(ji,jj) * z2dt )
                   !zcoef = ( ( zdep2 - rn_wdmin2 ) * ztmp - zzflxn * z2dt ) / ( zzflxp * z2dt )
@@ -245,48 +230,40 @@
                   ! changes have zeroed the coefficient since further iterations will
                   ! not change anything
-                  IF( zcoef > 0._wp ) THEN
-                     jflag = 1 
-                  ELSE
-                     zcoef = 0._wp
+                  IF( zcoef > 0._wp ) THEN   ;   jflag = 1 
+                  ELSE                       ;   zcoef = 0._wp
                   ENDIF
-                  IF(jk1 > nn_wdit) zcoef = 0._wp
-                  IF(zflxu1(ji,  jj) > 0._wp) zwdlmtu(ji  ,jj) = zcoef
-                  IF(zflxu1(ji-1,jj) < 0._wp) zwdlmtu(ji-1,jj) = zcoef
-                  IF(zflxv1(ji,  jj) > 0._wp) zwdlmtv(ji  ,jj) = zcoef
-                  IF(zflxv1(ji,jj-1) < 0._wp) zwdlmtv(ji,jj-1) = zcoef
-               END IF
-            END DO ! ji loop
-         END DO  ! jj loop
-
+                  IF( jk1 > nn_wdit )   zcoef = 0._wp
+                  IF( zflxu1(ji  ,jj  ) > 0._wp )   zwdlmtu(ji  ,jj  ) = zcoef
+                  IF( zflxu1(ji-1,jj  ) < 0._wp )   zwdlmtu(ji-1,jj  ) = zcoef
+                  IF( zflxv1(ji  ,jj  ) > 0._wp )   zwdlmtv(ji  ,jj  ) = zcoef
+                  IF( zflxv1(ji  ,jj-1) < 0._wp )   zwdlmtv(ji  ,jj-1) = zcoef
+               ENDIF
+            END DO
+         END DO
          CALL lbc_lnk_multi( zwdlmtu, 'U', 1., zwdlmtv, 'V', 1. )
-
-         IF(lk_mpp) CALL mpp_max(jflag)   !max over the global domain
-
-         IF(jflag == 0) EXIT
-          
+         !
+         IF( lk_mpp )   CALL mpp_max(jflag)   !max over the global domain
+         !
+         IF( jflag == 0 )   EXIT
+         !
       END DO  ! jk1 loop
-       
+      !
       DO jk = 1, jpkm1
-         un(:,:,jk) = un(:,:,jk) * zwdlmtu(:, :) 
-         vn(:,:,jk) = vn(:,:,jk) * zwdlmtv(:, :) 
-      END DO
-
-      CALL lbc_lnk_multi( un, 'U', -1., vn, 'V', -1. )
-        !
+         un(:,:,jk) = un(:,:,jk) * zwdlmtu(:,:) 
+         vn(:,:,jk) = vn(:,:,jk) * zwdlmtv(:,:) 
+      END DO
       un_b(:,:) = un_b(:,:) * zwdlmtu(:, :)
       vn_b(:,:) = vn_b(:,:) * zwdlmtv(:, :)
+      !
+!!gm TO BE SUPPRESSED ?  these lbc_lnk are useless since zwdlmtu and zwdlmtv are defined everywhere !
+      CALL lbc_lnk_multi( un  , 'U', -1., vn  , 'V', -1. )
       CALL lbc_lnk_multi( un_b, 'U', -1., vn_b, 'V', -1. )
-       
-      IF(jflag == 1 .AND. lwp) WRITE(numout,*) 'Need more iterations in wad_lmt!!!'
-       
+!!gm
+      !
+      IF(jflag == 1 .AND. lwp)   WRITE(numout,*) 'Need more iterations in wad_lmt!!!'
+      !
       !IF( ln_rnf      )   CALL sbc_rnf_div( hdivn )          ! runoffs (update hdivn field)
-      !IF( nn_cla == 1 )   CALL cla_div    ( kt )             ! Cross Land Advection (update hdivn field)
-      !
-      !
-      !
-      !
-      IF( nn_timing == 1 )  CALL timing_stop('wad_lmt')
-      !
-      IF( ln_timing )   CALL timing_stop('wad_lmt')
+      !
+      IF( ln_timing )   CALL timing_stop('wad_lmt')      !
       !
    END SUBROUTINE wad_lmt
@@ -303,9 +280,9 @@
       !! ** Action  : - calculate flux limiter and W/D flag
       !!----------------------------------------------------------------------
-      REAL(wp), INTENT(in)    ::   rdtbt    ! ocean time-step index
+      REAL(wp)                , INTENT(in   ) ::   rdtbt    ! ocean time-step index
       REAL(wp), DIMENSION(:,:), INTENT(inout) ::   zflxu,  zflxv, sshn_e, zssh_frc  
       !
       INTEGER  ::   ji, jj, jk, jk1     ! dummy loop indices
-      INTEGER  ::   jflag               ! local scalar
+      INTEGER  ::   jflag               ! local integer
       REAL(wp) ::   z2dt
       REAL(wp) ::   zcoef, zdep1, zdep2 ! local scalars
@@ -317,63 +294,56 @@
       REAL(wp), DIMENSION(jpi,jpj) ::   zflxu1, zflxv1           ! local 2D workspace
       !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )  CALL timing_start('wad_lmt_bt')
+      IF( ln_timing )   CALL timing_start('wad_lmt_bt')      !
       !
       jflag  = 0
-      zdepwd = 50._wp   !maximum depth that ocean cells can have W/D processes
-
+      zdepwd = 50._wp   ! maximum depth that ocean cells can have W/D processes
+      !
       z2dt = rdtbt   
-       
+      !
       zflxp(:,:)   = 0._wp
       zflxn(:,:)   = 0._wp
-
       zwdlmtu(:,:) = 1._wp
       zwdlmtv(:,:) = 1._wp
-       
-      ! Horizontal Flux in u and v direction
-       
-      DO jj = 2, jpj
+      !
+      DO jj = 2, jpj      ! Horizontal Flux in u and v direction
          DO ji = 2, jpi 
-
-           IF( tmask(ji, jj, 1 ) < 0.5_wp) CYCLE   ! we don't care about land cells
-           IF( ht_0(ji,jj) > zdepwd )      CYCLE   ! and cells which are unlikely to dry
-
-            zflxp(ji,jj) = max(zflxu(ji,jj), 0._wp) - min(zflxu(ji-1,jj),   0._wp) + &
-                         & max(zflxv(ji,jj), 0._wp) - min(zflxv(ji,  jj-1), 0._wp) 
-            zflxn(ji,jj) = min(zflxu(ji,jj), 0._wp) - max(zflxu(ji-1,jj),   0._wp) + &
-                         & min(zflxv(ji,jj), 0._wp) - max(zflxv(ji,  jj-1), 0._wp) 
-
+            !
+            IF( tmask(ji, jj, 1 ) < 0.5_wp) CYCLE   ! we don't care about land cells
+            IF( ht_0(ji,jj) > zdepwd )      CYCLE   ! and cells which are unlikely to dry
+            !
+            zflxp(ji,jj) = MAX( zflxu(ji,jj) , 0._wp ) - MIN( zflxu(ji-1,jj  ) , 0._wp )   &
+               &         + MAX( zflxv(ji,jj) , 0._wp ) - MIN( zflxv(ji,  jj-1) , 0._wp ) 
+            zflxn(ji,jj) = MIN( zflxu(ji,jj) , 0._wp ) - MAX( zflxu(ji-1,jj  ) , 0._wp )   &
+               &         + MIN( zflxv(ji,jj) , 0._wp ) - MAX( zflxv(ji,  jj-1) , 0._wp ) 
+            !
             zdep2 = ht_0(ji,jj) + sshn_e(ji,jj) - rn_wdmin1
-            IF(zdep2 .le. 0._wp) THEN  !add more safety, but not necessary
+            IF( zdep2 <= 0._wp ) THEN  !add more safety, but not necessary
               sshn_e(ji,jj) = rn_wdmin1 - ht_0(ji,jj)
-              IF(zflxu(ji,  jj) > 0._wp) zwdlmtu(ji  ,jj) = 0._wp
-              IF(zflxu(ji-1,jj) < 0._wp) zwdlmtu(ji-1,jj) = 0._wp
-              IF(zflxv(ji,  jj) > 0._wp) zwdlmtv(ji  ,jj) = 0._wp
-              IF(zflxv(ji,jj-1) < 0._wp) zwdlmtv(ji,jj-1) = 0._wp 
-            END IF
-         ENDDO
-      END DO
-
-      
-      !! start limiter iterations 
-      DO jk1 = 1, nn_wdit + 1
-       
-          
+              IF( zflxu(ji  ,jj  ) > 0._wp)   zwdlmtu(ji  ,jj  ) = 0._wp
+              IF( zflxu(ji-1,jj  ) < 0._wp)   zwdlmtu(ji-1,jj  ) = 0._wp
+              IF( zflxv(ji  ,jj  ) > 0._wp)   zwdlmtv(ji  ,jj  ) = 0._wp
+              IF( zflxv(ji  ,jj-1) < 0._wp)   zwdlmtv(ji  ,jj-1) = 0._wp 
+            ENDIF
+         END DO
+      END DO
+      !
+      DO jk1 = 1, nn_wdit + 1      !! start limiter iterations 
+         !
          zflxu1(:,:) = zflxu(:,:) * zwdlmtu(:,:)
          zflxv1(:,:) = zflxv(:,:) * zwdlmtv(:,:)
          jflag = 0     ! flag indicating if any further iterations are needed
-          
+         !
          DO jj = 2, jpj
             DO ji = 2, jpi 
-        
-               IF( tmask(ji, jj, 1 ) < 0.5_wp) CYCLE 
-               IF( ht_0(ji,jj) > zdepwd )      CYCLE
-        
+               !
+               IF( tmask(ji, jj, 1 ) < 0.5_wp )   CYCLE 
+               IF( ht_0(ji,jj)       > zdepwd )   CYCLE
+               !
                ztmp = e1e2t(ji,jj)
-
-               zzflxp = max(zflxu1(ji,jj), 0._wp) - min(zflxu1(ji-1,jj),   0._wp) + &
-                      & max(zflxv1(ji,jj), 0._wp) - min(zflxv1(ji,  jj-1), 0._wp) 
-               zzflxn = min(zflxu1(ji,jj), 0._wp) - max(zflxu1(ji-1,jj),   0._wp) + &
-                      & min(zflxv1(ji,jj), 0._wp) - max(zflxv1(ji,  jj-1), 0._wp) 
+               !
+               zzflxp = max(zflxu1(ji,jj), 0._wp) - min(zflxu1(ji-1,jj),   0._wp)   &
+                  &   + max(zflxv1(ji,jj), 0._wp) - min(zflxv1(ji,  jj-1), 0._wp) 
+               zzflxn = min(zflxu1(ji,jj), 0._wp) - max(zflxu1(ji-1,jj),   0._wp)   &
+                  &   + min(zflxv1(ji,jj), 0._wp) - max(zflxv1(ji,  jj-1), 0._wp) 
           
                zdep1 = (zzflxp + zzflxn) * z2dt / ztmp
@@ -399,25 +369,26 @@
             END DO ! ji loop
          END DO  ! jj loop
-
+         !
          CALL lbc_lnk_multi( zwdlmtu, 'U', 1., zwdlmtv, 'V', 1. )
-
+         !
          IF(lk_mpp) CALL mpp_max(jflag)   !max over the global domain
-
-         IF(jflag == 0) EXIT
-          
+         !
+         IF(jflag == 0)   EXIT
+         !
       END DO  ! jk1 loop
-       
+      !
       zflxu(:,:) = zflxu(:,:) * zwdlmtu(:, :) 
       zflxv(:,:) = zflxv(:,:) * zwdlmtv(:, :) 
-
+      !
+!!gm THIS lbc_lnk is useless since it is already done at the end of the jk1-loop
       CALL lbc_lnk_multi( zflxu, 'U', -1., zflxv, 'V', -1. )
-       
-      IF(jflag == 1 .AND. lwp) WRITE(numout,*) 'Need more iterations in wad_lmt_bt!!!'
-       
+!!gm end
+      !
+      IF( jflag == 1 .AND. lwp )   WRITE(numout,*) 'Need more iterations in wad_lmt_bt!!!'
+      !
       !IF( ln_rnf      )   CALL sbc_rnf_div( hdivn )          ! runoffs (update hdivn field)
-      !IF( nn_cla == 1 )   CALL cla_div    ( kt )             ! Cross Land Advection (update hdivn field)
-      !
-      !
-      IF( nn_timing == 1 )  CALL timing_stop('wad_lmt')
+      !
+      IF( ln_timing )   CALL timing_stop('wad_lmt_bt')      !
+      !
    END SUBROUTINE wad_lmt_bt
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/FLO/flo_oce.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/FLO/flo_oce.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/FLO/flo_oce.F90	(revision 9124)
@@ -7,5 +7,5 @@
    !!   NEMO      1.0  ! 2002-11  (G. Madec, A. Bozec)  F90: Free form and module
    !!----------------------------------------------------------------------
-#if   defined key_floats
+#if   defined   key_floats
    !!----------------------------------------------------------------------
    !!   'key_floats'                                        drifting floats
@@ -61,6 +61,6 @@
       !!----------------------------------------------------------------------
       ALLOCATE( wb(jpi,jpj,jpk) , nfloat(jpnfl) , nisobfl(jpnfl) , ngrpfl(jpnfl) , &
-                flxx(jpnfl)     , flyy(jpnfl)   , flzz(jpnfl)    ,                 & 
-                tpifl(jpnfl)    , tpjfl(jpnfl)  , tpkfl(jpnfl)   , STAT=flo_oce_alloc )
+         &      flxx(jpnfl)     , flyy(jpnfl)   , flzz(jpnfl)    ,                 & 
+         &      tpifl(jpnfl)    , tpjfl(jpnfl)  , tpkfl(jpnfl)   , STAT=flo_oce_alloc )
       !
       IF( lk_mpp             )   CALL mpp_sum ( flo_oce_alloc )
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/FLO/floats.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/FLO/floats.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/FLO/floats.F90	(revision 9124)
@@ -7,5 +7,5 @@
    !!   NEMO     1.0  ! 2002-06  (A. Bozec)  F90, Free form and module
    !!----------------------------------------------------------------------
-#if   defined key_floats
+#if   defined   key_floats
    !!----------------------------------------------------------------------
    !!   'key_floats'                                     float trajectories
@@ -22,4 +22,5 @@
    USE flo4rk          ! Trajectories, Runge Kutta scheme (flo_4rk routine)
    USE floblk          ! Trajectories, Blanke scheme      (flo_blk routine)
+   !
    USE in_out_manager  ! I/O manager
    USE timing          ! preformance summary
@@ -52,5 +53,5 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )   CALL timing_start('flo_stp')
+      IF( ln_timing )   CALL timing_start('flo_stp')
       !
       IF( ln_flork4 ) THEN   ;   CALL flo_4rk( kt )        ! Trajectories using a 4th order Runge Kutta scheme
@@ -66,5 +67,5 @@
       wb(:,:,:) = wn(:,:,:)         ! Save the old vertical velocity field
       !
-      IF( nn_timing == 1 )   CALL timing_stop('flo_stp')
+      IF( ln_timing )   CALL timing_stop('flo_stp')
       !
    END SUBROUTINE flo_stp
@@ -77,11 +78,9 @@
       !! ** Purpose :   Read the namelist of floats
       !!----------------------------------------------------------------------
-      INTEGER :: jfl
-      INTEGER :: ios                 ! Local integer output status for namelist read
+      INTEGER ::   jfl
+      INTEGER ::   ios                 ! Local integer output status for namelist read
       !
       NAMELIST/namflo/ jpnfl, jpnnewflo, ln_rstflo, nn_writefl, nn_stockfl, ln_argo, ln_flork4, ln_ariane, ln_flo_ascii
       !!---------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )   CALL timing_start('flo_init')
       !
       IF(lwp) WRITE(numout,*)
@@ -125,16 +124,13 @@
       IF( flo_rst_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'flo_rst : unable to allocate arrays' )
       !
-      !memory allocation 
-      jpnrstflo = jpnfl-jpnnewflo
-
-      !vertical axe for netcdf IOM ouput
-      DO jfl=1,jpnfl ; nfloat(jfl)=jfl ; ENDDO
-
+      jpnrstflo = jpnfl-jpnnewflo   ! memory allocation 
+      !
+      DO jfl = 1, jpnfl             ! vertical axe for netcdf IOM ouput
+         nfloat(jfl) = jfl 
+      END DO
       !
       CALL flo_dom                  ! compute/read initial position of floats
-
+      !
       wb(:,:,:) = wn(:,:,:)         ! set wb for computation of floats trajectories at the first time step
-      !
-      IF( nn_timing == 1 )   CALL timing_stop('flo_init')
       !
    END SUBROUTINE flo_init
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/ICB/icbstp.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/ICB/icbstp.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/ICB/icbstp.F90	(revision 9124)
@@ -1,4 +1,3 @@
 MODULE icbstp
-
    !!======================================================================
    !!                       ***  MODULE  icbstp  ***
@@ -13,4 +12,5 @@
    !!            -    !                            into icb copies with haloes
    !!----------------------------------------------------------------------
+
    !!----------------------------------------------------------------------
    !!   icb_stp       : start iceberg tracking
@@ -20,21 +20,22 @@
    USE dom_oce        ! ocean domain
    USE sbc_oce        ! ocean surface forcing
-   USE phycst
+   USE phycst         ! physical constants
+   !
+   USE icb_oce        ! iceberg: define arrays
+   USE icbini         ! iceberg: initialisation routines
+   USE icbutl         ! iceberg: utility routines
+   USE icbrst         ! iceberg: restart routines
+   USE icbdyn         ! iceberg: dynamics (ie advection) routines
+   USE icbclv         ! iceberg: calving routines
+   USE icbthm         ! iceberg: thermodynamics routines
+   USE icblbc         ! iceberg: lateral boundary routines (including mpp)
+   USE icbtrj         ! iceberg: trajectory I/O routines
+   USE icbdia         ! iceberg: budget
+   !
    USE in_out_manager ! nemo IO
-   USE lib_mpp
-   USE iom
-   USE fldread
+   USE lib_mpp        ! massively parallel library 
+   USE iom            ! I/O manager
+   USE fldread        ! field read
    USE timing         ! timing
-
-   USE icb_oce        ! define iceberg arrays
-   USE icbini         ! iceberg initialisation routines
-   USE icbutl         ! iceberg utility routines
-   USE icbrst         ! iceberg restart routines
-   USE icbdyn         ! iceberg dynamics (ie advection) routines
-   USE icbclv         ! iceberg calving routines
-   USE icbthm         ! iceberg thermodynamics routines
-   USE icblbc         ! iceberg lateral boundary routines (including mpp)
-   USE icbtrj         ! iceberg trajectory I/O routines
-   USE icbdia         ! iceberg budget
 
    IMPLICIT NONE
@@ -64,86 +65,83 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 ) CALL timing_start('icb_stp')
+      IF( ln_timing )   CALL timing_start('icb_stp')
 
-      !! start of timestep housekeeping
-
+      !                       !==  start of timestep housekeeping  ==!
+      !
       nktberg = kt
-
-      IF( nn_test_icebergs < 0 ) THEN      ! read calving data
+      !
+      IF( nn_test_icebergs < 0 ) THEN     !* read calving data
          !
          CALL fld_read ( kt, 1, sf_icb )
-         src_calving(:,:)      = sf_icb(1)%fnow(:,:,1)    ! calving in km^3/year (water equivalent)
+         src_calving     (:,:) = sf_icb(1)%fnow(:,:,1)    ! calving in km^3/year (water equivalent)
          src_calving_hflx(:,:) = 0._wp                    ! NO heat flux for now
          !
       ENDIF
-
+      !
       berg_grid%floating_melt(:,:) = 0._wp
-
-      ! anything that needs to be reset to zero each timestep for budgets is dealt with here
-      CALL icb_dia_step()
-
+      !
+      !                                   !* anything that needs to be reset to zero each timestep 
+      CALL icb_dia_step()                 !  for budgets is dealt with here
+      !
+      !                                   !* write out time
       ll_verbose = .FALSE.
-      IF( nn_verbose_write > 0 .AND. &
-          MOD(kt-1,nn_verbose_write ) == 0 )   ll_verbose = nn_verbose_level >= 0
-
-      ! write out time
-      IF( ll_verbose ) WRITE(numicb,9100) nktberg, ndastp, nsec_day
+      IF( nn_verbose_write > 0 .AND. MOD( kt-1 , nn_verbose_write ) == 0 )   ll_verbose = ( nn_verbose_level >= 0 )
+      !
+      IF( ll_verbose )   WRITE(numicb,9100) nktberg, ndastp, nsec_day
  9100 FORMAT('kt= ',i8, ' day= ',i8,' secs=',i8)
-
-      ! copy nemo forcing arrays into iceberg versions with extra halo
-      ! only necessary for variables not on T points
-      CALL icb_utl_copy()
-
-      !!----------------------------------------------------------------------
-      !! process icebergs
-
+      !
+      !                                   !* copy nemo forcing arrays into iceberg versions with extra halo
+      CALL icb_utl_copy()                 ! only necessary for variables not on T points
+      !
+      !
+      !                       !==  process icebergs  ==!
+      !                              !
                                      CALL icb_clv_flx( kt )   ! Accumulate ice from calving
-
+      !                              !
                                      CALL icb_clv()           ! Calve excess stored ice into icebergs
-
-
-!                               !==  For each berg, evolve  ==!
+      !                              !
+      !
+      !                       !==  For each berg, evolve  ==!
       !
       IF( ASSOCIATED(first_berg) )   CALL icb_dyn( kt )       ! ice berg dynamics
 
-      IF( lk_mpp ) THEN          ;   CALL icb_lbc_mpp()       ! Send bergs to other PEs
-      ELSE                       ;   CALL icb_lbc()           ! Deal with any cyclic boundaries in non-mpp case
+      IF( lk_mpp ) THEN   ;          CALL icb_lbc_mpp()       ! Send bergs to other PEs
+      ELSE                ;          CALL icb_lbc()           ! Deal with any cyclic boundaries in non-mpp case
       ENDIF
 
       IF( ASSOCIATED(first_berg) )   CALL icb_thm( kt )       ! Ice berg thermodynamics (melting) + rolling
-
-      !!----------------------------------------------------------------------
-      !! end of timestep housekeeping
-
+      !
+      !
+      !                       !==  diagnostics and output  ==!
+      !
+      !                                   !* For each berg, record trajectory (when needed)
       ll_sample_traj = .FALSE.
       IF( nn_sample_rate > 0 .AND. MOD(kt-1,nn_sample_rate) == 0 )   ll_sample_traj = .TRUE.
-      IF( ll_sample_traj .AND.   &
-          ASSOCIATED(first_berg) )   CALL icb_trj_write( kt )  ! For each berg, record trajectory
+      IF( ll_sample_traj .AND. ASSOCIATED(first_berg) )   CALL icb_trj_write( kt )
 
-      ! Gridded diagnostics
-      ! To get these iom_put's and those preceding to actually do something
-      ! use key_iomput in cpp file and create content for XML file
-
+      !                                   !* Gridded diagnostics
+      !                                   !  To get these iom_put's and those preceding to actually do something
+      !                                   !  use key_iomput in cpp file and create content for XML file
+      !
       CALL iom_put( "calving"           , berg_grid%calving      (:,:)   )  ! 'calving mass input'
       CALL iom_put( "berg_floating_melt", berg_grid%floating_melt(:,:)   )  ! 'Melt rate of icebergs + bits' , 'kg/m2/s'
       CALL iom_put( "berg_stored_ice"   , berg_grid%stored_ice   (:,:,:) )  ! 'Accumulated ice mass by class', 'kg'
-
-      ! store mean budgets
-      CALL icb_dia_put()
-
-      ! Dump icebergs to screen
-      if ( nn_verbose_level >= 2 )   CALL icb_utl_print( 'icb_stp, status', kt )
-
-      ! Diagnose budgets
+      !
+      CALL icb_dia_put()                  !* store mean budgets
+      !
+      !                                   !*  Dump icebergs to screen
+      IF( nn_verbose_level >= 2 )   CALL icb_utl_print( 'icb_stp, status', kt )
+      !
+      !                                   !* Diagnose budgets
       ll_budget = .FALSE.
       IF( nn_verbose_write > 0 .AND. MOD(kt-1,nn_verbose_write) == 0 )   ll_budget = ln_bergdia
       CALL icb_dia( ll_budget )
-
-      IF( MOD(kt,nn_stock) == 0 ) THEN
+      !
+      IF( MOD(kt,nn_stock) == 0 ) THEN    !* restart
          CALL icb_rst_write( kt )
          IF( nn_sample_rate > 0 )   CALL icb_trj_sync()
       ENDIF
-
-      IF( nn_timing == 1 ) CALL timing_stop('icb_stp')
+      !
+      IF( ln_timing )   CALL timing_stop('icb_stp')
       !
    END SUBROUTINE icb_stp
@@ -157,14 +155,15 @@
       !!
       !!----------------------------------------------------------------------
-      INTEGER, INTENT( in )  :: kt
+      INTEGER, INTENT( in )  ::   kt   ! model time-step index
       !!----------------------------------------------------------------------
-
+      !
       ! only write a restart if not done in icb_stp
-      IF( MOD(kt,nn_stock) .NE. 0 ) CALL icb_rst_write( kt )
+      IF( MOD(kt,nn_stock) /= 0 )   CALL icb_rst_write( kt )
 
       ! finish with trajectories if they were written
-      IF( nn_sample_rate .GT. 0 ) CALL icb_trj_end()
+      IF( nn_sample_rate > 0 )   CALL icb_trj_end()
 
-      IF(lwp)   WRITE(numout,'(a,i6)') 'icebergs: icb_end complete', narea
+      IF(lwp) WRITE(numout,'(a,i6)') 'icebergs: icb_end complete', narea
+      !
       CALL flush( numicb )
       CLOSE( numicb )
@@ -173,4 +172,3 @@
 
    !!-------------------------------------------------------------------------
-
 END MODULE icbstp
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90	(revision 9124)
@@ -100,7 +100,4 @@
    LOGICAL ::   ln_ctl           !: run control for debugging
    LOGICAL ::   ln_timing        !: run control for timing
-!!gm to be removed at the end of the 2017 merge party
-   INTEGER ::   nn_timing        !: run control for timing
-!!gm end
    LOGICAL ::   ln_diacfl        !: flag whether to create CFL diagnostics
    INTEGER ::   nn_print         !: level of print (0 no print)
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/LDF/ldfslp.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/LDF/ldfslp.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/LDF/ldfslp.F90	(revision 9124)
@@ -408,5 +408,4 @@
       IF( ln_timing )   CALL timing_start('ldf_slp_triad')
       !
-      !
       !--------------------------------!
       !  Some preliminary calculation  !
@@ -644,6 +643,4 @@
       REAL(wp) ::   zck, zfk,      zbw             !   -      -
       !!----------------------------------------------------------------------
-      !
-      IF( ln_timing )   CALL timing_start('ldf_slp_mxl')
       !
       zeps   =  1.e-20_wp        !==   Local constant initialization   ==!
@@ -727,6 +724,4 @@
       CALL lbc_lnk_multi( uslpml , 'U', -1. , vslpml , 'V', -1. , wslpiml, 'W', -1. , wslpjml, 'W', -1. ) 
       !
-      IF( ln_timing )   CALL timing_stop('ldf_slp_mxl')
-      !
    END SUBROUTINE ldf_slp_mxl
 
@@ -743,6 +738,4 @@
       INTEGER ::   ierr         ! local integer
       !!----------------------------------------------------------------------
-      !
-      IF( ln_timing )   CALL timing_start('ldf_slp_init')
       !
       IF(lwp) THEN
@@ -801,6 +794,4 @@
       ENDIF
       !
-      IF( ln_timing )   CALL timing_stop('ldf_slp_init')
-      !
    END SUBROUTINE ldf_slp_init
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/LDF/ldftra.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/LDF/ldftra.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/LDF/ldftra.F90	(revision 9124)
@@ -30,5 +30,4 @@
    USE lib_mpp         ! distribued memory computing library
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
-   USE timing          ! timing
 
    IMPLICIT NONE
@@ -492,6 +491,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( ln_timing )   CALL timing_start('ldf_eiv')
-      !
       zn   (:,:) = 0._wp      ! Local initialization
       zhw  (:,:) = 5._wp
@@ -571,6 +568,4 @@
       END DO
       !  
-      IF( ln_timing )   CALL timing_stop('ldf_eiv')
-      !
    END SUBROUTINE ldf_eiv
 
@@ -607,6 +602,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( ln_timing )   CALL timing_start( 'ldf_eiv_trp')
-      !
       IF( kt == kit000 )  THEN
          IF(lwp) WRITE(numout,*)
@@ -650,6 +643,4 @@
       IF( ln_ldfeiv_dia .AND. cdtype == 'TRA' )   CALL ldf_eiv_dia( zpsi_uw, zpsi_vw )
       !
-      IF( ln_timing )   CALL timing_stop( 'ldf_eiv_trp')
-      !
     END SUBROUTINE ldf_eiv_trp
 
@@ -675,6 +666,4 @@
 !!gm I don't like this routine....   Crazy  way of doing things, not optimal at all...
 !!gm     to be redesigned....   
-      IF( ln_timing )   CALL timing_start( 'ldf_eiv_dia')
-      !
       !                                                  !==  eiv stream function: output  ==!
       CALL lbc_lnk_multi( psi_uw, 'U', -1. , psi_vw, 'V', -1. )
@@ -780,6 +769,4 @@
       !
       !
-      IF( ln_timing )   CALL timing_stop( 'ldf_eiv_dia')      
-      !
    END SUBROUTINE ldf_eiv_dia
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk.F90	(revision 9124)
@@ -57,5 +57,4 @@
    USE in_out_manager ! I/O manager
    USE lib_mpp        ! distribued memory computing library
-   USE timing         ! Timing
    USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
    USE prtctl         ! Print control
@@ -383,6 +382,4 @@
       !!---------------------------------------------------------------------
       !
-      IF( ln_timing )   CALL timing_start('blk_oce')
-      !
       ! local scalars ( place there for vector optimisation purposes)
       zst(:,:) = pst(:,:) + rt0      ! convert SST from Celcius to Kelvin (and set minimum value far above 0 K)
@@ -564,6 +561,4 @@
       ENDIF
       !
-      IF( ln_timing )   CALL timing_stop('blk_oce')
-      !
    END SUBROUTINE blk_oce
 
@@ -713,6 +708,4 @@
       REAL(wp), DIMENSION(jpi,jpj) ::   zrhoa     ! transfer coefficient for momentum      (tau)
       !!---------------------------------------------------------------------
-      !
-      IF( ln_timing )   CALL timing_start('blk_ice_tau')
       !
       ! set transfer coefficients to default sea-ice values
@@ -811,6 +804,4 @@
       ENDIF
       !
-      IF( ln_timing )   CALL timing_stop('blk_ice_tau')
-      !
    END SUBROUTINE blk_ice_tau
 
@@ -845,6 +836,4 @@
       REAL(wp), DIMENSION(jpi,jpj)     ::   zrhoa
       !!---------------------------------------------------------------------
-      !
-      IF( ln_timing )   CALL timing_start('blk_ice_flx')
       !
       zcoef_dqlw = 4.0 * 0.95 * Stef             ! local scalars
@@ -965,6 +954,4 @@
       ENDIF
       !
-      IF( ln_timing )   CALL timing_stop('blk_ice_flx')
-      !
    END SUBROUTINE blk_ice_flx
    
@@ -1002,6 +989,4 @@
       REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zgfac   ! enhanced conduction factor
       !!---------------------------------------------------------------------
-
-      IF( ln_timing )  CALL timing_start('blk_ice_qcn')
       
       ! -------------------------------------!
@@ -1065,6 +1050,4 @@
       END DO 
       !      
-      IF( ln_timing )  CALL timing_stop('blk_ice_qcn')
-      !
    END SUBROUTINE blk_ice_qcn
    
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_algo_coare.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_algo_coare.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_algo_coare.F90	(revision 9124)
@@ -40,5 +40,4 @@
    USE lib_mpp        ! distribued memory computing library
    USE wrk_nemo       ! work arrays
-   USE timing         ! Timing
    USE prtctl         ! Print control
    USE lib_fortran    ! to use key_nosignedzero
@@ -121,6 +120,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('turb_coare')
-
       CALL wrk_alloc( jpi,jpj,   u_star, t_star, q_star, zeta_u, dt_zu, dq_zu)
       CALL wrk_alloc( jpi,jpj,   znu_a, z0, z0t, ztmp0, ztmp1, ztmp2 )
@@ -254,7 +251,5 @@
       CALL wrk_dealloc( jpi,jpj, znu_a, z0, z0t, ztmp0, ztmp1, ztmp2 )
       IF( .NOT. l_zt_equal_zu ) CALL wrk_dealloc( jpi,jpj, zeta_t )
-
-      IF( nn_timing == 1 )  CALL timing_stop('turb_coare')
-
+      !
    END SUBROUTINE turb_coare
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_algo_coare3p5.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_algo_coare3p5.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_algo_coare3p5.F90	(revision 9124)
@@ -39,5 +39,4 @@
    USE lib_mpp         ! distribued memory computing library
    USE wrk_nemo        ! work arrays
-   USE timing          ! Timing
    USE in_out_manager  ! I/O manager
    USE prtctl          ! Print control
@@ -122,6 +121,4 @@
       !!----------------------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('turb_coare3p5')
-
       CALL wrk_alloc( jpi,jpj, u_star, t_star, q_star, zeta_u, dt_zu, dq_zu)
       CALL wrk_alloc( jpi,jpj, znu_a, z0, z0t, ztmp0, ztmp1, ztmp2 )
@@ -262,7 +259,5 @@
       CALL wrk_dealloc( jpi,jpj, znu_a, z0, z0t, ztmp0, ztmp1, ztmp2 )
       IF( .NOT. l_zt_equal_zu ) CALL wrk_dealloc( jpi,jpj, zeta_t )
-
-      IF( nn_timing == 1 )  CALL timing_stop('turb_coare3p5')
-
+      !
    END SUBROUTINE turb_coare3p5
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_algo_ecmwf.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_algo_ecmwf.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_algo_ecmwf.F90	(revision 9124)
@@ -33,5 +33,4 @@
    USE lib_mpp         ! distribued memory computing library
    USE wrk_nemo        ! work arrays
-   USE timing          ! Timing
    USE in_out_manager  ! I/O manager
    USE prtctl          ! Print control
@@ -128,6 +127,4 @@
       !!----------------------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )   CALL timing_start('turb_ecmwf')
-      !
       CALL wrk_alloc( jpi,jpj,   u_star, t_star, q_star, func_m, func_h, dt_zu, dq_zu, Linv )
       CALL wrk_alloc( jpi,jpj,   znu_a, z0, z0t, z0q, ztmp0, ztmp1, ztmp2 )
@@ -292,6 +289,4 @@
       CALL wrk_dealloc( jpi,jpj,   znu_a, z0, z0t, z0q, ztmp0, ztmp1, ztmp2 )
       !
-      IF( nn_timing == 1 )   CALL timing_stop('turb_ecmwf')
-      !
    END SUBROUTINE TURB_ECMWF
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_algo_ncar.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_algo_ncar.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_algo_ncar.F90	(revision 9124)
@@ -35,5 +35,4 @@
    USE lib_mpp         ! distribued memory computing library
    USE wrk_nemo        ! work arrays
-   USE timing          ! Timing
    USE in_out_manager  ! I/O manager
    USE prtctl          ! Print control
@@ -127,6 +126,4 @@
       !!----------------------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )   CALL timing_start('turb_ncar')
-      !
       CALL wrk_alloc( jpi,jpj,   Cx_n10, sqrt_Cd_n10, zeta_u, stab )
       CALL wrk_alloc( jpi,jpj,   zpsi_h_u, ztmp0, ztmp1, ztmp2 )
@@ -229,6 +226,4 @@
       CALL wrk_dealloc( jpi,jpj,   zpsi_h_u, ztmp0, ztmp1, ztmp2 )
       !
-      IF( nn_timing == 1 )   CALL timing_stop('turb_ncar')
-      !
    END SUBROUTINE turb_ncar
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 9124)
@@ -47,5 +47,4 @@
    USE iom            ! NetCDF library
    USE lib_mpp        ! distribued memory computing library
-   USE timing         ! Timing
    USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
 
@@ -258,6 +257,4 @@
 
       !!---------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )   CALL timing_start('sbc_cpl_init')
       !
       ! ================================ !
@@ -1046,7 +1043,4 @@
          &   CALL ctl_stop( 'sbc_cpl_init: diurnal cycle reconstruction (ln_dm2dc) needs daily couping for solar radiation' )
       IF( ln_dm2dc .AND. ln_cpl ) ncpl_qsr_freq = 86400 / ncpl_qsr_freq
-
-      !
-      IF( nn_timing == 1 )   CALL timing_stop('sbc_cpl_init')
       !
    END SUBROUTINE sbc_cpl_init
@@ -1114,6 +1108,4 @@
       REAL(wp), DIMENSION(jpi,jpj) ::   ztx, zty, zmsk, zemp, zqns, zqsr
       !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )   CALL timing_start('sbc_cpl_rcv')
       !
       IF( ln_mixcpl )   zmsk(:,:) = 1. - xcplmask(:,:,0)
@@ -1453,6 +1445,4 @@
       ENDIF
       !
-      IF( nn_timing == 1 )   CALL timing_stop('sbc_cpl_rcv')
-      !
    END SUBROUTINE sbc_cpl_rcv
    
@@ -1498,6 +1488,4 @@
       REAL(wp), DIMENSION(jpi,jpj) ::   ztx, zty 
       !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )   CALL timing_start('sbc_cpl_ice_tau')
       !
       IF( srcv(jpr_itx1)%laction ) THEN   ;   itx =  jpr_itx1   
@@ -1658,6 +1646,4 @@
 
       ENDIF
-      !   
-      IF( nn_timing == 1 )   CALL timing_stop('sbc_cpl_ice_tau')
       !
    END SUBROUTINE sbc_cpl_ice_tau
@@ -1730,6 +1716,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('sbc_cpl_ice_flx')
-      !
       IF( ln_mixcpl )   zmsk(:,:) = 1. - xcplmask(:,:,0)
       ziceld(:,:) = 1._wp - picefr(:,:)
@@ -2113,5 +2097,4 @@
       !
 #endif
-      IF( nn_timing == 1 )   CALL timing_stop('sbc_cpl_ice_flx')
       !
    END SUBROUTINE sbc_cpl_ice_flx
@@ -2135,6 +2118,4 @@
       REAL(wp), DIMENSION(jpi,jpj,jpl) ::   ztmp3, ztmp4   
       !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )   CALL timing_start('sbc_cpl_snd')
       !
       isec = ( kt - nit000 ) * NINT( rdt )        ! date of exchanges
@@ -2713,6 +2694,4 @@
 #endif
       !
-      IF( nn_timing == 1 )   CALL timing_stop('sbc_cpl_snd')
-      !
    END SUBROUTINE sbc_cpl_snd
    
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcdcy.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcdcy.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcdcy.F90	(revision 9124)
@@ -16,7 +16,7 @@
    USE dom_oce          ! ocean space and time domain
    USE sbc_oce          ! Surface boundary condition: ocean fields
+   !
    USE in_out_manager   ! I/O manager
    USE lib_mpp          ! MPP library
-   USE timing           ! Timing
 
    IMPLICIT NONE
@@ -63,6 +63,7 @@
       !!              Part 1: a diurnally forced OGCM. Climate Dynamics 29:6, 575-590.
       !!----------------------------------------------------------------------
-      LOGICAL, OPTIONAL, INTENT(in) :: l_mask ! use the routine for night mask computation
+      LOGICAL , OPTIONAL          , INTENT(in) ::   l_mask    ! use the routine for night mask computation
       REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pqsrin    ! input daily QSR flux 
+      REAL(wp), DIMENSION(jpi,jpj)             ::   zqsrout   ! output QSR flux with diurnal cycle
       !!
       INTEGER  ::   ji, jj                                       ! dummy loop indices
@@ -73,5 +74,4 @@
       REAL(wp) ::   ztmp, ztmp1, ztmp2, ztest
       REAL(wp) ::   ztmpm, ztmpm1, ztmpm2
-      REAL(wp), DIMENSION(jpi,jpj) ::   zqsrout                  ! output QSR flux with diurnal cycle
       !---------------------------statement functions------------------------
       REAL(wp) ::   fintegral, pt1, pt2, paaa, pbbb, pccc        ! dummy statement function arguments
@@ -80,6 +80,4 @@
          & - paaa * pt1 - zinvtwopi * pbbb * SIN(pccc + ztwopi * pt1)
       !!---------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )  CALL timing_start('sbc_dcy')
       !
       ! Initialization
@@ -199,5 +197,5 @@
       DO jj = 1, jpj
          DO ji = 1, jpi
-            ztmpm = 0.0
+            ztmpm = 0._wp
             IF( ABS(rab(ji,jj)) < 1. ) THEN         ! day duration is less than 24h
                !
@@ -241,10 +239,8 @@
       END DO  
       !
-      IF ( PRESENT(l_mask) .AND. l_mask ) THEN
+      IF( PRESENT(l_mask) .AND. l_mask ) THEN
          zqsrout(:,:) = float(imask_night(:,:))
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('sbc_dcy')
-      !
    END FUNCTION sbc_dcy
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcfwb.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcfwb.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcfwb.F90	(revision 9124)
@@ -25,6 +25,4 @@
    USE in_out_manager ! I/O manager
    USE lib_mpp        ! distribued memory computing library
-   USE wrk_nemo       ! work arrays
-   USE timing         ! Timing
    USE lbclnk         ! ocean lateral boundary conditions
    USE lib_fortran    ! 
@@ -70,11 +68,7 @@
       REAL(wp) ::   z_fwf, z_fwf_nsrf, zsum_fwf, zsum_erp                ! local scalars
       REAL(wp) ::   zsurf_neg, zsurf_pos, zsurf_tospread, zcoef          !   -      -
-      REAL(wp), POINTER, DIMENSION(:,:) ::   ztmsk_neg, ztmsk_pos, z_wgt ! 2D workspaces
-      REAL(wp), POINTER, DIMENSION(:,:) ::   ztmsk_tospread, zerp_cor    !   -      -
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   ztmsk_neg, ztmsk_pos, z_wgt ! 2D workspaces
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   ztmsk_tospread, zerp_cor    !   -      -
       !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )  CALL timing_start('sbc_fwb')
-      !
-      CALL wrk_alloc( jpi,jpj, ztmsk_neg, ztmsk_pos, ztmsk_tospread, z_wgt, zerp_cor )
       !
       IF( kt == nit000 ) THEN
@@ -154,4 +148,6 @@
       CASE ( 3 )                             !==  global fwf set to zero and spread out over erp area  ==!
          !
+         ALLOCATE( ztmsk_neg(jpi,jpj) , ztmsk_pos(jpi,jpj) , ztmsk_tospread(jpi,jpj) , z_wgt(jpi,jpj) , zerp_cor(jpi,jpj) )
+         !
          IF( MOD( kt-1, kn_fsbc ) == 0 ) THEN
             ztmsk_pos(:,:) = tmask_i(:,:)                      ! Select <0 and >0 area of erp
@@ -203,4 +199,5 @@
             ENDIF
          ENDIF
+         DEALLOCATE( ztmsk_neg , ztmsk_pos , ztmsk_tospread , z_wgt , zerp_cor )
          !
       CASE DEFAULT                           !==  you should never be there  ==!
@@ -209,8 +206,4 @@
       END SELECT
       !
-      CALL wrk_dealloc( jpi,jpj, ztmsk_neg, ztmsk_pos, ztmsk_tospread, z_wgt, zerp_cor )
-      !
-      IF( nn_timing == 1 )  CALL timing_stop('sbc_fwb')
-      !
    END SUBROUTINE sbc_fwb
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90	(revision 9124)
@@ -19,5 +19,4 @@
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
    USE wrk_nemo        ! work arrays
-   USE timing          ! Timing
    USE daymod          ! calendar
    USE fldread         ! read input fields
@@ -127,6 +126,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('sbc_ice_cice')
-      !
       !                                        !----------------------!
       IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN     !  Ice time-step only  !
@@ -148,6 +145,4 @@
       ENDIF                                          ! End sea-ice time step only
       !
-      IF( nn_timing == 1 )  CALL timing_stop('sbc_ice_cice')
-
    END SUBROUTINE sbc_ice_cice
 
@@ -164,6 +159,4 @@
       INTEGER  ::   ji, jj, jl, jk                    ! dummy loop indices
       !!---------------------------------------------------------------------
-
-      IF( nn_timing == 1 )  CALL timing_start('cice_sbc_init')
       !
       CALL wrk_alloc( jpi,jpj, ztmp1, ztmp2 )
@@ -281,6 +274,4 @@
       CALL wrk_dealloc( jpi,jpj, ztmp1, ztmp2 )
       !
-      IF( nn_timing == 1 )  CALL timing_stop('cice_sbc_init')
-      !
    END SUBROUTINE cice_sbc_init
 
@@ -299,6 +290,4 @@
       REAL(wp) ::   zintb, zintn  ! dummy argument
       !!---------------------------------------------------------------------
-
-      IF( nn_timing == 1 )  CALL timing_start('cice_sbc_in')
       !
       CALL wrk_alloc( jpi,jpj, ztmp, zpice )
@@ -507,6 +496,4 @@
       CALL wrk_dealloc( jpi,jpj,ncat, ztmpn )
       !
-      IF( nn_timing == 1 )  CALL timing_stop('cice_sbc_in')
-      !
    END SUBROUTINE cice_sbc_in
 
@@ -523,6 +510,4 @@
       REAL(wp), DIMENSION(:,:), POINTER :: ztmp1, ztmp2
       !!---------------------------------------------------------------------
-
-      IF( nn_timing == 1 )  CALL timing_start('cice_sbc_out')
       !
       CALL wrk_alloc( jpi,jpj, ztmp1, ztmp2 )
@@ -680,6 +665,4 @@
       CALL wrk_dealloc( jpi,jpj, ztmp1, ztmp2 )
       !
-      IF( nn_timing == 1 )  CALL timing_stop('cice_sbc_out')
-      !
    END SUBROUTINE cice_sbc_out
 
@@ -691,11 +674,10 @@
       !! 
       !!
+      !!---------------------------------------------------------------------
       INTEGER, INTENT( in  ) ::   kt   ! ocean time step
-      !!---------------------------------------------------------------------
-
+      !!
       INTEGER  ::   jl                        ! dummy loop index
       INTEGER  ::   ierror
-
-      IF( nn_timing == 1 )  CALL timing_start('cice_sbc_hadgam')
+      !!---------------------------------------------------------------------
       !
       IF( kt == nit000 )  THEN
@@ -722,6 +704,4 @@
       END DO
       !
-      IF( nn_timing == 1 )  CALL timing_stop('cice_sbc_hadgam')
-      !
    END SUBROUTINE cice_sbc_hadgam
 
@@ -732,10 +712,11 @@
       !! ** Purpose: Finalize CICE
       !!---------------------------------------------------------------------
-
+      !
       IF(lwp) WRITE(numout,*)'cice_sbc_final'
-
+      !
       CALL CICE_Finalize
-
+      !
    END SUBROUTINE cice_sbc_final
+
 
    SUBROUTINE cice_sbc_force (kt)
@@ -755,10 +736,8 @@
       !! History :
       !!----------------------------------------------------------------------
-      !! * Modules used
       USE iom
-
-      !! * arguments
-      INTEGER, INTENT( in  ) ::   kt ! ocean time step
-
+      !!
+      INTEGER, INTENT( in  ) ::   kt   ! ocean time step
+      !!
       INTEGER  ::   ierror             ! return error code
       INTEGER  ::   ifpr               ! dummy loop index
@@ -769,5 +748,4 @@
       TYPE(FLD_N) ::   sn_top1, sn_top2, sn_top3, sn_top4, sn_top5
       TYPE(FLD_N) ::   sn_bot1, sn_bot2, sn_bot3, sn_bot4, sn_bot5 
-
       !!
       NAMELIST/namsbc_cice/ cn_dir, sn_snow, sn_rain, sn_sblm,   &
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcisf.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcisf.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcisf.F90	(revision 9124)
@@ -24,5 +24,4 @@
    USE fldread        ! read input field at current time step
    USE lbclnk         !
-   USE timing         ! Timing
    USE lib_fortran    ! glob_sum
 
@@ -409,6 +408,4 @@
       REAL(wp) :: zpress     ! pressure to compute the freezing point in depth
       !!----------------------------------------------------------------------
-
-      IF( nn_timing == 1 )   CALL timing_start('sbc_isf_bg03')
       !
       DO ji = 1, jpi
@@ -441,6 +438,4 @@
       END DO
       !
-      IF( nn_timing == 1 )   CALL timing_stop('sbc_isf_bg03')
-      !
   END SUBROUTINE sbc_isf_bg03
 
@@ -473,4 +468,5 @@
       REAL(wp), DIMENSION(jpi,jpj) ::   zfwflx, zhtflx, zhtflx_b
       !!---------------------------------------------------------------------
+      !
       ! coeficient for linearisation of potential tfreez
       ! Crude approximation for pressure (but commonly used)
@@ -478,5 +474,4 @@
       zlamb2 = 0.0832_wp
       zlamb3 =-7.53e-08_wp * grav * rau0
-      IF( nn_timing == 1 )  CALL timing_start('sbc_isf_cav')
       !
       ! initialisation
@@ -571,6 +566,4 @@
       CALL iom_put('isfgammas', zgammas)
       ! 
-      IF( nn_timing == 1 )  CALL timing_stop('sbc_isf_cav')
-      !
    END SUBROUTINE sbc_isf_cav
 
@@ -585,9 +578,9 @@
       !!                Jenkins et al., 2010, JPO, p2298-2312
       !!---------------------------------------------------------------------
-      REAL(wp), DIMENSION(:,:), INTENT(out) :: pgt, pgs
-      REAL(wp), DIMENSION(:,:), INTENT(in ) :: pqhisf, pqwisf
-      !
-      INTEGER  :: ikt                        
+      REAL(wp), DIMENSION(:,:), INTENT(  out) ::   pgt   , pgs      ! 
+      REAL(wp), DIMENSION(:,:), INTENT(in   ) ::   pqhisf, pqwisf   ! 
+      !
       INTEGER  :: ji, jj                     ! loop index
+      INTEGER  :: ikt                        ! local integer
       REAL(wp) :: zdku, zdkv                 ! U, V shear 
       REAL(wp) :: zPr, zSc, zRc              ! Prandtl, Scmidth and Richardson number 
@@ -615,8 +608,12 @@
          !! Jenkins et al., 2010, JPO, p2298-2312
          !! Adopted by Asay-Davis et al. (2015)
-!!gm  I don't understand the u* expression in those papers... (see for example zdfglf module)
-!!    for me ustar= Cd0 * |U|  not  (Cd0)^1/2 * |U| ....  which is what you can find in Jenkins et al.
-
-         !! compute ustar (eq. 24)           !! NB: here r_Cdmin_top = rn_Cd0 read in namdrg_top namelist)
+         !! compute ustar (eq. 24)
+!!gm  NB  use pCdU here so that it will incorporate local boost of Cd0 and log layer case :
+!!         zustar(:,:) = SQRT( rCdU_top(:,:) * SQRT(utbl(:,:) * utbl(:,:) + vtbl(:,:) * vtbl(:,:) + r_ke0_top) )
+!! or better :  compute ustar in zdfdrg  and use it here as well as in TKE, GLS and Co
+!!
+!!     ===>>>>    GM  to be done this chrismas
+!!         
+!!gm end
          zustar(:,:) = SQRT( r_Cdmin_top * (utbl(:,:) * utbl(:,:) + vtbl(:,:) * vtbl(:,:) + r_ke0_top) )
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90	(revision 9124)
@@ -365,5 +365,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('sbc')
+      IF( ln_timing )   CALL timing_start('sbc')
       !
       !                                            ! ---------------------------------------- !
@@ -518,5 +518,5 @@
       IF( kt == nitend )   CALL sbc_final         ! Close down surface module if necessary
       !
-      IF( nn_timing == 1 )  CALL timing_stop('sbc')
+      IF( ln_timing )   CALL timing_stop('sbc')
       !
    END SUBROUTINE sbc
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssr.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssr.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssr.F90	(revision 9124)
@@ -23,5 +23,4 @@
    USE lib_mpp        ! distribued memory computing library
    USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
-   USE timing         ! Timing
    USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)  
 
@@ -80,6 +79,4 @@
       TYPE(FLD_N) ::   sn_sst, sn_sss        ! informations about the fields to be read
       !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )  CALL timing_start('sbc_ssr')
       !
       IF( nn_sstr + nn_sssr /= 0 ) THEN
@@ -136,6 +133,4 @@
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('sbc_ssr')
-      !
    END SUBROUTINE sbc_ssr
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen.F90	(revision 9124)
@@ -23,5 +23,4 @@
    USE trc_oce        ! share passive tracers/Ocean variables
    USE lib_mpp        ! MPP library
-   USE timing         ! Timing
 
    IMPLICIT NONE
@@ -81,6 +80,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( ln_timing )   CALL timing_start('tra_adv_cen')
-      !
       IF( kt == kit000 )  THEN
          IF(lwp) WRITE(numout,*)
@@ -205,6 +202,4 @@
       END DO
       !
-      IF( ln_timing )   CALL timing_stop('tra_adv_cen')
-      !
    END SUBROUTINE tra_adv_cen
    
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_fct.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_fct.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_fct.F90	(revision 9124)
@@ -27,5 +27,4 @@
    USE lbclnk         ! ocean lateral boundary condition (or mpp link) 
    USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)  
-   USE timing         ! Timing
 
    IMPLICIT NONE
@@ -88,6 +87,4 @@
       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   ztrdx, ztrdy, ztrdz, zptry
       !!----------------------------------------------------------------------
-      !
-      IF( ln_timing )   CALL timing_start('tra_adv_fct')
       !
       IF( kt == kit000 )  THEN
@@ -324,6 +321,4 @@
       END DO                     ! end of tracer loop
       !
-      IF( ln_timing )   CALL timing_stop('tra_adv_fct')
-      !
    END SUBROUTINE tra_adv_fct
 
@@ -353,6 +348,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( ln_timing )   CALL timing_start('nonosc')
-      !
       zbig  = 1.e+40_wp
       zrtrn = 1.e-15_wp
@@ -428,6 +421,4 @@
       END DO
       CALL lbc_lnk_multi( paa, 'U', -1. , pbb, 'V', -1. )   ! lateral boundary condition (changed sign)
-      !
-      IF( ln_timing )   CALL timing_stop('nonosc')
       !
    END SUBROUTINE nonosc
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_mle.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_mle.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_mle.F90	(revision 9124)
@@ -16,9 +16,8 @@
    USE zdfmxl         ! mixed layer depth
    !
-   USE lbclnk         ! lateral boundary condition / mpp link
    USE in_out_manager ! I/O manager
    USE iom            ! IOM library
    USE lib_mpp        ! MPP library
-   USE timing         ! Timing
+   USE lbclnk         ! lateral boundary condition / mpp link
 
    IMPLICIT NONE
@@ -95,6 +94,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( ln_timing )   CALL timing_start('tra_adv_mle')
-      !
       !                                      !==  MLD used for MLE  ==!
       !                                                ! compute from the 10m density to deal with the diurnal cycle
@@ -248,6 +245,4 @@
          CALL iom_put( "psiv_mle", zpsi_vw )    ! j-mle streamfunction
       ENDIF
-      !
-      IF( ln_timing )   CALL timing_stop('tra_adv_mle')
       !
    END SUBROUTINE tra_adv_mle
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_mus.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_mus.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_mus.F90	(revision 9124)
@@ -27,9 +27,8 @@
    !
    USE iom            ! XIOS library
-   USE timing         ! Timing
-   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)  
    USE in_out_manager ! I/O manager
    USE lib_mpp        ! distribued memory computing
    USE lbclnk         ! ocean lateral boundary condition (or mpp link) 
+   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)  
 
    IMPLICIT NONE
@@ -91,6 +90,4 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zwy, zslpy   ! -      - 
       !!----------------------------------------------------------------------
-      !
-      IF( ln_timing )   CALL timing_start('tra_adv_mus')
       !
       IF( kt == kit000 )  THEN
@@ -275,6 +272,4 @@
       END DO                     ! end of tracer loop
       !
-      IF( ln_timing )   CALL timing_stop('tra_adv_mus')
-      !
    END SUBROUTINE tra_adv_mus
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_qck.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_qck.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_qck.F90	(revision 9124)
@@ -22,8 +22,7 @@
    USE diaptr          ! poleward transport diagnostics
    !
+   USE in_out_manager  ! I/O manager
    USE lib_mpp         ! distribued memory computing
    USE lbclnk          ! ocean lateral boundary condition (or mpp link)
-   USE in_out_manager  ! I/O manager
-   USE timing          ! Timing
    USE lib_fortran     ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)  
 
@@ -95,6 +94,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( ln_timing )   CALL timing_start('tra_adv_qck')
-      !
       IF( kt == kit000 )  THEN
          IF(lwp) WRITE(numout,*)
@@ -116,6 +113,4 @@
       !        ! vertical fluxes are computed with the 2nd order centered scheme
       CALL tra_adv_cen2_k( kt, cdtype, pwn,         ptn, pta, kjpt )
-      !
-      IF( ln_timing )   CALL timing_stop('tra_adv_qck')
       !
    END SUBROUTINE tra_adv_qck
@@ -427,6 +422,4 @@
       REAL(wp) ::  zc, zcurv, zfho          !   -      -
       !----------------------------------------------------------------------
-      !
-      IF( ln_timing )   CALL timing_start('quickest')
       !
       DO jk = 1, jpkm1
@@ -460,6 +453,4 @@
       END DO
       !
-      IF( ln_timing )   CALL timing_stop('quickest')
-      !
    END SUBROUTINE quickest
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_ubs.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_ubs.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_ubs.F90	(revision 9124)
@@ -22,8 +22,7 @@
    !
    USE iom            ! I/O library
+   USE in_out_manager ! I/O manager
    USE lib_mpp        ! massively parallel library
    USE lbclnk         ! ocean lateral boundary condition (or mpp link)
-   USE in_out_manager ! I/O manager
-   USE timing         ! Timing
    USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)  
 
@@ -102,6 +101,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( ln_timing )   CALL timing_start('tra_adv_ubs')
-      !
       IF( kt == kit000 )  THEN
          IF(lwp) WRITE(numout,*)
@@ -281,6 +278,4 @@
       END DO
       !
-      IF( ln_timing )   CALL timing_stop('tra_adv_ubs')
-      !
    END SUBROUTINE tra_adv_ubs
 
@@ -310,6 +305,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( ln_timing )   CALL timing_start('nonosc_z')
-      !
       zbig  = 1.e+40_wp
       zrtrn = 1.e-15_wp
@@ -379,6 +372,4 @@
       END DO
       !
-      IF( ln_timing )   CALL timing_stop('nonosc_z')
-      !
    END SUBROUTINE nonosc_z
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90	(revision 9124)
@@ -42,7 +42,7 @@
 
    PUBLIC   tra_bbl       !  routine called by step.F90
-   PUBLIC   tra_bbl_init  !  routine called by opa.F90
+   PUBLIC   tra_bbl_init  !  routine called by nemogcm.F90
    PUBLIC   tra_bbl_dif   !  routine called by trcbbl.F90
-   PUBLIC   tra_bbl_adv   !  -          -          -              -
+   PUBLIC   tra_bbl_adv   !     -      -          -
    PUBLIC   bbl           !  routine called by trcbbl.F90 and dtadyn.F90
 
@@ -185,6 +185,4 @@
       REAL(wp), DIMENSION(jpi,jpj) ::   zptb   ! workspace
       !!----------------------------------------------------------------------
-      !
-      IF( ln_timing )   CALL timing_start('tra_bbl_dif')
       !
       DO jn = 1, kjpt                                     ! tracer loop
@@ -211,7 +209,4 @@
       END DO                                                ! end tracer
       !                                                     ! ===========
-      !
-      IF( ln_timing )   CALL timing_stop('tra_bbl_dif')
-      !
    END SUBROUTINE tra_bbl_dif
 
@@ -243,5 +238,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( ln_timing )   CALL timing_start( 'tra_bbl_adv')
       !                                                          ! ===========
       DO jn = 1, kjpt                                            ! tracer loop
@@ -298,7 +292,4 @@
       END DO                                                ! end tracer
       !                                                     ! ===========
-      !
-      IF( ln_timing )   CALL timing_stop( 'tra_bbl_adv')
-      !
    END SUBROUTINE tra_bbl_adv
 
@@ -343,6 +334,4 @@
       REAL(wp), DIMENSION(jpi,jpj)        :: zub, zvb, zdep   ! 2D workspace
       !!----------------------------------------------------------------------
-      !
-      IF( ln_timing )   CALL timing_start( 'bbl')
       !
       IF( kt == kit000 )  THEN
@@ -475,6 +464,4 @@
       ENDIF
       !
-      IF( ln_timing )   CALL timing_stop( 'bbl')
-      !
    END SUBROUTINE bbl
 
@@ -495,6 +482,4 @@
       NAMELIST/nambbl/ ln_trabbl, nn_bbl_ldf, nn_bbl_adv, rn_ahtbbl, rn_gambbl
       !!----------------------------------------------------------------------
-      !
-      IF( ln_timing )   CALL timing_start( 'tra_bbl_init')
       !
       REWIND( numnam_ref )              ! Namelist nambbl in reference namelist : Bottom boundary layer scheme
@@ -569,6 +554,4 @@
       ahv_bbl_0(:,:) = rn_ahtbbl * e1_e2v(:,:) * e3v_bbl_0(:,:) * vmask(:,:,1)
       !
-      IF( ln_timing )   CALL timing_stop( 'tra_bbl_init')
-      !
    END SUBROUTINE tra_bbl_init
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso.F90	(revision 9124)
@@ -30,5 +30,4 @@
    USE phycst         ! physical constants
    USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
-   USE timing         ! Timing
 
    IMPLICIT NONE
@@ -113,6 +112,4 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zdit, zdjt, zftu, zftv, ztfw 
       !!----------------------------------------------------------------------
-      !
-      IF( ln_timing )   CALL timing_start('tra_ldf_iso')
       !
       IF( kt == kit000 )  THEN
@@ -383,6 +380,4 @@
       END DO                                                      ! end tracer loop
       !
-      IF( ln_timing )   CALL timing_stop('tra_ldf_iso')
-      !
    END SUBROUTINE tra_ldf_iso
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_lap_blp.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_lap_blp.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_lap_blp.F90	(revision 9124)
@@ -89,6 +89,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( ln_timing )   CALL timing_start('tra_ldf_lap')
-      !
       IF( kt == nit000 .AND. lwp )  THEN
          WRITE(numout,*)
@@ -165,6 +163,4 @@
       END DO                        ! end of tracer loop
       !                             ! ==================
-      !
-      IF( ln_timing )   CALL timing_stop('tra_ldf_lap')
       !
    END SUBROUTINE tra_ldf_lap
@@ -203,6 +199,4 @@
       !!---------------------------------------------------------------------
       !
-      IF( ln_timing )   CALL timing_start('tra_ldf_blp')
-      !
       IF( kt == kit000 .AND. lwp )  THEN
          WRITE(numout,*)
@@ -243,6 +237,4 @@
       END SELECT
       !
-      IF( ln_timing )   CALL timing_stop('tra_ldf_blp')
-      !
    END SUBROUTINE tra_ldf_blp
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_triad.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_triad.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_triad.F90	(revision 9124)
@@ -27,5 +27,4 @@
    USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
    USE lib_mpp        ! MPP library
-   USE timing         ! Timing
 
    IMPLICIT NONE
@@ -97,6 +96,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( ln_timing )   CALL timing_start('tra_ldf_triad')
-      !
       IF( .NOT.ALLOCATED(zdkt3d) )  THEN
          ALLOCATE( zdkt3d(jpi,jpj,0:1) , STAT=ierr )
@@ -430,6 +427,4 @@
       END DO                                                      ! end tracer loop
       !                                                           ! ===============
-      IF( ln_timing )   CALL timing_stop('tra_ldf_triad')
-      !
    END SUBROUTINE tra_ldf_triad
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/traqsr.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/traqsr.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/traqsr.F90	(revision 9124)
@@ -334,6 +334,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( ln_timing )   CALL timing_start('tra_qsr_init')
-      !
       REWIND( numnam_ref )              ! Namelist namtra_qsr in reference     namelist
       READ  ( numnam_ref, namtra_qsr, IOSTAT = ios, ERR = 901)
@@ -428,6 +426,4 @@
       ENDIF
       !
-      IF( ln_timing )   CALL timing_stop('tra_qsr_init')
-      !
    END SUBROUTINE tra_qsr_init
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/trasbc.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/trasbc.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/trasbc.F90	(revision 9124)
@@ -27,4 +27,5 @@
    USE trd_oce        ! trends: ocean variables
    USE trdtra         ! trends manager: tracers 
+   USE wet_dry,  ONLY : ll_wd, rn_wdmin1, r_rn_wdmin1   ! Wetting and drying
 #if defined key_asminc   
    USE asminc         ! Assimilation increment
@@ -36,5 +37,4 @@
    USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
    USE timing         ! Timing
-   USE wet_dry,  ONLY : ll_wd, rn_wdmin1, r_rn_wdmin1 ! Wetting and drying
 
    IMPLICIT NONE
@@ -252,5 +252,4 @@
       !
 #endif
-
       !
       !----------------------------------------
@@ -263,8 +262,6 @@
                DO ji = fs_2, fs_jpim1
                   zdep = 1._wp / e3t_n(ji,jj,jk) 
-                  tsa(ji,jj,jk,jp_tem) = tsa(ji,jj,jk,jp_tem) - htsc_iscpl(ji,jj,jk,jp_tem)                       &
-                      &                                         * zdep
-                  tsa(ji,jj,jk,jp_sal) = tsa(ji,jj,jk,jp_sal) - htsc_iscpl(ji,jj,jk,jp_sal)                       &
-                      &                                         * zdep  
+                  tsa(ji,jj,jk,jp_tem) = tsa(ji,jj,jk,jp_tem) - htsc_iscpl(ji,jj,jk,jp_tem) * zdep
+                  tsa(ji,jj,jk,jp_sal) = tsa(ji,jj,jk,jp_sal) - htsc_iscpl(ji,jj,jk,jp_sal) * zdep  
                END DO  
             END DO  
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf.F90	(revision 9124)
@@ -58,4 +58,10 @@
       IF( ln_timing )   CALL timing_start('tra_zdf')
       !
+      IF( kt == nit000 )  THEN
+         IF(lwp)WRITE(numout,*)
+         IF(lwp)WRITE(numout,*) 'tra_zdf : implicit vertical mixing on T & S'
+         IF(lwp)WRITE(numout,*) '~~~~~~~ '
+      ENDIF
+      !
       IF( neuler == 0 .AND. kt == nit000 ) THEN   ;   r2dt =      rdt   ! at nit000, =   rdt (restarting with Euler time stepping)
       ELSEIF( kt <= nit000 + 1           ) THEN   ;   r2dt = 2. * rdt   ! otherwise, = 2 rdt (leapfrog)
@@ -134,11 +140,4 @@
       !!---------------------------------------------------------------------
       !
-      IF( ln_timing )   CALL timing_start('tra_zdf_imp')
-      !
-      IF( kt == kit000 )  THEN
-         IF(lwp)WRITE(numout,*)
-         IF(lwp)WRITE(numout,*) 'tra_zdf_imp : implicit vertical mixing on ', cdtype
-         IF(lwp)WRITE(numout,*) '~~~~~~~~~~~ '
-      ENDIF
       !                                               ! ============= !
       DO jn = 1, kjpt                                 !  tracer loop  !
@@ -253,7 +252,4 @@
       END DO                                          !  end tracer loop  !
       !                                               ! ================= !
-      !
-      IF( ln_timing )   CALL timing_stop('tra_zdf_imp')
-      !
    END SUBROUTINE tra_zdf_imp
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/USR/usrdef_closea.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/USR/usrdef_closea.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/USR/usrdef_closea.F90	(revision 9124)
@@ -30,5 +30,4 @@
    USE lbclnk          ! lateral boundary condition - MPP exchanges
    USE lib_mpp         ! MPP library
-   USE timing
 
    IMPLICIT NONE
@@ -201,5 +200,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('sbc_clo')
       !                                                   !------------------!
       IF( kt == nit000 ) THEN                             !  Initialisation  !
@@ -335,6 +333,4 @@
       CALL lbc_lnk( emp , 'T', 1._wp )
       !
-      IF( nn_timing == 1 )  CALL timing_stop('sbc_clo')
-      !
    END SUBROUTINE sbc_clo
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/USR/usrdef_fmask.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/USR/usrdef_fmask.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/USR/usrdef_fmask.F90	(revision 9124)
@@ -30,5 +30,5 @@
    !!----------------------------------------------------------------------
    !! NEMO/OPA 4.0 , NEMO Consortium  (2016)
-   !! $Id$ 
+   !! $Id:$ 
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/USR/usrdef_hgr.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/USR/usrdef_hgr.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/USR/usrdef_hgr.F90	(revision 9124)
@@ -20,5 +20,4 @@
    USE in_out_manager ! I/O manager
    USE lib_mpp        ! MPP library
-   USE timing         ! Timing
    
    IMPLICIT NONE
@@ -29,5 +28,5 @@
    !!----------------------------------------------------------------------
    !! NEMO/OPA 4.0 , NEMO Consortium (2016)
-   !! $Id$ 
+   !! $Id:$ 
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
@@ -71,6 +70,4 @@
       REAL(wp) ::   zphi1, zphi0, zsin_alpha, zim05, zjm05, zbeta, znorme      !   -      -
       !!-------------------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )  CALL timing_start('usr_def_hgr')
       !
       !     !==  beta-plane with regular grid-spacing and rotated domain ==!  (GYRE configuration)
@@ -170,6 +167,4 @@
       IF(lwp) WRITE(numout,*) '                           beta-plane used. beta = ', zbeta, ' 1/(s.m)'
       !
-      IF( nn_timing == 1 )  CALL timing_stop('usr_def_hgr')
-      !
    END SUBROUTINE usr_def_hgr
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/USR/usrdef_istate.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/USR/usrdef_istate.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/USR/usrdef_istate.F90	(revision 9124)
@@ -26,5 +26,5 @@
    !!----------------------------------------------------------------------
    !! NEMO/OPA 4.0 , NEMO Consortium (2016)
-   !! $Id$ 
+   !! $Id:$ 
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/USR/usrdef_nam.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/USR/usrdef_nam.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/USR/usrdef_nam.F90	(revision 9124)
@@ -20,5 +20,4 @@
    USE in_out_manager ! I/O manager
    USE lib_mpp        ! MPP library
-   USE timing         ! Timing
    
    IMPLICIT NONE
@@ -33,5 +32,5 @@
    !!----------------------------------------------------------------------
    !! NEMO/OPA 4.0 , NEMO Consortium (2016)
-   !! $Id$ 
+   !! $Id:$ 
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/USR/usrdef_sbc.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/USR/usrdef_sbc.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/USR/usrdef_sbc.F90	(revision 9124)
@@ -13,20 +13,20 @@
    !!   usrdef_sbc    : user defined surface bounday conditions in GYRE case
    !!----------------------------------------------------------------------
-   USE oce             ! ocean dynamics and tracers
-   USE dom_oce         ! ocean space and time domain
-   USE sbc_oce         ! Surface boundary condition: ocean fields
-   USE phycst          ! physical constants
+   USE oce            ! ocean dynamics and tracers
+   USE dom_oce        ! ocean space and time domain
+   USE sbc_oce        ! Surface boundary condition: ocean fields
+   USE phycst         ! physical constants
    !
-   USE in_out_manager  ! I/O manager
-   USE lib_mpp         ! distribued memory computing library
-   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
-   USE lib_fortran     !
+   USE in_out_manager ! I/O manager
+   USE lib_mpp        ! distribued memory computing library
+   USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
+   USE lib_fortran    !
 
    IMPLICIT NONE
    PRIVATE
 
-   PUBLIC   usrdef_sbc_oce    ! routine called in sbcmod module
-   PUBLIC   usrdef_sbc_ice_tau  ! routine called by icestp.F90 for ice dynamics
-   PUBLIC   usrdef_sbc_ice_flx  ! routine called by icestp.F90 for ice thermo
+   PUBLIC   usrdef_sbc_oce       ! routine called in sbcmod module
+   PUBLIC   usrdef_sbc_ice_tau   ! routine called by icestp.F90 for ice dynamics
+   PUBLIC   usrdef_sbc_ice_flx   ! routine called by icestp.F90 for ice thermo
 
    !! * Substitutions
@@ -34,5 +34,5 @@
    !!----------------------------------------------------------------------
    !! NEMO/OPA 4.0 , NEMO Consortium (2016)
-   !! $Id$
+   !! $Id:$
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
@@ -225,7 +225,9 @@
    END SUBROUTINE usrdef_sbc_oce
 
+
    SUBROUTINE usrdef_sbc_ice_tau( kt )
       INTEGER, INTENT(in) ::   kt   ! ocean time step
    END SUBROUTINE usrdef_sbc_ice_tau
+
 
    SUBROUTINE usrdef_sbc_ice_flx( kt, phs, phi )
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/USR/usrdef_zgr.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/USR/usrdef_zgr.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/USR/usrdef_zgr.F90	(revision 9124)
@@ -24,5 +24,4 @@
    USE lib_mpp        ! distributed memory computing library
    USE wrk_nemo       ! Memory allocation
-   USE timing         ! Timing
 
    IMPLICIT NONE
@@ -31,9 +30,9 @@
    PUBLIC   usr_def_zgr        ! called by domzgr.F90
 
-  !! * Substitutions
+   !! * Substitutions
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
    !! NEMO/OPA 4.0 , NEMO Consortium (2016)
-   !! $Id$
+   !! $Id:$
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
@@ -132,6 +131,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('zgr_z')
-      !
       ! Set parameters of z(k) function
       ! -------------------------------
@@ -178,6 +175,4 @@
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('zgr_z')
-      !
    END SUBROUTINE zgr_z
 
@@ -236,6 +231,4 @@
       INTEGER  ::   jk
       !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )  CALL timing_start('zgr_zco')
       !
       DO jk = 1, jpk
@@ -251,6 +244,4 @@
       END DO
       !
-      IF( nn_timing == 1 )  CALL timing_stop('zgr_zco')
-      !
    END SUBROUTINE zgr_zco
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfgls.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfgls.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfgls.F90	(revision 9124)
@@ -1128,5 +1128,5 @@
    SUBROUTINE gls_rst( kt, cdrw )
       !!---------------------------------------------------------------------
-      !!                   ***  ROUTINE ts_rst  ***
+      !!                   ***  ROUTINE gls_rst  ***
       !!                     
       !! ** Purpose :   Read or write TKE file (en) in restart file
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 9124)
@@ -205,9 +205,9 @@
          CALL Agrif_ParentGrid_To_ChildGrid()
          IF( ln_diaobs )        CALL dia_obs_wri
-         IF( nn_timing == 1 )   CALL timing_finalize
+         IF( ln_timing )   CALL timing_finalize
          CALL Agrif_ChildGrid_To_ParentGrid()
       ENDIF
 #endif
-      IF( ln_timing    )   CALL timing_finalize
+      IF( ln_timing )   CALL timing_finalize
       !
       CALL nemo_closefile
@@ -550,11 +550,5 @@
       njctle    = nn_jctle
       isplt     = nn_isplt
-      jsplt     = nn_jsplt
-!!gm to be remove at the end of the 2017 merge party
-      if( ln_timing ) then  ;  nn_timing = 1
-      else                  ;  nn_timing = 0
-      endif
-!!gm end
-      
+      jsplt     = nn_jsplt      
 
       IF(lwp) THEN                  ! control print
@@ -613,5 +607,5 @@
       !
 #if defined key_agrif
-      IF( nn_timing == 1 ) CALL ctl_stop( 'AGRIF not implemented with nn_timing = 1')
+      IF( ln_timing )   CALL ctl_stop( 'AGRIF not implemented with ln_timing = true')
 #endif
       !
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/step.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/step.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/step.F90	(revision 9124)
@@ -91,4 +91,7 @@
 # endif
 #endif
+      !
+      IF( ln_timing )   CALL timing_start('stp')
+      !
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
       ! update I/O and calendar 
@@ -334,5 +337,9 @@
 #endif
       !
-      IF( ln_timing .AND.  kstp == nit000  )   CALL timing_reset
+      IF( ln_timing ) THEN
+         IF( ln_timing      )   CALL timing_start('stp')
+!!gm avoid the init phase during 1st time step ???  useless now no?
+         IF( kstp == nit000 )   CALL timing_reset           
+      ENDIF
       !
    END SUBROUTINE stp
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/SAS_SRC/daymod.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/SAS_SRC/daymod.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/SAS_SRC/daymod.F90	(revision 9124)
@@ -223,5 +223,5 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('day')
+      IF( ln_timing )   CALL timing_start('day')
       !
       zprec = 0.1 / rday
@@ -277,5 +277,5 @@
       IF( lrst_oce         ) CALL day_rst( kt, 'WRITE' )      ! write day restart information
       !
-      IF( nn_timing == 1 )  CALL timing_stop('day')
+      IF( ln_timing )   CALL timing_stop('day')
       !
    END SUBROUTINE day
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/SAS_SRC/diawri.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/SAS_SRC/diawri.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/SAS_SRC/diawri.F90	(revision 9124)
@@ -136,5 +136,5 @@
       !!----------------------------------------------------------------------
       ! 
-      IF( nn_timing == 1 )   CALL timing_start('dia_wri')
+      IF( ln_timing )   CALL timing_start('dia_wri')
       !
       ! Output the initial state and forcings
@@ -322,5 +322,5 @@
       ENDIF
       !
-      IF( nn_timing == 1 )   CALL timing_stop('dia_wri')
+      IF( ln_timing )   CALL timing_stop('dia_wri')
       !
    END SUBROUTINE dia_wri
@@ -350,5 +350,5 @@
       !!----------------------------------------------------------------------
       ! 
-      IF( nn_timing == 1 )   CALL timing_start('dia_wri_state')
+      IF( ln_timing )   CALL timing_start('dia_wri_state')
 
       ! 0. Initialisation
@@ -428,9 +428,9 @@
       ENDIF
 #endif
-       
-      IF( nn_timing == 1 )   CALL timing_stop('dia_wri_state')
-      ! 
-
+      !
+      IF( ln_timing )   CALL timing_stop('dia_wri_state')
+      !
    END SUBROUTINE dia_wri_state
+
    !!======================================================================
 END MODULE diawri
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90	(revision 9124)
@@ -424,9 +424,4 @@
       isplt     = nn_isplt
       jsplt     = nn_jsplt
-!!gm to be remove at the end of the 2017 merge party
-      if( ln_timing ) then  ;  nn_timing = 1
-      else                  ;  nn_timing = 0
-      endif
-!!gm end
 
       IF(lwp) THEN                  ! control print
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/SAS_SRC/sbcssm.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/SAS_SRC/sbcssm.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/SAS_SRC/sbcssm.F90	(revision 9124)
@@ -23,4 +23,5 @@
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
    USE zpshde          ! z-coord. with partial steps: horizontal derivatives
+   !
    USE in_out_manager  ! I/O manager
    USE iom             ! I/O library
@@ -72,5 +73,4 @@
       !!             - interpolates data if needed
       !!----------------------------------------------------------------------
-      !
       INTEGER, INTENT(in) ::   kt   ! ocean time-step index
       !
@@ -79,7 +79,6 @@
       REAL(wp) ::   ztintb     ! ratio applied to before records when doing time interpolation
       !!----------------------------------------------------------------------
-      
-      !
-      IF( nn_timing == 1 )  CALL timing_start( 'sbc_ssm')
+      !
+      IF( ln_timing )   CALL timing_start( 'sbc_ssm')
      
       IF ( l_sasread ) THEN
@@ -153,5 +152,5 @@
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop( 'sbc_ssm')
+      IF( ln_timing )   CALL timing_stop( 'sbc_ssm')
       !
    END SUBROUTINE sbc_ssm
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/AGE/trcsms_age.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/AGE/trcsms_age.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/AGE/trcsms_age.F90	(revision 9124)
@@ -45,10 +45,9 @@
       !! ** Method  : -
       !!----------------------------------------------------------------------
-      !
       INTEGER, INTENT(in) ::   kt   ! ocean time-step index
       INTEGER ::   jn, jk   ! dummy loop index
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('trc_sms_age')
+      IF( ln_timing )   CALL timing_start('trc_sms_age')
       !
       IF(lwp) WRITE(numout,*)
@@ -59,5 +58,5 @@
       DO jk = 1, nla_age
          tra(:,:,jk,jp_age) = rn_age_kill_rate * trb(:,:,jk,jp_age)
-      ENDDO
+      END DO
       !
       tra(:,:,nl_age,jp_age) = frac_kill_age * rn_age_kill_rate * trb(:,:,nl_age,jp_age)  &
@@ -66,9 +65,9 @@
       DO jk = nlb_age, jpk
          tra(:,:,jk,jp_age) = tmask(:,:,jk) * rryear
-      ENDDO
+      END DO
       !
       IF( l_trdtrc ) CALL trd_trc( tra(:,:,:,jp_age), jn, jptra_sms, kt )   ! save trends
       !
-      IF( nn_timing == 1 )  CALL timing_stop('trc_sms_age')
+      IF( ln_timing )   CALL timing_stop('trc_sms_age')
       !
    END SUBROUTINE trc_sms_age
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/C14/trcatm_c14.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/C14/trcatm_c14.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/C14/trcatm_c14.F90	(revision 9124)
@@ -49,5 +49,5 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('trc_atm_c14_ini')
+      IF( ln_timing )   CALL timing_start('trc_atm_c14_ini')
       !
       
@@ -192,5 +192,5 @@
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('trc_atm_c14_ini')
+      IF( ln_timing )   CALL timing_stop('trc_atm_c14_ini')
       !
    END SUBROUTINE trc_atm_c14_ini
@@ -216,5 +216,5 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('trc_atm_c14')
+      IF( ln_timing )   CALL timing_start('trc_atm_c14')
       !
       IF( kc14typ == 0) THEN
@@ -297,5 +297,5 @@
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('trc_atm_c14')
+      IF( ln_timing )   CALL timing_stop('trc_atm_c14')
       !
    END SUBROUTINE trc_atm_c14
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/C14/trcsms_c14.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/C14/trcsms_c14.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/C14/trcsms_c14.F90	(revision 9124)
@@ -28,5 +28,5 @@
    !!----------------------------------------------------------------------
    !! NEMO/TOP 3.3 , NEMO Consortium (2010)
-   !! $                                                                    $ 
+   !! $Id:$ 
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
@@ -60,5 +60,5 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('trc_sms_c14')
+      IF( ln_timing )   CALL timing_start('trc_sms_c14')
       !
       IF( kt ==  nittrc000 ) THEN
@@ -68,5 +68,4 @@
       ENDIF
       !
- 
       ! Get co2sbc & c14sbc(ji,jj): at 1st iter for all, at each time step for transient
       IF( kc14typ >= 1 .OR.  kt ==  nittrc000 )   CALL trc_atm_c14( kt, co2sbc, c14sbc ) 
@@ -80,8 +79,8 @@
       DO jj = 1, jpj
          DO ji = 1, jpi  
-            IF( tmask(ji,jj,1) >  0.) THEN
-
-               zt   = MIN( 40., tsn(ji,jj,1,jp_tem))
-
+            IF( tmask(ji,jj,1) >  0. ) THEN
+               !
+               zt   = MIN( 40. , tsn(ji,jj,1,jp_tem) )
+               !
                !  Computation of solubility zsol in [mol/(L * atm)]
                !   after Wanninkhof (2014) referencing Weiss (1974)
@@ -143,5 +142,4 @@
          END DO
       END DO
-
       !
       IF( lrst_trc ) THEN
@@ -149,5 +147,5 @@
          IF(lwp) WRITE(numout,*) ' trc_rst_wri_c14 : Write specific variables from c14 model '
          IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~'
-      !
+         !
          CALL iom_rstput( kt, nitrst, numrtw, 'co2sbc', co2sbc )       ! These five need      &
          CALL iom_rstput( kt, nitrst, numrtw, 'c14sbc', c14sbc )     ! &    to be written   &
@@ -156,14 +154,13 @@
          CALL iom_rstput( kt, nitrst, numrtw, 'qtr_c14', qtr_c14 )   ! &    to be coherent.
          CALL iom_rstput( kt, nitrst, numrtw, 'qint_c14', qint_c14 ) ! Cumulative
-      !
+         !
       ENDIF
 
       IF( l_trdtrc )  CALL trd_trc( tra(:,:,:,jp_c14), 1, jptra_sms, kt )   ! save trends
       !
-      IF( nn_timing == 1 )  CALL timing_stop('trc_sms_c14')
+      IF( ln_timing )   CALL timing_stop('trc_sms_c14')
       !
    END SUBROUTINE trc_sms_c14
 
-
   !!======================================================================
 END MODULE trcsms_c14
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/CFC/trcsms_cfc.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/CFC/trcsms_cfc.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/CFC/trcsms_cfc.F90	(revision 9124)
@@ -85,6 +85,5 @@
       !!----------------------------------------------------------------------
       !
-      !
-      IF( nn_timing == 1 )  CALL timing_start('trc_sms_cfc')
+      IF( ln_timing )   CALL timing_start('trc_sms_cfc')
       !
       ALLOCATE( zpatm(jphem,jp_cfc), STAT=ierr )
@@ -194,5 +193,5 @@
       END IF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('trc_sms_cfc')
+      IF( ln_timing )   CALL timing_stop('trc_sms_cfc')
       !
    END SUBROUTINE trc_sms_cfc
@@ -205,5 +204,5 @@
       !! ** Purpose : sets constants for CFC model
       !!---------------------------------------------------------------------
-      INTEGER :: jn
+      INTEGER ::   jn   !
       !!----------------------------------------------------------------------
       !
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/MY_TRC/trcsms_my_trc.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/MY_TRC/trcsms_my_trc.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/MY_TRC/trcsms_my_trc.F90	(revision 9124)
@@ -46,5 +46,5 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('trc_sms_my_trc')
+      IF( ln_timing )   CALL timing_start('trc_sms_my_trc')
       !
       IF(lwp) WRITE(numout,*)
@@ -67,7 +67,8 @@
       END IF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('trc_sms_my_trc')
+      IF( ln_timing )   CALL timing_stop('trc_sms_my_trc')
       !
    END SUBROUTINE trc_sms_my_trc
+
 
    INTEGER FUNCTION trc_sms_my_trc_alloc()
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P2Z/p2zbio.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P2Z/p2zbio.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P2Z/p2zbio.F90	(revision 9124)
@@ -101,5 +101,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p2z_bio')
+      IF( ln_timing )   CALL timing_start('p2z_bio')
       !
       IF( lk_iomput ) THEN
@@ -382,7 +382,8 @@
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p2z_bio')
+      IF( ln_timing )  CALL timing_stop('p2z_bio')
       !
    END SUBROUTINE p2z_bio
+
 
    SUBROUTINE p2z_bio_init
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P2Z/p2zexp.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P2Z/p2zexp.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P2Z/p2zexp.F90	(revision 9124)
@@ -68,5 +68,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p2z_exp')
+      IF( ln_timing )   CALL timing_start('p2z_exp')
       !
       IF( kt == nittrc000 )   CALL p2z_exp_init
@@ -155,7 +155,8 @@
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p2z_exp')
+      IF( ln_timing )  CALL timing_stop('p2z_exp')
       !
    END SUBROUTINE p2z_exp
+
 
    SUBROUTINE p2z_exp_init
@@ -166,8 +167,8 @@
       INTEGER  ::   ji, jj, jk
       REAL(wp) ::   zmaskt, zfluo, zfluu
-      REAL(wp), POINTER, DIMENSION(:,:  ) :: zrro
-      REAL(wp), POINTER, DIMENSION(:,:,:) :: zdm0
-      !!---------------------------------------------------------------------
-
+      REAL(wp), POINTER, DIMENSION(:,:  ) ::   zrro
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::   zdm0
+      !!---------------------------------------------------------------------
+      !
       IF(lwp) THEN
          WRITE(numout,*)
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P2Z/p2zopt.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P2Z/p2zopt.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P2Z/p2zopt.F90	(revision 9124)
@@ -11,4 +11,6 @@
    !!             3.2  !  2009-04  (C. Ethe, G. Madec)  minor optimisation + style
    !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
    !!   p2z_opt        :   Compute the light availability in the water column
    !!----------------------------------------------------------------------
@@ -69,5 +71,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p2z_opt')
+      IF( ln_timing )   CALL timing_start('p2z_opt')
       !
       ! Allocate temporary workspace
@@ -143,5 +145,5 @@
       CALL wrk_dealloc( jpi, jpj, jpk, zparr, zparg    )
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p2z_opt')
+      IF( ln_timing )   CALL timing_stop('p2z_opt')
       !
    END SUBROUTINE p2z_opt
@@ -157,7 +159,8 @@
       !!
       !!----------------------------------------------------------------------
+      INTEGER ::   ios   ! Local integer
+      !!
       NAMELIST/namlobopt/ xkg0, xkr0, xkgp, xkrp, xlg, xlr, rpig
       NAMELIST/namlobrat/ rcchl, redf, reddom
-      INTEGER :: ios                 ! Local integer output status for namelist read
       !!----------------------------------------------------------------------
 
@@ -168,5 +171,5 @@
       REWIND( numnatp_cfg )              ! Namelist namlobopt in configuration namelist : Lobster options
       READ  ( numnatp_cfg, namlobopt, IOSTAT = ios, ERR = 902 )
-902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namlobopt in configuration namelist', lwp )
+902   IF( ios >  0 ) CALL ctl_nam ( ios , 'namlobopt in configuration namelist', lwp )
       IF(lwm) WRITE ( numonp, namlobopt )
 
@@ -190,5 +193,5 @@
       REWIND( numnatp_cfg )              ! Namelist namlobrat in configuration namelist : Lobster ratios
       READ  ( numnatp_cfg, namlobrat, IOSTAT = ios, ERR = 904 )
-904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namlobrat in configuration namelist', lwp )
+904   IF( ios >  0 ) CALL ctl_nam ( ios , 'namlobrat in configuration namelist', lwp )
       IF(lwm) WRITE ( numonp, namlobrat )
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P2Z/p2zsed.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P2Z/p2zsed.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P2Z/p2zsed.F90	(revision 9124)
@@ -35,5 +35,4 @@
    !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -56,7 +55,6 @@
       !!              trend of passive tracers is saved for futher diagnostics.
       !!---------------------------------------------------------------------
-      !!
       INTEGER, INTENT( in ) ::   kt      ! ocean time-step index      
-      !!
+      !
       INTEGER  ::   ji, jj, jk, jl, ierr
       CHARACTER (len=25) :: charout
@@ -65,5 +63,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p2z_sed')
+      IF( ln_timing )   CALL timing_start('p2z_sed')
       !
       IF( kt == nittrc000 ) THEN
@@ -119,7 +117,8 @@
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p2z_sed')
+      IF( ln_timing )   CALL timing_stop('p2z_sed')
       !
    END SUBROUTINE p2z_sed
+
 
    SUBROUTINE p2z_sed_init
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P2Z/p2zsms.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P2Z/p2zsms.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P2Z/p2zsms.F90	(revision 9124)
@@ -6,4 +6,6 @@
    !! History :   1.0  !            M. Levy
    !!             2.0  !  2007-12  (C. Ethe, G. Madec)  revised architecture
+   !!----------------------------------------------------------------------
+
    !!----------------------------------------------------------------------
    !!   p2zsms        :  Time loop of passive tracers sms
@@ -42,11 +44,10 @@
       !! ** Method  : - ???
       !! --------------------------------------------------------------------
-      !!
       INTEGER, INTENT( in ) ::   kt      ! ocean time-step index      
       !
-      INTEGER :: jn
+      INTEGER ::   jn   ! dummy loop index
       !! --------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p2z_sms')
+      IF( ln_timing )   CALL timing_start('p2z_sms')
       !
       CALL p2z_opt( kt )      ! optical model
@@ -54,5 +55,5 @@
       CALL p2z_sed( kt )      ! sedimentation model
       CALL p2z_exp( kt )      ! export
-
+      !
       IF( l_trdtrc ) THEN
          DO jn = jp_pcs0, jp_pcs1
@@ -60,8 +61,7 @@
          END DO
       END IF
-
       !
       IF ( lwm .AND. kt == nittrc000 ) CALL FLUSH    ( numonp )     ! flush output namelist PISCES
-      IF( nn_timing == 1 )  CALL timing_stop('p2z_sms')
+      IF( ln_timing )   CALL timing_stop('p2z_sms')
       !
    END SUBROUTINE p2z_sms
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zagg.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zagg.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zagg.F90	(revision 9124)
@@ -10,4 +10,5 @@
    !!             3.6  !  2015-05  (O. Aumont) PISCES quota
    !!----------------------------------------------------------------------
+
    !!----------------------------------------------------------------------
    !!   p4z_agg       :  Compute aggregation of particles
@@ -38,5 +39,6 @@
       !! ** Method  : - ???
       !!---------------------------------------------------------------------
-      INTEGER, INTENT(in) :: kt, knt
+      INTEGER, INTENT(in) ::   kt, knt   !
+      !
       INTEGER  ::   ji, jj, jk
       REAL(wp) ::   zagg, zagg1, zagg2, zagg3, zagg4
@@ -49,6 +51,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p4z_agg')
-
+      IF( ln_timing )   CALL timing_start('p4z_agg')
       !
       !  Exchange between organic matter compartments due to coagulation/disaggregation
@@ -178,5 +179,5 @@
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p4z_agg')
+      IF( ln_timing )   CALL timing_stop('p4z_agg')
       !
    END SUBROUTINE p4z_agg
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zbio.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zbio.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zbio.F90	(revision 9124)
@@ -56,10 +56,10 @@
       !!---------------------------------------------------------------------
       INTEGER, INTENT(in) :: kt, knt
+      !
       INTEGER             :: ji, jj, jk, jn
       CHARACTER (len=25) :: charout
-
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p4z_bio')
+      IF( ln_timing )   CALL timing_start('p4z_bio')
       !
       !     ASSIGN THE SHEAR RATE THAT IS USED FOR AGGREGATION
@@ -112,5 +112,5 @@
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p4z_bio')
+      IF( ln_timing )   CALL timing_stop('p4z_bio')
       !
    END SUBROUTINE p4z_bio
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zche.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zche.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zche.F90	(revision 9124)
@@ -155,8 +155,7 @@
       REAL(wp) ::   zst  , zft  , zcks  , zckf  , zaksp1
       REAL(wp) ::   total2free, free2SWS, total2SWS, SWS2total
-
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p4z_che')
+      IF( ln_timing )   CALL timing_start('p4z_che')
       !
       ! Computation of chemical constants require practical salinity
@@ -447,7 +446,8 @@
       END DO
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p4z_che')
+      IF( ln_timing )  CALL timing_stop('p4z_che')
       !
    END SUBROUTINE p4z_che
+
 
    SUBROUTINE ahini_for_at(p_hini)
@@ -470,6 +470,7 @@
       REAL(wp)  ::  za2, za1, za0
       REAL(wp)  ::  p_dictot, p_bortot, p_alkcb 
-
-      IF( nn_timing == 1 )  CALL timing_start('ahini_for_at')
+      !!---------------------------------------------------------------------
+
+      IF( ln_timing )  CALL timing_start('ahini_for_at')
       !
       DO jk = 1, jpk
@@ -512,9 +513,10 @@
       END DO
       !
-      IF( nn_timing == 1 )  CALL timing_stop('ahini_for_at')
+      IF( ln_timing )  CALL timing_stop('ahini_for_at')
       !
    END SUBROUTINE ahini_for_at
 
    !===============================================================================
+
    SUBROUTINE anw_infsup( p_alknw_inf, p_alknw_sup )
 
@@ -564,5 +566,5 @@
    REAL(wp), POINTER, DIMENSION(:,:,:) :: zalknw_inf, zalknw_sup, rmask, zh_min, zh_max, zeqn_absmin
 
-   IF( nn_timing == 1 )  CALL timing_start('solve_at_general')
+   IF( ln_timing )  CALL timing_start('solve_at_general')
       !  Allocate temporary workspace
    CALL wrk_alloc( jpi, jpj, jpk, zalknw_inf, zalknw_sup, rmask )
@@ -801,8 +803,8 @@
 
 
-   IF( nn_timing == 1 )  CALL timing_stop('solve_at_general')
-
-
+      IF( ln_timing )   CALL timing_stop('solve_at_general')
+      !
    END SUBROUTINE solve_at_general
+
 
    INTEGER FUNCTION p4z_che_alloc()
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zfechem.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zfechem.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zfechem.F90	(revision 9124)
@@ -79,5 +79,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p4z_fechem')
+      IF( ln_timing )   CALL timing_start('p4z_fechem')
       !
       ! Allocate temporary workspace
@@ -366,5 +366,5 @@
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p4z_fechem')
+      IF( ln_timing )   CALL timing_stop('p4z_fechem')
       !
    END SUBROUTINE p4z_fechem
@@ -383,6 +383,8 @@
       !!
       !!----------------------------------------------------------------------
+      INTEGER ::   ios   ! Local integer 
+      !!
       NAMELIST/nampisfer/ ln_fechem, ln_ligvar, ln_fecolloid, xlam1, xlamdust, ligand, kfep 
-      INTEGER :: ios                 ! Local integer output status for namelist read
+      !!----------------------------------------------------------------------
 
       REWIND( numnatp_ref )              ! Namelist nampisfer in reference namelist : Pisces iron chemistry
@@ -392,5 +394,5 @@
       REWIND( numnatp_cfg )              ! Namelist nampisfer in configuration namelist : Pisces iron chemistry
       READ  ( numnatp_cfg, nampisfer, IOSTAT = ios, ERR = 902 )
-902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampisfer in configuration namelist', lwp )
+902   IF( ios >  0 ) CALL ctl_nam ( ios , 'nampisfer in configuration namelist', lwp )
       IF(lwm) WRITE ( numonp, nampisfer )
 
@@ -434,4 +436,5 @@
       !
    END SUBROUTINE p4z_fechem_init
+   
    !!======================================================================
 END MODULE p4zfechem
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zflx.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zflx.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zflx.F90	(revision 9124)
@@ -83,5 +83,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p4z_flx')
+      IF( ln_timing )   CALL timing_start('p4z_flx')
       !
       CALL wrk_alloc( jpi, jpj, zkgco2, zkgo2, zh2co3, zoflx, zpco2atm )
@@ -216,5 +216,5 @@
       CALL wrk_dealloc( jpi, jpj, zkgco2, zkgo2, zh2co3, zoflx, zpco2atm )
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p4z_flx')
+      IF( ln_timing )   CALL timing_stop('p4z_flx')
       !
    END SUBROUTINE p4z_flx
@@ -231,7 +231,8 @@
       !! ** input   :   Namelist nampisext
       !!----------------------------------------------------------------------
+      INTEGER ::   jm
+      INTEGER ::   ios   ! Local integer 
+      !
       NAMELIST/nampisext/ln_co2int, atcco2, clname, nn_offset
-      INTEGER :: jm
-      INTEGER :: ios                 ! Local integer output status for namelist read
       !!----------------------------------------------------------------------
       !
@@ -243,5 +244,5 @@
       REWIND( numnatp_cfg )              ! Namelist nampisext in configuration namelist : Pisces atm. conditions
       READ  ( numnatp_cfg, nampisext, IOSTAT = ios, ERR = 902 )
-902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampisext in configuration namelist', lwp )
+902   IF( ios >  0 ) CALL ctl_nam ( ios , 'nampisext in configuration namelist', lwp )
       IF(lwm) WRITE ( numonp, nampisext )
       !
@@ -292,5 +293,4 @@
          ENDIF
       ENDIF
-
       !
       oce_co2(:,:)  = 0._wp                ! Initialization of Flux of Carbon
@@ -302,6 +302,6 @@
    END SUBROUTINE p4z_flx_init
 
+
    SUBROUTINE p4z_patm( kt )
-
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE p4z_atm  ***
@@ -311,5 +311,4 @@
       !!
       !!----------------------------------------------------------------------
-      !! * arguments
       INTEGER, INTENT( in  ) ::   kt   ! ocean time step
       !
@@ -321,4 +320,5 @@
       !!
       NAMELIST/nampisatm/ ln_presatm, ln_presatmco2, sn_patm, sn_atmco2, cn_dir
+      !!----------------------------------------------------------------------
 
       !                                         ! ----------------------- !
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zint.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zint.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zint.F90	(revision 9124)
@@ -33,5 +33,4 @@
       !!
       !!---------------------------------------------------------------------
-      !
       INTEGER, INTENT( in ) ::   kt      ! ocean time-step index
       !
@@ -40,5 +39,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p4z_int')
+      IF( ln_timing )   CALL timing_start('p4z_int')
       !
       ! Computation of phyto and zoo metabolic rate
@@ -61,5 +60,5 @@
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p4z_int')
+      IF( ln_timing )   CALL timing_stop('p4z_int')
       !
    END SUBROUTINE p4z_int
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zligand.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zligand.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zligand.F90	(revision 9124)
@@ -50,5 +50,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p4z_ligand')
+      IF( ln_timing )   CALL timing_start('p4z_ligand')
       !
       ! ------------------------------------------------------------------
@@ -75,5 +75,4 @@
       ! Dissolution of nanoparticle Fe
       ! ----------------------------------------------------------
-
       DO jk = 1, jpkm1
          DO jj = 1, jpj
@@ -97,5 +96,5 @@
        ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p4z_ligand')
+      IF( ln_timing )   CALL timing_stop('p4z_ligand')
       !
    END SUBROUTINE p4z_ligand
@@ -114,6 +113,8 @@
       !!
       !!----------------------------------------------------------------------
+      INTEGER ::   ios   ! Local integer 
+      !
       NAMELIST/nampislig/ rlgw, prlgw, rlgs, rfep, rlig
-      INTEGER :: ios                 ! Local integer output status for namelist read
+      !!----------------------------------------------------------------------
 
       REWIND( numnatp_ref )              ! Namelist nampislig in reference namelist : Pisces remineralization
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zlim.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zlim.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zlim.F90	(revision 9124)
@@ -72,5 +72,4 @@
    !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -84,5 +83,4 @@
       !! ** Method  : - ???
       !!---------------------------------------------------------------------
-      !
       INTEGER, INTENT(in)  :: kt, knt
       !
@@ -95,5 +93,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p4z_lim')
+      IF( ln_timing )   CALL timing_start('p4z_lim')
       !
       DO jk = 1, jpkm1
@@ -224,10 +222,10 @@
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p4z_lim')
+      IF( ln_timing )   CALL timing_stop('p4z_lim')
       !
    END SUBROUTINE p4z_lim
 
+
    SUBROUTINE p4z_lim_init
-
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE p4z_lim_init  ***
@@ -241,19 +239,20 @@
       !!
       !!----------------------------------------------------------------------
-
+      INTEGER ::   ios   ! Local integer
+      !
       NAMELIST/namp4zlim/ concnno3, concdno3, concnnh4, concdnh4, concnfer, concdfer, concbfe,   &
          &                concbno3, concbnh4, xsizedia, xsizephy, xsizern, xsizerd,          & 
          &                xksi1, xksi2, xkdoc, qnfelim, qdfelim, caco3r, oxymin
-      INTEGER :: ios                 ! Local integer output status for namelist read
-
+      !!----------------------------------------------------------------------
+      !
       REWIND( numnatp_ref )              ! Namelist nampislim in reference namelist : Pisces nutrient limitation parameters
       READ  ( numnatp_ref, namp4zlim, IOSTAT = ios, ERR = 901)
 901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namp4zlim in reference namelist', lwp )
-
+      !
       REWIND( numnatp_cfg )              ! Namelist nampislim in configuration namelist : Pisces nutrient limitation parameters 
       READ  ( numnatp_cfg, namp4zlim, IOSTAT = ios, ERR = 902 )
-902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namp4zlim in configuration namelist', lwp )
+902   IF( ios >  0 ) CALL ctl_nam ( ios , 'namp4zlim in configuration namelist', lwp )
       IF(lwm) WRITE ( numonp, namp4zlim )
-
+      !
       IF(lwp) THEN                         ! control print
          WRITE(numout,*) ' '
@@ -286,4 +285,5 @@
    END SUBROUTINE p4z_lim_init
 
+
    INTEGER FUNCTION p4z_lim_alloc()
       !!----------------------------------------------------------------------
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zlys.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zlys.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zlys.F90	(revision 9124)
@@ -65,5 +65,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p4z_lys')
+      IF( ln_timing )  CALL timing_start('p4z_lys')
       !
       CALL wrk_alloc( jpi, jpj, jpk, zco3, zcaldiss, zhinit, zhi, zco3sat )
@@ -141,10 +141,10 @@
       CALL wrk_dealloc( jpi, jpj, jpk, zco3, zcaldiss, zhinit, zhi, zco3sat )
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p4z_lys')
+      IF( ln_timing )   CALL timing_stop('p4z_lys')
       !
    END SUBROUTINE p4z_lys
 
+
    SUBROUTINE p4z_lys_init
-
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE p4z_lys_init  ***
@@ -158,18 +158,18 @@
       !!
       !!----------------------------------------------------------------------
-      INTEGER  ::  ios                 ! Local integer output status for namelist read
-
+      INTEGER ::   ios   ! Local integer
+      !
       NAMELIST/nampiscal/ kdca, nca
       !!----------------------------------------------------------------------
-
+      !
       REWIND( numnatp_ref )              ! Namelist nampiscal in reference namelist : Pisces CaCO3 dissolution
       READ  ( numnatp_ref, nampiscal, IOSTAT = ios, ERR = 901)
 901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampiscal in reference namelist', lwp )
-
+      !
       REWIND( numnatp_cfg )              ! Namelist nampiscal in configuration namelist : Pisces CaCO3 dissolution
       READ  ( numnatp_cfg, nampiscal, IOSTAT = ios, ERR = 902 )
-902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampiscal in configuration namelist', lwp )
+902   IF( ios >  0 ) CALL ctl_nam ( ios , 'nampiscal in configuration namelist', lwp )
       IF(lwm) WRITE ( numonp, nampiscal )
-
+      !
       IF(lwp) THEN                         ! control print
          WRITE(numout,*) ' '
@@ -179,5 +179,5 @@
          WRITE(numout,*) '    order of reaction for calcite dissolution nca       =', nca
       ENDIF
-
+      !
       ! Number of seconds per month 
       rmtss =  nyear_len(1) * rday / raamo
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zmeso.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zmeso.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zmeso.F90	(revision 9124)
@@ -76,5 +76,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p4z_meso')
+      IF( ln_timing )   CALL timing_start('p4z_meso')
       !
       CALL wrk_alloc( jpi, jpj, jpk, zgrazing )
@@ -240,10 +240,10 @@
       CALL wrk_dealloc( jpi, jpj, jpk, zgrazing )
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p4z_meso')
+      IF( ln_timing )   CALL timing_stop('p4z_meso')
       !
    END SUBROUTINE p4z_meso
 
+
    SUBROUTINE p4z_meso_init
-
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE p4z_meso_init  ***
@@ -257,20 +257,20 @@
       !!
       !!----------------------------------------------------------------------
-
+      INTEGER ::   ios   ! Local integer
+      !
       NAMELIST/namp4zmes/ part2, grazrat2, resrat2, mzrat2, xprefc, xprefp, xprefz,   &
          &                xprefpoc, xthresh2dia, xthresh2phy, xthresh2zoo, xthresh2poc, &
          &                xthresh2, xkgraz2, epsher2, sigma2, unass2, grazflux
-      INTEGER :: ios                 ! Local integer output status for namelist read
-
+      !!----------------------------------------------------------------------
+      !
       REWIND( numnatp_ref )              ! Namelist nampismes in reference namelist : Pisces mesozooplankton
       READ  ( numnatp_ref, namp4zmes, IOSTAT = ios, ERR = 901)
 901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namp4zmes in reference namelist', lwp )
-
+      !
       REWIND( numnatp_cfg )              ! Namelist nampismes in configuration namelist : Pisces mesozooplankton
       READ  ( numnatp_cfg, namp4zmes, IOSTAT = ios, ERR = 902 )
-902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namp4zmes in configuration namelist', lwp )
+902   IF( ios >  0 ) CALL ctl_nam ( ios , 'namp4zmes in configuration namelist', lwp )
       IF(lwm) WRITE ( numonp, namp4zmes )
-
-
+      !
       IF(lwp) THEN                         ! control print
          WRITE(numout,*) ' ' 
@@ -296,6 +296,5 @@
          WRITE(numout,*) '    half sturation constant for grazing 2          xkgraz2      =', xkgraz2
       ENDIF
-
-
+      !
    END SUBROUTINE p4z_meso_init
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zmicro.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zmicro.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zmicro.F90	(revision 9124)
@@ -42,5 +42,4 @@
    REAL(wp), PUBLIC ::  epsher      !: half sturation constant for grazing 1 
 
-
    !!----------------------------------------------------------------------
    !! NEMO/TOP 3.3 , NEMO Consortium (2010)
@@ -48,5 +47,4 @@
    !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -75,5 +73,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p4z_micro')
+      IF( ln_timing )   CALL timing_start('p4z_micro')
       !
       CALL wrk_alloc( jpi, jpj, jpk, zgrazing )
@@ -196,5 +194,5 @@
       CALL wrk_dealloc( jpi, jpj, jpk, zgrazing )
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p4z_micro')
+      IF( ln_timing )   CALL timing_stop('p4z_micro')
       !
    END SUBROUTINE p4z_micro
@@ -202,5 +200,4 @@
 
    SUBROUTINE p4z_micro_init
-
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE p4z_micro_init  ***
@@ -214,19 +211,20 @@
       !!
       !!----------------------------------------------------------------------
-
+      INTEGER ::   ios   ! Local integer
+      !
       NAMELIST/namp4zzoo/ part, grazrat, resrat, mzrat, xpref2c, xpref2p, &
          &                xpref2d,  xthreshdia,  xthreshphy,  xthreshpoc, &
          &                xthresh, xkgraz, epsher, sigma1, unass
-      INTEGER :: ios                 ! Local integer output status for namelist read
-
+      !!----------------------------------------------------------------------
+      !
       REWIND( numnatp_ref )              ! Namelist nampiszoo in reference namelist : Pisces microzooplankton
       READ  ( numnatp_ref, namp4zzoo, IOSTAT = ios, ERR = 901)
 901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namp4zzoo in reference namelist', lwp )
-
+      !
       REWIND( numnatp_cfg )              ! Namelist nampiszoo in configuration namelist : Pisces microzooplankton
       READ  ( numnatp_cfg, namp4zzoo, IOSTAT = ios, ERR = 902 )
-902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namp4zzoo in configuration namelist', lwp )
+902   IF( ios >  0 ) CALL ctl_nam ( ios , 'namp4zzoo in configuration namelist', lwp )
       IF(lwm) WRITE ( numonp, namp4zzoo )
-
+      !
       IF(lwp) THEN                         ! control print
          WRITE(numout,*) ' '
@@ -249,5 +247,5 @@
          WRITE(numout,*) '    half sturation constant for grazing 1           xkgraz      =', xkgraz
       ENDIF
-
+      !
    END SUBROUTINE p4z_micro_init
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zmort.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zmort.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zmort.F90	(revision 9124)
@@ -72,5 +72,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p4z_nano')
+      IF( ln_timing )   CALL timing_start('p4z_nano')
       !
       prodcal(:,:,:) = 0.  !: calcite production variable set to zero
@@ -126,7 +126,8 @@
        ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p4z_nano')
+      IF( ln_timing )   CALL timing_stop('p4z_nano')
       !
    END SUBROUTINE p4z_nano
+
 
    SUBROUTINE p4z_diat
@@ -145,5 +146,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p4z_diat')
+      IF( ln_timing )   CALL timing_start('p4z_diat')
       !
 
@@ -201,10 +202,10 @@
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p4z_diat')
+      IF( ln_timing )   CALL timing_stop('p4z_diat')
       !
    END SUBROUTINE p4z_diat
 
+
    SUBROUTINE p4z_mort_init
-
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE p4z_mort_init  ***
@@ -218,17 +219,18 @@
       !!
       !!----------------------------------------------------------------------
-
+      INTEGER ::   ios   ! Local integer
+      !
       NAMELIST/namp4zmort/ wchl, wchld, wchldm, mprat, mprat2
-      INTEGER :: ios                 ! Local integer output status for namelist read
-
+      !!----------------------------------------------------------------------
+      !
       REWIND( numnatp_ref )              ! Namelist nampismort in reference namelist : Pisces phytoplankton
       READ  ( numnatp_ref, namp4zmort, IOSTAT = ios, ERR = 901)
 901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namp4zmort in reference namelist', lwp )
-
+      !
       REWIND( numnatp_cfg )              ! Namelist nampismort in configuration namelist : Pisces phytoplankton
       READ  ( numnatp_cfg, namp4zmort, IOSTAT = ios, ERR = 902 )
-902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namp4zmort in configuration namelist', lwp )
+902   IF( ios >  0 ) CALL ctl_nam ( ios , 'namp4zmort in configuration namelist', lwp )
       IF(lwm) WRITE ( numonp, namp4zmort )
-
+      !
       IF(lwp) THEN                         ! control print
          WRITE(numout,*) ' '
@@ -241,5 +243,5 @@
          WRITE(numout,*) '    Diatoms mortality rate                    mprat2    =', mprat2
       ENDIF
-
+      !
    END SUBROUTINE p4z_mort_init
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zopt.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zopt.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zopt.F90	(revision 9124)
@@ -18,5 +18,4 @@
    USE prtctl_trc      !  print control for debugging
 
-
    IMPLICIT NONE
    PRIVATE
@@ -59,5 +58,4 @@
       !! ** Method  : - ???
       !!---------------------------------------------------------------------
-      !
       INTEGER, INTENT(in) ::   kt, knt   ! ocean time step
       !
@@ -72,5 +70,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p4z_opt')
+      IF( ln_timing )  CALL timing_start('p4z_opt')
       !
       ! Allocate temporary workspace
@@ -250,7 +248,8 @@
                    CALL wrk_dealloc( jpi, jpj, jpk, zpar   ,  ze0, ze1, ze2, ze3, zchl3d )
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p4z_opt')
+      IF( ln_timing )  CALL timing_stop('p4z_opt')
       !
    END SUBROUTINE p4z_opt
+
 
    SUBROUTINE p4z_opt_par( kt, pqsr, pe1, pe2, pe3, pe0, pqsr100 ) 
@@ -334,13 +333,11 @@
       !!
       !!----------------------------------------------------------------------
-      !! * arguments
       INTEGER ,                INTENT(in) ::   kt     ! ocean time step
-
-      !! * local declarations
+      !
       INTEGER  :: ji,jj
       REAL(wp) :: zcoef
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p4z_optsbc')
+      IF( ln_timing )  CALL timing_start('p4z_optsbc')
       !
       ! Compute par_varsw at nit000 or only if there is more than 1 time record in par coefficient file
@@ -352,7 +349,8 @@
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p4z_optsbc')
+      IF( ln_timing )  CALL timing_stop('p4z_optsbc')
       !
    END SUBROUTINE p4z_opt_sbc
+
 
    SUBROUTINE p4z_opt_init
@@ -365,5 +363,4 @@
       !! ** Input   :   external ascii and netcdf files
       !!----------------------------------------------------------------------
-      !
       INTEGER :: numpar
       INTEGER :: ierr
@@ -375,8 +372,5 @@
       !
       NAMELIST/nampisopt/cn_dir, sn_par, ln_varpar, parlux
-
-      !!----------------------------------------------------------------------
-
-      IF( nn_timing == 1 )  CALL timing_start('p4z_opt_init')
+      !!----------------------------------------------------------------------
 
       REWIND( numnatp_ref )              ! Namelist nampisopt in reference namelist : Pisces attenuation coef. and PAR
@@ -434,6 +428,4 @@
       IF( ln_qsr_bio )   etot3    (:,:,:) = 0._wp
       ! 
-      IF( nn_timing == 1 )  CALL timing_stop('p4z_opt_init')
-      !
    END SUBROUTINE p4z_opt_init
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zpoc.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zpoc.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zpoc.F90	(revision 9124)
@@ -17,5 +17,4 @@
    USE prtctl_trc      !  print control for debugging
    USE iom             !  I/O manager
-
 
    IMPLICIT NONE
@@ -69,5 +68,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p4z_poc')
+      IF( ln_timing )  CALL timing_start('p4z_poc')
       !
       ! Allocate temporary workspace
@@ -470,5 +469,5 @@
       DEALLOCATE( alphag )
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p4z_poc')
+      IF( ln_timing )   CALL timing_stop('p4z_poc')
       !
    END SUBROUTINE p4z_poc
@@ -487,13 +486,11 @@
       !!
       !!----------------------------------------------------------------------
-      INTEGER :: jn
+      INTEGER ::   ios, ifault   ! Local integer
+      INTEGER ::   jn
       REAL(wp) :: remindelta, reminup, remindown
-      INTEGER  :: ifault
-
-      NAMELIST/nampispoc/ xremip, jcpoc, rshape,  &
-         &     xremipc, xremipn, xremipp
-
-
-      INTEGER :: ios                 ! Local integer output status for namelist read
+      !!
+      NAMELIST/nampispoc/ xremip , jcpoc  , rshape,  &
+         &                xremipc, xremipn, xremipp
+      !!----------------------------------------------------------------------
 
       REWIND( numnatp_ref )              ! Namelist nampisrem in reference namelist : Pisces remineralization
@@ -503,5 +500,5 @@
       REWIND( numnatp_cfg )              ! Namelist nampisrem in configuration namelist : Pisces remineralization
       READ  ( numnatp_cfg, nampispoc, IOSTAT = ios, ERR = 902 )
-902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampispoc in configuration namelist', lwp )
+902   IF( ios >  0 ) CALL ctl_nam ( ios , 'nampispoc in configuration namelist', lwp )
       IF(lwm) WRITE ( numonp, nampispoc )
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zprod.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zprod.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zprod.F90	(revision 9124)
@@ -65,5 +65,4 @@
       !! ** Method  : - ???
       !!---------------------------------------------------------------------
-      !
       INTEGER, INTENT(in) :: kt, knt
       !
@@ -85,5 +84,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p4z_prod')
+      IF( ln_timing )   CALL timing_start('p4z_prod')
       !
       !  Allocate temporary workspace
@@ -486,5 +485,5 @@
      CALL wrk_dealloc( jpi, jpj, jpk, zprorcan, zprorcad, zprofed, zprofen, zpronewn, zpronewd )
      !
-     IF( nn_timing == 1 )  CALL timing_stop('p4z_prod')
+     IF( ln_timing )  CALL timing_stop('p4z_prod')
      !
    END SUBROUTINE p4z_prod
@@ -502,8 +501,8 @@
       !! ** input   :   Namelist nampisprod
       !!----------------------------------------------------------------------
+      INTEGER :: ios                 ! Local integer output status for namelist read
       !
       NAMELIST/namp4zprod/ pislopen, pisloped, xadap, ln_newprod, bresp, excretn, excretd,  &
          &                 chlcnm, chlcdm, chlcmin, fecnm, fecdm, grosip
-      INTEGER :: ios                 ! Local integer output status for namelist read
       !!----------------------------------------------------------------------
 
@@ -514,5 +513,5 @@
       REWIND( numnatp_cfg )              ! Namelist nampisprod in configuration namelist : Pisces phytoplankton production
       READ  ( numnatp_cfg, namp4zprod, IOSTAT = ios, ERR = 902 )
-902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namp4zprod in configuration namelist', lwp )
+902   IF( ios >  0 ) CALL ctl_nam ( ios , 'namp4zprod in configuration namelist', lwp )
       IF(lwm) WRITE ( numonp, namp4zprod )
 
@@ -555,4 +554,5 @@
       !
    END FUNCTION p4z_prod_alloc
+
    !!======================================================================
 END MODULE p4zprod
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zrem.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zrem.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zrem.F90	(revision 9124)
@@ -58,5 +58,4 @@
       !! ** Method  : - ???
       !!---------------------------------------------------------------------
-      !
       INTEGER, INTENT(in) ::   kt, knt ! ocean time step
       !
@@ -72,5 +71,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p4z_rem')
+      IF( ln_timing )   CALL timing_start('p4z_rem')
       !
       ! Allocate temporary workspace
@@ -289,5 +288,5 @@
       CALL wrk_dealloc( jpi, jpj, jpk, zdepbac, zdepprod, zolimi, zfacsi, zfacsib )
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p4z_rem')
+      IF( ln_timing )   CALL timing_stop('p4z_rem')
       !
    END SUBROUTINE p4z_rem
@@ -309,4 +308,5 @@
          &                xremikc, xremikn, xremikp
       INTEGER :: ios                 ! Local integer output status for namelist read
+      !!----------------------------------------------------------------------
 
       REWIND( numnatp_ref )              ! Namelist nampisrem in reference namelist : Pisces remineralization
@@ -316,5 +316,5 @@
       REWIND( numnatp_cfg )              ! Namelist nampisrem in configuration namelist : Pisces remineralization
       READ  ( numnatp_cfg, nampisrem, IOSTAT = ios, ERR = 902 )
-902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampisrem in configuration namelist', lwp )
+902   IF( ios >  0 ) CALL ctl_nam ( ios , 'nampisrem in configuration namelist', lwp )
       IF(lwm) WRITE ( numonp, nampisrem )
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsbc.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsbc.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsbc.F90	(revision 9124)
@@ -108,6 +108,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p4z_sbc')
-
+      IF( ln_timing )  CALL timing_start('p4z_sbc')
       !
       ! Compute dust at nit000 or only if there is more than 1 time record in dust file
@@ -189,10 +188,10 @@
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p4z_sbc')
+      IF( ln_timing )  CALL timing_stop('p4z_sbc')
       !
    END SUBROUTINE p4z_sbc
 
+
    SUBROUTINE p4z_sbc_init
-
       !!----------------------------------------------------------------------
       !!                  ***  routine p4z_sbc_init  ***
@@ -232,6 +231,4 @@
         &                hratio, fep_rats, fep_rath, lgw_rath
       !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )  CALL timing_start('p4z_sbc_init')
       !
       !                            !* set file information
@@ -535,6 +532,4 @@
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p4z_sbc_init')
-      !
    END SUBROUTINE p4z_sbc_init
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsed.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsed.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsed.F90	(revision 9124)
@@ -68,8 +68,7 @@
       REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrpo4, ztrdop, zirondep, zsoufer, zpdep, zlight
       REAL(wp), POINTER, DIMENSION(:,:  ) :: zwsfep
-
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p4z_sed')
+      IF( ln_timing )  CALL timing_start('p4z_sed')
       !
       IF( kt == nittrc000 .AND. knt == 1 )   r1_rday  = 1. / rday
@@ -522,5 +521,5 @@
       IF( ln_ligand ) CALL wrk_dealloc( jpi, jpj, zwsfep )
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p4z_sed')
+      IF( ln_timing )  CALL timing_stop('p4z_sed')
       !
    END SUBROUTINE p4z_sed
@@ -537,5 +536,4 @@
    END FUNCTION p4z_sed_alloc
 
-
    !!======================================================================
 END MODULE p4zsed
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsink.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsink.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsink.F90	(revision 9124)
@@ -69,5 +69,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p4z_sink')
+      IF( ln_timing )   CALL timing_start('p4z_sink')
 
 
@@ -261,8 +261,9 @@
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p4z_sink')
+      IF( ln_timing )   CALL timing_stop('p4z_sink')
       !
    END SUBROUTINE p4z_sink
 
+
    SUBROUTINE p4z_sink_init
       !!----------------------------------------------------------------------
@@ -270,5 +271,6 @@
       !!----------------------------------------------------------------------
       INTEGER :: jk
-
+      !!----------------------------------------------------------------------
+      !
       ik100 = 10        !  last level where depth less than 100 m
       DO jk = jpkm1, 1, -1
@@ -282,4 +284,5 @@
       !
    END SUBROUTINE p4z_sink_init
+
 
    SUBROUTINE p4z_sink2( pwsink, psinkflx, jp_tra, kiter )
@@ -294,10 +297,9 @@
       !!      transport term, i.e.  div(u*tra).
       !!---------------------------------------------------------------------
-      !
       INTEGER , INTENT(in   )                         ::   jp_tra    ! tracer index index      
       INTEGER , INTENT(in   )                         ::   kiter     ! number of iterations for time-splitting 
       REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj,jpk) ::   pwsink    ! sinking speed
       REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   psinkflx  ! sinking fluxe
-      !!
+      !
       INTEGER  ::   ji, jj, jk, jn
       REAL(wp) ::   zigma,zew,zign, zflx, zstep
@@ -305,5 +307,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p4z_sink2')
+      IF( ln_timing )   CALL timing_start('p4z_sink2')
       !
       ! Allocate temporary workspace
@@ -391,5 +393,5 @@
       CALL wrk_dealloc( jpi, jpj, jpk, ztraz, zakz, zwsink2, ztrb )
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p4z_sink2')
+      IF( ln_timing )  CALL timing_stop('p4z_sink2')
       !
    END SUBROUTINE p4z_sink2
@@ -401,5 +403,6 @@
       !!----------------------------------------------------------------------
       INTEGER :: ierr(3)
-
+      !!----------------------------------------------------------------------
+      !
       ierr(:) = 0
       !
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsms.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsms.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsms.F90	(revision 9124)
@@ -40,5 +40,4 @@
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   xnegtr     !: ???
 
-
    !!----------------------------------------------------------------------
    !! NEMO/TOP 3.3 , NEMO Consortium (2010)
@@ -68,5 +67,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p4z_sms')
+      IF( ln_timing )   CALL timing_start('p4z_sms')
       !
       IF( kt == nittrc000 ) THEN
@@ -171,11 +170,12 @@
       !
 
-      IF( lk_iomput .OR. ln_check_mass )  CALL p4z_chk_mass( kt ) ! Mass conservation checking
-
-      IF ( lwm .AND. kt == nittrc000 ) CALL FLUSH    ( numonp )     ! flush output namelist PISCES
-      IF( nn_timing == 1 )  CALL timing_stop('p4z_sms')
-      !
+      IF( lk_iomput .OR. ln_check_mass )  CALL p4z_chk_mass( kt )    ! Mass conservation checking
+
+      IF( lwm .AND. kt == nittrc000    )  CALL FLUSH( numonp )       ! flush output namelist PISCES
+      !
+      IF( ln_timing )  CALL timing_stop('p4z_sms')
       !
    END SUBROUTINE p4z_sms
+
 
    SUBROUTINE p4z_sms_init
@@ -188,11 +188,12 @@
       !!             namelist: natext, natbio, natsms
       !!----------------------------------------------------------------------
+      INTEGER :: ios                 ! Local integer output status for namelist read
+      !!
       NAMELIST/nampisbio/ nrdttrc, wsbio, xkmort, ferat3, wsbio2, wsbio2max, wsbio2scale,    &
          &                   niter1max, niter2max, wfep, ldocp, ldocz, lthet,  &
          &                   no3rat3, po4rat3
-
+         !
       NAMELIST/nampisdmp/ ln_pisdmp, nn_pisdmp
       NAMELIST/nampismass/ ln_check_mass
-      INTEGER :: ios                 ! Local integer output status for namelist read
       !!----------------------------------------------------------------------
 
@@ -203,5 +204,5 @@
       REWIND( numnatp_cfg )              ! Namelist nampisbio in configuration namelist : Pisces variables
       READ  ( numnatp_cfg, nampisbio, IOSTAT = ios, ERR = 902 )
-902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampisbio in configuration namelist', lwp )
+902   IF( ios >  0 ) CALL ctl_nam ( ios , 'nampisbio in configuration namelist', lwp )
       IF(lwm) WRITE ( numonp, nampisbio )
 
@@ -238,5 +239,5 @@
       REWIND( numnatp_cfg )              ! Namelist nampisdmp in configuration namelist : Pisces damping
       READ  ( numnatp_cfg, nampisdmp, IOSTAT = ios, ERR = 906 )
-906   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampisdmp in configuration namelist', lwp )
+906   IF( ios >  0 ) CALL ctl_nam ( ios , 'nampisdmp in configuration namelist', lwp )
       IF(lwm) WRITE ( numonp, nampisdmp )
 
@@ -255,5 +256,5 @@
       REWIND( numnatp_cfg )              ! Namelist nampismass in configuration namelist : Pisces mass conservation check 
       READ  ( numnatp_cfg, nampismass, IOSTAT = ios, ERR = 908 )
-908   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampismass in configuration namelist', lwp )
+908   IF( ios >  0 ) CALL ctl_nam ( ios , 'nampismass in configuration namelist', lwp )
       IF(lwm) WRITE ( numonp, nampismass )
 
@@ -264,6 +265,7 @@
          WRITE(numout,*) '    Flag to check mass conservation of NO3/Si/TALK ln_check_mass = ', ln_check_mass
       ENDIF
-
+      !
    END SUBROUTINE p4z_sms_init
+
 
    SUBROUTINE p4z_rst( kt, cdrw )
@@ -279,7 +281,6 @@
       INTEGER         , INTENT(in) ::   kt         ! ocean time-step
       CHARACTER(len=*), INTENT(in) ::   cdrw       ! "READ"/"WRITE" flag
-      !
-      !!---------------------------------------------------------------------
-
+      !!---------------------------------------------------------------------
+      !
       IF( TRIM(cdrw) == 'READ' ) THEN
          !
@@ -337,4 +338,5 @@
    END SUBROUTINE p4z_rst
 
+
    SUBROUTINE p4z_dmp( kt )
       !!----------------------------------------------------------------------
@@ -354,5 +356,4 @@
       REAL(wp) :: zalksumb, zpo4sumb, zno3sumb, zsilsumb
       !!---------------------------------------------------------------------
-
 
       IF(lwp)  WRITE(numout,*)
@@ -415,5 +416,4 @@
       !!
       !!---------------------------------------------------------------------
-      !
       INTEGER, INTENT( in ) ::   kt      ! ocean time-step index      
       REAL(wp)             ::  zrdenittot, zsdenittot, znitrpottot
@@ -422,8 +422,5 @@
       REAL(wp), POINTER, DIMENSION(:,:,:) :: zwork
       !!----------------------------------------------------------------------
-
-      !
-      !!---------------------------------------------------------------------
-
+      !
       IF( kt == nittrc000 ) THEN 
          xfact1 = rfact2r * 12. / 1.e15 * ryyss    ! conversion molC/kt --> PgC/yr
@@ -535,7 +532,6 @@
          !
          IF( lwp ) WRITE(numnit,9200) ndastp, znitrpottot * xfact2  , &
-         &                             zrdenittot  * xfact2  , &
-         &                             zsdenittot  * xfact2
-
+            &                             zrdenittot  * xfact2  , &
+            &                             zsdenittot  * xfact2
       ENDIF
       !
@@ -543,5 +539,4 @@
  9100  FORMAT(i8,5e18.10)
  9200  FORMAT(i8,3f10.5)
-
        !
    END SUBROUTINE p4z_chk_mass
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p5zlim.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p5zlim.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p5zlim.F90	(revision 9124)
@@ -154,5 +154,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p5z_lim')
+      IF( ln_timing )   CALL timing_start('p5z_lim')
       !
       zratchl = 6.0
@@ -448,10 +448,10 @@
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p5z_lim')
+      IF( ln_timing )  CALL timing_stop('p5z_lim')
       !
    END SUBROUTINE p5z_lim
 
+
    SUBROUTINE p5z_lim_init
-
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE p5z_lim_init  ***
@@ -465,5 +465,6 @@
       !!
       !!----------------------------------------------------------------------
-
+      INTEGER :: ios                 ! Local integer output status for namelist read
+      !!
       NAMELIST/namp5zlim/ concnno3, concpno3, concdno3, concnnh4, concpnh4, concdnh4,  &
          &                concnfer, concpfer, concdfer, concbfe, concnpo4, concppo4,   &
@@ -471,21 +472,19 @@
          &                xsizephy, xsizern, xsizerp, xsizerd, xksi1, xksi2, xkdoc,    &
          &                caco3r, oxymin
-
+         !
       NAMELIST/namp5zquota/ qnnmin, qnnmax, qpnmin, qpnmax, qnpmin, qnpmax, qppmin,      &
          &                  qppmax, qndmin, qndmax, qpdmin, qpdmax, qfnmax, qfpmax, qfdmax,  &
          &                  qfnopt, qfpopt, qfdopt
- 
-
-      INTEGER :: ios                 ! Local integer output status for namelist read
-
+      !!----------------------------------------------------------------------
+      !
       REWIND( numnatp_ref )              ! Namelist nampislim in reference namelist : Pisces nutrient limitation parameters
       READ  ( numnatp_ref, namp5zlim, IOSTAT = ios, ERR = 901)
 901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampislim in reference namelist', lwp )
-
+      !
       REWIND( numnatp_cfg )              ! Namelist nampislim in configuration namelist : Pisces nutrient limitation parameters 
       READ  ( numnatp_cfg, namp5zlim, IOSTAT = ios, ERR = 902 )
-902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampislim in configuration namelist', lwp )
+902   IF( ios >  0 ) CALL ctl_nam ( ios , 'nampislim in configuration namelist', lwp )
       IF(lwm) WRITE ( numonp, namp5zlim )
-
+      !
       IF(lwp) THEN                         ! control print
          WRITE(numout,*) ' '
@@ -523,10 +522,10 @@
       READ  ( numnatp_ref, namp5zquota, IOSTAT = ios, ERR = 903)
 903   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampisquota in reference namelist', lwp )
-
+      !
       REWIND( numnatp_cfg )              ! Namelist nampislim in configuration namelist : Pisces nutrient limitation parameters 
       READ  ( numnatp_cfg, namp5zquota, IOSTAT = ios, ERR = 904 )
-904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampisquota in configuration namelist', lwp )
+904   IF( ios >  0 ) CALL ctl_nam ( ios , 'nampisquota in configuration namelist', lwp )
       IF(lwm) WRITE ( numonp, namp5zquota )
-
+      !
       IF(lwp) THEN                         ! control print
          WRITE(numout,*) ' '
@@ -552,5 +551,5 @@
          WRITE(numout,*) '    Maximal Fe quota for diatoms             qfdmax    = ', qfdmax
       ENDIF
-
+      !
       zpsino3 = 2.3 * rno3
       zpsinh4 = 1.8 * rno3
@@ -560,4 +559,5 @@
       !
    END SUBROUTINE p5z_lim_init
+
 
    INTEGER FUNCTION p5z_lim_alloc()
@@ -569,5 +569,5 @@
       !!----------------------------------------------------------------------
       ierr(:) = 0
-
+      !
       !*  Biological arrays for phytoplankton growth
       ALLOCATE( xpicono3(jpi,jpj,jpk), xpiconh4(jpi,jpj,jpk),       &
@@ -585,5 +585,5 @@
          &      fvpuptk (jpi,jpj,jpk), xlimpic (jpi,jpj,jpk),       &
          &      xlimsi  (jpi,jpj,jpk), STAT=ierr(1) )
-
+         !
       !*  Minimum/maximum quotas of phytoplankton
       ALLOCATE( xqnnmin (jpi,jpj,jpk), xqnnmax(jpi,jpj,jpk),       &
@@ -593,5 +593,5 @@
          &      xqndmin (jpi,jpj,jpk), xqndmax(jpi,jpj,jpk),       &
          &      xqpdmin (jpi,jpj,jpk), xqpdmax(jpi,jpj,jpk),     STAT=ierr(2) )
-      !
+         !
       p5z_lim_alloc = MAXVAL( ierr )
       !
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p5zmeso.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p5zmeso.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p5zmeso.F90	(revision 9124)
@@ -89,5 +89,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p5z_meso')
+      IF( ln_timing )   CALL timing_start('p5z_meso')
       !
       CALL wrk_alloc( jpi, jpj, jpk, zgrazing )
@@ -362,10 +362,10 @@
       CALL wrk_dealloc( jpi, jpj, jpk, zgrazing )
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p5z_meso')
+      IF( ln_timing )   CALL timing_stop('p5z_meso')
       !
    END SUBROUTINE p5z_meso
 
+
    SUBROUTINE p5z_meso_init
-
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE p5z_meso_init  ***
@@ -379,22 +379,21 @@
       !!
       !!----------------------------------------------------------------------
-
+      INTEGER :: ios                 ! Local integer output status for namelist read
+      !!
       NAMELIST/namp5zmes/part2, bmetexc2, grazrat2, resrat2, mzrat2, xpref2c, xpref2p, xpref2z, &
          &                xpref2m, xpref2d, xthresh2dia, xthresh2phy, xthresh2zoo, xthresh2poc, &
          &                xthresh2mes, xthresh2, xkgraz2, epsher2, ssigma2, unass2c, &
-      &                   unass2n, unass2p, srespir2, grazflux
-
-      INTEGER :: ios                 ! Local integer output status for namelist read
-
+         &                unass2n, unass2p, srespir2, grazflux
+      !!----------------------------------------------------------------------
+      !
       REWIND( numnatp_ref )              ! Namelist nampismes in reference namelist : Pisces mesozooplankton
       READ  ( numnatp_ref, namp5zmes, IOSTAT = ios, ERR = 901)
 901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampismes in reference namelist', lwp )
-
+      !
       REWIND( numnatp_cfg )              ! Namelist nampismes in configuration namelist : Pisces mesozooplankton
       READ  ( numnatp_cfg, namp5zmes, IOSTAT = ios, ERR = 902 )
-902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampismes in configuration namelist', lwp )
+902   IF( ios >  0 ) CALL ctl_nam ( ios , 'nampismes in configuration namelist', lwp )
       IF(lwm) WRITE ( numonp, namp5zmes )
-
-
+      !
       IF(lwp) THEN                         ! control print
          WRITE(numout,*) ' ' 
@@ -426,6 +425,5 @@
          WRITE(numout,*) '    Use excess carbon for respiration              bmetexc2    = ', bmetexc2
       ENDIF
-
-
+      !
    END SUBROUTINE p5z_meso_init
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p5zmicro.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p5zmicro.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p5zmicro.F90	(revision 9124)
@@ -86,5 +86,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p5z_micro')
+      IF( ln_timing )   CALL timing_start('p5z_micro')
       !
       CALL wrk_alloc( jpi, jpj, jpk, zgrazing )
@@ -306,5 +306,5 @@
       CALL wrk_dealloc( jpi, jpj, jpk, zgrazing )
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p5z_micro')
+      IF( ln_timing )   CALL timing_stop('p5z_micro')
       !
    END SUBROUTINE p5z_micro
@@ -312,5 +312,4 @@
 
    SUBROUTINE p5z_micro_init
-
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE p5z_micro_init  ***
@@ -324,21 +323,21 @@
       !!
       !!----------------------------------------------------------------------
-
+      INTEGER ::   ios   ! Local integer
+      !!
       NAMELIST/namp5zzoo/ part, grazrat, bmetexc, resrat, mzrat, xprefc, xprefn, &
          &                xprefp, xprefd, xprefz, xthreshdia, xthreshphy, &
          &                xthreshpic, xthreshpoc, xthreshzoo, xthresh, xkgraz, &
          &                epsher, ssigma, srespir, unassc, unassn, unassp
-
-      INTEGER :: ios                 ! Local integer output status for namelist read
-
+      !!----------------------------------------------------------------------
+      !
       REWIND( numnatp_ref )              ! Namelist nampiszoo in reference namelist : Pisces microzooplankton
       READ  ( numnatp_ref, namp5zzoo, IOSTAT = ios, ERR = 901)
 901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namp5zzoo in reference namelist', lwp )
-
+      !
       REWIND( numnatp_cfg )              ! Namelist nampiszoo in configuration namelist : Pisces microzooplankton
       READ  ( numnatp_cfg, namp5zzoo, IOSTAT = ios, ERR = 902 )
-902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namp5zzoo in configuration namelist', lwp )
+902   IF( ios >  0 ) CALL ctl_nam ( ios , 'namp5zzoo in configuration namelist', lwp )
       IF(lwm) WRITE ( numonp, namp5zzoo )
-
+      !
       IF(lwp) THEN                         ! control print
          WRITE(numout,*) ' '
@@ -369,5 +368,5 @@
          WRITE(numout,*) '    Use of excess carbon for respiration            bmetexc     =', bmetexc
       ENDIF
-
+      !
    END SUBROUTINE p5z_micro_init
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p5zmort.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p5zmort.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p5zmort.F90	(revision 9124)
@@ -74,5 +74,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p5z_nano')
+      IF( ln_timing )   CALL timing_start('p5z_nano')
       !
       prodcal(:,:,:) = 0.  !: calcite production variable set to zero
@@ -124,7 +124,8 @@
        ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p5z_nano')
+      IF( ln_timing )   CALL timing_stop('p5z_nano')
       !
    END SUBROUTINE p5z_nano
+
 
    SUBROUTINE p5z_pico
@@ -143,5 +144,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p5z_pico')
+      IF( ln_timing )   CALL timing_start('p5z_pico')
       !
       DO jk = 1, jpkm1
@@ -184,5 +185,5 @@
        ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p5z_pico')
+      IF( ln_timing )   CALL timing_stop('p5z_pico')
       !
    END SUBROUTINE p5z_pico
@@ -204,5 +205,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p5z_diat')
+      IF( ln_timing )   CALL timing_start('p5z_diat')
       !
 
@@ -262,10 +263,10 @@
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p5z_diat')
+      IF( ln_timing )   CALL timing_stop('p5z_diat')
       !
    END SUBROUTINE p5z_diat
 
+
    SUBROUTINE p5z_mort_init
-
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE p5z_mort_init  ***
@@ -279,7 +280,8 @@
       !!
       !!----------------------------------------------------------------------
-
+      INTEGER :: ios                 ! Local integer output status for namelist read
+      !!
       NAMELIST/namp5zmort/ wchln, wchlp, wchld, wchldm, mpratn, mpratp, mpratd
-      INTEGER :: ios                 ! Local integer output status for namelist read
+      !!----------------------------------------------------------------------
 
       REWIND( numnatp_ref )              ! Namelist nampismort in reference namelist : Pisces phytoplankton
@@ -289,5 +291,5 @@
       REWIND( numnatp_cfg )              ! Namelist nampismort in configuration namelist : Pisces phytoplankton
       READ  ( numnatp_cfg, namp5zmort, IOSTAT = ios, ERR = 902 )
-902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namp5zmort in configuration namelist', lwp )
+902   IF( ios >  0 ) CALL ctl_nam ( ios , 'namp5zmort in configuration namelist', lwp )
       IF(lwm) WRITE ( numonp, namp5zmort )
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p5zprod.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p5zprod.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p5zprod.F90	(revision 9124)
@@ -98,5 +98,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('p5z_prod')
+      IF( ln_timing )   CALL timing_start('p5z_prod')
       !
       !  Allocate temporary workspace
@@ -571,5 +571,5 @@
       CALL wrk_dealloc( jpi, jpj, jpk, zcroissp, zcroissn, zcroissd )
       !
-      IF( nn_timing == 1 )  CALL timing_stop('p5z_prod')
+      IF( ln_timing )   CALL timing_stop('p5z_prod')
       !
    END SUBROUTINE p5z_prod
@@ -587,9 +587,8 @@
       !! ** input   :   Namelist nampisprod
       !!----------------------------------------------------------------------
-      !
+      INTEGER :: ios                 ! Local integer output status for namelist read
+      !!
       NAMELIST/namp5zprod/ pislopen, pislopep, pisloped, excretn, excretp, excretd,     &
          &                 thetannm, thetanpm, thetandm, chlcmin, grosip, bresp, xadap
-
-      INTEGER :: ios                 ! Local integer output status for namelist read
       !!----------------------------------------------------------------------
 
@@ -600,5 +599,5 @@
       REWIND( numnatp_cfg )              ! Namelist nampisprod in configuration namelist : Pisces phytoplankton production
       READ  ( numnatp_cfg, namp5zprod, IOSTAT = ios, ERR = 902 )
-902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namp5zprod in configuration namelist', lwp )
+902   IF( ios >  0 ) CALL ctl_nam ( ios , 'namp5zprod in configuration namelist', lwp )
       IF(lwm) WRITE ( numonp, namp5zprod )
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/SED/par_sed.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/SED/par_sed.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/SED/par_sed.F90	(revision 9124)
@@ -7,6 +7,9 @@
    !!        !  06-12  (C. Ethe)  Orignal
    !!----------------------------------------------------------------------
-   !! $Id$
 #if defined key_sed
+   !!----------------------------------------------------------------------
+   !!   'key_sed'                                                  Sediment 
+   !!----------------------------------------------------------------------
+
    !! Domain characteristics
    USE par_kind
@@ -37,5 +40,4 @@
       jpwat = 7,         &   !: number of pore water component
       jpwatp1 = jpwat + 1
-
    
    ! pore water components       
@@ -61,3 +63,9 @@
       jpdia2dsed = 7
 #endif
+
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 4.0 , NEMO Consortium (2017)
+   !! $Id$ 
+   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !!======================================================================
 END MODULE par_sed
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/SED/sed.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/SED/sed.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/SED/sed.F90	(revision 9124)
@@ -4,7 +4,10 @@
    !! Sediment :   set sediment global variables
    !!======================================================================
-#if defined key_sed
    !! History :
    !!        !  06-12  (C. Ethe)  Orignal
+   !!----------------------------------------------------------------------
+#if defined key_sed
+   !!----------------------------------------------------------------------
+   !!   'key_sed'                                                  Sediment 
    !!----------------------------------------------------------------------
    USE par_sed
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/SED/sedadv.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/SED/sedadv.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/SED/sedadv.F90	(revision 9124)
@@ -1,9 +1,10 @@
 MODULE sedadv
-#if defined key_sed
    !!======================================================================
    !!              ***  MODULE  sedadv  ***
    !!    Sediment : vertical advection and burial
    !!=====================================================================
-   !! * Modules used
+#if defined key_sed
+   !!----------------------------------------------------------------------
+   !!   'key_sed'                                                  Sediment 
    !!----------------------------------------------------------------------
    !!   sed_adv :
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/par_pisces.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/par_pisces.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/par_pisces.F90	(revision 9124)
@@ -5,8 +5,4 @@
    !!======================================================================
    !! History :   2.0  !  2007-12  (C. Ethe, G. Madec)  revised architecture
-   !!----------------------------------------------------------------------
-   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
-   !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 
@@ -68,4 +64,8 @@
    INTEGER, PUBLIC  ::   jp_pcs1  !: Last  index of PISCES tracers
 
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
+   !! $Id$ 
+   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
    !!======================================================================
 END MODULE par_pisces
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/sms_pisces.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/sms_pisces.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/sms_pisces.F90	(revision 9124)
@@ -137,5 +137,4 @@
 CONTAINS
 
-
    INTEGER FUNCTION sms_pisces_alloc()
       !!----------------------------------------------------------------------
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/trcice_pisces.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/trcice_pisces.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/trcice_pisces.F90	(revision 9124)
@@ -20,7 +20,11 @@
    PUBLIC   trc_ice_ini_pisces ! called by trcini.F90 module
 
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 4.0 , NEMO Consortium (2017)
+   !! $Id: trcsub.F90 9019 2017-12-13 14:58:53Z timgraham $ 
+   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
-
    SUBROUTINE trc_ice_ini_pisces
       !!----------------------------------------------------------------------
@@ -29,9 +33,9 @@
       !! ** Purpose :   Initialisation of the PISCES biochemical model
       !!----------------------------------------------------------------------
-
+      !
       IF( ln_p4z .OR. ln_p5z ) THEN  ;   CALL p4z_ice_ini   !  PISCES
       ELSE                           ;   CALL p2z_ice_ini   !  LOBSTER
       ENDIF
-
+      !
    END SUBROUTINE trc_ice_ini_pisces
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/trcnam_pisces.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/trcnam_pisces.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/trcnam_pisces.F90	(revision 9124)
@@ -18,10 +18,8 @@
    USE iom             ! I/O manager
 
-
    IMPLICIT NONE
    PRIVATE
 
    PUBLIC   trc_nam_pisces   ! called by trcnam.F90 module
-
 
    !!----------------------------------------------------------------------
@@ -30,5 +28,4 @@
    !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -42,5 +39,4 @@
       !!             namelist: natext, natbio, natsms
       !!----------------------------------------------------------------------
-      !!
       INTEGER :: jl, jn
       INTEGER :: ios, ioptio                 ! Local integer output status for namelist read
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/trcsms_pisces.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/trcsms_pisces.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/PISCES/trcsms_pisces.F90	(revision 9124)
@@ -23,13 +23,5 @@
    !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
-
-      !!----------------------------------------------------------------------
-      !!                   ***  ROUTINE trc_ini_pisces ***
-      !!
-      !! ** Purpose :   Initialisation of the PISCES biochemical model
-      !!----------------------------------------------------------------------
-
 
    SUBROUTINE trc_sms_pisces( kt )
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/TRP/trcbbl.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/TRP/trcbbl.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/TRP/trcbbl.F90	(revision 9124)
@@ -50,5 +50,5 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('trc_bbl')
+      IF( ln_timing )   CALL timing_start('trc_bbl')
       !
       IF( .NOT. l_offline .AND. nn_dttrc == 1 ) THEN
@@ -92,5 +92,5 @@
       ENDIF
       !
-      IF( nn_timing == 1 ) CALL timing_stop('trc_bbl')
+      IF( ln_timing )   CALL timing_stop('trc_bbl')
       !
    END SUBROUTINE trc_bbl
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90	(revision 9124)
@@ -89,5 +89,5 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('trc_dmp')
+      IF( ln_timing )   CALL timing_start('trc_dmp')
       !
       IF( l_trdtrc )   CALL wrk_alloc( jpi, jpj, jpk, ztrtrd )   ! temporary save of trends
@@ -161,5 +161,5 @@
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('trc_dmp')
+      IF( ln_timing )   CALL timing_stop('trc_dmp')
       !
    END SUBROUTINE trc_dmp
@@ -179,6 +179,4 @@
       NAMELIST/namtrc_dmp/ nn_zdmp_tr , cn_resto_tr
       !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )  CALL timing_start('trc_dmp_ini')
       !
       REWIND( numnat_ref )              ! Namelist namtrc_dmp in reference namelist : Passive tracers newtonian damping
@@ -222,5 +220,4 @@
          !
       ENDIF
-      IF( nn_timing == 1 )  CALL timing_stop('trc_dmp_ini')
       !
    END SUBROUTINE trc_dmp_ini
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/TRP/trcldf.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/TRP/trcldf.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/TRP/trcldf.F90	(revision 9124)
@@ -74,5 +74,5 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )   CALL timing_start('trc_ldf')
+      IF( ln_timing )   CALL timing_start('trc_ldf')
       !
       IF( l_trdtrc )  THEN
@@ -124,5 +124,5 @@
       CALL wrk_dealloc( jpi,jpj,jpk,   zahu, zahv )
       !
-      IF( nn_timing == 1 )   CALL timing_stop('trc_ldf')
+      IF( ln_timing )   CALL timing_stop('trc_ldf')
       !
    END SUBROUTINE trc_ldf
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/TRP/trcnxt.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/TRP/trcnxt.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/TRP/trcnxt.F90	(revision 9124)
@@ -86,5 +86,5 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('trc_nxt')
+      IF( ln_timing )   CALL timing_start('trc_nxt')
       !
       IF( kt == nittrc000 .AND. lwp ) THEN
@@ -143,5 +143,5 @@
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('trc_nxt')
+      IF( ln_timing )   CALL timing_stop('trc_nxt')
       !
    END SUBROUTINE trc_nxt
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/TRP/trcrad.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/TRP/trcrad.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/TRP/trcrad.F90	(revision 9124)
@@ -54,5 +54,5 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('trc_rad')
+      IF( ln_timing )   CALL timing_start('trc_rad')
       !
       IF( kt == nittrc000 ) THEN
@@ -75,5 +75,5 @@
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('trc_rad')
+      IF( ln_timing )   CALL timing_stop('trc_rad')
       !
    END SUBROUTINE trc_rad
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/TRP/trcsbc.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/TRP/trcsbc.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/TRP/trcsbc.F90	(revision 9124)
@@ -68,5 +68,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('trc_sbc')
+      IF( ln_timing )   CALL timing_start('trc_sbc')
       !
       ! Allocate temporary workspace
@@ -182,5 +182,5 @@
       IF( l_trdtrc )  CALL wrk_dealloc( jpi,jpj,jpk,   ztrtrd )
       !
-      IF( nn_timing == 1 )  CALL timing_stop('trc_sbc')
+      IF( ln_timing )   CALL timing_stop('trc_sbc')
       !
    END SUBROUTINE trc_sbc
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90	(revision 9124)
@@ -56,5 +56,5 @@
       !! ---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )   CALL timing_start('trc_trp')
+      IF( ln_timing )   CALL timing_start('trc_trp')
       !
       IF( .NOT. lk_c1d ) THEN
@@ -91,5 +91,5 @@
       END IF
       !
-      IF( nn_timing == 1 )   CALL timing_stop('trc_trp')
+      IF( ln_timing )   CALL timing_stop('trc_trp')
       !
    END SUBROUTINE trc_trp
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/TRP/trczdf.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/TRP/trczdf.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/TRP/trczdf.F90	(revision 9124)
@@ -50,5 +50,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('trc_zdf')
+      IF( ln_timing )   CALL timing_start('trc_zdf')
       !
       IF( l_trdtrc )   ztrtrd(:,:,:,:)  = tra(:,:,:,:)
@@ -71,5 +71,5 @@
       END IF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('trc_zdf')
+      IF( ln_timing )  CALL timing_stop('trc_zdf')
       !
    END SUBROUTINE trc_zdf
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/trcbc.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/trcbc.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/trcbc.F90	(revision 9124)
@@ -60,5 +60,4 @@
       !!              - allocates passive tracer BC data structure 
       !!----------------------------------------------------------------------
-      !
       INTEGER,INTENT(IN) :: ntrc                           ! number of tracers
       INTEGER            :: jl, jn , ib, ibd, ii, ij, ik   ! dummy loop indices
@@ -81,7 +80,5 @@
                         & cn_dir_cbc, sn_trccbc, rn_trcfac, ln_rnf_ctl, rn_bc_time
       NAMELIST/namtrc_bdy/ cn_trc_dflt, cn_trc, nn_trcdmp_bdy
-
       !!----------------------------------------------------------------------
-      IF( nn_timing == 1 )  CALL timing_start('trc_bc_ini')
       !
       IF( lwp ) THEN
@@ -332,5 +329,4 @@
       !
       DEALLOCATE( slf_i )          ! deallocate local field structure
-      IF( nn_timing == 1 )  CALL timing_stop('trc_bc_ini')
       !
    END SUBROUTINE trc_bc_ini
@@ -348,6 +344,5 @@
       !!----------------------------------------------------------------------
       USE fldread
-      
-      !! * Arguments
+      !!      
       INTEGER, INTENT( in ) ::   kt              ! ocean time-step index
       INTEGER, INTENT( in ), OPTIONAL ::   jit   ! subcycle time-step index (for timesplitting option)
@@ -357,5 +352,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('trc_bc')
+      IF( ln_timing )   CALL timing_start('trc_bc')
 
       IF( kt == nit000 .AND. lwp) THEN
@@ -452,6 +447,5 @@
       END DO                                                     ! tracer loop
       !                                                          ! ===========
-      !
-      IF( nn_timing == 1 )  CALL timing_stop('trc_bc')
+      IF( ln_timing )   CALL timing_stop('trc_bc')
       !
    END SUBROUTINE trc_bc
@@ -462,5 +456,4 @@
    !!----------------------------------------------------------------------
 CONTAINS
-
    SUBROUTINE trc_bc_ini( ntrc )        ! Empty routine
       INTEGER,INTENT(IN) :: ntrc                           ! number of tracers
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/trcbdy.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/trcbdy.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/trcbdy.F90	(revision 9124)
@@ -51,5 +51,5 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 ) CALL timing_start('trc_bdy')
+      IF( ln_timing )   CALL timing_start('trc_bdy')
       !
       igrd = 1 
@@ -76,7 +76,8 @@
       END DO
       !
-      IF( nn_timing == 1 ) CALL timing_stop('trc_bdy')
+      IF( ln_timing )   CALL timing_stop('trc_bdy')
 
    END SUBROUTINE trc_bdy
+
 
    SUBROUTINE trc_bdy_dmp( kt )
@@ -98,9 +99,9 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 ) CALL timing_start('trc_bdy_dmp')
+      IF( ln_timing )   CALL timing_start('trc_bdy_dmp')
       !
       DO jn = 1, jptra
          DO ib_bdy=1, nb_bdy
-            IF ( trcdta_bdy(jn, ib_bdy)%dmp ) THEN
+            IF( trcdta_bdy(jn, ib_bdy)%dmp ) THEN
                igrd = 1                       ! Everything is at T-points here
                DO ib = 1, idx_bdy(ib_bdy)%nblen(igrd)
@@ -114,8 +115,8 @@
                END DO
             ENDIF
-         ENDDO
-      ENDDO
+         END DO
+      END DO
       !
-      IF( nn_timing == 1 ) CALL timing_stop('trc_bdy_dmp')
+      IF( ln_timing )   CALL timing_stop('trc_bdy_dmp')
       !
    END SUBROUTINE trc_bdy_dmp
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/trcdta.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/trcdta.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/trcdta.F90	(revision 9124)
@@ -20,4 +20,5 @@
    USE oce_trc       !  shared variables between ocean and passive tracers
    USE trc           !  passive tracers common variables
+   !
    USE iom           !  I/O manager
    USE lib_mpp       !  MPP library
@@ -69,6 +70,4 @@
       NAMELIST/namtrc_dta/ sn_trcdta, cn_dir, rn_trfac 
       !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )  CALL timing_start('trc_dta_ini')
       !
       IF( lwp ) THEN
@@ -154,5 +153,4 @@
       !
       DEALLOCATE( slf_i )          ! deallocate local field structure
-      IF( nn_timing == 1 )  CALL timing_stop('trc_dta_ini')
       !
    END SUBROUTINE trc_dta_ini
@@ -182,5 +180,5 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('trc_dta')
+      IF( ln_timing )   CALL timing_start('trc_dta')
       !
       IF( nb_trcdta > 0 ) THEN
@@ -246,5 +244,5 @@
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('trc_dta')
+      IF( ln_timing )  CALL timing_stop('trc_dta')
       !
    END SUBROUTINE trc_dta
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/trcice.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/trcice.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/trcice.F90	(revision 9124)
@@ -12,5 +12,4 @@
    !!   trc_ice   :  Call the appropriate sea ice tracer subroutine
    !!----------------------------------------------------------------------
-
    USE oce_trc         ! shared variables between ocean and passive tracers
    USE trc             ! passive tracers common variables
@@ -24,6 +23,11 @@
    PRIVATE
    
-   PUBLIC   trc_ice_ini ! called by trc_nam
+   PUBLIC   trc_ice_ini   ! called by trc_nam
 
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 4.0 , NEMO Consortium (2011)
+   !! $Id: trcini.F90 9019 2017-12-13 14:58:53Z timgraham $ 
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
    
@@ -37,6 +41,5 @@
       !!            
       !!---------------------------------------------------------------------
-      ! --- Variable declarations --- !
-
+      !
       IF(lwp) THEN
          WRITE(numout,*)
@@ -44,12 +47,10 @@
          WRITE(numout,*) '~~~~~~~~~~~~~'
       ENDIF
-
-      IF( nn_timing == 1 )  CALL timing_start('trc_ice_ini')
       !
       CALL trc_nam_ice
       !
-      trc_i(:,:,:) = 0.0d0 ! by default
-      trc_o(:,:,:) = 0.0d0 ! by default
-
+      trc_i(:,:,:) = 0._wp   ! by default
+      trc_o(:,:,:) = 0._wp   ! by default
+      !
       IF ( nn_ice_tr == 1 ) THEN
          IF( ln_pisces  )    CALL trc_ice_ini_pisces       ! PISCES  bio-model
@@ -59,8 +60,7 @@
          IF( ln_my_trc  )    CALL trc_ice_ini_my_trc       ! MY_TRC  tracers
       ENDIF
-
-      IF( nn_timing == 1 )   CALL timing_stop('trc_ice_ini')
       !
    END SUBROUTINE trc_ice_ini
+
 
    SUBROUTINE trc_nam_ice
@@ -86,7 +86,4 @@
          WRITE(numout,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
       ENDIF
-
-      IF( nn_timing == 1 )  CALL timing_start('trc_nam_ice')
-
       !
       REWIND( numnat_ref )              ! Namelist namtrc_ice in reference namelist : Passive tracer input data
@@ -110,6 +107,4 @@
          cn_trc_o      (jn) = sn_tri_tracer(jn)%ctrc_o
       END DO
-
-      IF( nn_timing == 1 )   CALL timing_stop('trc_nam_ice')
       !
    END SUBROUTINE trc_nam_ice
@@ -122,8 +117,6 @@
    SUBROUTINE trc_ice_ini                   ! Dummy routine   
    END SUBROUTINE trc_ice_ini
-
    SUBROUTINE trc_nam_ice
    END SUBROUTINE trc_nam_ice
-
 #endif
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/trcini.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/trcini.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/trcini.F90	(revision 9124)
@@ -52,5 +52,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )   CALL timing_start('trc_init')
+      IF( ln_timing )   CALL timing_start('trc_init')
       !
       IF(lwp) WRITE(numout,*)
@@ -80,5 +80,5 @@
       CALL trc_ini_inv   ! Inventories
       !
-      IF( nn_timing == 1 )   CALL timing_stop('trc_init')
+      IF( ln_timing )   CALL timing_stop('trc_init')
       !
    END SUBROUTINE trc_init
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/trcsms.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/trcsms.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/trcsms.F90	(revision 9124)
@@ -47,5 +47,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )   CALL timing_start('trc_sms')
+      IF( ln_timing )   CALL timing_start('trc_sms')
       !
       IF( ln_pisces  )   CALL trc_sms_pisces ( kt )    ! main program of PISCES 
@@ -61,5 +61,5 @@
       ENDIF
       !
-      IF( nn_timing == 1 )   CALL timing_stop('trc_sms')
+      IF( ln_timing )   CALL timing_stop('trc_sms')
       !
    END SUBROUTINE trc_sms
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/trcstp.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/trcstp.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/trcstp.F90	(revision 9124)
@@ -59,5 +59,5 @@
       !!-------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )   CALL timing_start('trc_stp')
+      IF( ln_timing )   CALL timing_start('trc_stp')
       !
       IF( ( neuler == 0 .AND. kt == nittrc000 ) .OR. ln_top_euler ) THEN     ! at nittrc000
@@ -112,5 +112,5 @@
 9300  FORMAT(i10,D23.16)
       !
-      IF( nn_timing == 1 )   CALL timing_stop('trc_stp')
+      IF( ln_timing )   CALL timing_stop('trc_stp')
       !
    END SUBROUTINE trc_stp
@@ -136,4 +136,6 @@
       CHARACTER(len=2) ::   cl2   ! 2 characters
       !!----------------------------------------------------------------------
+      !
+      IF( ln_timing )   CALL timing_start('trc_mean_qsr')
       !
       IF( kt == nittrc000 ) THEN
@@ -227,4 +229,6 @@
       ENDIF
       !
+      IF( ln_timing )   CALL timing_stop('trc_mean_qsr')
+      !
    END SUBROUTINE trc_mean_qsr
 
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/trcsub.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/trcsub.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/trcsub.F90	(revision 9124)
@@ -97,5 +97,5 @@
       !!-------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('trc_sub_stp')
+      IF( ln_timing )   CALL timing_start('trc_sub_stp')
       !
       IF( kt == nit000 ) THEN
@@ -286,5 +286,5 @@
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('trc_sub_stp')
+      IF( ln_timing )   CALL timing_stop('trc_sub_stp')
       !
    END SUBROUTINE trc_sub_stp
@@ -302,6 +302,4 @@
       INTEGER ::   ierr
       !!-------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )  CALL timing_start('trc_sub_ini')
       !
       IF(lwp) WRITE(numout,*)
@@ -348,7 +346,6 @@
       ENDIF
       !
-      IF( nn_timing == 1 )  CALL timing_stop('trc_sub_ini')
-      !
    END SUBROUTINE trc_sub_ini
+
 
    SUBROUTINE trc_sub_reset( kt )
@@ -365,5 +362,5 @@
       !!-------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('trc_sub_reset')
+      IF( ln_timing )   CALL timing_start('trc_sub_reset')
       !
       !   restore physics variables
@@ -443,5 +440,5 @@
       !
       !
-      IF( nn_timing == 1 )  CALL timing_stop('trc_sub_reset')
+      IF( ln_timing )   CALL timing_stop('trc_sub_reset')
       !
    END SUBROUTINE trc_sub_reset
@@ -473,5 +470,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('trc_sub_ssh')
+      IF( ln_timing )   CALL timing_start('trc_sub_ssh')
       !
       ! Allocate temporary workspace
@@ -533,5 +530,5 @@
       CALL wrk_dealloc( jpi,jpj,   zhdiv )
       !
-      IF( nn_timing == 1 )  CALL timing_stop('trc_sub_ssh')
+      IF( ln_timing )   CALL timing_stop('trc_sub_ssh')
       !
    END SUBROUTINE trc_sub_ssh
Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/trcwri.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/trcwri.F90	(revision 9123)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/trcwri.F90	(revision 9124)
@@ -44,5 +44,5 @@
       !!---------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('trc_wri')
+      IF( ln_timing )   CALL timing_start('trc_wri')
       !
       IF( l_offline .AND. kt == nittrc000 .AND. lwp ) THEN    ! WRITE root name in date.file for use by postpro
@@ -60,5 +60,5 @@
       IF( ln_my_trc  )   CALL trc_wri_my_trc     ! MY_TRC  tracers
       !
-      IF( nn_timing == 1 )  CALL timing_stop('trc_wri')
+      IF( ln_timing )   CALL timing_stop('trc_wri')
       !
    END SUBROUTINE trc_wri
