Index: branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfbfr.F90
===================================================================
--- branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfbfr.F90	(revision 10770)
+++ branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfbfr.F90	(revision 10774)
@@ -105,4 +105,5 @@
          WRITE(numout,*) 'zdf_bfr : Set bottom friction coefficient (non-linear case)'
          WRITE(numout,*) '~~~~~~~~'
+         IF(lflush) CALL flush(numout)
       ENDIF
       !
@@ -262,4 +263,5 @@
       IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~'
       IF(lwp) WRITE(numout,*) '   Namelist nam_bfr : set bottom friction parameters'
+      IF(lwp .AND. lflush) CALL flush(numout)
       !
       SELECT CASE (nn_bfr)
@@ -399,4 +401,5 @@
       !
       IF(lwp) WRITE(numout,*) '      implicit bottom friction switch                ln_bfrimp  = ', ln_bfrimp
+      IF(lwp .AND. lflush) CALL flush(numout)
       !
       !                              ! Make sure ln_zdfexp=.false. when use implicit bfr
@@ -430,4 +433,5 @@
                    WRITE(numout,*) 'BFR ', narea, nimpp+ji, njmpp+jj, ikbu
                    WRITE(numout,*) 'BFR ', ABS( bfrcoef2d(ji,jj) ), zfru
+                   IF(lflush) CALL flush(numout)
                 ENDIF
                 ictu = ictu + 1
@@ -437,4 +441,5 @@
                      WRITE(numout,*) 'BFR ', narea, nimpp+ji, njmpp+jj, ikbv
                      WRITE(numout,*) 'BFR ', bfrcoef2d(ji,jj), zfrv
+                     IF(lflush) CALL flush(numout)
                  ENDIF
                  ictv = ictv + 1
@@ -452,4 +457,5 @@
                       WRITE(numout,*) 'TFR ', narea, nimpp+ji, njmpp+jj, ikbu
                       WRITE(numout,*) 'TFR ', ABS( tfrcoef2d(ji,jj) ), zfru
+                      IF(lflush) CALL flush(numout)
                    ENDIF
                    ictu = ictu + 1
@@ -459,4 +465,5 @@
                       WRITE(numout,*) 'TFR ', narea, nimpp+ji, njmpp+jj, ikbv
                       WRITE(numout,*) 'TFR ', tfrcoef2d(ji,jj), zfrv
+                      IF(lflush) CALL flush(numout)
                    ENDIF
                    ictv = ictv + 1
@@ -483,4 +490,5 @@
          IF ( ln_isfcav ) WRITE(numout,*) ' Top friction coefficient now ranges from: ', zmintfr, ' to ', zmaxtfr
          WRITE(numout,*) ' Bottom/Top friction coefficient will be reduced where necessary'
+         IF(lflush) CALL flush(numout)
       ENDIF
       ENDIF
Index: branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfddm.F90
===================================================================
--- branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfddm.F90	(revision 10770)
+++ branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfddm.F90	(revision 10774)
@@ -255,4 +255,5 @@
          WRITE(numout,*) '      maximum avs for dd mixing      rn_avts   = ', rn_avts
          WRITE(numout,*) '      heat/salt buoyancy flux ratio  rn_hsbfr  = ', rn_hsbfr
+         IF(lflush) CALL flush(numout)
       ENDIF
       !
Index: branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfevd.F90
===================================================================
--- branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfevd.F90	(revision 10770)
+++ branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfevd.F90	(revision 10774)
@@ -69,4 +69,5 @@
          IF(lwp) WRITE(numout,*) '~~~~~~~ '
          IF(lwp) WRITE(numout,*)
+         IF(lwp .AND. lflush) CALL flush(numout)
       ENDIF
 
Index: branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfgls.F90
===================================================================
--- branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfgls.F90	(revision 10770)
+++ branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfgls.F90	(revision 10774)
@@ -903,4 +903,5 @@
          WRITE(numout,*) '      Surface roughness (m)                         rn_hsro        = ', rn_hsro
          WRITE(numout,*) '      Bottom roughness (m) (nambfr namelist)        rn_bfrz0       = ', rn_bfrz0
+         IF(lflush) CALL flush(numout)
       ENDIF
 
@@ -990,5 +991,6 @@
          !
       END SELECT
-
+      !
+      IF(lwp .AND. lflush) CALL flush(numout)
       !
       SELECT CASE ( nn_stab_func )     !* set the parameters of the stability functions
@@ -1066,5 +1068,6 @@
          !
       END SELECT
-    
+      !
+      IF(lwp .AND. lflush) CALL flush(numout) 
       !                                !* Set Schmidt number for psi diffusion in the wave breaking case
       !                                     ! See Eq. (13) of Carniel et al, OM, 30, 225-239, 2009
@@ -1118,4 +1121,5 @@
          WRITE(numout,*) 'rl_sf   = ',rl_sf
          WRITE(numout,*)
+         IF(lflush) CALL flush(numout)
       ENDIF
 
@@ -1194,4 +1198,5 @@
             ELSE                        
                IF(lwp) WRITE(numout,*) ' ===>>>> : previous run without gls scheme, en and mxln computed by iterative loop'
+               IF(lwp .AND. lflush) CALL flush(numout)
                en  (:,:,:) = rn_emin
                mxln(:,:,:) = 0.05        
@@ -1204,4 +1209,5 @@
          ELSE                                   !* Start from rest
             IF(lwp) WRITE(numout,*) ' ===>>>> : Initialisation of en and mxln by background values'
+            IF(lwp .AND. lflush) CALL flush(numout)
             en  (:,:,:) = rn_emin
             mxln(:,:,:) = 0.05       
@@ -1211,4 +1217,5 @@
          !                                   ! -------------------
          IF(lwp) WRITE(numout,*) '---- gls-rst ----'
+         IF(lwp .AND. lflush) CALL flush(numout)
          IF(nn_timing == 2)  CALL timing_start('iom_rstput')
          CALL iom_rstput( kt, nitrst, numrow, 'en'   , en     ) 
Index: branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfini.F90
===================================================================
--- branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfini.F90	(revision 10770)
+++ branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfini.F90	(revision 10774)
@@ -83,4 +83,5 @@
          WRITE(numout,*) '      npc call  frequency                 nn_npc    = ', nn_npc
          WRITE(numout,*) '      npc print frequency                 nn_npcp   = ', nn_npcp
+         IF(lflush) CALL flush(numout)
       ENDIF
 
@@ -154,5 +155,6 @@
          CALL ctl_stop( ' except for TKE, GLS or KPP physics, a convection scheme is',   &
          &              ' required: ln_zdfevd or ln_zdfnpc logicals' )
-
+      !
+      IF(lwp .AND. lflush) CALL flush(numout)
       !                               !* Background eddy viscosity and diffusivity profil
       IF( nn_avb == 0 ) THEN                ! Define avmb, avtb from namelist parameter
Index: branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfkpp.F90
===================================================================
--- branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfkpp.F90	(revision 10770)
+++ branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfkpp.F90	(revision 10774)
@@ -1214,4 +1214,5 @@
          IF(lwp) WRITE(numout,*) 'tra_kpp : KPP non-local tracer fluxes'
          IF(lwp) WRITE(numout,*) '~~~~~~~   '
+         IF(lflush) CALL flush(numout)
       ENDIF
 
@@ -1286,4 +1287,5 @@
          IF(lwp) WRITE(numout,*) 'trc_kpp : KPP non-local tracer fluxes'
          IF(lwp) WRITE(numout,*) '~~~~~~~   '
+         IF(lflush) CALL flush(numout)
       ENDIF
 
@@ -1384,4 +1386,5 @@
          WRITE(numout,*) '     max. mix. in interior convec.                 rn_difcon   = ', rn_difcon
          WRITE(numout,*) '     horizontal average flag                       nn_ave      = ', nn_ave
+         IF(lflush) CALL flush(numout)
       ENDIF
 
@@ -1410,4 +1413,6 @@
          ENDIF
       ENDIF
+    
+      IF(lwp .AND. lflush) CALL flush(numout)
       
 
@@ -1421,4 +1426,5 @@
          WRITE(numout,*) '     Constant value for unreso. turbul. velocity shear Vtc = ', Vtc
          WRITE(numout,*) '     Non-dimensional coef. for nonlocal transport      rcg = ', rcg
+         IF(lflush) CALL flush(numout)
        ENDIF
 
@@ -1438,4 +1444,5 @@
          IF(lwp) WRITE(numout,*) '          no horizontal average on avt, avmu, avmv'
          IF(lwp) WRITE(numout,*) '          only in very high horizontal resolution !'
+         IF(lwp .AND. lflush) CALL flush(numout)
          ! weighting mean arrays etmean, eumean and evmean
          !           ( 1  1 )                                          ( 1 )
@@ -1464,4 +1471,5 @@
       CASE ( 1 )                ! horizontal average 
          IF(lwp) WRITE(numout,*) '          horizontal average on avt, avmu, avmv'
+         IF(lwp .AND. lflush) CALL flush(numout)
          ! weighting mean arrays etmean, eumean and evmean
          !           ( 1/2  1  1/2 )              ( 1/2  1/2 )             ( 1/2  1  1/2 )
Index: branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfmxl.F90
===================================================================
--- branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfmxl.F90	(revision 10770)
+++ branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfmxl.F90	(revision 10774)
@@ -108,4 +108,5 @@
          IF(lwp) WRITE(numout,*) 'zdf_mxl : mixed layer depth'
          IF(lwp) WRITE(numout,*) '~~~~~~~ '
+         IF(lflush) CALL flush(numout)
          !                             ! allocate zdfmxl arrays
          IF( zdf_mxl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'zdf_mxl : unable to allocate arrays' )
@@ -396,7 +397,11 @@
             END DO
          END DO
-         WRITE(numout,*) 'zthick_0(jk =',jk,') =',zthick_0(2,2)
-         WRITE(numout,*) 'fsdepw(jk+1 =',jk+1,') =',fsdepw(2,2,jk+1)
+         IF(lwp) THEN
+            WRITE(numout,*) 'zthick_0(jk =',jk,') =',zthick_0(2,2)
+            WRITE(numout,*) 'fsdepw(jk+1 =',jk+1,') =',fsdepw(2,2,jk+1)
+         ENDIF
       END DO
+      
+      IF(lflush) CALL flush(numout)
 
       ! Surface boundary condition
@@ -429,5 +434,6 @@
       END DO
 
-      WRITE(numout,*) 'htc_mld(after) =',htc_mld(2,2)
+      IF(lwp) WRITE(numout,*) 'htc_mld(after) =',htc_mld(2,2)
+      IF(lwp .AND. lflush) CALL flush(numout)
 
       ! Convert to heat content
@@ -491,4 +497,5 @@
             END DO
             WRITE(numout,*) '===================================================================='
+            IF(lflush) CALL flush(numout)
          ENDIF
       ENDIF
Index: branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfric.F90
===================================================================
--- branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfric.F90	(revision 10770)
+++ branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfric.F90	(revision 10774)
@@ -276,4 +276,5 @@
          WRITE(numout,*) '      Vertical eddy Visc. in the ML  rn_wvmix  = ', rn_wvmix
          WRITE(numout,*) '      Use the MLD parameterization   ln_mldw   = ', ln_mldw
+         IF(lflush) CALL flush(numout)
       ENDIF
       !
Index: branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90
===================================================================
--- branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90	(revision 10770)
+++ branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90	(revision 10774)
@@ -797,4 +797,5 @@
          WRITE(numout,*) 'zdf_tke_init :  New tidal mixing case: force rn_emin = 1.e-10 and rmxl_min = 1.e-3 '
          WRITE(numout,*) '~~~~~~~~~~~~'
+         IF(lflush) CALL flush(numout)
       ENDIF
 # else
@@ -825,4 +826,5 @@
          WRITE(numout,*)
          WRITE(numout,*) '      critical Richardson nb with your parameters  ri_cri = ', ri_cri
+         IF(lflush) CALL flush(numout)
       ENDIF
       !
@@ -838,4 +840,5 @@
       IF( ln_mxl0 ) THEN
          IF(lwp) WRITE(numout,*) '   use a surface mixing length = F(stress) :   set rn_mxl0 = rmxl_min'
+         IF(lwp .AND. lflush) CALL flush(numout)
          rn_mxl0 = rmxl_min
       ENDIF
@@ -949,4 +952,5 @@
            ELSE                                     ! No TKE array found: initialisation
               IF(lwp) WRITE(numout,*) ' ===>>>> : previous run without tke scheme, en computed by iterative loop'
+              IF(lwp .AND. lflush) CALL flush(numout)
               en (:,:,:) = rn_emin * tmask(:,:,:)
               CALL tke_avn                               ! recompute avt, avm, avmu, avmv and dissl (approximation)
@@ -971,5 +975,8 @@
      ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN   ! Create restart file
         !                                   ! -------------------
-        IF(lwp .AND. nprint > 0) WRITE(numout,*) '---- tke-rst ----'
+        IF(lwp .AND. nprint > 0) THEN
+           WRITE(numout,*) '---- tke-rst ----'
+           IF(lflush) CALL flush(numout)
+        ENDIF
         IF(nn_timing == 2)  CALL timing_start('iom_rstput')
         CALL iom_rstput( kt, nitrst, numrow, 'en'   , en     )
Index: branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftmx.F90
===================================================================
--- branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftmx.F90	(revision 10770)
+++ branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftmx.F90	(revision 10774)
@@ -156,4 +156,5 @@
          IF(lwp) WRITE(numout,*) 
          IF(lwp) WRITE(numout,*) '          N Total power consumption by av_tide    : ztpc = ', ztpc * 1.e-12 ,'TW'
+         IF(lwp .AND. lflush) CALL flush(numout)
       ENDIF
        
@@ -310,4 +311,5 @@
          ztpc= rau0 * ztpc / ( rn_me * rn_tfe_itf )
          IF(lwp) WRITE(numout,*) '          N Total power consumption by zavt_itf: ztpc = ', ztpc * 1.e-12 ,'TW'
+         IF(lwp .AND. lflush) CALL flush(numout)
       ENDIF
 
@@ -401,4 +403,5 @@
          WRITE(numout,*) '      ITF specific parameterisation         = ', ln_tmx_itf
          WRITE(numout,*) '      ITF tidal dissipation efficiency      = ', rn_tfe_itf
+         IF(lflush) CALL flush(numout)
       ENDIF
 
@@ -468,4 +471,5 @@
          WRITE(numout,*) 
          WRITE(numout,*) '          Total power consumption of the tidally driven part of Kz : ztpc = ', ztpc * 1.e-12 ,'TW'
+         IF(lflush) CALL flush(numout)
 
 
@@ -497,4 +501,5 @@
          END DO
          WRITE(numout,*) '          Min de zkz ', ztpc, ' Max = ', maxval(zkz(:,:) )
+         IF(lflush) CALL flush(numout)
 
          DO jk = 2, jpkm1
@@ -516,4 +521,5 @@
          ztpc= rau0 * 1/(rn_tfe * rn_me) * ztpc
          WRITE(numout,*) '          2 Total power consumption of the tidally driven part of Kz : ztpc = ', ztpc * 1.e-12 ,'TW'
+         IF(lflush) CALL flush(numout)
 
          DO jk = 1, jpk
@@ -528,4 +534,5 @@
             WRITE(numout,*) '            N2 min - jk= ', jk,'   ', ze_z * 1.e4,' cm2/s min= ',ztpc*1.e4,   &
                &       'max= ', MAXVAL(zav_tide(:,:,jk) )*1.e4, ' cm2/s'
+            IF(lflush) CALL flush(numout)
          END DO
 
@@ -533,4 +540,6 @@
          WRITE(numout,*) 
          WRITE(numout,*) '          Initial profile of tidal vertical mixing'
+         IF(lflush) CALL flush(numout)
+
          DO jk = 1, jpk
             DO jj = 1,jpj
@@ -543,4 +552,5 @@
             WRITE(numout,*) '                jk= ', jk,'   ', ze_z * 1.e4,' cm2/s'
          END DO
+         IF(lflush) CALL flush(numout)
          DO jk = 1, jpk
             zkz(:,:) = az_tmx(:,:,jk) /rn_n2min
@@ -551,4 +561,5 @@
                &       'max= ', MAXVAL(zkz)*1.e4, ' cm2/s'
          END DO
+         IF(lflush) CALL flush(numout)
          !
       ENDIF
@@ -862,4 +873,5 @@
             WRITE(numout,*)
             WRITE(numout,*) '      Total power consumption by av_wave: ztpc =  ', ztpc * 1.e-12_wp, 'TW'
+            IF(lflush) CALL flush(numout)
          ENDIF
       ENDIF
@@ -983,4 +995,5 @@
          WRITE(numout,*) '      Variable (T) or constant (F) mixing efficiency            = ', ln_mevar
          WRITE(numout,*) '      Differential internal wave-driven mixing (T) or not (F)   = ', ln_tsdiff
+         IF(lflush) CALL flush(numout)
       ENDIF
       
@@ -995,4 +1008,5 @@
          WRITE(numout,*) '   Force the background value applied to avm & avt in TKE to be everywhere ',   &
             &               'the viscous molecular value & a very small diffusive value, resp.'
+         IF(lflush) CALL flush(numout)
       ENDIF
       
@@ -1042,4 +1056,5 @@
          WRITE(numout,*) '      Pycnocline-intensifed wave-breaking energy: ', zpyc * 1.e-12_wp, 'TW'
          WRITE(numout,*) '      Critical slope wave-breaking energy:        ', zcri * 1.e-12_wp, 'TW'
+         IF(lflush) CALL flush(numout)
       ENDIF
       !
