Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ASM/asmbkg.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ASM/asmbkg.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ASM/asmbkg.F90	(revision 10986)
@@ -82,5 +82,8 @@
          !
          IF( .NOT. llok ) THEN
-            IF(lwp) WRITE(numout,*) ' Setting up assimilation background file '// TRIM( c_asmbkg )
+            IF(lwp) THEN
+               WRITE(numout,*) ' Setting up assimilation background file '// TRIM( c_asmbkg )
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             !
             !                                      ! Define the output file        
@@ -90,5 +93,8 @@
                zdate = REAL( ndastp )
                IF( ln_zdftke ) THEN                   ! read turbulent kinetic energy ( en )
-                  IF(lwp) WRITE(numout,*) ' Reading TKE (en) from restart...'
+                  IF(lwp) THEN
+                     WRITE(numout,*) ' Reading TKE (en) from restart...'
+                     IF(lflush) CALL FLUSH(numout)
+                  ENDIF
                   CALL tke_rst( nit000, 'READ' )
                ENDIF
@@ -120,5 +126,8 @@
          !
          IF( .NOT. llok ) THEN
-            IF(lwp) WRITE(numout,*) ' Setting up assimilation background file '// TRIM( c_asmdin )
+            IF(lwp) THEN
+               WRITE(numout,*) ' Setting up assimilation background file '// TRIM( c_asmdin )
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             !
             !                                      ! Define the output file        
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ASM/asminc.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ASM/asminc.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ASM/asminc.F90	(revision 10986)
@@ -173,4 +173,5 @@
          WRITE(numout,*) '      Logical switch for ensuring that the sa > salfixmin      ln_salfix = ', ln_salfix
          WRITE(numout,*) '      Minimum salinity after applying the increments           salfixmin = ', salfixmin
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -209,4 +210,5 @@
          WRITE(numout,*) '       ditiaustr_date = ', ditiaustr_date
          WRITE(numout,*) '       ditiaufin_date = ', ditiaufin_date
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -311,4 +313,5 @@
              WRITE(numout,*) '         Time-integrated weight = ', ztotwgt
              WRITE(numout,*) '         ==================================='
+             IF(lflush) CALL FLUSH(numout)
           ENDIF
          
@@ -347,4 +350,5 @@
             WRITE(numout,*) 'asm_inc_init : Assimilation increments valid between dates ', z_inc_dateb,' and ', z_inc_datef
             WRITE(numout,*) '~~~~~~~~~~~~'
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
          !
@@ -462,4 +466,5 @@
             WRITE(numout,*) '   ==>>>  Assimilation background state valid at : ', zdate_bkg
             WRITE(numout,*)
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
          !
@@ -491,5 +496,8 @@
       ENDIF
       !
-      IF(lwp) WRITE(numout,*) '   ==>>>   Euler time step switch is ', neuler
+      IF(lwp) THEN
+         WRITE(numout,*) '   ==>>>   Euler time step switch is ', neuler
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
       !
       IF( lk_asminc ) THEN                            !==  data assimilation  ==!
@@ -542,4 +550,5 @@
                WRITE(numout,*) 'tra_asm_inc : Tracer IAU at time step = ', kt,' with IAU weight = ', wgtiau(it)
                WRITE(numout,*) '~~~~~~~~~~~~'
+               IF(lflush) CALL FLUSH(numout)
             ENDIF
             !
@@ -657,4 +666,5 @@
                WRITE(numout,*) 'dyn_asm_inc : Dynamics IAU at time step = ', kt,' with IAU weight = ', wgtiau(it)
                WRITE(numout,*) '~~~~~~~~~~~~'
+               IF(lflush) CALL FLUSH(numout)
             ENDIF
             !
@@ -728,4 +738,5 @@
                   &  kt,' with IAU weight = ', wgtiau(it)
                WRITE(numout,*) '~~~~~~~~~~~~'
+               IF(lflush) CALL FLUSH(numout)
             ENDIF
             !
@@ -845,4 +856,5 @@
                WRITE(numout,*) 'seaice_asm_inc : sea ice conc IAU at time step = ', kt,' with IAU weight = ', wgtiau(it)
                WRITE(numout,*) '~~~~~~~~~~~~'
+               IF(lflush) CALL FLUSH(numout)
             ENDIF
             !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/BDY/bdydta.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/BDY/bdydta.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/BDY/bdydta.F90	(revision 10986)
@@ -449,8 +449,11 @@
       !!---------------------------------------------------------------------------
       !
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) 'bdy_dta_ini : initialization of data at the open boundaries'
-      IF(lwp) WRITE(numout,*) '~~~~~~~~~~'
-      IF(lwp) WRITE(numout,*) ''
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'bdy_dta_ini : initialization of data at the open boundaries'
+         WRITE(numout,*) '~~~~~~~~~~'
+         WRITE(numout,*) ''
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
 
       ! Set nn_dta
@@ -485,5 +488,8 @@
          ENDIF
 #endif               
-         IF(lwp) WRITE(numout,*) 'Maximum number of files to open =', nb_bdy_fld(jbdy)
+         IF(lwp) THEN
+            WRITE(numout,*) 'Maximum number of files to open =', nb_bdy_fld(jbdy)
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
       END DO            
 
@@ -532,5 +538,8 @@
 
                IF( dta%ll_ssh ) THEN 
-                  if(lwp) write(numout,*) '++++++ reading in ssh field'
+                  IF(lwp) THEN
+                     write(numout,*) '++++++ reading in ssh field'
+                     IF(lflush) CALL FLUSH(numout)
+                  ENDIF
                   jfld = jfld + 1
                   blf_i(jfld) = bn_ssh
@@ -543,5 +552,8 @@
 
                IF( dta%ll_u2d .and. .not. ln_full_vel_array(jbdy) ) THEN
-                  if(lwp) write(numout,*) '++++++ reading in u2d field'
+                  IF(lwp) THEN
+                     write(numout,*) '++++++ reading in u2d field'
+                     IF(lflush) CALL FLUSH(numout)
+                  ENDIF
                   jfld = jfld + 1
                   blf_i(jfld) = bn_u2d
@@ -554,5 +566,8 @@
 
                IF( dta%ll_v2d .and. .not. ln_full_vel_array(jbdy) ) THEN
-                  if(lwp) write(numout,*) '++++++ reading in v2d field'
+                  IF(lwp) THEN
+                     write(numout,*) '++++++ reading in v2d field'
+                     IF(lflush) CALL FLUSH(numout)
+                  ENDIF
                   jfld = jfld + 1
                   blf_i(jfld) = bn_v2d
@@ -572,5 +587,8 @@
 
                IF( dta%ll_u3d .OR. ( ln_full_vel_array(jbdy) .and. dta%ll_u2d ) ) THEN
-                  if(lwp) write(numout,*) '++++++ reading in u3d field'
+                  IF(lwp) THEN
+                     write(numout,*) '++++++ reading in u3d field'
+                     IF(lflush) CALL FLUSH(numout)
+                  ENDIF
                   jfld = jfld + 1
                   blf_i(jfld) = bn_u3d
@@ -583,5 +601,8 @@
 
                IF( dta%ll_v3d .OR. ( ln_full_vel_array(jbdy) .and. dta%ll_v2d ) ) THEN
-                  if(lwp) write(numout,*) '++++++ reading in v3d field'
+                  IF(lwp) THEN
+                     write(numout,*) '++++++ reading in v3d field'
+                     IF(lflush) CALL FLUSH(numout)
+                  ENDIF
                   jfld = jfld + 1
                   blf_i(jfld) = bn_v3d
@@ -599,5 +620,8 @@
 
                IF( dta%ll_tem ) THEN
-                  if(lwp) write(numout,*) '++++++ reading in tem field'
+                  IF(lwp) THEN
+                     write(numout,*) '++++++ reading in tem field'
+                     IF(lflush) CALL FLUSH(numout)
+                  ENDIF
                   jfld = jfld + 1
                   blf_i(jfld) = bn_tem
@@ -609,5 +633,8 @@
 
                IF( dta%ll_sal ) THEN
-                  if(lwp) write(numout,*) '++++++ reading in sal field'
+                  IF(lwp) THEN
+                     write(numout,*) '++++++ reading in sal field'
+                     IF(lflush) CALL FLUSH(numout)
+                  ENDIF
                   jfld = jfld + 1
                   blf_i(jfld) = bn_sal
@@ -732,8 +759,12 @@
             write(numout,*) '++++++ dta%ll_tem = ',dta%ll_tem
             write(numout,*) '++++++ dta%ll_sal = ',dta%ll_sal
+            IF(lflush) CALL FLUSH(numout)
          endif
 
          IF ( nn_dyn2d_dta(jbdy) == 0 .or. nn_dyn2d_dta(jbdy) == 2 ) THEN
-            if(lwp) write(numout,*) '++++++ dta%ssh/u2d/u3d allocated space'
+            IF(lwp) THEN
+               write(numout,*) '++++++ dta%ssh/u2d/u3d allocated space'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             IF( dta%ll_ssh ) ALLOCATE( dta%ssh(nblen(1)) )
             IF( dta%ll_u2d ) ALLOCATE( dta%u2d(nblen(2)) )
@@ -742,5 +773,8 @@
          IF ( nn_dyn2d_dta(jbdy) == 1 .or. nn_dyn2d_dta(jbdy) == 3 ) THEN
             IF( dta%ll_ssh ) THEN
-               if(lwp) write(numout,*) '++++++ dta%ssh pointing to fnow'
+               IF(lwp) THEN
+                  write(numout,*) '++++++ dta%ssh pointing to fnow'
+                  IF(lflush) CALL FLUSH(numout)
+               ENDIF
                jfld = jfld + 1
                dta%ssh => bf(jfld)%fnow(:,1,1)
@@ -748,8 +782,14 @@
             IF ( dta%ll_u2d ) THEN
                IF ( ln_full_vel_array(jbdy) ) THEN
-                  if(lwp) write(numout,*) '++++++ dta%u2d allocated space'
+                  IF(lwp) THEN
+                     write(numout,*) '++++++ dta%u2d allocated space'
+                     IF(lflush) CALL FLUSH(numout)
+                  ENDIF
                   ALLOCATE( dta%u2d(nblen(2)) )
                ELSE
-                  if(lwp) write(numout,*) '++++++ dta%u2d pointing to fnow'
+                  IF(lwp) THEN
+                     write(numout,*) '++++++ dta%u2d pointing to fnow'
+                     IF(lflush) CALL FLUSH(numout)
+                  ENDIF
                   jfld = jfld + 1
                   dta%u2d => bf(jfld)%fnow(:,1,1)
@@ -758,8 +798,14 @@
             IF ( dta%ll_v2d ) THEN
                IF ( ln_full_vel_array(jbdy) ) THEN
-                  if(lwp) write(numout,*) '++++++ dta%v2d allocated space'
+                  IF(lwp) THEN
+                     write(numout,*) '++++++ dta%v2d allocated space'
+                     IF(lflush) CALL FLUSH(numout)
+                  ENDIF
                   ALLOCATE( dta%v2d(nblen(3)) )
                ELSE
-                  if(lwp) write(numout,*) '++++++ dta%v2d pointing to fnow'
+                  IF(lwp) THEN
+                     write(numout,*) '++++++ dta%v2d pointing to fnow'
+                     IF(lflush) CALL FLUSH(numout)
+                  ENDIF
                   jfld = jfld + 1
                   dta%v2d => bf(jfld)%fnow(:,1,1)
@@ -769,5 +815,8 @@
 
          IF ( nn_dyn3d_dta(jbdy) == 0 ) THEN
-            if(lwp) write(numout,*) '++++++ dta%u3d/v3d allocated space'
+            IF(lwp) THEN
+               write(numout,*) '++++++ dta%u3d/v3d allocated space'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             IF( dta%ll_u3d ) ALLOCATE( dta_bdy(jbdy)%u3d(nblen(2),jpk) )
             IF( dta%ll_v3d ) ALLOCATE( dta_bdy(jbdy)%v3d(nblen(3),jpk) )
@@ -776,10 +825,16 @@
            &  ( ln_full_vel_array(jbdy) .and. ( nn_dyn2d_dta(jbdy) == 1 .or. nn_dyn2d_dta(jbdy) == 3 ) ) ) THEN
             IF ( dta%ll_u3d .or. ( ln_full_vel_array(jbdy) .and. dta%ll_u2d ) ) THEN
-               if(lwp) write(numout,*) '++++++ dta%u3d pointing to fnow'
+               IF(lwp) THEN
+                  write(numout,*) '++++++ dta%u3d pointing to fnow'
+                  IF(lflush) CALL FLUSH(numout)
+               ENDIF
                jfld = jfld + 1
                dta_bdy(jbdy)%u3d => bf(jfld)%fnow(:,1,:)
             ENDIF
             IF ( dta%ll_v3d .or. ( ln_full_vel_array(jbdy) .and. dta%ll_v2d ) ) THEN
-               if(lwp) write(numout,*) '++++++ dta%v3d pointing to fnow'
+               IF(lwp) THEN
+                  write(numout,*) '++++++ dta%v3d pointing to fnow'
+                  IF(lflush) CALL FLUSH(numout)
+               ENDIF
                jfld = jfld + 1
                dta_bdy(jbdy)%v3d => bf(jfld)%fnow(:,1,:)
@@ -788,15 +843,24 @@
 
          IF( nn_tra_dta(jbdy) == 0 ) THEN
-            if(lwp) write(numout,*) '++++++ dta%tem/sal allocated space'
+            IF(lwp) THEN
+               write(numout,*) '++++++ dta%tem/sal allocated space'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             IF( dta%ll_tem ) ALLOCATE( dta_bdy(jbdy)%tem(nblen(1),jpk) )
             IF( dta%ll_sal ) ALLOCATE( dta_bdy(jbdy)%sal(nblen(1),jpk) )
          ELSE
             IF( dta%ll_tem ) THEN
-               if(lwp) write(numout,*) '++++++ dta%tem pointing to fnow'
+               IF(lwp) THEN
+                  write(numout,*) '++++++ dta%tem pointing to fnow'
+                  IF(lflush) CALL FLUSH(numout)
+               ENDIF
                jfld = jfld + 1
                dta_bdy(jbdy)%tem => bf(jfld)%fnow(:,1,:)
             ENDIF
             IF( dta%ll_sal ) THEN 
-               if(lwp) write(numout,*) '++++++ dta%sal pointing to fnow'
+               IF(lwp) THEN
+                  write(numout,*) '++++++ dta%sal pointing to fnow'
+                  IF(lflush) CALL FLUSH(numout)
+               ENDIF
                jfld = jfld + 1
                dta_bdy(jbdy)%sal => bf(jfld)%fnow(:,1,:)
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/BDY/bdyini.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/BDY/bdyini.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/BDY/bdyini.F90	(revision 10986)
@@ -91,7 +91,10 @@
       ! -----------------------------------------
       IF ( ln_bdy ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'bdy_init : initialization of open boundaries'
-         IF(lwp) WRITE(numout,*) '~~~~~~~~'
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) 'bdy_init : initialization of open boundaries'
+            WRITE(numout,*) '~~~~~~~~'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          !
          ! Open boundaries definition (arrays and masks)
@@ -105,7 +108,10 @@
          !
       ELSE
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'bdy_init : open boundaries not used (ln_bdy = F)'
-         IF(lwp) WRITE(numout,*) '~~~~~~~~'
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) 'bdy_init : open boundaries not used (ln_bdy = F)'
+            WRITE(numout,*) '~~~~~~~~'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          !
       ENDIF
@@ -403,4 +409,6 @@
         ENDIF
      ENDIF
+
+     IF(lflush .AND. lwp) CALL FLUSH(numout)
 
       ! -------------------------------------------------
@@ -568,7 +576,10 @@
                !
                ibr_max = MAXVAL( nbrdta(:,igrd,ib_bdy) )
-               IF(lwp) WRITE(numout,*)
-               IF(lwp) WRITE(numout,*) ' Maximum rimwidth in file is ', ibr_max
-               IF(lwp) WRITE(numout,*) ' nn_rimwidth from namelist is ', nn_rimwidth(ib_bdy)
+               IF(lwp) THEN
+                  WRITE(numout,*)
+                  WRITE(numout,*) ' Maximum rimwidth in file is ', ibr_max
+                  WRITE(numout,*) ' nn_rimwidth from namelist is ', nn_rimwidth(ib_bdy)
+                  IF(lflush) CALL FLUSH(numout)
+               ENDIF
                IF (ibr_max < nn_rimwidth(ib_bdy))   &
                      CALL ctl_stop( 'nn_rimwidth is larger than maximum rimwidth in file',cn_coords_file(ib_bdy) )
@@ -1205,5 +1216,8 @@
                IF( i_offset == 1 .and. zefl + zwfl == 2 ) THEN
                   icount = icount + 1
-                  IF(lwp) WRITE(numout,*) 'Problem with igrd = ',igrd,' at (global) nbi, nbj : ',mig(nbi),mjg(nbj)
+                  IF(lwp) THEN
+                     WRITE(numout,*) 'Problem with igrd = ',igrd,' at (global) nbi, nbj : ',mig(nbi),mjg(nbj)
+                     IF(lflush) CALL FLUSH(numout)
+                  ENDIF
                ELSE
                   idx_bdy(ib_bdy)%flagu(ib,igrd) = -zefl + zwfl
@@ -1237,5 +1251,8 @@
                ! This error check only works if you are using the bdyXmask arrays
                IF( j_offset == 1 .and. znfl + zsfl == 2 ) THEN
-                  IF(lwp) WRITE(numout,*) 'Problem with igrd = ',igrd,' at (global) nbi, nbj : ',mig(nbi),mjg(nbj)
+                  IF(lwp) THEN
+                     WRITE(numout,*) 'Problem with igrd = ',igrd,' at (global) nbi, nbj : ',mig(nbi),mjg(nbj)
+                     IF(lflush) CALL FLUSH(numout)
+                  ENDIF
                   icount = icount + 1
                ELSE
@@ -1273,12 +1290,15 @@
       !!----------------------------------------------------------------------
       !
-      IF (lwp) WRITE(numout,*) ' '
-      IF (lwp) WRITE(numout,*) 'bdy_ctl_seg: Check analytical segments'
-      IF (lwp) WRITE(numout,*) '~~~~~~~~~~~~'
-      !
-      IF(lwp) WRITE(numout,*) 'Number of east  segments     : ', nbdysege
-      IF(lwp) WRITE(numout,*) 'Number of west  segments     : ', nbdysegw
-      IF(lwp) WRITE(numout,*) 'Number of north segments     : ', nbdysegn
-      IF(lwp) WRITE(numout,*) 'Number of south segments     : ', nbdysegs
+      IF (lwp) THEN
+         WRITE(numout,*) ' '
+         WRITE(numout,*) 'bdy_ctl_seg: Check analytical segments'
+         WRITE(numout,*) '~~~~~~~~~~~~'
+      !
+         WRITE(numout,*) 'Number of east  segments     : ', nbdysege
+         WRITE(numout,*) 'Number of west  segments     : ', nbdysegw
+         WRITE(numout,*) 'Number of north segments     : ', nbdysegn
+         WRITE(numout,*) 'Number of south segments     : ', nbdysegs
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
       ! 1. Check bounds
       !----------------
@@ -1322,5 +1342,8 @@
       ! 2. Look for segment crossings
       !------------------------------ 
-      IF (lwp) WRITE(numout,*) '**Look for segments corners  :'
+      IF (lwp) THEN
+         WRITE(numout,*) '**Look for segments corners  :'
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
       !
       itest = 0 ! corner number
@@ -1482,5 +1505,8 @@
             ELSE
                ! This is a corner
-               IF(lwp) WRITE(numout,*) 'Found a South-West corner at (i,j): ', jpiwob(ib), jpjwdt(ib)
+               IF(lwp) THEN
+                  WRITE(numout,*) 'Found a South-West corner at (i,j): ', jpiwob(ib), jpjwdt(ib)
+                  IF(lflush) CALL FLUSH(numout)
+               ENDIF
                CALL bdy_ctl_corn(npckgw(ib), icornw(ib,1))
                itest=itest+1
@@ -1494,5 +1520,8 @@
             ELSE
                ! This is a corner
-               IF(lwp) WRITE(numout,*) 'Found a North-West corner at (i,j): ', jpiwob(ib), jpjwft(ib)
+               IF(lwp) THEN
+                  WRITE(numout,*) 'Found a North-West corner at (i,j): ', jpiwob(ib), jpjwft(ib)
+                  IF(lflush) CALL FLUSH(numout)
+               ENDIF
                CALL bdy_ctl_corn(npckgw(ib), icornw(ib,2))
                itest=itest+1
@@ -1522,5 +1551,8 @@
             ELSE
                ! This is a corner
-               IF(lwp) WRITE(numout,*) 'Found a South-East corner at (i,j): ', jpieob(ib)+1, jpjedt(ib)
+               IF(lwp) THEN
+                  WRITE(numout,*) 'Found a South-East corner at (i,j): ', jpieob(ib)+1, jpjedt(ib)
+                  IF(lflush) CALL FLUSH(numout)
+               ENDIF
                CALL bdy_ctl_corn(npckge(ib), icorne(ib,1))
                itest=itest+1
@@ -1534,5 +1566,8 @@
             ELSE
                ! This is a corner
-               IF(lwp) WRITE(numout,*) 'Found a North-East corner at (i,j): ', jpieob(ib)+1, jpjeft(ib)
+               IF(lwp) THEN
+                  WRITE(numout,*) 'Found a North-East corner at (i,j): ', jpieob(ib)+1, jpjeft(ib)
+                  IF(lflush) CALL FLUSH(numout)
+               ENDIF
                CALL bdy_ctl_corn(npckge(ib), icorne(ib,2))
                itest=itest+1
@@ -1593,5 +1628,8 @@
       END DO
       !
-      IF ((itest==0).AND.(lwp)) WRITE(numout,*) 'NO open boundary corner found'
+      IF ((itest==0).AND.(lwp)) THEN
+         WRITE(numout,*) 'NO open boundary corner found'
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
       !
       ! Other tests TBD: 
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/BDY/bdytides.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/BDY/bdytides.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/BDY/bdytides.F90	(revision 10986)
@@ -82,8 +82,9 @@
       !!----------------------------------------------------------------------
       !
-      IF (nb_bdy>0) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'bdytide_init : initialization of tidal harmonic forcing at open boundaries'
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~'
+      IF (nb_bdy>0 .AND. lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'bdytide_init : initialization of tidal harmonic forcing at open boundaries'
+         WRITE(numout,*) '~~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -107,16 +108,17 @@
             IF(lwm .AND. nprint > 2) WRITE ( numond, nambdy_tide )
             !                                               ! Parameter control and print
-            IF(lwp) WRITE(numout,*) '  '
-            IF(lwp) WRITE(numout,*) '          Namelist nambdy_tide : tidal harmonic forcing at open boundaries'
-            IF(lwp) WRITE(numout,*) '             read tidal data in 2d files: ', ln_bdytide_2ddta
-            IF(lwp) WRITE(numout,*) '             assume complex conjugate   : ', ln_bdytide_conj
-            IF(lwp) WRITE(numout,*) '             Number of tidal components to read: ', nb_harmo
-            IF(lwp) THEN 
-                    WRITE(numout,*) '             Tidal components: ' 
+            IF(lwp) THEN
+               WRITE(numout,*) '  '
+               WRITE(numout,*) '          Namelist nambdy_tide : tidal harmonic forcing at open boundaries'
+               WRITE(numout,*) '             read tidal data in 2d files: ', ln_bdytide_2ddta
+               WRITE(numout,*) '             assume complex conjugate   : ', ln_bdytide_conj
+               WRITE(numout,*) '             Number of tidal components to read: ', nb_harmo
+               WRITE(numout,*) '             Tidal components: ' 
                DO itide = 1, nb_harmo
                   WRITE(numout,*)  '                 ', Wave(ntide(itide))%cname_tide 
                END DO
+               WRITE(numout,*) ' '
+               IF(lflush) CALL FLUSH(numout)
             ENDIF 
-            IF(lwp) WRITE(numout,*) ' '
 
             ! Allocate space for tidal harmonics data - get size from OBC data arrays
@@ -312,4 +314,5 @@
            WRITE(numout,*) 'bdytide_update : (re)Initialization of the tidal bdy forcing at kt=',kt
            WRITE(numout,*) '~~~~~~~~~~~~~~ '
+           IF(lflush) CALL FLUSH(numout)
         ENDIF
         !
@@ -419,7 +422,8 @@
                !
                IF(lwp) THEN
-               WRITE(numout,*)
-               WRITE(numout,*) 'bdy_tide_dta : Refresh nodal factors for tidal open bdy data at kt=',kt
-               WRITE(numout,*) '~~~~~~~~~~~~~~ '
+                  WRITE(numout,*)
+                  WRITE(numout,*) 'bdy_tide_dta : Refresh nodal factors for tidal open bdy data at kt=',kt
+                  WRITE(numout,*) '~~~~~~~~~~~~~~ '
+                  IF(lflush) CALL FLUSH(numout)
                ENDIF
                !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/BDY/bdyvol.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/BDY/bdyvol.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/BDY/bdyvol.F90	(revision 10986)
@@ -163,11 +163,14 @@
 
 
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*)'bdy_vol : time step :', kt
-         IF(lwp) WRITE(numout,*)'~~~~~~~ '
-         IF(lwp) WRITE(numout,*)'          cumulate flux EMP             =', z_cflxemp  , ' (m3/s)'
-         IF(lwp) WRITE(numout,*)'          total lateral surface of OBC  =', bdysurftot, '(m2)'
-         IF(lwp) WRITE(numout,*)'          correction velocity zubtpecor =', zubtpecor , '(m/s)'
-         IF(lwp) WRITE(numout,*)'          cumulated transport ztranst   =', ztranst   , '(m3/s)'
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*)'bdy_vol : time step :', kt
+            WRITE(numout,*)'~~~~~~~ '
+            WRITE(numout,*)'          cumulate flux EMP             =', z_cflxemp  , ' (m3/s)'
+            WRITE(numout,*)'          total lateral surface of OBC  =', bdysurftot, '(m2)'
+            WRITE(numout,*)'          correction velocity zubtpecor =', zubtpecor , '(m/s)'
+            WRITE(numout,*)'          cumulated transport ztranst   =', ztranst   , '(m3/s)'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
       END IF 
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/C1D/c1d.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/C1D/c1d.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/C1D/c1d.F90	(revision 10986)
@@ -67,4 +67,5 @@
          WRITE(numout,*) '      column longitude                rn_lon1d     = ', rn_lon1d
          WRITE(numout,*) '      column localization in a grid   ln_c1d_locpt = ', ln_c1d_locpt
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/C1D/dtauvd.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/C1D/dtauvd.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/C1D/dtauvd.F90	(revision 10986)
@@ -84,4 +84,5 @@
             WRITE(numout,*) '   U & V current data not used'
          ENDIF
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !                             ! no initialization when restarting
@@ -155,4 +156,5 @@
             WRITE(numout,*)
             WRITE(numout,*) 'dta_uvd: interpolate U & V current data onto the s- or mixed s-z-coordinate mesh'
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
          !
@@ -210,5 +212,8 @@
       IF( .NOT. ln_uvd_dyndmp    ) THEN   !==   deallocate U & V current structure   ==! 
          !                                !==   (data used only for initialization)  ==!
-         IF(lwp) WRITE(numout,*) 'dta_uvd: deallocate U & V current arrays as they are only used to initialize the run'
+         IF(lwp) THEN
+            WRITE(numout,*) 'dta_uvd: deallocate U & V current arrays as they are only used to initialize the run'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
                                    DEALLOCATE( sf_uvd(1)%fnow )     ! U current arrays in the structure
          IF( sf_uvd(1)%ln_tint )   DEALLOCATE( sf_uvd(1)%fdta )
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/C1D/dyncor_c1d.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/C1D/dyncor_c1d.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/C1D/dyncor_c1d.F90	(revision 10986)
@@ -48,7 +48,10 @@
       !!----------------------------------------------------------------------
 
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) 'cor_c1d : Coriolis factor at T-point'
-      IF(lwp) WRITE(numout,*) '~~~~~~~'
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'cor_c1d : Coriolis factor at T-point'
+         WRITE(numout,*) '~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
 
       !
@@ -68,8 +71,9 @@
       !!----------------------------------------------------------------------
       !
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'dyn_cor_c1d : total vorticity trend in 1D'
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~'
+      IF( kt == nit000 .AND. lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'dyn_cor_c1d : total vorticity trend in 1D'
+         WRITE(numout,*) '~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/C1D/dyndmp.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/C1D/dyndmp.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/C1D/dyndmp.F90	(revision 10986)
@@ -98,4 +98,5 @@
          WRITE(numout,*) '      Damping file name               cn_resto  = ', cn_resto
          WRITE(numout,*)
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -112,4 +113,5 @@
             CALL ctl_stop(ctmp1)
          END SELECT
+         IF(lwp .AND. lflush) CALL FLUSH(numout)
          !
          IF( .NOT. ln_uvd_dyndmp ) THEN      ! force the initialization of U & V current data for damping
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/CRS/crsdom.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/CRS/crsdom.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/CRS/crsdom.F90	(revision 10986)
@@ -2085,4 +2085,5 @@
          WRITE(numout,*) ' njmpp_full  = ', njmpp_full
          WRITE(numout,*)
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       
@@ -2147,5 +2148,8 @@
 
          CASE ( 2 ) 
-            WRITE(numout,*)  'crs_init, jperio=2 not supported' 
+            IF(lwp) THEN
+               WRITE(numout,*)  'crs_init, jperio=2 not supported' 
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
         
          CASE ( 5, 6 )    ! F-pivot at North Fold
@@ -2178,10 +2182,16 @@
 
          CASE DEFAULT
-            WRITE(numout,*) 'crs_init. Only jperio = 0, 1, 3, 4, 5, 6 supported' 
+            IF(lwp) THEN
+               WRITE(numout,*) 'crs_init. Only jperio = 0, 1, 3, 4, 5, 6 supported' 
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
  
          END SELECT
 
       CASE (1 )
-         WRITE(numout,*) 'crs_init.  Equator-centered bins option not yet available' 
+         IF(lwp) THEN
+            WRITE(numout,*) 'crs_init.  Equator-centered bins option not yet available' 
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
 
       END SELECT
@@ -2250,7 +2260,10 @@
 
       !
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) '    crsini : mbkt is ocean bottom k-index of T-, U-, V- and W-levels '
-      IF(lwp) WRITE(numout,*) '    ~~~~~~~~~~~~~'
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) '    crsini : mbkt is ocean bottom k-index of T-, U-, V- and W-levels '
+         WRITE(numout,*) '    ~~~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
       !
       mbkt_crs(:,:) = MAX( mbathy_crs(:,:) , 1 )    ! bottom k-index of T-level (=1 over land)
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/CRS/crsdomwri.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/CRS/crsdomwri.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/CRS/crsdomwri.F90	(revision 10986)
@@ -58,7 +58,10 @@
       !
       !
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) 'crs_dom_wri : create NetCDF mesh and mask file'
-      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'crs_dom_wri : create NetCDF mesh and mask file'
+         WRITE(numout,*) '~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
       
       clnam = 'mesh_mask_crs'  ! filename (mesh and mask informations)
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/CRS/crsini.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/CRS/crsini.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/CRS/crsini.F90	(revision 10986)
@@ -99,4 +99,5 @@
         WRITE(numout,*) '      type of Kz coarsening (0,1,2)         nn_crs_kz  = ', nn_crs_kz
         WRITE(numout,*) '      wn coarsened or computed using hdivn  ln_crs_wn  = ', ln_crs_wn
+        IF(lflush) CALL FLUSH(numout)
      ENDIF
               
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DIA/dia25h.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DIA/dia25h.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DIA/dia25h.F90	(revision 10986)
@@ -67,4 +67,5 @@
          WRITE(numout,*) '   Namelist nam_dia25h : set 25h outputs '
          WRITE(numout,*) '      Switch for 25h diagnostics (T) or not (F)  ln_dia25h  = ', ln_dia25h
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       IF( .NOT. ln_dia25h )   RETURN
@@ -159,4 +160,5 @@
               WRITE(numout,*) 'dia_wri_tide : Summing instantaneous hourly diagnostics at timestep ',kt
               WRITE(numout,*) '~~~~~~~~~~~~ '
+              IF(lflush) CALL FLUSH(numout)
          ENDIF
 
@@ -180,4 +182,5 @@
          IF (lwp) THEN
             WRITE(numout,*) 'dia_tide : Summed the following number of hourly values so far',cnt_25h
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
          !
@@ -190,4 +193,5 @@
             WRITE(numout,*) 'dia_wri_tide : Writing 25 hour mean tide diagnostics at timestep', kt
             WRITE(numout,*) '~~~~~~~~~~~~ '
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
          !
@@ -208,5 +212,8 @@
          ENDIF
          !
-         IF(lwp)  WRITE(numout,*) 'dia_wri_tide : Mean calculated by dividing 25 hour sums and writing output'
+         IF(lwp)  THEN
+            WRITE(numout,*) 'dia_wri_tide : Mean calculated by dividing 25 hour sums and writing output'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          zmdi=1.e+20 !missing data indicator for masking
          ! write tracers (instantaneous)
@@ -261,6 +268,9 @@
          ENDIF
          cnt_25h = 1
-         IF(lwp)  WRITE(numout,*) 'dia_wri_tide :   &
+         IF(lwp)  THEN
+            WRITE(numout,*) 'dia_wri_tide :   &
             &    After 25hr mean write, reset sum to current value and cnt_25h to one for overlapping average', cnt_25h
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
       ENDIF !  cnt_25h .EQ. 25 .AND.  MOD( kt, i_steps * 24) == 0 .AND. kt .NE. nn_it000
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DIA/diacfl.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DIA/diacfl.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DIA/diacfl.F90	(revision 10986)
@@ -142,4 +142,5 @@
          WRITE(numout,*) '   Max Cv = ', rCv_max, ' at (i,j,k) = (',nCv_loc(1),nCv_loc(2),nCv_loc(3),') => dt/C = ', z2dt/rCv_max
          WRITE(numout,*) '   Max Cw = ', rCw_max, ' at (i,j,k) = (',nCw_loc(1),nCw_loc(2),nCw_loc(3),') => dt/C = ', z2dt/rCw_max
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -166,4 +167,5 @@
          WRITE(numcfl,*) 'Timestep  Direction  Max C     i    j    k'
          WRITE(numcfl,*) '******************************************'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DIA/diadct.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DIA/diadct.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DIA/diadct.F90	(revision 10986)
@@ -158,5 +158,5 @@
         IF(nn_dct .GE. nn_dctwri .AND. MOD(nn_dct,nn_dctwri) .NE. 0)  &
           &  CALL ctl_stop( 'diadct: nn_dct should be smaller and a multiple of nn_dctwri' )
-
+        IF(lflush) CALL FLUSH(numout)
      ENDIF
 
@@ -222,4 +222,5 @@
          WRITE(numout,*) "~~~~~~~~~~~~~~~~~~~~~~~~~"
          WRITE(numout,*) "nb_sec = ",nb_sec
+         IF(lflush) CALL FLUSH(numout)
      ENDIF
 
@@ -241,5 +242,8 @@
         IF( MOD(kt,nn_dctwri)==0 )THEN
 
-           IF( kt==nit000+nn_dctwri-1 )WRITE(numout,*)"      diadct: average transports and write at kt = ",kt         
+           IF( kt==nit000+nn_dctwri-1 ) THEN
+              WRITE(numout,*)"      diadct: average transports and write at kt = ",kt         
+              IF(lflush) CALL FLUSH(numout)
+           ENDIF
   
            !! divide arrays by nn_dctwri/nn_dct to obtain average 
@@ -321,6 +325,8 @@
      DO jsec=1,nb_sec_max      !loop on the nb_sec sections
 
-        IF (  jsec==nn_secdebug .OR. nn_secdebug==-1  ) &
-           & WRITE(numout,*)'debuging for section number: ',jsec 
+        IF (  jsec==nn_secdebug .OR. nn_secdebug==-1  ) THEN
+           WRITE(numout,*)'debuging for section number: ',jsec 
+           IF(lflush) CALL FLUSH(numout)
+        ENDIF
 
         !initialization
@@ -341,5 +347,8 @@
         IF( jsec .NE. isec )  CALL ctl_stop( cltmp )
 
-        IF( jsec==nn_secdebug .OR. nn_secdebug==-1 )WRITE(numout,*)"isec ",isec 
+        IF( jsec==nn_secdebug .OR. nn_secdebug==-1 ) THEN
+           WRITE(numout,*)"isec ",isec 
+           IF(lflush) CALL FLUSH(numout)
+        ENDIF
 
         READ(numdct_in)secs(jsec)%name
@@ -376,4 +385,5 @@
             WRITE(numout,clformat)"      Temperature classes :             ",secs(jsec)%ztem
             WRITE(numout,clformat)"      Depth classes :                   ",secs(jsec)%zlay
+            IF(lflush) CALL FLUSH(numout)
         ENDIF               
 
@@ -398,4 +408,5 @@
                  WRITE(numout,*)'        # I J ',jpt,coordtemp(jpt),directemp(jpt)
               ENDDO                  
+              IF(lflush) CALL FLUSH(numout)
            ENDIF
  
@@ -434,4 +445,5 @@
                  WRITE(numout,*)'         # I J : ',iiglo,ijglo
               ENDDO
+              IF(lflush) CALL FLUSH(numout)
            ENDIF
 
@@ -468,11 +480,13 @@
                  ijglo = secs(jsec)%listPoint(jpt)%J + njmpp - 1
                  WRITE(numout,*)'         # I J : ',iiglo,ijglo
-                 CALL FLUSH(numout)
+                 IF(lflush) CALL FLUSH(numout)
               ENDDO
            ENDIF
 
         ELSE  ! iptglo = 0
-           IF( jsec==nn_secdebug .OR. nn_secdebug==-1 )&
+           IF( jsec==nn_secdebug .OR. nn_secdebug==-1 ) THEN
               WRITE(numout,*)'   No points for this section.'
+              IF(lflush) CALL FLUSH(numout)
+           ENDIF
         ENDIF
 
@@ -510,6 +524,9 @@
      !----------------------------------------------------------------------------
      !
-     IF( ld_debug )WRITE(numout,*)'      -------------------------'
-     IF( ld_debug )WRITE(numout,*)'      removepoints in listpoint'
+     IF( ld_debug ) THEN
+        WRITE(numout,*)'      -------------------------'
+        WRITE(numout,*)'      removepoints in listpoint'
+        IF(lflush) CALL FLUSH(numout)
+     ENDIF
 
      !iextr=extremity of list_point that we verify
@@ -529,4 +546,5 @@
         WRITE(numout,*)'      ', cdind,' ',cdextr,' ',itest
         WRITE(numout,*)'      Actual number of points: ',sec%nb_point
+        IF(lflush) CALL FLUSH(numout)
      ENDIF
 
@@ -556,4 +574,5 @@
         WRITE(numout,*)'      Number of points after removepoints :',sec%nb_point
         WRITE(numout,*)'      sec%direction after removepoints :',sec%direction(1:sec%nb_point)
+        IF(lflush) CALL FLUSH(numout)
      ENDIF
       !
@@ -592,5 +611,8 @@
       !!--------------------------------------------------------
       !
-      IF( ld_debug )WRITE(numout,*)'      Compute transport'
+      IF( ld_debug ) THEN
+         WRITE(numout,*)'      Compute transport'
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
 
       !---------------------------!
@@ -626,5 +648,8 @@
          IF( sec%slopeSection .GE. 9999. )     isgnv =  1
 
-         IF( ld_debug )write(numout,*)"sec%slopeSection isgnu isgnv ",sec%slopeSection,isgnu,isgnv
+         IF( ld_debug ) THEN
+            write(numout,*)"sec%slopeSection isgnu isgnv ",sec%slopeSection,isgnu,isgnv
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
 
          !--------------------------------------!
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DIA/diaharm.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DIA/diaharm.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DIA/diaharm.F90	(revision 10986)
@@ -81,4 +81,5 @@
          WRITE(numout,*) 'dia_harm_init: Tidal harmonic analysis initialization'
          WRITE(numout,*) '~~~~~~~ '
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -99,4 +100,5 @@
          WRITE(numout,*) 'Last  time step used for analysis:  nitend_han= ', nitend_han
          WRITE(numout,*) 'Time step frequency for harmonic analysis:  nstep_han= ', nstep_han
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -123,5 +125,5 @@
          WRITE(numout,*) '        Namelist nam_diaharm'
          WRITE(numout,*) '        nb_ana    = ', nb_ana
-         CALL flush(numout)
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -148,9 +150,11 @@
       CALL tide_harmo( ana_freq, vt, ut, ft, name, nb_ana )
 
-      IF(lwp) WRITE(numout,*) 'Analysed frequency  : ',nb_ana ,'Frequency '
-
-      DO jh = 1, nb_ana
-        IF(lwp) WRITE(numout,*) '                    : ',tname(jh),' ',ana_freq(jh)
-      END DO
+      IF(lwp) THEN
+         WRITE(numout,*) 'Analysed frequency  : ',nb_ana ,'Frequency '
+         DO jh = 1, nb_ana
+            WRITE(numout,*) '                    : ',tname(jh),' ',ana_freq(jh)
+         END DO
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
 
       ! Initialize temporary arrays:
@@ -228,7 +232,10 @@
       !!--------------------------------------------------------------------
       !
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) 'anharmo_end: kt=nitend_han: Perform harmonic analysis'
-      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~'
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'anharmo_end: kt=nitend_han: Perform harmonic analysis'
+         WRITE(numout,*) '~~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
 
       ztime_ini = nit000_han*rdt                 ! Initial time in seconds at the beginning of analysis
@@ -382,7 +389,10 @@
       !!----------------------------------------------------------------------
 
-      IF(lwp) WRITE(numout,*) '  '
-      IF(lwp) WRITE(numout,*) 'dia_wri_harm : Write harmonic analysis results'
-      IF(lwp) WRITE(numout,*) '  '
+      IF(lwp) THEN
+         WRITE(numout,*) '  '
+         WRITE(numout,*) 'dia_wri_harm : Write harmonic analysis results'
+         WRITE(numout,*) '  '
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
 
       ! A) Elevation
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DIA/diahsb.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DIA/diahsb.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DIA/diahsb.F90	(revision 10986)
@@ -211,5 +211,5 @@
          CALL iom_put( 'bgvole3t' , zdiff_v2 * 1.e-9    )              ! volume e3t drift      (km3)  
          !
-         IF( kt == nitend .AND. lwp) THEN
+         IF( kt == nitend .AND. lwp .AND. nprint > 0) THEN
             WRITE(numout,*)
             WRITE(numout,*) 'dia_hsb : last time step hsb diagnostics: at it= ', kt,' date= ', ndastp
@@ -219,4 +219,5 @@
             WRITE(numout,*) '   volume ssh  drift = ', zdiff_v1 * 1.e-9   , ' km^3'
             WRITE(numout,*) '   volume e3t  drift = ', zdiff_v2 * 1.e-9   , ' km^3'
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
          !
@@ -257,7 +258,10 @@
          IF( ln_rstart ) THEN                   !* Read the restart file
             !
-            IF(lwp) WRITE(numout,*)
-            IF(lwp) WRITE(numout,*) '   dia_hsb_rst : read hsb restart at it= ', kt,' date= ', ndastp
-            IF(lwp) WRITE(numout,*)
+            IF(lwp) THEN
+               WRITE(numout,*)
+               WRITE(numout,*) '   dia_hsb_rst : read hsb restart at it= ', kt,' date= ', ndastp
+               WRITE(numout,*)
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             CALL iom_get( numror, 'frc_v', frc_v, ldxios = lrxios )
             CALL iom_get( numror, 'frc_t', frc_t, ldxios = lrxios )
@@ -277,7 +281,9 @@
             ENDIF
          ELSE
-            IF(lwp) WRITE(numout,*)
-            IF(lwp) WRITE(numout,*) '   dia_hsb_rst : initialise hsb at initial state '
-            IF(lwp) WRITE(numout,*)
+            IF(lwp) THEN
+               WRITE(numout,*)
+               WRITE(numout,*) '   dia_hsb_rst : initialise hsb at initial state '
+               WRITE(numout,*)
+            ENDIF
             surf_ini(:,:) = e1e2t(:,:) * tmask_i(:,:)         ! initial ocean surface
             ssh_ini(:,:) = sshn(:,:)                          ! initial ssh
@@ -310,7 +316,10 @@
       ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN   ! Create restart file
          !                                   ! -------------------
-         IF(lwp .AND. nprint > 0) WRITE(numout,*)
-         IF(lwp .AND. nprint > 0) WRITE(numout,*) '   dia_hsb_rst : write restart at it= ', kt,' date= ', ndastp
-         IF(lwp .AND. nprint > 0) WRITE(numout,*)
+         IF(lwp .AND. nprint > 0) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) '   dia_hsb_rst : write restart at it= ', kt,' date= ', ndastp
+            WRITE(numout,*)
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          !
          IF( lwxios ) CALL iom_swap(      cwxios_context          )
@@ -359,4 +368,5 @@
          WRITE(numout,*) 'dia_hsb_init : heat and salt budgets diagnostics'
          WRITE(numout,*) '~~~~~~~~~~~~ '
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       REWIND( numnam_ref )              ! Namelist namhsb in reference namelist
@@ -371,4 +381,5 @@
          WRITE(numout,*) '   Namelist  namhsb :'
          WRITE(numout,*) '      check the heat and salt budgets (T) or not (F)       ln_diahsb = ', ln_diahsb
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DIA/diahth.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DIA/diahth.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DIA/diahth.F90	(revision 10986)
@@ -127,8 +127,11 @@
          END IF
 
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'dia_hth : diagnostics of the thermocline depth'
-         IF(lwp) WRITE(numout,*) '~~~~~~~ '
-         IF(lwp) WRITE(numout,*)
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) 'dia_hth : diagnostics of the thermocline depth'
+            WRITE(numout,*) '~~~~~~~ '
+            WRITE(numout,*)
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
       ENDIF
 
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DIA/diaptr.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DIA/diaptr.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DIA/diaptr.F90	(revision 10986)
@@ -407,4 +407,5 @@
          WRITE(numout,*) '      Poleward heat & salt transport (T) or not (F)      ln_diaptr  = ', ln_diaptr
          WRITE(numout,*) '      Global (F) or glo/Atl/Pac/Ind/Indo-Pac basins      ln_subbas  = ', ln_subbas
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DIA/diatmb.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DIA/diatmb.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DIA/diatmb.F90	(revision 10986)
@@ -56,4 +56,5 @@
          WRITE(numout,*) '   Namelist nam_diatmb : set tmb outputs '
          WRITE(numout,*) '      Switch for TMB diagnostics (T) or not (F)  ln_diatmb  = ', ln_diatmb
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DIA/diawri.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DIA/diawri.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DIA/diawri.F90	(revision 10986)
@@ -430,5 +430,4 @@
       INTEGER, INTENT( in ) ::   kt   ! ocean time-step index
       !
-      LOGICAL ::   ll_print = .FALSE.                        ! =T print and flush numout
       CHARACTER (len=40) ::   clhstnam, clop, clmx           ! local names
       INTEGER  ::   inum = 11                                ! temporary logical unit
@@ -488,12 +487,12 @@
          CALL ymds2ju( nyear, nmonth, nday, rdt, zjulian )
          zjulian = zjulian - adatrj   !   set calendar origin to the beginning of the experiment
-         IF(lwp)WRITE(numout,*)
-         IF(lwp)WRITE(numout,*) 'Date 0 used :', nit000, ' YEAR ', nyear,   &
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) 'Date 0 used :', nit000, ' YEAR ', nyear,   &
             &                    ' MONTH ', nmonth, ' DAY ', nday, 'Julian day : ', zjulian
-         IF(lwp)WRITE(numout,*) ' indexes of zoom = ', iimi, iima, ijmi, ijma,   &
+            WRITE(numout,*) ' indexes of zoom = ', iimi, iima, ijmi, ijma,   &
                                  ' limit storage in depth = ', ipk
-
-         ! WRITE root name in date.file for use by postpro
-         IF(lwp) THEN
+            IF(lflush) CALL FLUSH(numout)
+            ! WRITE root name in date.file for use by postpro
             CALL dia_nam( clhstnam, nwrite,' ' )
             CALL ctl_opn( inum, 'date.file', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea )
@@ -505,5 +504,8 @@
 
          CALL dia_nam( clhstnam, nwrite, 'grid_T' )
-         IF(lwp) WRITE(numout,*) " Name of NETCDF file ", clhstnam    ! filename
+         IF(lwp) THEN
+            WRITE(numout,*) " Name of NETCDF file ", clhstnam    ! filename
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,           &  ! Horizontal grid: glamt and gphit
             &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       &
@@ -541,5 +543,8 @@
 
          CALL dia_nam( clhstnam, nwrite, 'grid_U' )
-         IF(lwp) WRITE(numout,*) " Name of NETCDF file ", clhstnam    ! filename
+         IF(lwp) THEN
+            WRITE(numout,*) " Name of NETCDF file ", clhstnam    ! filename
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          CALL histbeg( clhstnam, jpi, glamu, jpj, gphiu,           &  ! Horizontal grid: glamu and gphiu
             &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       &
@@ -554,5 +559,8 @@
 
          CALL dia_nam( clhstnam, nwrite, 'grid_V' )                   ! filename
-         IF(lwp) WRITE(numout,*) " Name of NETCDF file ", clhstnam
+         IF(lwp) THEN
+            WRITE(numout,*) " Name of NETCDF file ", clhstnam
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          CALL histbeg( clhstnam, jpi, glamv, jpj, gphiv,           &  ! Horizontal grid: glamv and gphiv
             &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       &
@@ -567,5 +575,8 @@
 
          CALL dia_nam( clhstnam, nwrite, 'grid_W' )                   ! filename
-         IF(lwp) WRITE(numout,*) " Name of NETCDF file ", clhstnam
+         IF(lwp) THEN
+            WRITE(numout,*) " Name of NETCDF file ", clhstnam
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,           &  ! Horizontal grid: glamt and gphit
             &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       &
@@ -737,7 +748,9 @@
          CALL histend( nid_W, snc4chunks=snc4set )
 
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'End of NetCDF Initialization'
-         IF(ll_print) CALL FLUSH(numout )
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) 'End of NetCDF Initialization'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
 
       ENDIF
@@ -753,4 +766,5 @@
          WRITE(numout,*) 'dia_wri : write model outputs in NetCDF files at ', kt, 'time-step'
          WRITE(numout,*) '~~~~~~ '
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -887,8 +901,11 @@
       !!----------------------------------------------------------------------
       ! 
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) 'dia_wri_state : single instantaneous ocean state'
-      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~   and forcing fields file created '
-      IF(lwp) WRITE(numout,*) '                and named :', cdfile_name, '...nc'
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'dia_wri_state : single instantaneous ocean state'
+         WRITE(numout,*) '~~~~~~~~~~~~~   and forcing fields file created '
+         WRITE(numout,*) '                and named :', cdfile_name, '...nc'
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
 
 #if defined key_si3
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/closea.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/closea.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/closea.F90	(revision 10986)
@@ -97,7 +97,10 @@
       !!----------------------------------------------------------------------
       !
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*)'dom_clo : read in masks to define closed seas '
-      IF(lwp) WRITE(numout,*)'~~~~~~~'
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*)'dom_clo : read in masks to define closed seas '
+         WRITE(numout,*)'~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
       !
       ! read the closed seas masks (if they exist) from domain_cfg file (if it exists)
@@ -120,13 +123,19 @@
             CALL mpp_max('closea', jncs)
             IF( jncs > 0 ) THEN
-               IF( lwp ) WRITE(numout,*) 'Number of closed seas : ',jncs
+               IF( lwp ) THEN
+                  WRITE(numout,*) 'Number of closed seas : ',jncs
+                  IF(lflush) CALL FLUSH(numout)
+               ENDIF
             ELSE
                CALL ctl_stop( 'Problem with closea_mask field in domain_cfg file. Has no values > 0 so no closed seas defined.')
             ENDIF
          ELSE 
-            IF( lwp ) WRITE(numout,*)
-            IF( lwp ) WRITE(numout,*) '   ==>>>   closea_mask field not found in domain_cfg file.'
-            IF( lwp ) WRITE(numout,*) '           No closed seas defined.'
-            IF( lwp ) WRITE(numout,*)
+            IF( lwp ) THEN
+               WRITE(numout,*)
+               WRITE(numout,*) '   ==>>>   closea_mask field not found in domain_cfg file.'
+               WRITE(numout,*) '           No closed seas defined.'
+               WRITE(numout,*)
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             l_sbc_clo = .false.
             jncs = 0 
@@ -148,10 +157,16 @@
                CALL mpp_max('closea', jncsr)
                IF( jncsr > 0 ) THEN
-                  IF( lwp ) WRITE(numout,*) 'Number of closed seas rnf mappings : ',jncsr
+                  IF( lwp ) THEN
+                     WRITE(numout,*) 'Number of closed seas rnf mappings : ',jncsr
+                     IF(lflush) CALL FLUSH(numout)
+                  ENDIF
                ELSE
                   CALL ctl_stop( 'Problem with closea_mask_rnf field in domain_cfg file. Has no values > 0 so no closed seas rnf mappings defined.')
                ENDIF
             ELSE 
-               IF( lwp ) WRITE(numout,*) 'closea_mask_rnf field not found in domain_cfg file. No closed seas rnf mappings defined.'
+               IF( lwp ) THEN
+                  WRITE(numout,*) 'closea_mask_rnf field not found in domain_cfg file. No closed seas rnf mappings defined.'
+                  IF(lflush) CALL FLUSH(numout)
+               ENDIF
                jncsr = 0
             ENDIF
@@ -168,10 +183,16 @@
                CALL mpp_max('closea', jncse)
                IF( jncse > 0 ) THEN 
-                  IF( lwp ) WRITE(numout,*) 'Number of closed seas empmr mappings : ',jncse
+                  IF( lwp ) THEN
+                     WRITE(numout,*) 'Number of closed seas empmr mappings : ',jncse
+                     IF(lflush) CALL FLUSH(numout)
+                  ENDIF
                ELSE
                   CALL ctl_stop( 'Problem with closea_mask_empmr field in domain_cfg file. Has no values > 0 so no closed seas empmr mappings defined.')
                ENDIF
             ELSE 
-               IF( lwp ) WRITE(numout,*) 'closea_mask_empmr field not found in domain_cfg file. No closed seas empmr mappings defined.'
+               IF( lwp ) THEN
+                  WRITE(numout,*) 'closea_mask_empmr field not found in domain_cfg file. No closed seas empmr mappings defined.'
+                  IF(lflush) CALL FLUSH(numout)
+               ENDIF
                jncse = 0
             ENDIF
@@ -182,5 +203,8 @@
          !
       ELSE ! ln_read_cfg = .false. so no domain_cfg file
-         IF( lwp ) WRITE(numout,*) 'No domain_cfg file so no closed seas defined.'
+         IF( lwp ) THEN
+            WRITE(numout,*) 'No domain_cfg file so no closed seas defined.'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          l_sbc_clo = .false.
          l_clo_rnf = .false.
@@ -219,7 +243,10 @@
       IF( kt == nit000 ) THEN                             !  Initialisation  !
          !                                                !------------------!
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*)'sbc_clo : closed seas '
-         IF(lwp) WRITE(numout,*)'~~~~~~~'
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*)'sbc_clo : closed seas '
+            WRITE(numout,*)'~~~~~~~'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
 
          ALLOCATE( surf(jncs+1) , STAT=ierr )
@@ -267,22 +294,25 @@
          ENDIF
          !
-         IF(lwp) WRITE(numout,*)'     Closed sea surface areas (km2)'
-         DO jc = 1, jncs
-            IF(lwp) WRITE(numout,FMT='(1I3,5X,ES12.2)') jc, surf(jc) * 1.0e-6
-         END DO
-         IF(lwp) WRITE(numout,FMT='(A,ES12.2)') 'Global surface area excluding closed seas (km2): ', surf(jncs+1) * 1.0e-6
-         !
-         IF(jncsr > 0) THEN
-            IF(lwp) WRITE(numout,*)'     Closed sea target rnf surface areas (km2)'
-            DO jcr = 1, jncsr
-               IF(lwp) WRITE(numout,FMT='(1I3,5X,ES12.2)') jcr, surfr(jcr) * 1.0e-6
+         IF(lwp) THEN
+            WRITE(numout,*)'     Closed sea surface areas (km2)'
+            DO jc = 1, jncs
+               WRITE(numout,FMT='(1I3,5X,ES12.2)') jc, surf(jc) * 1.0e-6
             END DO
-         ENDIF
-         !
-         IF(jncse > 0) THEN
-            IF(lwp) WRITE(numout,*)'     Closed sea target empmr surface areas (km2)'
-            DO jce = 1, jncse
-               IF(lwp) WRITE(numout,FMT='(1I3,5X,ES12.2)') jce, surfe(jce) * 1.0e-6
-            END DO
+            WRITE(numout,FMT='(A,ES12.2)') 'Global surface area excluding closed seas (km2): ', surf(jncs+1) * 1.0e-6
+         !
+            IF(jncsr > 0) THEN
+               WRITE(numout,*)'     Closed sea target rnf surface areas (km2)'
+               DO jcr = 1, jncsr
+                  WRITE(numout,FMT='(1I3,5X,ES12.2)') jcr, surfr(jcr) * 1.0e-6
+               END DO
+            ENDIF
+         !
+            IF(jncse > 0) THEN
+               WRITE(numout,*)'     Closed sea target empmr surface areas (km2)'
+               DO jce = 1, jncse
+                  WRITE(numout,FMT='(1I3,5X,ES12.2)') jce, surfe(jce) * 1.0e-6
+               END DO
+            ENDIF
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
       ENDIF
@@ -453,4 +483,5 @@
          WRITE(numout,*) 'clo_bat : suppression of closed seas'
          WRITE(numout,*) '~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -461,5 +492,8 @@
          id = iom_varid(inum, 'closea_mask', ldstop = .false.)      
          IF( id > 0 ) THEN
-            IF( lwp ) WRITE(numout,*) 'Suppressing closed seas in bathymetry based on closea_mask field,'
+            IF( lwp ) THEN
+               WRITE(numout,*) 'Suppressing closed seas in bathymetry based on closea_mask field,'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             CALL iom_get ( inum, jpdom_data, 'closea_mask', zdata_in )
             closea_mask(:,:) = NINT(zdata_in(:,:))
@@ -469,5 +503,8 @@
             ENDWHERE
          ELSE
-            IF( lwp ) WRITE(numout,*) 'No closea_mask field found in domain_cfg file. No suppression of closed seas.'
+            IF( lwp ) THEN
+               WRITE(numout,*) 'No closea_mask field found in domain_cfg file. No suppression of closed seas.'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
          ENDIF
          !
@@ -475,5 +512,8 @@
          !
       ELSE
-         IF( lwp ) WRITE(numout,*) 'No domain_cfg file => no suppression of closed seas.'
+         IF( lwp ) THEN
+            WRITE(numout,*) 'No domain_cfg file => no suppression of closed seas.'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/daymod.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/daymod.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/daymod.F90	(revision 10986)
@@ -134,8 +134,11 @@
 
       ! control print
-      IF(lwp) WRITE(numout,'(a,i6,a,i2,a,i2,a,i8,a,i8,a,i8,a,i8)')   &
+      IF(lwp) THEN
+         WRITE(numout,'(a,i6,a,i2,a,i2,a,i8,a,i8,a,i8,a,i8)')   &
            &                   ' =======>> 1/2 time step before the start of the run DATE Y/M/D = ',   &
            &                   nyear, '/', nmonth, '/', nday, '  nsec_day:', nsec_day, '  nsec_week:', nsec_week, '  &
            &                   nsec_month:', nsec_month , '  nsec_year:' , nsec_year
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
 
       ! Up to now, calendar parameters are related to the end of previous run (nit000-1)
@@ -269,8 +272,11 @@
          CALL ymds2ju( nyear, 01, 01, 0.0, fjulstartyear )
          !
-         IF(lwp .AND. nprint > 0) WRITE(numout,'(a,i8,a,i4.4,a,i2.2,a,i2.2,a,i3.3)') '======>> time-step =', kt,   &
-              &   '      New day, DATE Y/M/D = ', nyear, '/', nmonth, '/', nday, '      nday_year = ', nday_year
-         IF(lwp .AND. nprint > 0) WRITE(numout,'(a,i8,a,i7,a,i5)') '         nsec_year = ', nsec_year,   &
+         IF(lwp .AND. nprint > 0) THEN
+            WRITE(numout,'(a,i8,a,i4.4,a,i2.2,a,i2.2,a,i3.3)') '======>> time-step =', kt,   &
+           &   '      New day, DATE Y/M/D = ', nyear, '/', nmonth, '/', nday, '      nday_year = ', nday_year
+            WRITE(numout,'(a,i8,a,i7,a,i5)') '         nsec_year = ', nsec_year,   &
               &   '   nsec_month = ', nsec_month, '   nsec_day = ', nsec_day, '   nsec_week = ', nsec_week
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
       ENDIF
 
@@ -337,4 +343,5 @@
                END SELECT
                WRITE(numout,*)
+               IF(lflush) CALL FLUSH(numout)
             ENDIF
             ! Control of date
@@ -397,4 +404,5 @@
 	    WRITE(numout,*) '   nn_time0                                         : ',nn_time0
             WRITE(numout,*)
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
          !
@@ -406,4 +414,5 @@
                WRITE(numout,*) 'rst_write : write oce restart file  kt =', kt
                WRITE(numout,*) '~~~~~~~'
+               IF(lflush) CALL FLUSH(numout)
             ENDIF
          ENDIF
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/domain.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/domain.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/domain.F90	(revision 10986)
@@ -112,4 +112,5 @@
          WRITE(numout,*)     '      Ocean model configuration used:'
          WRITE(numout,*)     '         cn_cfg = ', TRIM( cn_cfg ), '   nn_cfg = ', nn_cfg
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       lwxios = .FALSE.
@@ -129,5 +130,8 @@
       IF(cdstr == 'SAS') THEN
          IF(lrxios) THEN
-               IF(lwp) write(numout,*) 'Disable reading restart file using XIOS for SAS'
+               IF(lwp) THEN
+                  write(numout,*) 'Disable reading restart file using XIOS for SAS'
+                  IF(lflush) CALL FLUSH(numout)
+               ENDIF
                lrxios = .FALSE.
          ENDIF
@@ -203,4 +207,5 @@
          WRITE(numout,*) '~~~~~~~~'
          WRITE(numout,*) 
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -268,4 +273,5 @@
             WRITE(numout,25)              (mj1(jj),jj = 1,jpjglo)
          ENDIF
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
  25   FORMAT( 100(10x,19i4,/) )
@@ -303,4 +309,5 @@
          WRITE(numout,*) 'dom_nam : domain initialization through namelist read'
          WRITE(numout,*) '~~~~~~~ '
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -349,4 +356,5 @@
             WRITE(numout,*) "      AGRIF: ln_xios_read will be ingored. See setting for parent"
          ENDIF
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -363,7 +371,10 @@
       neuler = nn_euler
       IF( neuler == 1 .AND. .NOT. ln_rstart ) THEN
-         IF(lwp) WRITE(numout,*)  
-         IF(lwp) WRITE(numout,*)'   ==>>>   Start from rest (ln_rstart=F)'
-         IF(lwp) WRITE(numout,*)'           an Euler initial time step is used : nn_euler is forced to 0 '   
+         IF(lwp) THEN
+            WRITE(numout,*)  
+            WRITE(numout,*)'   ==>>>   Start from rest (ln_rstart=F)'
+            WRITE(numout,*)'           an Euler initial time step is used : nn_euler is forced to 0 '   
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          neuler = 0
       ENDIF
@@ -383,5 +394,8 @@
       IF( Agrif_Root() ) THEN
 #endif
-      IF(lwp) WRITE(numout,*)
+      IF(lwp) THEN
+         WRITE(numout,*)
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
       SELECT CASE ( nleapy )        ! Choose calendar for IOIPSL
       CASE (  1 ) 
@@ -395,4 +409,5 @@
          IF(lwp) WRITE(numout,*) '   ==>>>   The IOIPSL calendar is "360d", i.e. 360 days in a year'
       END SELECT
+      IF(lflush .AND. lwp) CALL FLUSH(numout)
 #if defined key_agrif
       ENDIF
@@ -416,4 +431,5 @@
          WRITE(numout,*) '      asselin time filter parameter           rn_atfp     = ', rn_atfp
          WRITE(numout,*) '      online coarsening of dynamical fields   ln_crs      = ', ln_crs
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -446,4 +462,5 @@
          WRITE(numout,*) '      number of chunks in k-dimension             nn_nchunks_k = ', nn_nchunks_k
          WRITE(numout,*) '      apply netcdf4/hdf5 chunking & compression   ln_nc4zip    = ', ln_nc4zip
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -506,4 +523,5 @@
          WRITE(numout,"(14x,'e2t maxi: ',1f10.2,' at i = ',i5,' j= ',i5)") ze2max, ima2(1), ima2(2)
          WRITE(numout,"(14x,'e2t mini: ',1f10.2,' at i = ',i5,' j= ',i5)") ze2min, imi2(1), imi2(2)
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -597,7 +615,10 @@
       !!----------------------------------------------------------------------
       !
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) 'cfg_write : create the domain configuration file (', TRIM(cn_domcfg_out),'.nc)'
-      IF(lwp) WRITE(numout,*) '~~~~~~~~~'
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'cfg_write : create the domain configuration file (', TRIM(cn_domcfg_out),'.nc)'
+         WRITE(numout,*) '~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
       !
       !                       ! ============================= !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/domhgr.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/domhgr.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/domhgr.F90	(revision 10986)
@@ -86,10 +86,14 @@
          WRITE(numout,*) '~~~~~~~   '
          WRITE(numout,*) '   namcfg : read (=T) or user defined (=F) configuration    ln_read_cfg  = ', ln_read_cfg
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
       !
       IF( ln_read_cfg ) THEN        !==  read in mesh_mask.nc file  ==!
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) '   ==>>>   read horizontal mesh in ', TRIM( cn_domcfg ), ' file'
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) '   ==>>>   read horizontal mesh in ', TRIM( cn_domcfg ), ' file'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          !
          CALL hgr_read   ( glamt , glamu , glamv , glamf ,   &    ! geographic position (required)
@@ -101,6 +105,9 @@
          !
       ELSE                          !==  User defined configuration  ==! 
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) '          User defined horizontal mesh (usr_def_hgr)'
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) '          User defined horizontal mesh (usr_def_hgr)'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          !
          CALL usr_def_hgr( glamt , glamu , glamv , glamf ,   &    ! geographic position (required)
@@ -116,12 +123,21 @@
       !
       IF( iff == 0 ) THEN                 ! Coriolis parameter has not been defined 
-         IF(lwp) WRITE(numout,*) '          Coriolis parameter calculated on the sphere from gphif & gphit'
+         IF(lwp) THEN
+            WRITE(numout,*) '          Coriolis parameter calculated on the sphere from gphif & gphit'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          ff_f(:,:) = 2. * omega * SIN( rad * gphif(:,:) )     ! compute it on the sphere at f-point
          ff_t(:,:) = 2. * omega * SIN( rad * gphit(:,:) )     !    -        -       -    at t-point
       ELSE
          IF( ln_read_cfg ) THEN
-            IF(lwp) WRITE(numout,*) '          Coriolis parameter have been read in ', TRIM( cn_domcfg ), ' file'
+            IF(lwp) THEN
+               WRITE(numout,*) '          Coriolis parameter have been read in ', TRIM( cn_domcfg ), ' file'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
          ELSE
-            IF(lwp) WRITE(numout,*) '          Coriolis parameter have been set in usr_def_hgr routine'
+            IF(lwp) THEN
+               WRITE(numout,*) '          Coriolis parameter have been set in usr_def_hgr routine'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
          ENDIF
       ENDIF
@@ -138,10 +154,16 @@
       e1e2f (:,:) = e1f(:,:) * e2f(:,:)   ;   r1_e1e2f(:,:) = 1._wp / e1e2f(:,:)
       IF( ie1e2u_v == 0 ) THEN               ! u- & v-surfaces have not been defined
-         IF(lwp) WRITE(numout,*) '          u- & v-surfaces calculated as e1 e2 product'
+         IF(lwp .AND. nprint > 1) THEN
+            WRITE(numout,*) '          u- & v-surfaces calculated as e1 e2 product'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          e1e2u (:,:) = e1u(:,:) * e2u(:,:)         ! compute them
          e1e2v (:,:) = e1v(:,:) * e2v(:,:) 
       ELSE
-         IF(lwp) WRITE(numout,*) '          u- & v-surfaces have been read in "mesh_mask" file:'
-         IF(lwp) WRITE(numout,*) '                     grid size reduction in strait(s) is used'
+         IF(lwp) THEN
+            WRITE(numout,*) '          u- & v-surfaces have been read in "mesh_mask" file:'
+            WRITE(numout,*) '                     grid size reduction in strait(s) is used'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
       ENDIF
       r1_e1e2u(:,:) = 1._wp / e1e2u(:,:)     ! compute their invert in any cases
@@ -185,4 +207,5 @@
          WRITE(numout,*) '   hgr_read : read the horizontal coordinates in mesh_mask'
          WRITE(numout,*) '   ~~~~~~~~      jpiglo = ', jpiglo, ' jpjglo = ', jpjglo, ' jpk = ', jpk
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -211,5 +234,8 @@
       IF(  iom_varid( inum, 'ff_f', ldstop = .FALSE. ) > 0  .AND.  &
          & iom_varid( inum, 'ff_t', ldstop = .FALSE. ) > 0    ) THEN
-         IF(lwp) WRITE(numout,*) '           Coriolis factor at f- and t-points read in ', TRIM( cn_domcfg ), ' file'
+         IF(lwp) THEN
+            WRITE(numout,*) '           Coriolis factor at f- and t-points read in ', TRIM( cn_domcfg ), ' file'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          CALL iom_get( inum, jpdom_data, 'ff_f'  , pff_f  , lrowattr=ln_use_jattr )
          CALL iom_get( inum, jpdom_data, 'ff_t'  , pff_t  , lrowattr=ln_use_jattr )
@@ -220,5 +246,8 @@
       !
       IF( iom_varid( inum, 'e1e2u', ldstop = .FALSE. ) > 0 ) THEN
-         IF(lwp) WRITE(numout,*) '           e1e2u & e1e2v read in ', TRIM( cn_domcfg ), ' file'
+         IF(lwp) THEN
+            WRITE(numout,*) '           e1e2u & e1e2v read in ', TRIM( cn_domcfg ), ' file'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          CALL iom_get( inum, jpdom_data, 'e1e2u'  , pe1e2u  , lrowattr=ln_use_jattr )
          CALL iom_get( inum, jpdom_data, 'e1e2v'  , pe1e2v  , lrowattr=ln_use_jattr )
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/dommsk.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/dommsk.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/dommsk.F90	(revision 10986)
@@ -119,4 +119,5 @@
          WRITE(numout,*) '      lateral momentum boundary cond.    rn_shlat  = ',rn_shlat
          WRITE(numout,*) '      consistency with analytical form   ln_vorlat = ',ln_vorlat 
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -129,5 +130,5 @@
          CALL ctl_stop( 'dom_msk: wrong value for rn_shlat (i.e. a negalive value). We stop.' )
       ENDIF
-
+      IF(lwp .AND. lflush) CALL FLUSH(numout)
       !  Ocean/land mask at t-point  (computed from ko_top and ko_bot)
       ! ----------------------------
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/domvvl.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/domvvl.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/domvvl.F90	(revision 10986)
@@ -120,7 +120,10 @@
       !!----------------------------------------------------------------------
       !
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) 'dom_vvl_init : Variable volume activated'
-      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~'
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'dom_vvl_init : Variable volume activated'
+         WRITE(numout,*) '~~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
       !
       CALL dom_vvl_ctl     ! choose vertical coordinate (z_star, z_tilde or layer)
@@ -304,7 +307,10 @@
       !
       IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'dom_vvl_sf_nxt : compute after scale factors'
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~'
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) 'dom_vvl_sf_nxt : compute after scale factors'
+            WRITE(numout,*) '~~~~~~~~~~~~~~'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
       ENDIF
 
@@ -533,5 +539,8 @@
          z_tmax = MAXVAL( tmask(:,:,1) *  ABS( ssha(:,:) ) )
          CALL mpp_max( 'domvvl', z_tmax )                                ! max over the global domain
-         IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ssha))) =', z_tmax
+         IF( lwp    ) THEN
+            WRITE(numout, *) kt,' MAXVAL(abs(ssha))) =', z_tmax
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
       END IF
 
@@ -601,4 +610,5 @@
          IF(lwp) WRITE(numout,*) 'dom_vvl_sf_swp : - time filter and swap of scale factors'
          IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~   - interpolate scale factors and compute depths for next time step'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -820,5 +830,8 @@
                CALL iom_get( numror, jpdom_autoglo, 'e3t_n', e3t_n(:,:,:), ldxios = lrxios )
                ! needed to restart if land processor not computed 
-               IF(lwp) write(numout,*) 'dom_vvl_rst : e3t_b and e3t_n found in restart files'
+               IF(lwp) THEN
+                  write(numout,*) 'dom_vvl_rst : e3t_b and e3t_n found in restart files'
+                  IF(lflush) CALL FLUSH(numout)
+               ENDIF
                WHERE ( tmask(:,:,:) == 0.0_wp ) 
                   e3t_n(:,:,:) = e3t_0(:,:,:)
@@ -829,21 +842,30 @@
                ENDIF
             ELSE IF( id1 > 0 ) THEN
-               IF(lwp) write(numout,*) 'dom_vvl_rst WARNING : e3t_n not found in restart files'
-               IF(lwp) write(numout,*) 'e3t_n set equal to e3t_b.'
-               IF(lwp) write(numout,*) 'neuler is forced to 0'
+               IF(lwp) THEN
+                  write(numout,*) 'dom_vvl_rst WARNING : e3t_n not found in restart files'
+                  write(numout,*) 'e3t_n set equal to e3t_b.'
+                  write(numout,*) 'neuler is forced to 0'
+                  IF(lflush) CALL FLUSH(numout)
+               ENDIF
                CALL iom_get( numror, jpdom_autoglo, 'e3t_b', e3t_b(:,:,:), ldxios = lrxios )
                e3t_n(:,:,:) = e3t_b(:,:,:)
                neuler = 0
             ELSE IF( id2 > 0 ) THEN
-               IF(lwp) write(numout,*) 'dom_vvl_rst WARNING : e3t_b not found in restart files'
-               IF(lwp) write(numout,*) 'e3t_b set equal to e3t_n.'
-               IF(lwp) write(numout,*) 'neuler is forced to 0'
+               IF(lwp) THEN
+                  write(numout,*) 'dom_vvl_rst WARNING : e3t_b not found in restart files'
+                  write(numout,*) 'e3t_b set equal to e3t_n.'
+                  write(numout,*) 'neuler is forced to 0'
+                  IF(lflush) CALL FLUSH(numout)
+               ENDIF
                CALL iom_get( numror, jpdom_autoglo, 'e3t_n', e3t_n(:,:,:), ldxios = lrxios )
                e3t_b(:,:,:) = e3t_n(:,:,:)
                neuler = 0
             ELSE
-               IF(lwp) write(numout,*) 'dom_vvl_rst WARNING : e3t_n not found in restart file'
-               IF(lwp) write(numout,*) 'Compute scale factor from sshn'
-               IF(lwp) write(numout,*) 'neuler is forced to 0'
+               IF(lwp) THEN
+                  write(numout,*) 'dom_vvl_rst WARNING : e3t_n not found in restart file'
+                  write(numout,*) 'Compute scale factor from sshn'
+                  write(numout,*) 'neuler is forced to 0'
+                  IF(lflush) CALL FLUSH(numout)
+               ENDIF
                DO jk = 1, jpk
                   e3t_n(:,:,jk) =  e3t_0(:,:,jk) * ( ht_0(:,:) + sshn(:,:) ) &
@@ -952,5 +974,8 @@
       ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN   ! Create restart file
          !                                   ! ===================
-         IF(lwp .AND. nprint > 0) WRITE(numout,*) '---- dom_vvl_rst ----'
+         IF(lwp .AND. nprint > 0) THEN
+            WRITE(numout,*) '---- dom_vvl_rst ----'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          IF( lwxios ) CALL iom_swap(      cwxios_context          )
          !                                           ! --------- !
@@ -1024,4 +1049,5 @@
          ENDIF
          WRITE(numout,*) '         debug prints flag                                 ln_vvl_dbg   = ', ln_vvl_dbg
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -1041,4 +1067,5 @@
          IF( ln_vvl_layer           ) WRITE(numout,*) '      ==>>>   layer vertical coordinate is used'
          IF( ln_vvl_ztilde_as_zstar ) WRITE(numout,*) '      ==>>>   to emulate a zstar coordinate'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/domwri.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/domwri.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/domwri.F90	(revision 10986)
@@ -63,7 +63,10 @@
       !!----------------------------------------------------------------------
       !
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) 'dom_wri : create NetCDF mesh and mask information file(s)'
-      IF(lwp) WRITE(numout,*) '~~~~~~~'
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'dom_wri : create NetCDF mesh and mask information file(s)'
+         WRITE(numout,*) '~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
       
       clnam = 'mesh_mask'  ! filename (mesh and mask informations)
@@ -283,4 +286,5 @@
          WRITE(numout,*) 'dom_stiff : maximum grid stiffness ratio: ', zrxmax
          WRITE(numout,*) '~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/domzgr.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/domzgr.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/domzgr.F90	(revision 10986)
@@ -80,4 +80,5 @@
          WRITE(numout,*) 'dom_zgr : vertical coordinate'
          WRITE(numout,*) '~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -86,6 +87,9 @@
 
       IF( ln_read_cfg ) THEN        !==  read in mesh_mask.nc file  ==!
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) '   ==>>>   Read vertical mesh in ', TRIM( cn_domcfg ), ' file'
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) '   ==>>>   Read vertical mesh in ', TRIM( cn_domcfg ), ' file'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          !
          CALL zgr_read   ( ln_zco  , ln_zps  , ln_sco, ln_isfcav,   & 
@@ -97,6 +101,9 @@
             !
       ELSE                          !==  User defined configuration  ==!
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) '          User defined vertical mesh (usr_def_zgr)'
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) '          User defined vertical mesh (usr_def_zgr)'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          !
          CALL usr_def_zgr( ln_zco  , ln_zps  , ln_sco, ln_isfcav,   & 
@@ -127,4 +134,5 @@
          WRITE(numout,*) '      s- or hybrid z-s-coordinate    ln_sco    = ', ln_sco
          WRITE(numout,*) '      ice shelf cavities             ln_isfcav = ', ln_isfcav
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -163,4 +171,5 @@
             &                          ' uw', MAXVAL(  e3uw_0(:,:,:) ), ' vw', MAXVAL(  e3vw_0(:,:,:) ),  &
             &                          ' w ', MAXVAL(   e3w_0(:,:,:) )
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -199,4 +208,5 @@
          WRITE(numout,*) '   zgr_read : read the vertical coordinates in ', TRIM( cn_domcfg ), ' file'
          WRITE(numout,*) '   ~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -248,4 +258,5 @@
             WRITE(numout, "(9x,' level  gdept_1d  gdepw_1d  e3t_1d   e3w_1d  ')" )
             WRITE(numout, "(10x, i4, 4f9.2)" ) ( jk, pdept_1d(jk), pdepw_1d(jk), pe3t_1d(jk), pe3w_1d(jk), jk = 1, jpk )
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
       ENDIF
@@ -286,7 +297,10 @@
       !!----------------------------------------------------------------------
       !
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) '    zgr_top_bot : ocean top and bottom k-index of T-, U-, V- and W-levels '
-      IF(lwp) WRITE(numout,*) '    ~~~~~~~~~~~'
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) '    zgr_top_bot : ocean top and bottom k-index of T-, U-, V- and W-levels '
+         WRITE(numout,*) '    ~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
       !
       mikt(:,:) = MAX( k_top(:,:) , 1 )    ! top    ocean k-index of T-level (=1 over land)
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/dtatsd.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/dtatsd.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/dtatsd.F90	(revision 10986)
@@ -87,4 +87,5 @@
             WRITE(numout,*) '   ===>>   T & S data not used'
          ENDIF
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -184,4 +185,5 @@
             WRITE(numout,*)
             WRITE(numout,*) 'dta_tsd: interpolates T & S data onto the s- or mixed s-z-coordinate mesh'
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
          !
@@ -243,5 +245,8 @@
       IF( .NOT.ln_tsd_dmp ) THEN                   !==   deallocate T & S structure   ==! 
          !                                              (data used only for initialisation)
-         IF(lwp .AND. nprint > 1) WRITE(numout,*) 'dta_tsd: deallocte T & S arrays as they are only use to initialize the run'
+         IF(lwp .AND. nprint > 1) THEN
+            WRITE(numout,*) 'dta_tsd: deallocte T & S arrays as they are only use to initialize the run'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
                                         DEALLOCATE( sf_tsd(jp_tem)%fnow )     ! T arrays in the structure
          IF( sf_tsd(jp_tem)%ln_tint )   DEALLOCATE( sf_tsd(jp_tem)%fdta )
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/iscplhsb.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/iscplhsb.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/iscplhsb.F90	(revision 10986)
@@ -170,4 +170,5 @@
                            WRITE(numout,*) '                     ',ji,' ',jj,' ',jk,' ',narea
                            WRITE(numout,*) ' we are now looking for the closest wet cell on the horizontal '
+                           IF(lflush) CALL FLUSH(numout)
                            ENDIF
                         ! We deal with these points later.
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/iscplini.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/iscplini.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/iscplini.F90	(revision 10986)
@@ -83,4 +83,5 @@
          WRITE(numout,*) ' coupling time step                       = ', rdt_iscpl
          WRITE(numout,*) ' number of call of the extrapolation loop = ', nn_drown
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/istate.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/istate.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/istate.F90	(revision 10986)
@@ -63,7 +63,10 @@
       !!----------------------------------------------------------------------
       !
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) 'istate_init : Initialization of the dynamics and tracers'
-      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'istate_init : Initialization of the dynamics and tracers'
+         WRITE(numout,*) '~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
 
 !!gm  Why not include in the first call of dta_tsd ?  
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/phycst.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/phycst.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DOM/phycst.F90	(revision 10986)
@@ -132,4 +132,5 @@
          WRITE(numout,*)
          WRITE(numout,*) '      smallest real computer value       rsmall = ', rsmall
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/divhor.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/divhor.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/divhor.F90	(revision 10986)
@@ -72,4 +72,5 @@
          IF(lwp) WRITE(numout,*) 'div_hor : horizontal velocity divergence '
          IF(lwp) WRITE(numout,*) '~~~~~~~   '
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynadv.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynadv.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynadv.F90	(revision 10986)
@@ -102,4 +102,5 @@
          WRITE(numout,*) 'dyn_adv_init : choice/control of the momentum advection scheme'
          WRITE(numout,*) '~~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -119,4 +120,5 @@
          WRITE(numout,*) '      flux form: 2nd order centred scheme              ln_dynadv_cen2 = ', ln_dynadv_cen2
          WRITE(numout,*) '                 3rd order UBS scheme                  ln_dynadv_ubs  = ', ln_dynadv_ubs
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -141,4 +143,5 @@
          CASE( np_FLX_ubs )   ;   WRITE(numout,*) '   ==>>>   flux form   : UBS       scheme is used'
          END SELECT
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynadv_cen2.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynadv_cen2.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynadv_cen2.F90	(revision 10986)
@@ -57,4 +57,5 @@
          WRITE(numout,*) 'dyn_adv_cen2 : 2nd order flux form momentum advection'
          WRITE(numout,*) '~~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynadv_ubs.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynadv_ubs.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynadv_ubs.F90	(revision 10986)
@@ -82,4 +82,5 @@
          IF(lwp) WRITE(numout,*) 'dyn_adv_ubs : UBS flux form momentum advection'
          IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynhpg.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynhpg.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynhpg.F90	(revision 10986)
@@ -170,4 +170,5 @@
          WRITE(numout,*) '      s-coord. (Density Jacobian: Cubic polynomial)     ln_hpg_djc    = ', ln_hpg_djc
          WRITE(numout,*) '      s-coord. (Pressure Jacobian: Cubic polynomial)    ln_hpg_prj    = ', ln_hpg_prj
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -211,4 +212,5 @@
          END SELECT
          WRITE(numout,*)
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !                          
@@ -218,6 +220,9 @@
       ELSE                            !--- set an ice shelf load
          !
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) '   ice shelf case: set the ice-shelf load'
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) '   ice shelf case: set the ice-shelf load'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          ALLOCATE( zts_top(jpi,jpj,jpts) , zrhd(jpi,jpj,jpk) , zrhdtop_isf(jpi,jpj) , ziceload(jpi,jpj) ) 
          !
@@ -279,8 +284,9 @@
       !!----------------------------------------------------------------------
       !
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'dyn:hpg_zco : hydrostatic pressure gradient trend'
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~   z-coordinate case '
+      IF( kt == nit000 .AND. lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'dyn:hpg_zco : hydrostatic pressure gradient trend'
+         WRITE(numout,*) '~~~~~~~~~~~   z-coordinate case '
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -340,8 +346,9 @@
       !!----------------------------------------------------------------------
       !
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'dyn:hpg_zps : hydrostatic pressure gradient trend'
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~   z-coordinate with partial steps - vector optimization'
+      IF( kt == nit000 .AND. lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'dyn:hpg_zps : hydrostatic pressure gradient trend'
+         WRITE(numout,*) '~~~~~~~~~~~   z-coordinate with partial steps - vector optimization'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -439,8 +446,9 @@
       IF( ln_wd_il ) ALLOCATE(zcpx(jpi,jpj), zcpy(jpi,jpj))
       !
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'dyn:hpg_sco : hydrostatic pressure gradient trend'
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~   s-coordinate case, OPA original scheme used'
+      IF( kt == nit000 .AND. lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'dyn:hpg_sco : hydrostatic pressure gradient trend'
+         WRITE(numout,*) '~~~~~~~~~~~   s-coordinate case, OPA original scheme used'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -726,8 +734,9 @@
       END IF
 
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'dyn:hpg_djc : hydrostatic pressure gradient trend'
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~   s-coordinate case, density Jacobian with cubic polynomial scheme'
+      IF( kt == nit000 .AND. lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'dyn:hpg_djc : hydrostatic pressure gradient trend'
+         WRITE(numout,*) '~~~~~~~~~~~   s-coordinate case, density Jacobian with cubic polynomial scheme'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -960,8 +969,9 @@
       !!----------------------------------------------------------------------
       !
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'dyn:hpg_prj : hydrostatic pressure gradient trend'
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~   s-coordinate case, cubic spline pressure Jacobian'
+      IF( kt == nit000 .AND. lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'dyn:hpg_prj : hydrostatic pressure gradient trend'
+         WRITE(numout,*) '~~~~~~~~~~~   s-coordinate case, cubic spline pressure Jacobian'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynkeg.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynkeg.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynkeg.F90	(revision 10986)
@@ -84,8 +84,9 @@
       IF( ln_timing )   CALL timing_start('dyn_keg')
       !
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'dyn_keg : kinetic energy gradient trend, scheme number=', kscheme
-         IF(lwp) WRITE(numout,*) '~~~~~~~'
+      IF( kt == nit000 .AND. lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'dyn_keg : kinetic energy gradient trend, scheme number=', kscheme
+         WRITE(numout,*) '~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynldf.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynldf.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynldf.F90	(revision 10986)
@@ -106,4 +106,5 @@
          CASE( np_blp    )   ;   WRITE(numout,*) '   ==>>>   iso-level bi-laplacian operator'
          END SELECT
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynldf_iso.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynldf_iso.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynldf_iso.F90	(revision 10986)
@@ -114,7 +114,10 @@
       !
       IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'dyn_ldf_iso : iso-neutral laplacian diffusive operator or '
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~   s-coordinate horizontal diffusive operator'
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) 'dyn_ldf_iso : iso-neutral laplacian diffusive operator or '
+            WRITE(numout,*) '~~~~~~~~~~~   s-coordinate horizontal diffusive operator'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          !                                      ! allocate dyn_ldf_bilap arrays
          IF( dyn_ldf_iso_alloc() /= 0 )   CALL ctl_stop('STOP', 'dyn_ldf_iso: failed to allocate arrays')
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynldf_lap_blp.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynldf_lap_blp.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynldf_lap_blp.F90	(revision 10986)
@@ -62,4 +62,5 @@
          WRITE(numout,*) 'dyn_ldf : iso-level harmonic (laplacian) operator, pass=', kpass
          WRITE(numout,*) '~~~~~~~ '
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -129,4 +130,5 @@
          IF(lwp) WRITE(numout,*) 'dyn_ldf_blp : bilaplacian operator momentum '
          IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynnxt.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynnxt.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynnxt.F90	(revision 10986)
@@ -106,8 +106,9 @@
       IF( l_trddyn     )   ALLOCATE( zua(jpi,jpj,jpk) , zva(jpi,jpj,jpk) )
       !
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'dyn_nxt : time stepping'
-         IF(lwp) WRITE(numout,*) '~~~~~~~'
+      IF( kt == nit000 .AND. lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'dyn_nxt : time stepping'
+         WRITE(numout,*) '~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynspg.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynspg.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynspg.F90	(revision 10986)
@@ -198,4 +198,5 @@
          WRITE(numout,*) 'dyn_spg_init : choice of the surface pressure gradient scheme'
          WRITE(numout,*) '~~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -213,4 +214,5 @@
          WRITE(numout,*) '      Explicit free surface                  ln_dynspg_exp = ', ln_dynspg_exp
          WRITE(numout,*) '      Free surface with time splitting       ln_dynspg_ts  = ', ln_dynspg_ts
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !                          ! Control of surface pressure gradient scheme options
@@ -229,4 +231,5 @@
          IF( nspg == np_TS  )   WRITE(numout,*) '   ==>>>   free surface with time splitting scheme'
          IF( nspg == np_NO  )   WRITE(numout,*) '   ==>>>   No surface surface pressure gradient trend in momentum Eqs.'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynspg_exp.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynspg_exp.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynspg_exp.F90	(revision 10986)
@@ -61,11 +61,17 @@
       !
       IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'dyn_spg_exp : surface pressure gradient trend'
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~   (explicit free surface)'
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) 'dyn_spg_exp : surface pressure gradient trend'
+            WRITE(numout,*) '~~~~~~~~~~~   (explicit free surface)'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          !
          spgu(:,:) = 0._wp   ;   spgv(:,:) = 0._wp
          !
-         IF( .NOT.ln_linssh .AND. lwp ) WRITE(numout,*) '      non linear free surface: spg is included in dynhpg'
+         IF( .NOT.ln_linssh .AND. lwp ) THEN
+            WRITE(numout,*) '      non linear free surface: spg is included in dynhpg'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
       ENDIF
 
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynspg_ts.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynspg_ts.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynspg_ts.F90	(revision 10986)
@@ -197,8 +197,11 @@
       IF( kt == nit000 ) THEN                   !* initialisation
          !
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'dyn_spg_ts : surface pressure gradient trend'
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~   free surface with time splitting'
-         IF(lwp) WRITE(numout,*)
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) 'dyn_spg_ts : surface pressure gradient trend'
+            WRITE(numout,*) '~~~~~~~~~~   free surface with time splitting'
+            WRITE(numout,*)
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          !
          IF( neuler == 0 )   ll_init=.TRUE.
@@ -1422,6 +1425,9 @@
 #endif
          ELSE                                   !* Start from rest
-            IF(lwp) WRITE(numout,*)
-            IF(lwp) WRITE(numout,*) '   ==>>>   start from rest: set barotropic values to 0'
+            IF(lwp) THEN
+               WRITE(numout,*)
+               WRITE(numout,*) '   ==>>>   start from rest: set barotropic values to 0'
+               IF(lflush) CALL FLUSH(numout) 
+            ENDIF
             ub2_b (:,:) = 0._wp   ;   vb2_b (:,:) = 0._wp   ! used in the 1st interpol of agrif
             un_adv(:,:) = 0._wp   ;   vn_adv(:,:) = 0._wp   ! used in the 1st interpol of agrif
@@ -1436,5 +1442,8 @@
       ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN   ! Create restart file
          !                                   ! -------------------
-         IF(lwp .AND. nprint > 0) WRITE(numout,*) '---- ts_rst ----'
+         IF(lwp .AND. nprint > 0) THEN
+            WRITE(numout,*) '---- ts_rst ----'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          IF( lwxios ) CALL iom_swap(      cwxios_context          )
          CALL iom_rstput( kt, nitrst, numrow, 'ub2_b'   , ub2_b  (:,:), ldxios = lwxios )
@@ -1494,25 +1503,28 @@
       zcmax = zcmax * rdtbt
       ! Print results
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) 'dyn_spg_ts_init : split-explicit free surface'
-      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~~'
-      IF( ln_bt_auto ) THEN
-         IF(lwp) WRITE(numout,*) '     ln_ts_auto =.true. Automatically set nn_baro '
-         IF(lwp) WRITE(numout,*) '     Max. courant number allowed: ', rn_bt_cmax
-      ELSE
-         IF(lwp) WRITE(numout,*) '     ln_ts_auto=.false.: Use nn_baro in namelist   nn_baro = ', nn_baro
-      ENDIF
-
-      IF(ln_bt_av) THEN
-         IF(lwp) WRITE(numout,*) '     ln_bt_av =.true.  ==> Time averaging over nn_baro time steps is on '
-      ELSE
-         IF(lwp) WRITE(numout,*) '     ln_bt_av =.false. => No time averaging of barotropic variables '
-      ENDIF
-      !
-      !
-      IF(ln_bt_fw) THEN
-         IF(lwp) WRITE(numout,*) '     ln_bt_fw=.true.  => Forward integration of barotropic variables '
-      ELSE
-         IF(lwp) WRITE(numout,*) '     ln_bt_fw =.false.=> Centred integration of barotropic variables '
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'dyn_spg_ts_init : split-explicit free surface'
+         WRITE(numout,*) '~~~~~~~~~~~~~~~'
+         IF( ln_bt_auto ) THEN
+            WRITE(numout,*) '     ln_ts_auto =.true. Automatically set nn_baro '
+            WRITE(numout,*) '     Max. courant number allowed: ', rn_bt_cmax
+         ELSE
+            WRITE(numout,*) '     ln_ts_auto=.false.: Use nn_baro in namelist   nn_baro = ', nn_baro
+         ENDIF
+
+         IF(ln_bt_av) THEN
+            WRITE(numout,*) '     ln_bt_av =.true.  ==> Time averaging over nn_baro time steps is on '
+         ELSE
+            WRITE(numout,*) '     ln_bt_av =.false. => No time averaging of barotropic variables '
+         ENDIF
+      !
+      !
+         IF(ln_bt_fw) THEN
+            WRITE(numout,*) '     ln_bt_fw=.true.  => Forward integration of barotropic variables '
+         ELSE
+            WRITE(numout,*) '     ln_bt_fw =.false.=> Centred integration of barotropic variables '
+         ENDIF
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -1530,10 +1542,13 @@
       END SELECT
       !
-      IF(lwp) WRITE(numout,*) ' '
-      IF(lwp) WRITE(numout,*) '     nn_baro = ', nn_baro
-      IF(lwp) WRITE(numout,*) '     Barotropic time step [s] is :', rdtbt
-      IF(lwp) WRITE(numout,*) '     Maximum Courant number is   :', zcmax
-      !
-      IF(lwp) WRITE(numout,*)    '     Time diffusion parameter rn_bt_alpha: ', rn_bt_alpha
+      IF(lwp) THEN
+         WRITE(numout,*) ' '
+         WRITE(numout,*) '     nn_baro = ', nn_baro
+         WRITE(numout,*) '     Barotropic time step [s] is :', rdtbt
+         WRITE(numout,*) '     Maximum Courant number is   :', zcmax
+      !
+         WRITE(numout,*)    '     Time diffusion parameter rn_bt_alpha: ', rn_bt_alpha
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
       IF ((ln_bt_av.AND.nn_bt_flt/=0).AND.(rn_bt_alpha>0._wp)) THEN
          CALL ctl_stop( 'dynspg_ts ERROR: if rn_bt_alpha > 0, remove temporal averaging' )
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynvor.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynvor.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynvor.F90	(revision 10986)
@@ -220,4 +220,5 @@
          IF(lwp) WRITE(numout,*) 'dyn:vor_enT : vorticity term: t-point energy conserving scheme'
          IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -352,8 +353,9 @@
       !!----------------------------------------------------------------------
       !
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'dyn:vor_ene : vorticity term: energy conserving scheme'
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
+      IF( kt == nit000 .AND. lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'dyn:vor_ene : vorticity term: energy conserving scheme'
+         WRITE(numout,*) '~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -460,8 +462,9 @@
       !!----------------------------------------------------------------------
       !
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'dyn:vor_ens : vorticity term: enstrophy conserving scheme'
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
+      IF( kt == nit000 .AND. lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'dyn:vor_ens : vorticity term: enstrophy conserving scheme'
+         WRITE(numout,*) '~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !                                                ! ===============
@@ -568,8 +571,9 @@
       !!----------------------------------------------------------------------
       !
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'dyn:vor_een : vorticity term: energy and enstrophy conserving scheme'
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
+      IF( kt == nit000 .AND. lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'dyn:vor_een : vorticity term: energy and enstrophy conserving scheme'
+         WRITE(numout,*) '~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -725,8 +729,9 @@
       !!----------------------------------------------------------------------
       !
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'dyn:vor_een : vorticity term: energy and enstrophy conserving scheme'
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
+      IF( kt == nit000 .AND. lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'dyn:vor_een : vorticity term: energy and enstrophy conserving scheme'
+         WRITE(numout,*) '~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -847,4 +852,5 @@
          WRITE(numout,*) 'dyn_vor_init : vorticity term : read namelist and control the consistency'
          WRITE(numout,*) '~~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -867,4 +873,5 @@
          WRITE(numout,*) '      mixed enstrophy/energy conserving scheme       ln_dynvor_mix = ', ln_dynvor_mix
          WRITE(numout,*) '      masked (=T) or unmasked(=F) vorticity          ln_dynvor_msk = ', ln_dynvor_msk
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -874,6 +881,9 @@
       ! If energy, enstrophy or mixed advection of momentum in vector form change the value for masks
       ! at angles with three ocean points and one land point
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) '      change fmask value in the angles (T)           ln_vorlat = ', ln_vorlat
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) '      change fmask value in the angles (T)           ln_vorlat = ', ln_vorlat
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
       IF( ln_vorlat .AND. ( ln_dynvor_ene .OR. ln_dynvor_ens .OR. ln_dynvor_mix ) ) THEN
          DO jk = 1, jpk
@@ -951,4 +961,5 @@
          CASE( np_MIX )   ;   WRITE(numout,*) '   ==>>>   mixed enstrophy/energy conserving scheme (MIX)'
          END SELECT         
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynzad.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynzad.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynzad.F90	(revision 10986)
@@ -66,4 +66,5 @@
          IF(lwp) WRITE(numout,*)
          IF(lwp) WRITE(numout,*) 'dyn_zad : 2nd order vertical advection scheme'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynzdf.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynzdf.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynzdf.F90	(revision 10986)
@@ -82,7 +82,10 @@
       !
       IF( kt == nit000 ) THEN       !* initialization
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'dyn_zdf_imp : vertical momentum diffusion implicit operator'
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~ '
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) 'dyn_zdf_imp : vertical momentum diffusion implicit operator'
+            WRITE(numout,*) '~~~~~~~~~~~ '
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          !
          If( ln_linssh ) THEN   ;    r_vvl = 0._wp    ! non-linear free surface indicator
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/sshwzv.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/sshwzv.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/sshwzv.F90	(revision 10986)
@@ -77,8 +77,9 @@
       IF( ln_timing )   CALL timing_start('ssh_nxt')
       !
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'ssh_nxt : after sea surface height'
-         IF(lwp) WRITE(numout,*) '~~~~~~~ '
+      IF( kt == nit000 .AND. lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'ssh_nxt : after sea surface height'
+         WRITE(numout,*) '~~~~~~~ '
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -152,7 +153,10 @@
       !
       IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'wzv : now vertical velocity '
-         IF(lwp) WRITE(numout,*) '~~~~~ '
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) 'wzv : now vertical velocity '
+            WRITE(numout,*) '~~~~~ '
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          !
          wn(:,:,jpk) = 0._wp                  ! bottom boundary condition: w=0 (set once for all)
@@ -240,8 +244,9 @@
       IF( ln_timing )   CALL timing_start('ssh_swp')
       !
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'ssh_swp : Asselin time filter and swap of sea surface height'
-         IF(lwp) WRITE(numout,*) '~~~~~~~ '
+      IF( kt == nit000 .AND. lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'ssh_swp : Asselin time filter and swap of sea surface height'
+         WRITE(numout,*) '~~~~~~~ '
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !              !==  Euler time-stepping: no filter, just swap  ==!
@@ -294,7 +299,10 @@
       !
       IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'wAimp : Courant number-based partitioning of now vertical velocity '
-         IF(lwp) WRITE(numout,*) '~~~~~ '
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) 'wAimp : Courant number-based partitioning of now vertical velocity '
+            WRITE(numout,*) '~~~~~ '
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          !
          Cu_adv(:,:,jpk) = 0._wp              ! bottom value : Cu_adv=0 (set once for all)
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/wet_dry.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/wet_dry.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/wet_dry.F90	(revision 10986)
@@ -104,7 +104,11 @@
          WRITE(numout,*) '      cut off depth sbc for wd   rn_wd_sbcdep       = ', rn_wd_sbcdep
          WRITE(numout,*) '      fraction to start sbc wgt rn_wd_sbcfra        = ', rn_wd_sbcfra
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       IF( .NOT. ln_read_cfg ) THEN
-         IF(lwp) WRITE(numout,*) '      No configuration file so seting ssh_ref to zero  '
+         IF(lwp) THEN
+            WRITE(numout,*) '      No configuration file so seting ssh_ref to zero  '
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          ssh_ref=0._wp
       ENDIF
@@ -266,5 +270,8 @@
 !!gm
       !
-      IF(jflag == 1 .AND. lwp)   WRITE(numout,*) 'Need more iterations in wad_lmt!!!'
+      IF(jflag == 1 .AND. lwp)   THEN
+         WRITE(numout,*) 'Need more iterations in wad_lmt!!!'
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
       !
       !IF( ln_rnf      )   CALL sbc_rnf_div( hdivn )          ! runoffs (update hdivn field)
@@ -390,5 +397,8 @@
 !!gm end
       !
-      IF( jflag == 1 .AND. lwp )   WRITE(numout,*) 'Need more iterations in wad_lmt_bt!!!'
+      IF( jflag == 1 .AND. lwp )   THEN
+         WRITE(numout,*) 'Need more iterations in wad_lmt_bt!!!'
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
       !
       !IF( ln_rnf      )   CALL sbc_rnf_div( hdivn )          ! runoffs (update hdivn field)
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/FLO/flo4rk.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/FLO/flo4rk.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/FLO/flo4rk.F90	(revision 10986)
@@ -58,12 +58,16 @@
       !
       IF( ierror /= 0 ) THEN
-         WRITE(numout,*) 'flo_4rk: allocation of workspace arrays failed'
+         IF(lwp) THEN
+            WRITE(numout,*) 'flo_4rk: allocation of workspace arrays failed'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
       ENDIF
 
     
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'flo_4rk : compute Runge Kutta trajectories for floats '
-         IF(lwp) WRITE(numout,*) '~~~~~~~'
+      IF( kt == nit000 .AND. lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'flo_4rk : compute Runge Kutta trajectories for floats '
+         WRITE(numout,*) '~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -114,4 +118,6 @@
          ENDIF
       END DO
+     
+      IF(lflush .AND. lwp) CALL FLUSH(numout)
       
       ! 4 steps of Runge-Kutta algorithme
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/FLO/floats.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/FLO/floats.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/FLO/floats.F90	(revision 10986)
@@ -84,7 +84,10 @@
       !!---------------------------------------------------------------------
       !
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) 'flo_stp : call floats routine '
-      IF(lwp) WRITE(numout,*) '~~~~~~~'
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'flo_stp : call floats routine '
+         WRITE(numout,*) '~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
 
       REWIND( numnam_ref )              ! Namelist namflo in reference namelist : Floats
@@ -109,5 +112,5 @@
          WRITE(numout,*) '            Use of ariane convention              ln_ariane    = ', ln_ariane
          WRITE(numout,*) '            ascii output (T) or netcdf output (F) ln_flo_ascii = ', ln_flo_ascii
-
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/FLO/floblk.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/FLO/floblk.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/FLO/floblk.F90	(revision 10986)
@@ -71,8 +71,9 @@
       !!---------------------------------------------------------------------
 
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'flo_blk : compute Blanke trajectories for floats '
-         IF(lwp) WRITE(numout,*) '~~~~~~~ '
+      IF( kt == nit000 .AND. lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'flo_blk : compute Blanke trajectories for floats '
+         WRITE(numout,*) '~~~~~~~ '
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/FLO/flodom.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/FLO/flodom.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/FLO/flodom.F90	(revision 10986)
@@ -59,7 +59,10 @@
       ! Initialisation with the geographical position or restart
       
-      IF(lwp) WRITE(numout,*) 'flo_dom : compute initial position of floats'
-      IF(lwp) WRITE(numout,*) '~~~~~~~~'
-      IF(lwp) WRITE(numout,*) '           jpnfl = ',jpnfl
+      IF(lwp) THEN
+         WRITE(numout,*) 'flo_dom : compute initial position of floats'
+         WRITE(numout,*) '~~~~~~~~'
+         WRITE(numout,*) '           jpnfl = ',jpnfl
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
       
       !-------------------------!
@@ -89,5 +92,8 @@
          IF( jpnfl > jpnrstflo )THEN
 
-            IF(lwp) WRITE(numout,*) '        add new floats'
+            IF(lwp) THEN
+               WRITE(numout,*) '        add new floats'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
 
             IF( ln_ariane )THEN  !Add new floats with ariane convention
@@ -145,5 +151,8 @@
       DO jfl = kfl_start,kfl_end
          READ(inum,*) flxx(jfl),flyy(jfl),flzz(jfl), nisobfl(jfl),ngrpfl(jfl),itrash
-         if(lwp)write(numout,*)'read:',jfl,flxx(jfl),flyy(jfl),flzz(jfl), nisobfl(jfl),ngrpfl(jfl),itrash ; call flush(numout)
+         IF(lwp) THEN
+            write(numout,*)'read:',jfl,flxx(jfl),flyy(jfl),flzz(jfl), nisobfl(jfl),ngrpfl(jfl),itrash
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
       END DO
       CLOSE(inum)
@@ -266,10 +275,13 @@
          DO jfl =  kfl_start,kfl_end
             IF( idomfl(jfl) == 1 ) THEN
-               IF(lwp) WRITE(numout,*)'*****************************'
-               IF(lwp) WRITE(numout,*)'!!!!!!!  WARNING   !!!!!!!!!!'
-               IF(lwp) WRITE(numout,*)'*****************************'
-               IF(lwp) WRITE(numout,*)'The float number',jfl,'is out of the sea.'
-               IF(lwp) WRITE(numout,*)'geographical position',flxx(jfl),flyy(jfl),flzz(jfl)
-               IF(lwp) WRITE(numout,*)'index position',tpifl(jfl),tpjfl(jfl),tpkfl(jfl)
+               IF(lwp) THEN
+                  WRITE(numout,*)'*****************************'
+                  WRITE(numout,*)'!!!!!!!  WARNING   !!!!!!!!!!'
+                  WRITE(numout,*)'*****************************'
+                  WRITE(numout,*)'The float number',jfl,'is out of the sea.'
+                  WRITE(numout,*)'geographical position',flxx(jfl),flyy(jfl),flzz(jfl)
+                  WRITE(numout,*)'index position',tpifl(jfl),tpjfl(jfl),tpkfl(jfl)
+                  IF(lflush) CALL FLUSH(numout)
+               ENDIF
             ENDIF
          END DO
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/FLO/florst.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/FLO/florst.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/FLO/florst.F90	(revision 10986)
@@ -67,4 +67,5 @@
             WRITE(numout,*) 'flo_rst : write in  restart_float file '
             WRITE(numout,*) '~~~~~~~    '
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
 
@@ -118,4 +119,5 @@
                   ENDIF
                END DO
+               IF(lflush) CALL FLUSH(numout)
             ENDIF
          ENDIF
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/IOM/in_out_manager.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/IOM/in_out_manager.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/IOM/in_out_manager.F90	(revision 10986)
@@ -129,6 +129,8 @@
    INTEGER ::   nn_isplt         !: number of processors following i
    INTEGER ::   nn_jsplt         !: number of processors following j
+   LOGICAL ::   ln_flush         !: flush numout flag
    !                                          
    INTEGER ::   nprint, nictls, nictle, njctls, njctle, isplt, jsplt    !: OLD namelist names
+   LOGICAL ::   lflush
 
    INTEGER ::   ijsplt     =    1      !: nb of local domain = nb of processors
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/IOM/iom.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/IOM/iom.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/IOM/iom.F90	(revision 10986)
@@ -321,5 +321,8 @@
         ENDIF
 !set name of the restart file and enable available fields
-        if(lwp .AND. nprint > 1) WRITE(numout,*) 'Setting restart filename (for XIOS) to: ',rst_file
+        if(lwp .AND. nprint > 1) THEN
+           WRITE(numout,*) 'Setting restart filename (for XIOS) to: ',rst_file
+           IF(lflush) CALL FLUSH(numout)
+        ENDIF
         CALL xios_get_handle("file_definition", filegroup_hdl )
         CALL xios_add_child(filegroup_hdl, file_hdl, 'rrestart')
@@ -346,5 +349,8 @@
                         scalar_ref = "grid_scalar", operation = "instant")
                 END SELECT
-                IF(lwp .AND. nprint > 1) WRITE(numout,*) 'XIOS read: ', TRIM(rst_rfields(i)%vname), ' enabled in ', TRIM(rst_file)
+                IF(lwp .AND. nprint > 1) THEN
+                   WRITE(numout,*) 'XIOS read: ', TRIM(rst_rfields(i)%vname), ' enabled in ', TRIM(rst_file)
+                   IF(lflush) CALL FLUSH(numout)
+                ENDIF
            ENDIF
          ENDIF
@@ -537,5 +543,8 @@
 
 !set name of the restart file and enable available fields
-        IF(lwp .AND. nprint > 1) WRITE(numout,*) 'Setting restart filename (for XIOS write) to: ',cdrst_file
+        IF(lwp .AND. nprint > 1) THEN
+           WRITE(numout,*) 'Setting restart filename (for XIOS write) to: ',cdrst_file
+           IF(lflush) CALL FLUSH(numout)
+        ENDIF
         CALL xios_get_handle("file_definition", filegroup_hdl )
         CALL xios_add_child(filegroup_hdl, file_hdl, 'wrestart')
@@ -543,9 +552,15 @@
            CALL xios_set_file_attr( "wrestart", type="one_file", enabled=.TRUE.,& 
                                     mode="write", output_freq=xios_timestep) 
-           if(lwp .AND. nprint > 1) write(numout,*) 'OPEN ', trim(cdrst_file), ' in one_file mode' 
+           IF(lwp .AND. nprint > 1) THEN
+              write(numout,*) 'OPEN ', trim(cdrst_file), ' in one_file mode' 
+              IF(lflush) CALL FLUSH(numout)
+           ENDIF
         ELSE  
            CALL xios_set_file_attr( "wrestart", type="multiple_file", enabled=.TRUE.,& 
                                     mode="write", output_freq=xios_timestep) 
-           if(lwp .AND. nprint > 1) write(numout,*) 'OPEN ', trim(cdrst_file), ' in multiple_file mode' 
+           IF(lwp .AND. nprint > 1) THEN
+              write(numout,*) 'OPEN ', trim(cdrst_file), ' in multiple_file mode' 
+              IF(lflush) CALL FLUSH(numout)
+           ENDIF
         ENDIF 
         CALL xios_set_file_attr( "wrestart", name=trim(cdrst_file))
@@ -824,6 +839,8 @@
                iom_file(jf)%nfid       = 0          ! free the id 
                IF( PRESENT(kiomid) )   kiomid = 0   ! return 0 as id to specify that the file was closed
-               IF(lwp  .AND. nprint > 1) &
+               IF(lwp  .AND. nprint > 1) THEN
                  WRITE(numout,*) TRIM(clinfo)//' close file: '//TRIM(iom_file(jf)%name)//' ok'
+                 IF(lflush) CALL FLUSH(numout)
+               ENDIF
             ELSEIF( PRESENT(kiomid) ) THEN
                WRITE(ctmp1,*) '--->',  kiomid
@@ -942,5 +959,8 @@
       ELSE
 #if defined key_iomput
-         IF(lwp .AND. nprint > 1) WRITE(numout,*) 'XIOS RST READ (0D): ', trim(cdvar)
+         IF(lwp .AND. nprint > 1) THEN
+            WRITE(numout,*) 'XIOS RST READ (0D): ', trim(cdvar)
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          CALL iom_swap( TRIM(crxios_context) )
          CALL xios_recv_field( trim(cdvar), pvar)
@@ -1267,6 +1287,8 @@
 
             IF( istop == nstop ) THEN   ! no additional errors until this point...
-               IF(lwp .AND. nprint > 1) &
+               IF(lwp .AND. nprint > 1) THEN
                   WRITE(numout,"(10x,' read ',a,' (rec: ',i6,') in ',a,' ok')") TRIM(cdvar), itime, TRIM(iom_file(kiomid)%name)
+                  IF(lflush) CALL FLUSH(numout)
+               ENDIF
              
                !--- overlap areas and extra hallows (mpp)
@@ -1298,5 +1320,8 @@
          IF( PRESENT(pv_r3d) ) THEN
             pv_r3d(:, :, :) = 0.
-            if(lwp .AND. nprint > 1) write(numout,*) 'XIOS RST READ (3D): ',trim(cdvar)
+            IF(lwp .AND. nprint > 1) THEN
+               write(numout,*) 'XIOS RST READ (3D): ',trim(cdvar)
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             CALL xios_recv_field( trim(cdvar), pv_r3d)
             IF(idom /= jpdom_unknown ) then
@@ -1305,5 +1330,8 @@
          ELSEIF( PRESENT(pv_r2d) ) THEN
             pv_r2d(:, :) = 0.
-            if(lwp .AND. nprint > 1) write(numout,*) 'XIOS RST READ (2D): ', trim(cdvar)
+            IF(lwp .AND. nprint > 1) THEN
+               write(numout,*) 'XIOS RST READ (2D): ', trim(cdvar)
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             CALL xios_recv_field( trim(cdvar), pv_r2d)
             IF(idom /= jpdom_unknown ) THEN
@@ -1312,5 +1340,8 @@
          ELSEIF( PRESENT(pv_r1d) ) THEN
             pv_r1d(:) = 0.
-            if(lwp .AND. nprint > 1) write(numout,*) 'XIOS RST READ (1D): ', trim(cdvar)
+            IF(lwp .AND. nprint > 1) THEN
+               write(numout,*) 'XIOS RST READ (1D): ', trim(cdvar)
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             CALL xios_recv_field( trim(cdvar), pv_r1d)
          ENDIF
@@ -1514,5 +1545,8 @@
 #ifdef key_iomput
       IF( kt == kwrite ) THEN
-          IF(lwp .AND. nprint > 1) write(numout,*) 'RESTART: write (XIOS 0D) ',trim(cdvar)
+          IF(lwp .AND. nprint > 1) THEN
+             write(numout,*) 'RESTART: write (XIOS 0D) ',trim(cdvar)
+             IF(lflush) CALL FLUSH(numout)
+          ENDIF
           CALL xios_send_field(trim(cdvar), pvar)
       ENDIF
@@ -1544,5 +1578,8 @@
 #ifdef key_iomput
       IF( kt == kwrite ) THEN
-         IF(lwp .AND. nprint > 1) write(numout,*) 'RESTART: write (XIOS 1D) ',trim(cdvar)
+         IF(lwp .AND. nprint > 1) THEN
+            write(numout,*) 'RESTART: write (XIOS 1D) ',trim(cdvar)
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          CALL xios_send_field(trim(cdvar), pvar)
       ENDIF
@@ -1574,5 +1611,8 @@
 #ifdef key_iomput
       IF( kt == kwrite ) THEN
-         IF(lwp .AND. nprint > 1) write(numout,*) 'RESTART: write (XIOS 2D) ',trim(cdvar)
+         IF(lwp .AND. nprint > 1) THEN
+            write(numout,*) 'RESTART: write (XIOS 2D) ',trim(cdvar)
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          CALL xios_send_field(trim(cdvar), pvar)
       ENDIF
@@ -1604,5 +1644,8 @@
 #ifdef key_iomput
       IF( kt == kwrite ) THEN
-         IF(lwp .AND. nprint > 1) write(numout,*) 'RESTART: write (XIOS 3D) ',trim(cdvar)
+         IF(lwp .AND. nprint > 1) THEN
+            write(numout,*) 'RESTART: write (XIOS 3D) ',trim(cdvar)
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          CALL xios_send_field(trim(cdvar), pvar)
       ENDIF
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/IOM/iom_nf90.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/IOM/iom_nf90.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/IOM/iom_nf90.F90	(revision 10986)
@@ -88,5 +88,8 @@
          !                                       !=========================!
          IF( ldwrt ) THEN  ! ... in write mode
-            IF(lwp .AND. nprint > 0) WRITE(numout,*) TRIM(clinfo)//' open existing file: '//TRIM(cdname)//' in WRITE mode'
+            IF(lwp .AND. nprint > 0) THEN
+               WRITE(numout,*) TRIM(clinfo)//' open existing file: '//TRIM(cdname)//' in WRITE mode'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             IF( snc4set%luse ) THEN
                CALL iom_nf90_check(NF90_OPEN( TRIM(cdname), NF90_WRITE  , if90id ), clinfo)
@@ -96,5 +99,8 @@
             CALL iom_nf90_check(NF90_SET_FILL( if90id, NF90_NOFILL, idmy                          ), clinfo)
          ELSE              ! ... in read mode
-            IF(lwp .AND. nprint > 0) WRITE(numout,*) TRIM(clinfo)//' open existing file: '//TRIM(cdname)//' in READ mode'
+            IF(lwp .AND. nprint > 0) THEN
+               WRITE(numout,*) TRIM(clinfo)//' open existing file: '//TRIM(cdname)//' in READ mode'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             CALL iom_nf90_check(NF90_OPEN( TRIM(cdname), NF90_NOWRITE, if90id, chunksize = ichunk ), clinfo)
          ENDIF
@@ -107,5 +113,8 @@
                cdname = TRIM(cltmp)
             ENDIF
-            IF(lwp .AND. nprint > 0) WRITE(numout,*) TRIM(clinfo)//' create new file: '//TRIM(cdname)//' in WRITE mode'
+            IF(lwp .AND. nprint > 0) THEN
+               WRITE(numout,*) TRIM(clinfo)//' create new file: '//TRIM(cdname)//' in WRITE mode'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
 
             IF( llclobber ) THEN   ;   imode = IOR( NF90_64BIT_OFFSET, NF90_CLOBBER   )
@@ -113,5 +122,8 @@
             ENDIF
             IF( snc4set%luse ) THEN
-               IF(lwp .AND. nprint > 0) WRITE(numout,*) TRIM(clinfo)//' creating file: '//TRIM(cdname)//' in hdf5 (netcdf4) mode'
+               IF(lwp .AND. nprint > 0) THEN
+                  WRITE(numout,*) TRIM(clinfo)//' creating file: '//TRIM(cdname)//' in hdf5 (netcdf4) mode'
+                  IF(lflush) CALL FLUSH(numout)
+               ENDIF
                CALL GET_NF90_SYMBOL("NF90_HDF5", ihdf5)
                IF( llclobber ) THEN   ;   imode = IOR(ihdf5, NF90_CLOBBER)
@@ -165,5 +177,8 @@
                &                                       len  = iom_file(kiomid)%lenuld ), clinfo )
          ENDIF
-         IF(lwp .AND. nprint > 0) WRITE(numout,*) '                   ---> '//TRIM(cdname)//' OK'
+         IF(lwp .AND. nprint > 0) THEN
+            WRITE(numout,*) '                   ---> '//TRIM(cdname)//' OK'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
       ELSE
          kiomid = 0               ! return error flag
@@ -562,5 +577,8 @@
          ! trick: defined to 0 to say that dimension variables are defined but not yet written
          iom_file(kiomid)%dimsz(1, 1)  = 0   
-         IF(lwp .AND. nprint > 1) WRITE(numout,*) TRIM(clinfo)//' define dimension variables done'
+         IF(lwp .AND. nprint > 1) THEN
+            WRITE(numout,*) TRIM(clinfo)//' define dimension variables done'
+            IF(lflush) CALL FLUSH(numout)
+          ENDIF
       ENDIF
       ! define the data if it is not already done
@@ -637,7 +655,13 @@
             CALL iom_nf90_check(SET_NF90_DEF_VAR_CHUNKING(if90id, idvar, ichunkalg, ichunksz), clinfo)
             CALL iom_nf90_check(SET_NF90_DEF_VAR_DEFLATE(if90id, idvar, ishuffle, ideflate, ideflate_level), clinfo)
-            IF(lwp .AND. nprint > 1) WRITE(numout,*) TRIM(clinfo)//' chunked ok. Chunks sizes: ', ichunksz
-         ENDIF
-         IF(lwp .AND. nprint > 1) WRITE(numout,*) TRIM(clinfo)//' defined ok'
+            IF(lwp .AND. nprint > 1) THEN
+               WRITE(numout,*) TRIM(clinfo)//' chunked ok. Chunks sizes: ', ichunksz
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
+         ENDIF
+         IF(lwp .AND. nprint > 1) THEN
+            WRITE(numout,*) TRIM(clinfo)//' defined ok'
+            IF(lflush) CALL FLUSH(numout)
+          ENDIF
       ELSE
          idvar = kvid
@@ -685,5 +709,8 @@
                CALL iom_nf90_check( NF90_INQUIRE_DIMENSION( if90id, 3, len = iom_file(kiomid)%dimsz(1,3) ), clinfo )
                iom_file(kiomid)%dimsz(1  , 4) = 1   ! unlimited dimension
-               IF(lwp .AND. nprint > 1) WRITE(numout,*) TRIM(clinfo)//' write dimension variables done'
+               IF(lwp .AND. nprint > 1) THEN
+                  WRITE(numout,*) TRIM(clinfo)//' write dimension variables done'
+                  IF(lflush) CALL FLUSH(numout)
+               ENDIF
             ENDIF
          ENDIF
@@ -703,5 +730,8 @@
          IF( iom_file(kiomid)%luld(idvar) )   iom_file(kiomid)%dimsz(iom_file(kiomid)%ndims(idvar), idvar)    &
                &                            = iom_file(kiomid)%dimsz(iom_file(kiomid)%ndims(idvar), idvar) + 1
-         IF(lwp .AND. nprint > 0) WRITE(numout,*) TRIM(clinfo)//' written ok'
+         IF(lwp .AND. nprint > 0) THEN
+            WRITE(numout,*) TRIM(clinfo)//' written ok'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
       ENDIF
       !     
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/IOM/prtctl.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/IOM/prtctl.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/IOM/prtctl.F90	(revision 10986)
@@ -493,6 +493,9 @@
          zidom = zidom + ilcitl(ji,1) - nrecil
       END DO
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*)' sum ilcitl(i,1) = ', zidom, ' jpiglo = ', jpiglo
+      IF(lwp) THEN 
+         WRITE(numout,*)
+         WRITE(numout,*)' sum ilcitl(i,1) = ', zidom, ' jpiglo = ', jpiglo
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
       
       zjdom = nrecjl
@@ -500,6 +503,9 @@
          zjdom = zjdom + ilcjtl(1,jj) - nrecjl
       END DO
-      IF(lwp) WRITE(numout,*)' sum ilcitl(1,j) = ', zjdom, ' jpjglo = ', jpjglo
-      IF(lwp) WRITE(numout,*)
+      IF(lwp) THEN
+         WRITE(numout,*)' sum ilcitl(1,j) = ', zjdom, ' jpjglo = ', jpjglo
+         WRITE(numout,*)
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
       
 
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/IOM/restart.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/IOM/restart.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/IOM/restart.F90	(revision 10986)
@@ -104,4 +104,5 @@
                   ENDIF
                ENDIF
+               IF(lflush) CALL FLUSH(numout)
             ENDIF
             !
@@ -211,4 +212,5 @@
             IF ( snc4set%luse )      WRITE(numout,*) 'rst_read : configured with NetCDF4 support'
             WRITE(numout,*) '~~~~~~~~'
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
          lxios_sini = .FALSE.
@@ -223,5 +225,8 @@
              crxios_context = 'nemo_rst'
              IF( .NOT.lxios_set ) THEN
-                 IF(lwp .AND. nprint > 0) WRITE(numout,*) 'Enable restart reading by XIOS'
+                 IF(lwp .AND. nprint > 0) THEN
+                    WRITE(numout,*) 'Enable restart reading by XIOS'
+                    IF(lflush) CALL FLUSH(numout)
+                 ENDIF
                  CALL iom_init( crxios_context, ld_tmppatch = .false. )
                  lxios_set = .TRUE.
@@ -230,5 +235,8 @@
          IF( TRIM(Agrif_CFixed()) /= '0' .AND. lrxios) THEN
              CALL iom_init( crxios_context, ld_tmppatch = .false. )
-             IF(lwp .AND. nprint > 0) WRITE(numout,*) 'Enable restart reading by XIOS for AGRIF'
+             IF(lwp .AND. nprint > 0) THEN
+                WRITE(numout,*) 'Enable restart reading by XIOS for AGRIF'
+                IF(lflush) CALL FLUSH(numout)
+             ENDIF
              lxios_set = .TRUE.
          ENDIF 
@@ -264,6 +272,8 @@
       IF( ln_diurnal ) CALL iom_get( numror, jpdom_autoglo, 'Dsst' , x_dsst, ldxios = lrxios ) 
       IF ( ln_diurnal_only ) THEN 
-         IF(lwp) WRITE( numout, * ) &
-         &   "rst_read:- ln_diurnal_only set, setting rhop=rau0" 
+         IF(lwp) THEN
+            WRITE( numout, * ) "rst_read:- ln_diurnal_only set, setting rhop=rau0" 
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          rhop = rau0
          CALL iom_get( numror, jpdom_autoglo, 'tn'     , w3d, ldxios = lrxios ) 
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/LBC/lib_mpp.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/LBC/lib_mpp.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/LBC/lib_mpp.F90	(revision 10986)
@@ -617,5 +617,8 @@
          !                                       --------------------------
          IF ( SIZE(todelay(idvar)%z1d) /= isz ) THEN                  ! Check dimension coherence
-            IF(lwp) WRITE(numout,*) ' WARNING: the nb of delayed variables in restart file is not the model one'
+            IF(lwp) THEN
+               WRITE(numout,*) ' WARNING: the nb of delayed variables in restart file is not the model one'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             DEALLOCATE(todelay(idvar)%z1d)
             ndelayid(idvar) = -1                                      ! do as if we had no restart
@@ -684,5 +687,8 @@
          !                                       --------------------------
          IF ( SIZE(todelay(idvar)%z1d) /= isz ) THEN                  ! Check dimension coherence
-            IF(lwp) WRITE(numout,*) ' WARNING: the nb of delayed variables in restart file is not the model one'
+            IF(lwp) THEN
+               WRITE(numout,*) ' WARNING: the nb of delayed variables in restart file is not the model one'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             DEALLOCATE(todelay(idvar)%z1d)
             ndelayid(idvar) = -1                                      ! do as if we had no restart
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/LBC/mppini.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/LBC/mppini.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/LBC/mppini.F90	(revision 10986)
@@ -94,4 +94,5 @@
          WRITE(numout,*) '   l_Iperio = ', l_Iperio, '    l_Jperio = ', l_Jperio 
          WRITE(numout,*) '     npolj  = ',   npolj , '      njmpp  = ', njmpp
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -189,4 +190,5 @@
          WRITE(numout,*) '~~~~~~~~ '
          WRITE(numout,*)
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       IF( jpni < 1 .OR. jpnj < 1 ) THEN
@@ -211,4 +213,5 @@
             WRITE(numout,9000) '      - has mpi subdomains with a maximum size of (jpi = ',  iimax, ', jpj = ',  ijmax,   &
                &                                                             ', jpi*jpj = ',  iimax* ijmax, ')'
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
          IF( iimax*ijmax < jpimax*jpjmax ) THEN   ! chosen subdomain size is larger that the best subdomain size
@@ -264,4 +267,5 @@
             ENDIF
             WRITE(numout,*)
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
          CALL mpp_init_bestpartition( mppsize, ldlist = .TRUE. )   ! must be done by all core
@@ -284,4 +288,5 @@
             WRITE(numout,9003) '   Number of suppressed land subdomains = ', jpni*jpnj - inijmin
             WRITE(numout,*)
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
       ENDIF
@@ -337,4 +342,5 @@
          WRITE(numout,*) '      sum ilci(i,1) = ', sum(ilci(:,1)), ' jpiglo = ', jpiglo
          WRITE(numout,*) '      sum ilcj(1,j) = ', sum(ilcj(1,:)), ' jpjglo = ', jpjglo
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
      
@@ -507,4 +513,6 @@
             il1 = il1+ifreq
          END DO
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
  9400    FORMAT('           ***'   ,20('*************',a3)    )
  9403    FORMAT('           *     ',20('         *   ',a3)    )
@@ -512,5 +520,4 @@
  9402    FORMAT('       ',i3,' *  ',20(i3,'  x',i3,'   *   ') )
  9404    FORMAT('           *  '   ,20('      ',i3,'   *   ') )
-      ENDIF
          
       ! just to save nono etc for all proc
@@ -647,4 +654,5 @@
          WRITE(numout,*) '      nrecj  = ', nrecj  
          WRITE(numout,*) '      nn_hls = ', nn_hls 
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -655,4 +663,5 @@
             WRITE(numout,*)
             WRITE(numout,*) '   ==>>>   North fold boundary prepared for jpni >1'
+            IF(lflush) CALL FLUSH(numout)
             ! additional prints in layout.dat
          ENDIF
@@ -948,4 +957,5 @@
             WRITE(numout,         *) '  --------------------------------------', '-----', '--------------'
             WRITE(numout,*)
+            IF(lflush) CALL FLUSH(numout)
          END IF
          iitarget = MINLOC( inbi0(:)*inbj0(:), mask = inbi0(:)*inbj0(:) >= knbij, dim = 1 )
@@ -955,8 +965,11 @@
             inbij = COUNT(llisoce)
             DEALLOCATE( llisoce )
-            IF(lwp) WRITE(numout,'(a, i5, a, i5, a, i4, a, i4, a, i9, a, i5, a, i5, a)')    &
+            IF(lwp) THEN
+               WRITE(numout,'(a, i5, a, i5, a, i4, a, i4, a, i9, a, i5, a, i5, a)')    &
                &     'nb_cores ' , inbij,' oce + ', inbi0(ji)*inbj0(ji) - inbij             &
                &                                , ' land ( ', inbi0(ji),' x ', inbj0(ji),   &
                & ' ), nb_points ', iszi0(ji)*iszj0(ji),' ( ', iszi0(ji),' x ', iszj0(ji),' )'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
          END DO
          DEALLOCATE( inbi0, inbj0, iszi0, iszj0 )
@@ -1171,4 +1184,5 @@
           WRITE(numout,*) '                    ihals = ', ihals(1), ihals(2)
           WRITE(numout,*) '                    ihale = ', ihale(1), ihale(2)
+          IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/LDF/ldfc1d_c2d.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/LDF/ldfc1d_c2d.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/LDF/ldfc1d_c2d.F90	(revision 10986)
@@ -61,6 +61,9 @@
       !!----------------------------------------------------------------------
       !
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) '   ldf_c1d : set a given profile to eddy mixing coefficients'
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) '   ldf_c1d : set a given profile to eddy mixing coefficients'
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
       !
       ! initialization of the profile
@@ -134,6 +137,9 @@
       !!----------------------------------------------------------------------
       !
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) '   ldf_c2d :   aht = Ufac * max(e1,e2)   with Ufac = ', pUfac, ' m/s'
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) '   ldf_c2d :   aht = Ufac * max(e1,e2)   with Ufac = ', pUfac, ' m/s'
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
       !
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/LDF/ldfdyn.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/LDF/ldfdyn.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/LDF/ldfdyn.F90	(revision 10986)
@@ -151,4 +151,5 @@
          WRITE(numout,*) '            lower limit (default 1.0)         rn_minfac    = ', rn_minfac
          WRITE(numout,*) '            upper limit (default 1.0)         rn_maxfac    = ', rn_maxfac
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -224,4 +225,5 @@
          END SELECT
          WRITE(numout,*)
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       
@@ -233,5 +235,8 @@
       !
       IF( ln_dynldf_OFF ) THEN
-         IF(lwp) WRITE(numout,*) '   ==>>>   No viscous operator selected. ahmt and ahmf are not allocated'
+         IF(lwp) THEN
+            WRITE(numout,*) '   ==>>>   No viscous operator selected. ahmt and ahmf are not allocated'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          RETURN
          !
@@ -255,11 +260,17 @@
          !
          CASE(   0  )      !==  constant  ==!
-            IF(lwp) WRITE(numout,*) '   ==>>>   eddy viscosity. = constant = ', zah0, cl_Units
+            IF(lwp) THEN
+               WRITE(numout,*) '   ==>>>   eddy viscosity. = constant = ', zah0, cl_Units
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             ahmt(:,:,1:jpkm1) = zah0
             ahmf(:,:,1:jpkm1) = zah0
             !
          CASE(  10  )      !==  fixed profile  ==!
-            IF(lwp) WRITE(numout,*) '   ==>>>   eddy viscosity = F( depth )'
-            IF(lwp) WRITE(numout,*) '           surface viscous coef. = constant = ', zah0, cl_Units
+            IF(lwp) THEN
+               WRITE(numout,*) '   ==>>>   eddy viscosity = F( depth )'
+               WRITE(numout,*) '           surface viscous coef. = constant = ', zah0, cl_Units
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             ahmt(:,:,1) = zah0                        ! constant surface value
             ahmf(:,:,1) = zah0
@@ -267,5 +278,8 @@
             !
          CASE ( -20 )      !== fixed horizontal shape read in file  ==!
-            IF(lwp) WRITE(numout,*) '   ==>>>   eddy viscosity = F(i,j) read in eddy_viscosity.nc file'
+            IF(lwp) THEN
+               WRITE(numout,*) '   ==>>>   eddy viscosity = F(i,j) read in eddy_viscosity.nc file'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             CALL iom_open( 'eddy_viscosity_2D.nc', inum )
             CALL iom_get ( inum, jpdom_data, 'ahmt_2d', ahmt(:,:,1) )
@@ -278,11 +292,17 @@
             !
          CASE(  20  )      !== fixed horizontal shape  ==!
-            IF(lwp) WRITE(numout,*) '   ==>>>   eddy viscosity = F( e1, e2 ) or F( e1^3, e2^3 ) (lap. or blp. case)'
-            IF(lwp) WRITE(numout,*) '           using a fixed viscous velocity = ', rn_Uv  ,' m/s   and   Lv = Max(e1,e2)'
-            IF(lwp) WRITE(numout,*) '           maximum reachable coefficient (at the Equator) = ', zah_max, cl_Units, '  for e1=1°)'
+            IF(lwp) THEN
+               WRITE(numout,*) '   ==>>>   eddy viscosity = F( e1, e2 ) or F( e1^3, e2^3 ) (lap. or blp. case)'
+               WRITE(numout,*) '           using a fixed viscous velocity = ', rn_Uv  ,' m/s   and   Lv = Max(e1,e2)'
+               WRITE(numout,*) '           maximum reachable coefficient (at the Equator) = ', zah_max, cl_Units, '  for e1=1°)'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             CALL ldf_c2d( 'DYN', zUfac      , inn        , ahmt, ahmf )         ! surface value proportional to scale factor^inn
             !
          CASE( -30  )      !== fixed 3D shape read in file  ==!
-            IF(lwp) WRITE(numout,*) '   ==>>>   eddy viscosity = F(i,j,k) read in eddy_viscosity_3D.nc file'
+            IF(lwp) THEN
+               WRITE(numout,*) '   ==>>>   eddy viscosity = F(i,j,k) read in eddy_viscosity_3D.nc file'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             CALL iom_open( 'eddy_viscosity_3D.nc', inum )
             CALL iom_get ( inum, jpdom_data, 'ahmt_3d', ahmt )
@@ -291,19 +311,28 @@
             !
          CASE(  30  )       !==  fixed 3D shape  ==!
-            IF(lwp) WRITE(numout,*) '   ==>>>   eddy viscosity = F( latitude, longitude, depth )'
-            IF(lwp) WRITE(numout,*) '           using a fixed viscous velocity = ', rn_Uv  ,' m/s   and   Ld = Max(e1,e2)'
-            IF(lwp) WRITE(numout,*) '           maximum reachable coefficient (at the Equator) = ', zah_max, cl_Units, '  for e1=1°)'
+            IF(lwp) THEN
+               WRITE(numout,*) '   ==>>>   eddy viscosity = F( latitude, longitude, depth )'
+               WRITE(numout,*) '           using a fixed viscous velocity = ', rn_Uv  ,' m/s   and   Ld = Max(e1,e2)'
+               WRITE(numout,*) '           maximum reachable coefficient (at the Equator) = ', zah_max, cl_Units, '  for e1=1°)'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             CALL ldf_c2d( 'DYN', zUfac      , inn        , ahmt, ahmf )         ! surface value proportional to scale factor^inn
             CALL ldf_c1d( 'DYN', ahmt(:,:,1), ahmf(:,:,1), ahmt, ahmf )  ! reduction with depth
             !
          CASE(  31  )       !==  time varying 3D field  ==!
-            IF(lwp) WRITE(numout,*) '   ==>>>   eddy viscosity = F( latitude, longitude, depth , time )'
-            IF(lwp) WRITE(numout,*) '           proportional to the local velocity : 1/2 |u|e (lap) or 1/12 |u|e^3 (blp)'
+            IF(lwp) THEN
+               WRITE(numout,*) '   ==>>>   eddy viscosity = F( latitude, longitude, depth , time )'
+               WRITE(numout,*) '           proportional to the local velocity : 1/2 |u|e (lap) or 1/12 |u|e^3 (blp)'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             !
             l_ldfdyn_time = .TRUE.     ! will be calculated by call to ldf_dyn routine in step.F90
             !
          CASE(  32  )       !==  time varying 3D field  ==!
-            IF(lwp) WRITE(numout,*) '   ==>>>   eddy viscosity = F( latitude, longitude, depth , time )'
-            IF(lwp) WRITE(numout,*) '           proportional to the local deformation rate and gridscale (Smagorinsky)'
+            IF(lwp) THEN
+               WRITE(numout,*) '   ==>>>   eddy viscosity = F( latitude, longitude, depth , time )'
+               WRITE(numout,*) '           proportional to the local deformation rate and gridscale (Smagorinsky)'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             !
             l_ldfdyn_time = .TRUE.     ! will be calculated by call to ldf_dyn routine in step.F90
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/LDF/ldfslp.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/LDF/ldfslp.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/LDF/ldfslp.F90	(revision 10986)
@@ -746,4 +746,5 @@
          WRITE(numout,*) 'ldf_slp_init : direction of lateral mixing'
          WRITE(numout,*) '~~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -752,5 +753,8 @@
       !
       IF( ln_traldf_triad ) THEN        ! Griffies operator : triad of slopes
-         IF(lwp) WRITE(numout,*) '   ==>>>   triad) operator (Griffies)'
+         IF(lwp) THEN
+            WRITE(numout,*) '   ==>>>   triad) operator (Griffies)'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          ALLOCATE( triadi_g(jpi,jpj,jpk,0:1,0:1) , triadj_g(jpi,jpj,jpk,0:1,0:1) ,     &
             &      triadi  (jpi,jpj,jpk,0:1,0:1) , triadj  (jpi,jpj,jpk,0:1,0:1) ,     &
@@ -760,5 +764,8 @@
          !
       ELSE                             ! Madec operator : slopes at u-, v-, and w-points
-         IF(lwp) WRITE(numout,*) '   ==>>>   iso operator (Madec)'
+         IF(lwp) THEN
+            WRITE(numout,*) '   ==>>>   iso operator (Madec)'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          ALLOCATE( omlmask(jpi,jpj,jpk) ,                                                                        &
             &      uslp(jpi,jpj,jpk) , uslpml(jpi,jpj) , wslpi(jpi,jpj,jpk) , wslpiml(jpi,jpj) ,     &
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/LDF/ldftra.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/LDF/ldftra.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/LDF/ldftra.F90	(revision 10986)
@@ -146,4 +146,5 @@
          WRITE(numout,*) 'ldf_tra_init : lateral tracer diffusion'
          WRITE(numout,*) '~~~~~~~~~~~~ '
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       
@@ -180,4 +181,5 @@
          WRITE(numout,*) '            lateral diffusive velocity (if cst)  rn_Ud           = ', rn_Ud, ' m/s'
          WRITE(numout,*) '            lateral diffusive length   (if cst)  rn_Ld           = ', rn_Ld, ' m'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -271,4 +273,5 @@
          END SELECT
          WRITE(numout,*)
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -281,5 +284,8 @@
       IF( ln_traldf_OFF ) THEN               !== no explicit diffusive operator  ==!
          !
-         IF(lwp) WRITE(numout,*) '   ==>>>   No diffusive operator selected. ahtu and ahtv are not allocated'
+         IF(lwp) THEN
+            WRITE(numout,*) '   ==>>>   No diffusive operator selected. ahtu and ahtv are not allocated'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          RETURN
          !
@@ -304,11 +310,17 @@
          !
          CASE(   0  )      !==  constant  ==!
-            IF(lwp) WRITE(numout,*) '   ==>>>   eddy diffusivity = constant = ', aht0, cl_Units
+            IF(lwp) THEN
+               WRITE(numout,*) '   ==>>>   eddy diffusivity = constant = ', aht0, cl_Units
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             ahtu(:,:,1:jpkm1) = aht0
             ahtv(:,:,1:jpkm1) = aht0
             !
          CASE(  10  )      !==  fixed profile  ==!
-            IF(lwp) WRITE(numout,*) '   ==>>>   eddy diffusivity = F( depth )'
-            IF(lwp) WRITE(numout,*) '           surface eddy diffusivity = constant = ', aht0, cl_Units
+            IF(lwp) THEN
+               WRITE(numout,*) '   ==>>>   eddy diffusivity = F( depth )'
+               WRITE(numout,*) '           surface eddy diffusivity = constant = ', aht0, cl_Units
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             ahtu(:,:,1) = aht0                        ! constant surface value
             ahtv(:,:,1) = aht0
@@ -316,5 +328,8 @@
             !
          CASE ( -20 )      !== fixed horizontal shape and magnitude read in file  ==!
-            IF(lwp) WRITE(numout,*) '   ==>>>   eddy diffusivity = F(i,j) read in eddy_diffusivity.nc file'
+            IF(lwp) THEN
+               WRITE(numout,*) '   ==>>>   eddy diffusivity = F(i,j) read in eddy_diffusivity.nc file'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             CALL iom_open( 'eddy_diffusivity_2D.nc', inum )
             CALL iom_get ( inum, jpdom_data, 'ahtu_2D', ahtu(:,:,1) )
@@ -327,14 +342,20 @@
             !
          CASE(  20  )      !== fixed horizontal shape  ==!
-            IF(lwp) WRITE(numout,*) '   ==>>>   eddy diffusivity = F( e1, e2 ) or F( e1^3, e2^3 ) (lap or blp case)'
-            IF(lwp) WRITE(numout,*) '           using a fixed diffusive velocity = ', rn_Ud,' m/s   and   Ld = Max(e1,e2)'
-            IF(lwp) WRITE(numout,*) '           maximum reachable coefficient (at the Equator) = ', zah_max, cl_Units, '  for e1=1°)'
+            IF(lwp) THEN
+               WRITE(numout,*) '   ==>>>   eddy diffusivity = F( e1, e2 ) or F( e1^3, e2^3 ) (lap or blp case)'
+               WRITE(numout,*) '           using a fixed diffusive velocity = ', rn_Ud,' m/s   and   Ld = Max(e1,e2)'
+               WRITE(numout,*) '           maximum reachable coefficient (at the Equator) = ', zah_max, cl_Units, '  for e1=1°)'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             CALL ldf_c2d( 'TRA', zUfac      , inn        , ahtu, ahtv )    ! value proportional to scale factor^inn
             !
          CASE(  21  )      !==  time varying 2D field  ==!
-            IF(lwp) WRITE(numout,*) '   ==>>>   eddy diffusivity = F( latitude, longitude, time )'
-            IF(lwp) WRITE(numout,*) '                            = F( growth rate of baroclinic instability )'
-            IF(lwp) WRITE(numout,*) '            min value = 0.2 * aht0 (with aht0= 1/2 rn_Ud*rn_Ld)'
-            IF(lwp) WRITE(numout,*) '            max value =       aei0 (with aei0=1/2 rn_Ue*Le  increased to aht0 within 20N-20S'
+            IF(lwp) THEN
+               WRITE(numout,*) '   ==>>>   eddy diffusivity = F( latitude, longitude, time )'
+               WRITE(numout,*) '                            = F( growth rate of baroclinic instability )'
+               WRITE(numout,*) '            min value = 0.2 * aht0 (with aht0= 1/2 rn_Ud*rn_Ld)'
+               WRITE(numout,*) '            max value =       aei0 (with aei0=1/2 rn_Ue*Le  increased to aht0 within 20N-20S'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             !
             l_ldftra_time = .TRUE.     ! will be calculated by call to ldf_tra routine in step.F90
@@ -344,5 +365,8 @@
             !
          CASE( -30  )      !== fixed 3D shape read in file  ==!
-            IF(lwp) WRITE(numout,*) '   ==>>>   eddy diffusivity = F(i,j,k) read in eddy_diffusivity.nc file'
+            IF(lwp) THEN
+               WRITE(numout,*) '   ==>>>   eddy diffusivity = F(i,j,k) read in eddy_diffusivity.nc file'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             CALL iom_open( 'eddy_diffusivity_3D.nc', inum )
             CALL iom_get ( inum, jpdom_data, 'ahtu_3D', ahtu )
@@ -351,13 +375,19 @@
             !
          CASE(  30  )      !==  fixed 3D shape  ==!
-            IF(lwp) WRITE(numout,*) '   ==>>>   eddy diffusivity = F( latitude, longitude, depth )'
-            IF(lwp) WRITE(numout,*) '           using a fixed diffusive velocity = ', rn_Ud,' m/s   and   Ld = Max(e1,e2)'
-            IF(lwp) WRITE(numout,*) '           maximum reachable coefficient (at the Equator) = ', zah_max, cl_Units, '  for e1=1°)'
+            IF(lwp) THEN
+               WRITE(numout,*) '   ==>>>   eddy diffusivity = F( latitude, longitude, depth )'
+               WRITE(numout,*) '           using a fixed diffusive velocity = ', rn_Ud,' m/s   and   Ld = Max(e1,e2)'
+               WRITE(numout,*) '           maximum reachable coefficient (at the Equator) = ', zah_max, cl_Units, '  for e1=1°)'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             CALL ldf_c2d( 'TRA', zUfac      , inn        , ahtu, ahtv )    ! surface value proportional to scale factor^inn
             CALL ldf_c1d( 'TRA', ahtu(:,:,1), ahtv(:,:,1), ahtu, ahtv )    ! reduction with depth
             !
          CASE(  31  )      !==  time varying 3D field  ==!
-            IF(lwp) WRITE(numout,*) '   ==>>>   eddy diffusivity = F( latitude, longitude, depth , time )'
-            IF(lwp) WRITE(numout,*) '           proportional to the velocity : 1/2 |u|e or 1/12 |u|e^3'
+            IF(lwp) THEN
+               WRITE(numout,*) '   ==>>>   eddy diffusivity = F( latitude, longitude, depth , time )'
+               WRITE(numout,*) '           proportional to the velocity : 1/2 |u|e or 1/12 |u|e^3'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             !
             l_ldftra_time = .TRUE.     ! will be calculated by call to ldf_tra routine in step.F90
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/OBS/obs_write.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/OBS/obs_write.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/OBS/obs_write.F90	(revision 10986)
@@ -186,4 +186,5 @@
          WRITE(numout,*)'~~~~~~~~~~~~~'
          WRITE(numout,*)'Writing '//TRIM(clfiletype)//' feedback file : ',TRIM(clfname)
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -458,4 +459,5 @@
          WRITE(numout,*)'~~~~~~~~~~~~~'
          WRITE(numout,*)'Writing '//TRIM(surfdata%cvars(1))//' feedback file : ',TRIM(clfname)
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -571,4 +573,5 @@
          WRITE(numout,*) 'obs_wri_stats :'
          WRITE(numout,*) '~~~~~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -600,4 +603,5 @@
             WRITE(numout,*) 'Overall RMS obs minus model of the good observations: ',sqrt( zsumx2/inumgoodobsmpp )
             WRITE(numout,*) ''
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
 
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/OBS/obsinter_h2d.h90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/OBS/obsinter_h2d.h90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/OBS/obsinter_h2d.h90	(revision 10986)
@@ -281,4 +281,5 @@
                   WRITE(numout,*)'Switching to great circle distance'
                   WRITE(numout,*)
+                  IF(lflush) CALL FLUSH(numout)
                ENDIF
                CALL obs_int_h2d_ds1( kpk2, ikmax,                        &
@@ -1129,4 +1130,5 @@
             WRITE(numout,*)' Iterations for i,j exceed max iteration count!'
             WRITE(numout,*)
+            IF(lflush) CALL FLUSH(numout)
             
             ldfail = .TRUE.
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/cpl_oasis3.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/cpl_oasis3.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/cpl_oasis3.F90	(revision 10986)
@@ -157,8 +157,11 @@
          IF( njmpp + jpj - 1 == jpjglo ) nlej = jpj
       ENDIF 
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) 'cpl_define : initialization in coupled ocean/atmosphere case'
-      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~~~~'
-      IF(lwp) WRITE(numout,*)
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'cpl_define : initialization in coupled ocean/atmosphere case'
+         WRITE(numout,*) '~~~~~~~~~~~~~~~~~'
+         WRITE(numout,*)
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
 
       ncplmodel = kcplmodel
@@ -208,4 +211,5 @@
          WRITE(numout,*) ' multiexchg: nldi, nlei, nimpp =', nldi, nlei, nimpp
          WRITE(numout,*) ' multiexchg: nldj, nlej, njmpp =', nldj, nlej, njmpp
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
    
@@ -243,5 +247,8 @@
                   END IF
 #endif
-                  IF( ln_ctl ) WRITE(numout,*) "Define", ji, jc, jm, " "//TRIM(zclname), " for ", OASIS_Out
+                  IF( ln_ctl ) THEN 
+                     WRITE(numout,*) "Define", ji, jc, jm, " "//TRIM(zclname), " for ", OASIS_Out
+                     IF(lflush) CALL FLUSH(numout)
+                  ENDIF
                   CALL oasis_def_var (ssnd(ji)%nid(jc,jm), zclname, id_part   , (/ 2, 1 /),   &
                      &                OASIS_Out          , ishape , OASIS_REAL, nerror )
@@ -288,5 +295,8 @@
                   END IF
 #endif
-                  IF( ln_ctl ) WRITE(numout,*) "Define", ji, jc, jm, " "//TRIM(zclname), " for ", OASIS_In
+                  IF( ln_ctl ) THEN
+                     WRITE(numout,*) "Define", ji, jc, jm, " "//TRIM(zclname), " for ", OASIS_In
+                     IF(lflush) CALL FLUSH(numout)
+                  ENDIF
                   CALL oasis_def_var (srcv(ji)%nid(jc,jm), zclname, id_part   , (/ 2, 1 /),   &
                      &                OASIS_In           , ishape , OASIS_REAL, nerror )
@@ -361,4 +371,5 @@
                      WRITE(numout,*) '     -     Sum value is ', SUM(pdata(:,:,jc))
                      WRITE(numout,*) '****************'
+                     IF(lflush) CALL FLUSH(numout)
                   ENDIF
                ENDIF
@@ -420,5 +431,8 @@
                   &        kinfo == OASIS_RecvOut .OR. kinfo == OASIS_FromRestOut
                
-               IF ( ln_ctl )   WRITE(numout,*) "llaction, kinfo, kstep, ivarid: " , llaction, kinfo, kstep, srcv(kid)%nid(jc,jm)
+               IF ( ln_ctl )   THEN
+                  WRITE(numout,*) "llaction, kinfo, kstep, ivarid: " , llaction, kinfo, kstep, srcv(kid)%nid(jc,jm)
+                  IF(lflush) CALL FLUSH(numout)
+               ENDIF
                
                IF ( llaction ) THEN
@@ -442,4 +456,5 @@
                      WRITE(numout,*) '     -     Sum value is ', SUM(pdata(:,:,jc))
                      WRITE(numout,*) '****************'
+                     IF(lflush) CALL FLUSH(numout)
                   ENDIF
                   
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/fldread.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/fldread.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/fldread.F90	(revision 10986)
@@ -304,4 +304,5 @@
                      & sd(jf)%nrec_b(1), sd(jf)%nrec_a(1), REAL(sd(jf)%nrec_b(2),wp)/rday, REAL(sd(jf)%nrec_a(2),wp)/rday
                   WRITE(numout, *) '      it_offset is : ',it_offset
+                  IF(lflush) CALL FLUSH(numout)
                ENDIF
                ! temporal interpolation weights
@@ -315,4 +316,5 @@
                   WRITE(numout, clfmt) TRIM(sd(jf)%clvar), kt, REAL(isecsbc,wp)/rday, nyear, nmonth, nday,    &
                      &                 sd(jf)%nrec_a(1), REAL(sd(jf)%nrec_b(2),wp)/rday, REAL(sd(jf)%nrec_a(2),wp)/rday
+                  IF(lflush) CALL FLUSH(numout)
                ENDIF
             ENDIF
@@ -440,5 +442,8 @@
          !
          clfmt = "('   fld_init : time-interpolation for ', a, ' read previous record = ', i6, ' at time = ', f7.2, ' days')"
-         IF(lwp .AND. nprint > 1) WRITE(numout, clfmt) TRIM(sdjf%clvar), sdjf%nrec_a(1), REAL(sdjf%nrec_a(2),wp)/rday
+         IF(lwp .AND. nprint > 1) THEN
+            WRITE(numout, clfmt) TRIM(sdjf%clvar), sdjf%nrec_a(1), REAL(sdjf%nrec_a(2),wp)/rday
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          !
       ENDIF
@@ -762,6 +767,9 @@
       ENDIF
 
-      IF(lwp.AND. nprint > 1) WRITE(numout,*) 'Dim size for ',        TRIM(clvar),' is ', ilendta
-      IF(lwp.AND. nprint > 1) WRITE(numout,*) 'Number of levels for ',TRIM(clvar),' is ', ipk
+      IF(lwp.AND. nprint > 1) THEN
+         WRITE(numout,*) 'Dim size for ',        TRIM(clvar),' is ', ilendta
+         WRITE(numout,*) 'Number of levels for ',TRIM(clvar),' is ', ipk
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
       !
       SELECT CASE( ipk )
@@ -1174,6 +1182,9 @@
                      END DO
                      sd(ju)%rotn(jn) = .TRUE.               ! vector was rotated 
-                     IF( lwp .AND. kt == nit000 .AND. nprint > 1)   WRITE(numout,*)   &
+                     IF( lwp .AND. kt == nit000 .AND. nprint > 1)   THEN
+                         WRITE(numout,*)   &
                         &   'fld_read: vector pair ('//TRIM(sd(ju)%clvar)//', '//TRIM(sd(iv)%clvar)//') rotated on to model grid'
+                         IF(lflush) CALL FLUSH(numout)
+                     ENDIF
                   ENDIF
                ENDIF
@@ -1340,4 +1351,5 @@
             call flush(numout)
          END DO
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -1411,4 +1423,5 @@
          ENDIF
          IF( ASSOCIATED(ref_wgts(kw)%data_wgt) )  WRITE(numout,*) '       allocated'
+         IF(lflush) CALL FLUSH(numout)
       END DO
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/geo2ocean.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/geo2ocean.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/geo2ocean.F90	(revision 10986)
@@ -69,7 +69,10 @@
       !
       IF( lmust_init ) THEN      ! at 1st call only: set  gsin. & gcos.
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) ' rot_rep: coordinate transformation : geographic <==> model (i,j)-components'
-         IF(lwp) WRITE(numout,*) ' ~~~~~~~~    '
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) ' rot_rep: coordinate transformation : geographic <==> model (i,j)-components'
+            WRITE(numout,*) ' ~~~~~~~~    '
+            IF(lflush) CALL FLUSH(numout)
+      ENDIF
          !
          CALL angle( glamt, gphit, glamu, gphiu, glamv, gphiv, glamf, gphif )       ! initialization of the transformation
@@ -450,7 +453,10 @@
       ! -----------------------------------------------
       IF( lmust_init ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) ' obs_rot : geographic <--> stretched'
-         IF(lwp) WRITE(numout,*) ' ~~~~~~~   coordinate transformation'
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) ' obs_rot : geographic <--> stretched'
+            WRITE(numout,*) ' ~~~~~~~   coordinate transformation'
+            IF(lflush) CALL FLUSH(numout)
+      ENDIF
          CALL angle( glamt, gphit, glamu, gphiu, glamv, gphiv, glamf, gphif )       ! initialization of the transformation
          lmust_init = .FALSE.
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbcapr.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbcapr.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbcapr.F90	(revision 10986)
@@ -91,4 +91,5 @@
          WRITE(numout,*) '   Namelist namsbc_apr : Atmospheric PRessure as extrenal forcing'
          WRITE(numout,*) '      ref. pressure: global mean Patm (T) or a constant (F)  ln_ref_apr = ', ln_ref_apr
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -99,10 +100,12 @@
          IF(lwp) WRITE(numout,*) '         Reference Patm used : ', rn_pref, ' N/m2'
       ENDIF
+      IF(lwp .AND. lflush) CALL FLUSH(numout)
       !
       r1_grau = 1.e0 / (grav * rau0)               !* constant for optimization
       !
       !                                            !* control check
-      IF ( ln_apr_obc  ) THEN
-         IF(lwp) WRITE(numout,*) '         Inverse barometer added to OBC ssh data'
+      IF ( ln_apr_obc  .AND. lwp) THEN
+         WRITE(numout,*) '         Inverse barometer added to OBC ssh data'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 !jc: stop below should rather be a warning 
@@ -155,9 +158,15 @@
          !                                            !* Restart: read in restart file
          IF( ln_rstart .AND. iom_varid( numror, 'ssh_ibb', ldstop = .FALSE. ) > 0 ) THEN 
-            IF(lwp) WRITE(numout,*) 'sbc_apr:   ssh_ibb read in the restart file'
+            IF(lwp .AND. nprint > 0) THEN
+               WRITE(numout,*) 'sbc_apr:   ssh_ibb read in the restart file'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             CALL iom_get( numror, jpdom_autoglo, 'ssh_ibb', ssh_ibb, ldxios = lrxios )   ! before inv. barometer ssh
             !
          ELSE                                         !* no restart: set from nit000 values
-            IF(lwp) WRITE(numout,*) 'sbc_apr:   ssh_ibb set to nit000 values'
+            IF(lwp .AND. nprint > 0) THEN
+               WRITE(numout,*) 'sbc_apr:   ssh_ibb set to nit000 values'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             ssh_ibb(:,:) = ssh_ib(:,:)
          ENDIF
@@ -166,7 +175,10 @@
       IF( lrst_oce ) THEN                       !      Write in the ocean restart file     !
          !                                      ! ---------------------------------------- !
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'sbc_apr : ssh_ib written in ocean restart file at it= ', kt,' date= ', ndastp
-         IF(lwp) WRITE(numout,*) '~~~~'
+         IF(lwp .AND. nprint > 0) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) 'sbc_apr : ssh_ib written in ocean restart file at it= ', kt,' date= ', ndastp
+            WRITE(numout,*) '~~~~'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          IF( lwxios ) CALL iom_swap(      cwxios_context          )
          CALL iom_rstput( kt, nitrst, numrow, 'ssh_ibb' , ssh_ib, ldxios = lwxios )
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbcblk.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbcblk.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbcblk.F90	(revision 10986)
@@ -278,4 +278,5 @@
          CASE( np_ECMWF     )   ;   WRITE(numout,*) '   ==>>>   "ECMWF" algorithm       (IFS cycle 31)'
          END SELECT
+         IF(lflush) CALL FLUSH(numout)
          !
       ENDIF
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbccpl.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbccpl.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbccpl.F90	(revision 10986)
@@ -330,4 +330,5 @@
          WRITE(numout,*)'  ln_usecplmask                       = ', ln_usecplmask
          WRITE(numout,*)'  nn_cats_cpl                         = ', nn_cats_cpl
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -466,6 +467,9 @@
          l_rnfcpl              = .TRUE.                      ! -> no need to read runoffs in sbcrnf
          ln_rnf                = nn_components /= jp_iam_sas ! -> force to go through sbcrnf if not sas
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) '   runoffs received from oasis -> force ln_rnf = ', ln_rnf
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) '   runoffs received from oasis -> force ln_rnf = ', ln_rnf
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
       ENDIF
       !
@@ -476,6 +480,9 @@
       IF( srcv(jpr_isf)%laction .AND. ln_isf ) THEN
          l_isfcpl             = .TRUE.                      ! -> no need to read isf in sbcisf
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) '   iceshelf received from oasis '
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) '   iceshelf received from oasis '
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
       ENDIF
       !
@@ -542,7 +549,10 @@
          srcv(jpr_co2 )%laction = .TRUE.
          l_co2cpl = .TRUE.
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) '   Atmospheric pco2 received from oasis '
-         IF(lwp) WRITE(numout,*)
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) '   Atmospheric pco2 received from oasis '
+            WRITE(numout,*)
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
       ENDIF
       !
@@ -666,4 +676,5 @@
             WRITE(numout,*)'                  wind stress module'
             WRITE(numout,*)
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
       ENDIF
@@ -713,4 +724,5 @@
             WRITE(numout,*)'               fraction of solar net radiation absorbed in the first ocean level'
             WRITE(numout,*)
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
       ENDIF
@@ -980,4 +992,5 @@
             WRITE(numout,*)'               fraction of solar net radiation absorbed in the first ocean level'
             WRITE(numout,*)
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
       ENDIF
@@ -1020,4 +1033,5 @@
             WRITE(numout,*)'                  wind stress U,V components'
             WRITE(numout,*)'                  wind stress module'
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
       ENDIF
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbcdcy.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbcdcy.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbcdcy.F90	(revision 10986)
@@ -97,4 +97,5 @@
             WRITE(numout,*) '~~~~~~~'
             WRITE(numout,*)
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
          ! allocate sbcdcy arrays
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbcflx.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbcflx.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbcflx.F90	(revision 10986)
@@ -169,4 +169,5 @@
                WRITE(numout,*) ' day: ', ndastp , TRIM(sf(jf)%clvar), ' * ', zfact
             END DO
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
          !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbcfwb.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbcfwb.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbcfwb.F90	(revision 10986)
@@ -83,4 +83,5 @@
             IF( kn_fwb == 2 )   WRITE(numout,*) '          adjusted from previous year budget'
             IF( kn_fwb == 3 )   WRITE(numout,*) '          fwf set to zero and spread out over erp area'
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
          !
@@ -121,8 +122,11 @@
             fwfold = a_fwb                            ! current year freshwater budget correction
             !                                         ! estimate from the previous year budget
-            IF(lwp)WRITE(numout,*)
-            IF(lwp)WRITE(numout,*)'sbc_fwb : year = ',iyear  , ' freshwater budget correction = ', fwfold
-            IF(lwp)WRITE(numout,*)'          year = ',iyear-1, ' freshwater budget read       = ', a_fwb
-            IF(lwp)WRITE(numout,*)'          year = ',iyear-2, ' freshwater budget read       = ', a_fwb_b
+            IF(lwp) THEN
+               WRITE(numout,*)
+               WRITE(numout,*)'sbc_fwb : year = ',iyear  , ' freshwater budget correction = ', fwfold
+               WRITE(numout,*)'          year = ',iyear-1, ' freshwater budget read       = ', a_fwb
+               WRITE(numout,*)'          year = ',iyear-2, ' freshwater budget read       = ', a_fwb_b
+               IF(lflush) CALL FLUSH(numout)
+             ENDIF
          ENDIF   
          !                                         ! Update fwfold if new year start
@@ -200,4 +204,5 @@
                WRITE(numout,*)'   MIN(zerp_cor) = ', MINVAL(zerp_cor) 
                WRITE(numout,*)'   MAX(zerp_cor) = ', MAXVAL(zerp_cor) 
+               IF(lflush) CALL FLUSH(numout)
             ENDIF
          ENDIF
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbcisf.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbcisf.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbcisf.F90	(revision 10986)
@@ -206,5 +206,8 @@
          IF( ln_rstart .AND.    &                     ! Restart: read in restart file
             &   iom_varid( numror, 'fwf_isf_b', ldstop = .FALSE. ) > 0 ) THEN
-            IF(lwp .AND. nprint > 0) WRITE(numout,*) '          nit000-1 isf tracer content forcing fields read in the restart file'
+            IF(lwp .AND. nprint > 0) THEN
+               WRITE(numout,*) '          nit000-1 isf tracer content forcing fields read in the restart file'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             CALL iom_get( numror, jpdom_autoglo, 'fwf_isf_b', fwfisf_b(:,:)         , ldxios = lrxios )   ! before salt content isf_tsc trend
             CALL iom_get( numror, jpdom_autoglo, 'isf_sc_b' , risf_tsc_b(:,:,jp_sal), ldxios = lrxios )   ! before salt content isf_tsc trend
@@ -217,8 +220,11 @@
       ! 
       IF( lrst_oce ) THEN
-         IF(lwp .AND. nprint > 0) WRITE(numout,*)
-         IF(lwp .AND. nprint > 0) WRITE(numout,*) 'sbc : isf surface tracer content forcing fields written in ocean restart file ',   &
+         IF(lwp .AND. nprint > 0) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) 'sbc : isf surface tracer content forcing fields written in ocean restart file ',   &
             &                    'at it= ', kt,' date= ', ndastp
-         IF(lwp .AND. nprint > 0) WRITE(numout,*) '~~~~'
+            WRITE(numout,*) '~~~~'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          IF( lwxios ) CALL iom_swap(      cwxios_context          )
          CALL iom_rstput( kt, nitrst, numrow, 'fwf_isf_b', fwfisf(:,:)         , ldxios = lwxios )
@@ -285,15 +291,18 @@
       IF(lwm .AND. nprint > 2) WRITE ( numond, namsbc_isf )
 
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) 'sbc_isf_init : heat flux of the ice shelf'
-      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~'
-      IF(lwp) WRITE(numout,*) '   Namelist namsbc_isf :'
-      IF(lwp) WRITE(numout,*) '      type ice shelf melting/freezing         nn_isf      = ', nn_isf
-      IF(lwp) WRITE(numout,*) '      bulk formulation (nn_isf=1 only)        nn_isfblk   = ', nn_isfblk
-      IF(lwp) WRITE(numout,*) '      thickness of the top boundary layer     rn_hisf_tbl = ', rn_hisf_tbl
-      IF(lwp) WRITE(numout,*) '      gamma formulation                       nn_gammablk = ', nn_gammablk 
-      IF(lwp) WRITE(numout,*) '      gammat coefficient                      rn_gammat0  = ', rn_gammat0  
-      IF(lwp) WRITE(numout,*) '      gammas coefficient                      rn_gammas0  = ', rn_gammas0  
-      IF(lwp) WRITE(numout,*) '      top drag coef. used (from namdrg_top)   rn_Cd0      = ', r_Cdmin_top 
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'sbc_isf_init : heat flux of the ice shelf'
+         WRITE(numout,*) '~~~~~~~~~~~~'
+         WRITE(numout,*) '   Namelist namsbc_isf :'
+         WRITE(numout,*) '      type ice shelf melting/freezing         nn_isf      = ', nn_isf
+         WRITE(numout,*) '      bulk formulation (nn_isf=1 only)        nn_isfblk   = ', nn_isfblk
+         WRITE(numout,*) '      thickness of the top boundary layer     rn_hisf_tbl = ', rn_hisf_tbl
+         WRITE(numout,*) '      gamma formulation                       nn_gammablk = ', nn_gammablk 
+         WRITE(numout,*) '      gammat coefficient                      rn_gammat0  = ', rn_gammat0  
+         WRITE(numout,*) '      gammas coefficient                      rn_gammas0  = ', rn_gammas0  
+         WRITE(numout,*) '      top drag coef. used (from namdrg_top)   rn_Cd0      = ', r_Cdmin_top 
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
 
 
@@ -377,4 +386,5 @@
          CALL ctl_stop( 'sbc_isf_init: wrong value of nn_isf' )
       END SELECT
+      IF(lwp .AND. lflush) CALL FLUSH(numout)
          
       rhisf_tbl_0(:,:) = rhisf_tbl(:,:)
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbcmod.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbcmod.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbcmod.F90	(revision 10986)
@@ -105,4 +105,5 @@
          WRITE(numout,*) 'sbc_init : surface boundary condition setting'
          WRITE(numout,*) '~~~~~~~~ '
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -162,4 +163,5 @@
          WRITE(numout,*) '               Stokes coriolis term                 ln_stcor      = ', ln_stcor
          WRITE(numout,*) '               neutral drag coefficient (CORE,NCAR) ln_cdgw       = ', ln_cdgw
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -207,4 +209,5 @@
          CALL ctl_stop( 'sbc_init : unsupported value for nn_components' )
       END SELECT
+      IF(lwp .AND. lflush) CALL FLUSH(numout)
       !                             !* coupled options
       IF( ln_cpl ) THEN
@@ -287,4 +290,5 @@
          END SELECT
          IF( ll_not_nemo  )       WRITE(numout,*) '               + OASIS coupled SAS'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -303,4 +307,5 @@
             WRITE(numout,*)"   OPA-SAS coupled via OASIS : nn_fsbc re-defined from OASIS namcouple ", nn_fsbc
             WRITE(numout,*)
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
       ENDIF
@@ -495,5 +500,8 @@
          IF( ln_rstart .AND.    &                               !* Restart: read in restart file
             & iom_varid( numror, 'utau_b', ldstop = .FALSE. ) > 0 ) THEN
-            IF(lwp .AND. nprint > 0) WRITE(numout,*) '          nit000-1 surface forcing fields red in the restart file'
+            IF(lwp .AND. nprint > 0) THEN
+               WRITE(numout,*) '          nit000-1 surface forcing fields red in the restart file'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             CALL iom_get( numror, jpdom_autoglo, 'utau_b', utau_b, ldxios = lrxios )   ! before i-stress  (U-point)
             CALL iom_get( numror, jpdom_autoglo, 'vtau_b', vtau_b, ldxios = lrxios )   ! before j-stress  (V-point)
@@ -509,5 +517,8 @@
             ENDIF
          ELSE                                                   !* no restart: set from nit000 values
-            IF(lwp) WRITE(numout,*) '          nit000-1 surface forcing fields set to nit000'
+            IF(lwp .AND. nprint > 0) THEN
+               WRITE(numout,*) '          nit000-1 surface forcing fields set to nit000'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             utau_b(:,:) = utau(:,:)
             vtau_b(:,:) = vtau(:,:)
@@ -520,8 +531,11 @@
       IF( lrst_oce ) THEN                              !      Write in the ocean restart file     !
          !                                             ! ---------------------------------------- !
-         IF(lwp .AND. nprint > 0) WRITE(numout,*)
-         IF(lwp .AND. nprint > 0) WRITE(numout,*) 'sbc : ocean surface forcing fields written in ocean restart file ',   &
+         IF(lwp .AND. nprint > 0) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) 'sbc : ocean surface forcing fields written in ocean restart file ',   &
             &                    'at it= ', kt,' date= ', ndastp
-         IF(lwp .AND. nprint > 0) WRITE(numout,*) '~~~~'
+            WRITE(numout,*) '~~~~'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          IF( lwxios ) CALL iom_swap(      cwxios_context          )
          CALL iom_rstput( kt, nitrst, numrow, 'utau_b' , utau, ldxios = lwxios )
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbcrnf.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbcrnf.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbcrnf.F90	(revision 10986)
@@ -146,10 +146,16 @@
          IF( ln_rstart .AND.    &                               !* Restart: read in restart file
             & iom_varid( numror, 'rnf_b', ldstop = .FALSE. ) > 0 ) THEN
-            IF(lwp .AND. nprint > 0) WRITE(numout,*) '          nit000-1 runoff forcing fields red in the restart file', lrxios
+            IF(lwp .AND. nprint > 0) THEN
+               WRITE(numout,*) '          nit000-1 runoff forcing fields red in the restart file', lrxios
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             CALL iom_get( numror, jpdom_autoglo, 'rnf_b', rnf_b, ldxios = lrxios )     ! before runoff
             CALL iom_get( numror, jpdom_autoglo, 'rnf_hc_b', rnf_tsc_b(:,:,jp_tem), ldxios = lrxios )   ! before heat content of runoff
             CALL iom_get( numror, jpdom_autoglo, 'rnf_sc_b', rnf_tsc_b(:,:,jp_sal), ldxios = lrxios )   ! before salinity content of runoff
          ELSE                                                   !* no restart: set from nit000 values
-            IF(lwp .AND. nprint > 0) WRITE(numout,*) '          nit000-1 runoff forcing fields set to nit000'
+            IF(lwp .AND. nprint > 0) THEN
+               WRITE(numout,*) '          nit000-1 runoff forcing fields set to nit000'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             rnf_b    (:,:  ) = rnf    (:,:  )
             rnf_tsc_b(:,:,:) = rnf_tsc(:,:,:)
@@ -159,8 +165,11 @@
       IF( lrst_oce ) THEN                              !      Write in the ocean restart file     !
          !                                             ! ---------------------------------------- !
-         IF(lwp .AND. nprint > 0) WRITE(numout,*)
-         IF(lwp .AND. nprint > 0) WRITE(numout,*) 'sbcrnf : runoff forcing fields written in ocean restart file ',   &
+         IF(lwp .AND. nprint > 0) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) 'sbcrnf : runoff forcing fields written in ocean restart file ',   &
             &                    'at it= ', kt,' date= ', ndastp
-         IF(lwp .AND. nprint > 0) WRITE(numout,*) '~~~~'
+            WRITE(numout,*) '~~~~'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          IF( lwxios ) CALL iom_swap(      cwxios_context          )
          CALL iom_rstput( kt, nitrst, numrow, 'rnf_b' , rnf, ldxios = lwxios )
@@ -284,4 +293,5 @@
          WRITE(numout,*) '      depth of river mouth additional mixing     rn_hrnf      = ', rn_hrnf
          WRITE(numout,*) '      multiplicative factor for runoff           rn_rfact     = ', rn_rfact
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !                                   ! ==================
@@ -291,6 +301,9 @@
       IF( .NOT. l_rnfcpl ) THEN                    
          ALLOCATE( sf_rnf(1), STAT=ierror )         ! Create sf_rnf structure (runoff inflow)
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) '   ==>>>   runoffs inflow read in a file'
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) '   ==>>>   runoffs inflow read in a file'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          IF( ierror > 0 ) THEN
             CALL ctl_stop( 'sbc_rnf_init: unable to allocate sf_rnf structure' )   ;   RETURN
@@ -302,6 +315,9 @@
       !
       IF( ln_rnf_tem ) THEN                      ! Create (if required) sf_t_rnf structure
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) '   ==>>>   runoffs temperatures read in a file'
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) '   ==>>>   runoffs temperatures read in a file'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          ALLOCATE( sf_t_rnf(1), STAT=ierror  )
          IF( ierror > 0 ) THEN
@@ -314,6 +330,9 @@
       !
       IF( ln_rnf_sal  ) THEN                     ! Create (if required) sf_s_rnf and sf_t_rnf structures
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) '   ==>>>   runoffs salinities read in a file'
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) '   ==>>>   runoffs salinities read in a file'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          ALLOCATE( sf_s_rnf(1), STAT=ierror  )
          IF( ierror > 0 ) THEN
@@ -326,6 +345,9 @@
       !
       IF( ln_rnf_depth ) THEN                    ! depth of runoffs set from a file
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) '   ==>>>   runoffs depth read in a file'
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) '   ==>>>   runoffs depth read in a file'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          rn_dep_file = TRIM( cn_dir )//TRIM( sn_dep_rnf%clname )
          IF( .NOT. sn_dep_rnf%ln_clim ) THEN   ;   WRITE(rn_dep_file, '(a,"_y",i4)' ) TRIM( rn_dep_file ), nyear    ! add year 
@@ -363,9 +385,12 @@
       ELSE IF( ln_rnf_depth_ini ) THEN           ! runoffs applied at the surface
          !
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) '   ==>>>   depth of runoff computed once from max value of runoff'
-         IF(lwp) WRITE(numout,*) '        max value of the runoff climatologie (over global domain) rn_rnf_max = ', rn_rnf_max
-         IF(lwp) WRITE(numout,*) '        depth over which runoffs is spread                        rn_dep_max = ', rn_dep_max
-         IF(lwp) WRITE(numout,*) '        create (=1) a runoff depth file or not (=0)      nn_rnf_depth_file  = ', nn_rnf_depth_file
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) '   ==>>>   depth of runoff computed once from max value of runoff'
+            WRITE(numout,*) '        max value of the runoff climatologie (over global domain) rn_rnf_max = ', rn_rnf_max
+            WRITE(numout,*) '        depth over which runoffs is spread                        rn_dep_max = ', rn_dep_max
+            WRITE(numout,*) '        create (=1) a runoff depth file or not (=0)      nn_rnf_depth_file  = ', nn_rnf_depth_file
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
 
          CALL iom_open( TRIM( sn_rnf%clname ), inum )    !  open runoff file
@@ -417,5 +442,8 @@
          !
          IF( nn_rnf_depth_file == 1 ) THEN      !  save  output nb levels for runoff
-            IF(lwp) WRITE(numout,*) '   ==>>>   create runoff depht file'
+            IF(lwp) THEN
+               WRITE(numout,*) '   ==>>>   create runoff depht file'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             CALL iom_open  ( TRIM( sn_dep_rnf%clname ), inum, ldwrt = .TRUE. )
             CALL iom_rstput( 0, 0, inum, 'rodepth', h_rnf )
@@ -449,16 +477,22 @@
             IF( ln_sco )   CALL ctl_warn( 'sbc_rnf_init: number of levels over which Kz is increased is computed for zco...' )
          ENDIF
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) '   ==>>>   Specific treatment used in vicinity of river mouths :'
-         IF(lwp) WRITE(numout,*) '             - Increase Kz in surface layers (if rn_hrnf > 0 )'
-         IF(lwp) WRITE(numout,*) '               by ', rn_avt_rnf,' m2/s  over ', nkrnf, ' w-levels'
-         IF(lwp) WRITE(numout,*) '             - set to zero SSS damping       (if ln_ssr=T)'
-         IF(lwp) WRITE(numout,*) '             - mixed upstream-centered       (if ln_traadv_cen2=T)'
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) '   ==>>>   Specific treatment used in vicinity of river mouths :'
+            WRITE(numout,*) '             - Increase Kz in surface layers (if rn_hrnf > 0 )'
+            WRITE(numout,*) '               by ', rn_avt_rnf,' m2/s  over ', nkrnf, ' w-levels'
+            WRITE(numout,*) '             - set to zero SSS damping       (if ln_ssr=T)'
+            WRITE(numout,*) '             - mixed upstream-centered       (if ln_traadv_cen2=T)'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          !
          CALL rnf_mouth                             ! set river mouth mask
          !
       ELSE                                      ! No treatment at river mouths
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) '   ==>>>   No specific treatment at river mouths'
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) '   ==>>>   No specific treatment at river mouths'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          rnfmsk  (:,:) = 0._wp
          rnfmsk_z(:)   = 0._wp
@@ -499,7 +533,10 @@
       !!----------------------------------------------------------------------
       !
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) '   rnf_mouth : river mouth mask'
-      IF(lwp) WRITE(numout,*) '   ~~~~~~~~~ '
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) '   rnf_mouth : river mouth mask'
+         WRITE(numout,*) '   ~~~~~~~~~ '
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
       !
       cl_rnfile = TRIM( cn_dir )//TRIM( sn_cnf%clname )
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbcssm.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbcssm.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbcssm.F90	(revision 10986)
@@ -88,7 +88,10 @@
          IF( kt == nit000 .AND. .NOT. l_ssm_mean ) THEN   !   Initialisation: 1st time-step, no input means !
             !                                             ! ----------------------------------------------- !
-            IF(lwp) WRITE(numout,*)
-            IF(lwp) WRITE(numout,*) 'sbc_ssm : mean fields initialised to instantaneous values'
-            IF(lwp) WRITE(numout,*) '~~~~~~~   '
+            IF(lwp) THEN
+               WRITE(numout,*)
+               WRITE(numout,*) 'sbc_ssm : mean fields initialised to instantaneous values'
+               WRITE(numout,*) '~~~~~~~   '
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             zcoef = REAL( nn_fsbc - 1, wp )
             ssu_m(:,:) = zcoef * ub(:,:,1)
@@ -151,8 +154,11 @@
          IF( lrst_oce ) THEN                              !      Write in the ocean restart file     !
             !                                             ! ---------------------------------------- !
-            IF(lwp) WRITE(numout,*)
-            IF(lwp) WRITE(numout,*) 'sbc_ssm : sea surface mean fields written in ocean restart file ',   &
+            IF(lwp) THEN
+               WRITE(numout,*)
+               WRITE(numout,*) 'sbc_ssm : sea surface mean fields written in ocean restart file ',   &
                &                    'at it= ', kt,' date= ', ndastp
-            IF(lwp) WRITE(numout,*) '~~~~~~~'
+               WRITE(numout,*) '~~~~~~~'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             zf_sbc = REAL( nn_fsbc, wp )
             IF( lwxios ) CALL iom_swap(      cwxios_context          )
@@ -197,13 +203,19 @@
       IF( nn_fsbc == 1 ) THEN
          !
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'sbc_ssm_init : sea surface mean fields, nn_fsbc=1 : instantaneous values'
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~ '
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) 'sbc_ssm_init : sea surface mean fields, nn_fsbc=1 : instantaneous values'
+            WRITE(numout,*) '~~~~~~~~~~~ '
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          !
       ELSE
          !               
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'sbc_ssm_init : sea surface mean fields'
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~ '
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) 'sbc_ssm_init : sea surface mean fields'
+            WRITE(numout,*) '~~~~~~~~~~~~ '
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          !
          IF( ln_rstart .AND. iom_varid( numror, 'nn_fsbc', ldstop = .FALSE. ) > 0 ) THEN
@@ -224,5 +236,8 @@
             !
             IF( zf_sbc /= REAL( nn_fsbc, wp ) ) THEN      ! nn_fsbc has changed between 2 runs
-               IF(lwp) WRITE(numout,*) '   restart with a change in the frequency of mean from ', zf_sbc, ' to ', nn_fsbc 
+               IF(lwp) THEN
+                  WRITE(numout,*) '   restart with a change in the frequency of mean from ', zf_sbc, ' to ', nn_fsbc 
+                  IF(lflush) CALL FLUSH(numout)
+               ENDIF
                zcoef = REAL( nn_fsbc - 1, wp ) / zf_sbc 
                ssu_m(:,:) = zcoef * ssu_m(:,:) 
@@ -234,5 +249,8 @@
                frq_m(:,:) = zcoef * frq_m(:,:)
             ELSE
-               IF(lwp) WRITE(numout,*) '   mean fields read in the ocean restart file'
+               IF(lwp) THEN
+                  WRITE(numout,*) '   mean fields read in the ocean restart file'
+                  IF(lflush) CALL FLUSH(numout)
+               ENDIF
             ENDIF
          ENDIF
@@ -241,5 +259,8 @@
       IF( .NOT.l_ssm_mean ) THEN   ! default initialisation. needed by iceistate
          !
-         IF(lwp) WRITE(numout,*) '   default initialisation of ss._m arrays'
+         IF(lwp) THEN
+            WRITE(numout,*) '   default initialisation of ss._m arrays'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          ssu_m(:,:) = ub(:,:,1)
          ssv_m(:,:) = vb(:,:,1)
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbcssr.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbcssr.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbcssr.F90	(revision 10986)
@@ -162,4 +162,5 @@
          WRITE(numout,*) 'sbc_ssr : SST and/or SSS damping term '
          WRITE(numout,*) '~~~~~~~ '
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       ! 
@@ -182,4 +183,5 @@
          WRITE(numout,*) '         flag to bound erp term                 ln_sssr_bnd = ', ln_sssr_bnd
          WRITE(numout,*) '         ABS(Max./Min.) erp threshold           rn_sssr_bnd = ', rn_sssr_bnd, ' mm/day'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbctide.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbctide.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/sbctide.F90	(revision 10986)
@@ -88,4 +88,5 @@
                WRITE(numout,*) Wave(ntide(jk))%cname_tide, utide(jk), ftide(jk), v0tide(jk), omega_tide(jk)
             END DO
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
          !
@@ -145,4 +146,5 @@
          WRITE(numout,*) 'tide_init_load : Initialization of load potential from file'
          WRITE(numout,*) '~~~~~~~~~~~~~~ '
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/tideini.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/tideini.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/SBC/tideini.F90	(revision 10986)
@@ -80,11 +80,15 @@
             WRITE(numout,*) '         Fraction of SSH used in scal. approx.   rn_scal_load = ', rn_scal_load
             WRITE(numout,*) '         Duration (days) of ramp                 rdttideramp  = ', rdttideramp
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
       ELSE
          rn_scal_load = 0._wp 
 
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'tide_init : tidal components not used (ln_tide = F)'
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~ '
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) 'tide_init : tidal components not used (ln_tide = F)'
+            WRITE(numout,*) '~~~~~~~~~ '
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          RETURN
       ENDIF
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/STO/stopar.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/STO/stopar.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/STO/stopar.F90	(revision 10986)
@@ -275,4 +275,5 @@
             WRITE(numout,*) 'sto_par_init : NO use of stochastic parameterization'
             WRITE(numout,*) '~~~~~~~~~~~~'
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
          RETURN
@@ -327,10 +328,8 @@
          ! WRITE(numout,*) '      passes of Laplacian filter              nn_trc_flt    = ', nn_trc_flt
          ! WRITE(numout,*) '      limitation factor                       rn_trc_lim    = ', rn_trc_lim
-
-      ENDIF
-
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) '   stochastic parameterization :'
-
+         WRITE(numout,*)
+         WRITE(numout,*) '   stochastic parameterization :'
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
       ! Set number of 2D stochastic arrays
       jpsto2d = 0
@@ -388,4 +387,5 @@
          jsto_trd  = jpsto3d
       ENDIF
+      IF(lwp .AND. lflush) CALL FLUSH(numout)
 
       ! Allocate 2D stochastic arrays
@@ -698,4 +698,5 @@
             WRITE(numout,*) 'sto_rst_read : read stochastic parameters from restart file'
             WRITE(numout,*) '~~~~~~~~~~~~'
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
 
@@ -758,4 +759,5 @@
                WRITE(numout,*) 'sto_rst_write : write stochastic parameters in restart file'
                WRITE(numout,*) '~~~~~~~~~~~~~'
+               IF(lflush) CALL FLUSH(numout)
             ENDIF
          ENDIF
@@ -804,4 +806,5 @@
                   WRITE(numout,*) '             kt = '             , kt
                ENDIF
+               IF(lflush) CALL FLUSH(numout)
             ENDIF
             ! open the restart file
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/eosbn2.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/eosbn2.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/eosbn2.F90	(revision 10986)
@@ -1253,4 +1253,5 @@
          WRITE(numout,*) '      EOS-80  : rho=F(Potential    Temperature, Practical Salinity, depth)   ln_EOS80  = ', ln_EOS80
          WRITE(numout,*) '      S-EOS   : rho=F(Conservative Temperature, Absolute  Salinity, depth)   ln_SEOS   = ', ln_SEOS
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -1669,4 +1670,5 @@
          !
       END SELECT
+      IF(lwp .AND. lflush) CALL FLUSH(numout)
       !
       rau0_rcp    = rau0 * rcp 
@@ -1684,13 +1686,17 @@
             WRITE(numout,*) '   ==>>>   model does not use Conservative Temperature'
          ENDIF
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) '   Associated physical constant'
-      IF(lwp) WRITE(numout,*) '      volumic mass of reference           rau0  = ', rau0   , ' kg/m^3'
-      IF(lwp) WRITE(numout,*) '      1. / rau0                        r1_rau0  = ', r1_rau0, ' m^3/kg'
-      IF(lwp) WRITE(numout,*) '      ocean specific heat                 rcp   = ', rcp    , ' J/Kelvin'
-      IF(lwp) WRITE(numout,*) '      rau0 * rcp                       rau0_rcp = ', rau0_rcp
-      IF(lwp) WRITE(numout,*) '      1. / ( rau0 * rcp )           r1_rau0_rcp = ', r1_rau0_rcp
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) '   Associated physical constant'
+         WRITE(numout,*) '      volumic mass of reference           rau0  = ', rau0   , ' kg/m^3'
+         WRITE(numout,*) '      1. / rau0                        r1_rau0  = ', r1_rau0, ' m^3/kg'
+         WRITE(numout,*) '      ocean specific heat                 rcp   = ', rcp    , ' J/Kelvin'
+         WRITE(numout,*) '      rau0 * rcp                       rau0_rcp = ', rau0_rcp
+         WRITE(numout,*) '      1. / ( rau0 * rcp )           r1_rau0_rcp = ', r1_rau0_rcp
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
       !
    END SUBROUTINE eos_init
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traadv.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traadv.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traadv.F90	(revision 10986)
@@ -220,4 +220,5 @@
          WRITE(numout,*) '            vertical   2nd/4th order               nn_ubs_v   = ', nn_ubs_v
          WRITE(numout,*) '      QUICKEST scheme                           ln_traadv_qck = ', ln_traadv_qck
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -265,4 +266,5 @@
          CASE( np_QCK     )   ;   WRITE(numout,*) '   ==>>>   QUICKEST scheme is used'
          END SELECT
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traadv_cen.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traadv_cen.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traadv_cen.F90	(revision 10986)
@@ -80,8 +80,9 @@
       !!----------------------------------------------------------------------
       !
-      IF( kt == kit000 )  THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'tra_adv_cen : centered advection scheme on ', cdtype, ' order h/v =', kn_cen_h,'/', kn_cen_v
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~ '
+      IF( kt == kit000 .AND. lwp)  THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'tra_adv_cen : centered advection scheme on ', cdtype, ' order h/v =', kn_cen_h,'/', kn_cen_v
+         WRITE(numout,*) '~~~~~~~~~~~~ '
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !                          ! set local switches
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traadv_fct.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traadv_fct.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traadv_fct.F90	(revision 10986)
@@ -88,8 +88,9 @@
       !!----------------------------------------------------------------------
       !
-      IF( kt == kit000 )  THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'tra_adv_fct : FCT advection scheme on ', cdtype
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
+      IF( kt == kit000 .AND. lwp)  THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'tra_adv_fct : FCT advection scheme on ', cdtype
+         WRITE(numout,*) '~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traadv_mus.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traadv_mus.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traadv_mus.F90	(revision 10986)
@@ -92,9 +92,12 @@
       !
       IF( kt == kit000 )  THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'tra_adv : MUSCL advection scheme on ', cdtype
-         IF(lwp) WRITE(numout,*) '        : mixed up-stream           ', ld_msc_ups
-         IF(lwp) WRITE(numout,*) '~~~~~~~'
-         IF(lwp) WRITE(numout,*)
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) 'tra_adv : MUSCL advection scheme on ', cdtype
+            WRITE(numout,*) '        : mixed up-stream           ', ld_msc_ups
+            WRITE(numout,*) '~~~~~~~'
+            WRITE(numout,*)
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          !
          ! Upstream / MUSCL scheme indicator
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traadv_qck.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traadv_qck.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traadv_qck.F90	(revision 10986)
@@ -94,9 +94,10 @@
       !!----------------------------------------------------------------------
       !
-      IF( kt == kit000 )  THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'tra_adv_qck : 3rd order quickest advection scheme on ', cdtype
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~'
-         IF(lwp) WRITE(numout,*)
+      IF( kt == kit000 .AND. lwp)  THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'tra_adv_qck : 3rd order quickest advection scheme on ', cdtype
+         WRITE(numout,*) '~~~~~~~~~~~~'
+         WRITE(numout,*)
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traadv_ubs.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traadv_ubs.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traadv_ubs.F90	(revision 10986)
@@ -101,8 +101,9 @@
       !!----------------------------------------------------------------------
       !
-      IF( kt == kit000 )  THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'tra_adv_ubs :  horizontal UBS advection scheme on ', cdtype
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~'
+      IF( kt == kit000 .AND. lwp)  THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'tra_adv_ubs :  horizontal UBS advection scheme on ', cdtype
+         WRITE(numout,*) '~~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/trabbc.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/trabbc.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/trabbc.F90	(revision 10986)
@@ -151,4 +151,5 @@
          WRITE(numout,*) '      Constant geothermal flux value               rn_geoflx_cst = ', rn_geoflx_cst
          WRITE(numout,*)
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -188,4 +189,5 @@
          IF(lwp) WRITE(numout,*) '   ==>>>   no geothermal heat flux'
       ENDIF
+      IF(lwp .AND. lflush) CALL FLUSH(numout)
       !
    END SUBROUTINE tra_bbc_init
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/trabbl.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/trabbl.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/trabbl.F90	(revision 10986)
@@ -335,8 +335,9 @@
       !!----------------------------------------------------------------------
       !
-      IF( kt == kit000 )  THEN
-         IF(lwp)  WRITE(numout,*)
-         IF(lwp)  WRITE(numout,*) 'trabbl:bbl : Compute bbl velocities and diffusive coefficients in ', cdtype
-         IF(lwp)  WRITE(numout,*) '~~~~~~~~~~'
+      IF( kt == kit000 .AND. lwp)  THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'trabbl:bbl : Compute bbl velocities and diffusive coefficients in ', cdtype
+         WRITE(numout,*) '~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !                                        !* bottom variables (T, S, alpha, beta, depth, velocity)
@@ -500,4 +501,5 @@
          WRITE(numout,*) '       Namelist nambbl : set bbl parameters'
          WRITE(numout,*) '          bottom boundary layer flag          ln_trabbl  = ', ln_trabbl
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       IF( .NOT.ln_trabbl )   RETURN
@@ -508,4 +510,5 @@
          WRITE(numout,*) '          diffusive bbl coefficient           rn_ahtbbl  = ', rn_ahtbbl, ' m2/s'
          WRITE(numout,*) '          advective bbl coefficient           rn_gambbl  = ', rn_gambbl, ' s'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -513,6 +516,8 @@
       IF( tra_bbl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'tra_bbl_init : unable to allocate arrays' )
       !
-      IF( nn_bbl_adv == 1 )    WRITE(numout,*) '       * Advective BBL using upper velocity'
-      IF( nn_bbl_adv == 2 )    WRITE(numout,*) '       * Advective BBL using velocity = F( delta rho)'
+      IF(lwp) THEN
+         IF( nn_bbl_adv == 1 )    WRITE(numout,*) '       * Advective BBL using upper velocity'
+         IF( nn_bbl_adv == 2 )    WRITE(numout,*) '       * Advective BBL using velocity = F( delta rho)'
+      ENDIF
       !
       !                             !* vertical index of  "deep" bottom u- and v-points
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/tradmp.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/tradmp.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/tradmp.F90	(revision 10986)
@@ -195,4 +195,5 @@
          WRITE(numout,*) '         Damping file name               cn_resto = ', cn_resto
          WRITE(numout,*)
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -208,4 +209,5 @@
             CALL ctl_stop('tra_dmp_init : wrong value of nn_zdmp')
          END SELECT
+         IF(lwp .AND. lflush) CALL FLUSH(numout)
          !
          !!TG: Initialisation of dtatsd - Would it be better to have dmpdta routine
@@ -213,6 +215,9 @@
          !!gm: In principle yes. Nevertheless, we can't anticipate demands that have never been formulated.
          IF( .NOT.ln_tsd_dmp ) THEN
-            IF(lwp) WRITE(numout,*)
-            IF(lwp) WRITE(numout, *)  '   read T-S data not initialized, we force ln_tsd_dmp=T'
+            IF(lwp) THEN
+               WRITE(numout,*)
+               WRITE(numout, *)  '   read T-S data not initialized, we force ln_tsd_dmp=T'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             CALL dta_tsd_init( ld_tradmp=ln_tradmp )        ! forces the initialisation of T-S data
          ENDIF
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traldf.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traldf.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traldf.F90	(revision 10986)
@@ -121,4 +121,5 @@
          CASE( np_blp_it )   ;   WRITE(numout,*) '   ==>>>   Rotated bilaplacian operator (triad)'
          END SELECT
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traldf_iso.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traldf_iso.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traldf_iso.F90	(revision 10986)
@@ -114,7 +114,10 @@
       !
       IF( kpass == 1 .AND. kt == kit000 )  THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'tra_ldf_iso : rotated laplacian diffusion operator on ', cdtype
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) 'tra_ldf_iso : rotated laplacian diffusion operator on ', cdtype
+            WRITE(numout,*) '~~~~~~~~~~~'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          !
          akz     (:,:,:) = 0._wp      
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traldf_lap_blp.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traldf_lap_blp.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traldf_lap_blp.F90	(revision 10986)
@@ -85,4 +85,5 @@
          WRITE(numout,*) 'tra_ldf_lap : iso-level laplacian diffusion on ', cdtype, ', pass=', kpass
          WRITE(numout,*) '~~~~~~~~~~~ '
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -199,4 +200,5 @@
          END SELECT
          WRITE(numout,*) '~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traldf_triad.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traldf_triad.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traldf_triad.F90	(revision 10986)
@@ -102,8 +102,9 @@
       ENDIF
      !
-      IF( kpass == 1 .AND. kt == kit000 )  THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'tra_ldf_triad : rotated laplacian diffusion operator on ', cdtype
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~'
+      IF( kpass == 1 .AND. kt == kit000 .AND. lwp)  THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'tra_ldf_triad : rotated laplacian diffusion operator on ', cdtype
+         WRITE(numout,*) '~~~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !   
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/tramle.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/tramle.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/tramle.F90	(revision 10986)
@@ -289,4 +289,5 @@
          WRITE(numout,*) '         =1 no MLE in case of convection ; =0 always MLE              nn_conv   = ', nn_conv
          WRITE(numout,*) '         Density difference used to define ML for FK              rn_rho_c_mle  = ', rn_rho_c_mle
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -300,4 +301,5 @@
             WRITE(numout,*) '   ==>>>   Mixed Layer Eddy parametrisation NOT used'
          ENDIF
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -305,7 +307,10 @@
          !
          rb_c = grav * rn_rho_c_mle /rau0        ! Mixed Layer buoyancy criteria
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) '      ML buoyancy criteria = ', rb_c, ' m/s2 '
-         IF(lwp) WRITE(numout,*) '      associated ML density criteria defined in zdfmxl = ', rho_c, 'kg/m3'
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) '      ML buoyancy criteria = ', rb_c, ' m/s2 '
+            WRITE(numout,*) '      associated ML density criteria defined in zdfmxl = ', rho_c, 'kg/m3'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          !
          IF( nn_mle == 0 ) THEN           ! MLE array allocation & initialisation
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/tranxt.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/tranxt.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/tranxt.F90	(revision 10986)
@@ -95,8 +95,9 @@
       IF( ln_timing )   CALL timing_start( 'tra_nxt')
       !
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'tra_nxt : achieve the time stepping by Asselin filter and array swap'
-         IF(lwp) WRITE(numout,*) '~~~~~~~'
+      IF( kt == nit000 .AND. lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'tra_nxt : achieve the time stepping by Asselin filter and array swap'
+         WRITE(numout,*) '~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -213,8 +214,9 @@
       !!----------------------------------------------------------------------
       !
-      IF( kt == kit000 )  THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'tra_nxt_fix : time stepping', cdtype
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
+      IF( kt == kit000 .AND. lwp)  THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'tra_nxt_fix : time stepping', cdtype
+         WRITE(numout,*) '~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -271,8 +273,9 @@
       !!----------------------------------------------------------------------
       !
-      IF( kt == kit000 )  THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'tra_nxt_vvl : time stepping', cdtype
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
+      IF( kt == kit000 .AND. lwp)  THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'tra_nxt_vvl : time stepping', cdtype
+         WRITE(numout,*) '~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traqsr.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traqsr.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/traqsr.F90	(revision 10986)
@@ -118,8 +118,9 @@
       IF( ln_timing )   CALL timing_start('tra_qsr')
       !
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'tra_qsr : penetration of the surface solar radiation'
-         IF(lwp) WRITE(numout,*) '~~~~~~~'
+      IF( kt == nit000 .AND. lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'tra_qsr : penetration of the surface solar radiation'
+         WRITE(numout,*) '~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -135,5 +136,8 @@
 !!gm case neuler  not taken into account....
          IF( ln_rstart .AND. iom_varid( numror, 'qsr_hc_b', ldstop = .FALSE. ) > 0 ) THEN    ! read in restart
-            IF(lwp .AND. nprint >0) WRITE(numout,*) '          nit000-1 qsr tracer content forcing field read in the restart file'
+            IF(lwp .AND. nprint >0) THEN
+               WRITE(numout,*) '          nit000-1 qsr tracer content forcing field read in the restart file'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             z1_2 = 0.5_wp
             CALL iom_get( numror, jpdom_autoglo, 'qsr_hc_b', qsr_hc_b, ldxios = lrxios )   ! before heat content trend due to Qsr flux
@@ -358,4 +362,5 @@
          WRITE(numout,*) '      2 bands: longest depth of extinction         rn_si1     = ', rn_si1
          WRITE(numout,*)
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -418,4 +423,5 @@
          !
       END SELECT
+      IF(lwp .AND. lflush) CALL FLUSH(numout)
       !
       qsr_hc(:,:,:) = 0._wp     ! now qsr heat content set to zero where it will not be computed
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/trasbc.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/trasbc.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/trasbc.F90	(revision 10986)
@@ -82,8 +82,9 @@
       IF( ln_timing )   CALL timing_start('tra_sbc')
       !
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'tra_sbc : TRAcer Surface Boundary Condition'
-         IF(lwp) WRITE(numout,*) '~~~~~~~ '
+      IF( kt == nit000 .AND. lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'tra_sbc : TRAcer Surface Boundary Condition'
+         WRITE(numout,*) '~~~~~~~ '
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -107,5 +108,8 @@
          IF( ln_rstart .AND.    &               ! Restart: read in restart file
               & iom_varid( numror, 'sbc_hc_b', ldstop = .FALSE. ) > 0 ) THEN
-            IF(lwp .AND. nprint > 0) WRITE(numout,*) '          nit000-1 sbc tracer content field read in the restart file'
+            IF(lwp .AND. nprint > 0) THEN
+               WRITE(numout,*) '          nit000-1 sbc tracer content field read in the restart file'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             zfact = 0.5_wp
             sbc_tsc(:,:,:) = 0._wp
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/trazdf.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/trazdf.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRA/trazdf.F90	(revision 10986)
@@ -58,8 +58,9 @@
       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,*) '~~~~~~~ '
+      IF( kt == nit000 .AND. lflush)  THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'tra_zdf : implicit vertical mixing on T & S'
+         WRITE(numout,*) '~~~~~~~ '
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRD/trdglo.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRD/trdglo.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRD/trdglo.F90	(revision 10986)
@@ -282,4 +282,5 @@
             WRITE (numout,9513) umo(jpdyn_tau) / tvolu, vmo(jpdyn_tau) / tvolv
 !!gm            IF( ln_drgimp )   WRITE (numout,9514) umo(jpdyn_bfri) / tvolu, vmo(jpdyn_bfri) / tvolv
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
 
@@ -321,4 +322,5 @@
             WRITE (numout,9533) hke(jpdyn_tau) / tvolt
 !!gm            IF( ln_drgimp )   WRITE (numout,9534) hke(jpdyn_bfri) / tvolt
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
 
@@ -353,4 +355,5 @@
             WRITE (numout,*)
             WRITE (numout,*)
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
 
@@ -419,4 +422,5 @@
             &                   (  smo(jptra_xad) + smo(jptra_yad) + smo(jptra_zad) + smo(jptra_ldf) + smo(jptra_zdf)   &
             &                    + smo(jptra_npc) + smo(jptra_dmp)                   + smo(jptra_nsr) ) / tvolt
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
 
@@ -454,4 +458,5 @@
             &                   (  s2(jptra_xad) + s2(jptra_yad) + s2(jptra_zad) + s2(jptra_ldf) + s2(jptra_zdf)   &
             &                    + s2(jptra_npc) + s2(jptra_dmp)                  + s2(jptra_nsr) ) / tvolt
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
 
@@ -486,4 +491,5 @@
             WRITE (numout,9448)   t2(jptra_zdf)/tvolt,   s2(jptra_zdf)/tvolt
             WRITE (numout,9449)   t2(jptra_npc)/tvolt,   s2(jptra_npc)/tvolt
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
 
@@ -519,4 +525,5 @@
          WRITE(numout,*) 'trd_glo_init : integral constraints properties trends'
          WRITE(numout,*) '~~~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -528,5 +535,8 @@
       CALL mpp_sum( 'trdglo', tvolt )   ! sum over the global domain
 
-      IF(lwp) WRITE(numout,*) '                total ocean volume at T-point   tvolt = ',tvolt
+      IF(lwp) THEN
+         WRITE(numout,*) '                total ocean volume at T-point   tvolt = ',tvolt
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
 
       ! Initialization of potential to kinetic energy conversion
@@ -552,4 +562,5 @@
          WRITE(numout,*) '                total ocean volume at U-point   tvolu = ',tvolu
          WRITE(numout,*) '                total ocean volume at V-point   tvolv = ',tvolv
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRD/trdini.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRD/trdini.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRD/trdini.F90	(revision 10986)
@@ -70,4 +70,5 @@
          !
          WRITE(numout,*) '      frequency of trends diagnostics (glo)     nn_trd      = ', nn_trd
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRD/trdken.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRD/trdken.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRD/trdken.F90	(revision 10986)
@@ -247,4 +247,5 @@
          WRITE(numout,*) 'trd_ken_init : 3D Kinetic Energy trends'
          WRITE(numout,*) '~~~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !                           ! allocate box volume arrays
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRD/trdmxl.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRD/trdmxl.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRD/trdmxl.F90	(revision 10986)
@@ -373,4 +373,5 @@
          IF( ln_ctl ) THEN
             WRITE(numout,*) '             we reach kt == nit000 + 1 = ', nit000+1
+            IF(lflush) CALL FLUSH(numout)
             CALL prt_ctl(tab2d_1=tmlbb   , clinfo1=' tmlbb   -   : ', mask1=tmask)
             CALL prt_ctl(tab2d_1=tmlbn   , clinfo1=' tmlbn   -   : ', mask1=tmask)
@@ -383,4 +384,5 @@
          IF( ln_trdmxl_instant ) THEN
             WRITE(numout,*) '             restart from kt == nit000 = ', nit000
+            IF(lflush) CALL FLUSH(numout)
             CALL prt_ctl(tab2d_1=tmlbb   , clinfo1=' tmlbb   -   : ', mask1=tmask)
             CALL prt_ctl(tab2d_1=tmlbn   , clinfo1=' tmlbn   -   : ', mask1=tmask)
@@ -388,4 +390,5 @@
          ELSE
             WRITE(numout,*) '             restart from kt == nit000 = ', nit000
+            IF(lflush) CALL FLUSH(numout)
             CALL prt_ctl(tab2d_1=tmlbn          , clinfo1=' tmlbn           -  : ', mask1=tmask)
             CALL prt_ctl(tab2d_1=hmxlbn         , clinfo1=' hmxlbn          -  : ', mask1=tmask)
@@ -611,4 +614,5 @@
             WRITE(numout,*) '          TRA zsmlres (jpi/2,jpj/2) : ', zsmlres (jpi/2,jpj/2)
             WRITE(numout,*) '          TRA zsmlres2(jpi/2,jpj/2) : ', zsmlres2(jpi/2,jpj/2)
+            IF(lflush) CALL FLUSH(numout)
             !
          END IF
@@ -753,4 +757,5 @@
          WRITE(numout,*) '      unit conversion factor                     rn_ucf             = ', rn_ucf
          WRITE(numout,*) '      criteria to compute the MLD                rn_rho_c           = ', rn_rho_c
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRD/trdmxl_rst.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRD/trdmxl_rst.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRD/trdmxl_rst.F90	(revision 10986)
@@ -65,4 +65,5 @@
             ELSE                          ;   WRITE(numout,*) '             kt = '             , kt,' date= ', ndastp
             ENDIF
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
 
@@ -75,4 +76,5 @@
          WRITE(numout,*) '~~~~~~~~~~'
          WRITE(numout,*)
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -139,4 +141,5 @@
          WRITE(numout,*) ' trd_mxl_rst_read : read the NetCDF mixed layer trend restart file'
          WRITE(numout,*) ' ~~~~~~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRD/trdpen.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRD/trdpen.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRD/trdpen.F90	(revision 10986)
@@ -140,4 +140,5 @@
          WRITE(numout,*) 'trd_pen_init : 3D Potential ENergy trends'
          WRITE(numout,*) '~~~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !                           ! allocate box volume arrays
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRD/trdvor.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRD/trdvor.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/TRD/trdvor.F90	(revision 10986)
@@ -200,6 +200,8 @@
 
       IF( ndebug /= 0 ) THEN
-         IF(lwp) WRITE(numout,*) ' debuging trd_vor_zint: I done'
-         CALL FLUSH(numout)
+         IF(lwp) THEN
+            WRITE(numout,*) ' debuging trd_vor_zint: I done'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
       ENDIF
       !
@@ -291,6 +293,8 @@
    
       IF( ndebug /= 0 ) THEN
-         IF(lwp) WRITE(numout,*) ' debuging trd_vor_zint: I done'
-         CALL FLUSH(numout)
+         IF(lwp) THEN
+            WRITE(numout,*) ' debuging trd_vor_zint: I done'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
       ENDIF
       !
@@ -416,4 +420,5 @@
             WRITE(numout,*) 'trd_vor : write trends in the NetCDF file at kt = ', kt
             WRITE(numout,*) '~~~~~~~  '
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
  
@@ -434,5 +439,5 @@
          IF( ndebug /= 0 ) THEN
             WRITE(numout,*) ' debuging trd_vor: III.4 done'
-            CALL FLUSH(numout)
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
          !
@@ -477,4 +482,5 @@
          WRITE(numout,*) '               ##########################################################################'
          WRITE(numout,*) ' '
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -490,5 +496,5 @@
       IF( ndebug /= 0 ) THEN
          WRITE(numout,*) ' debuging trd_vor_init: I. done'
-         CALL FLUSH(numout)
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -512,5 +518,8 @@
       zout = nn_trd*rdt
 
-      IF(lwp) WRITE(numout,*) '               netCDF initialization'
+      IF(lwp) THEN
+         WRITE(numout,*) '               netCDF initialization'
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
 
       ! II.2 Compute julian date from starting date of the run
@@ -518,13 +527,19 @@
       CALL ymds2ju( nyear, nmonth, nday, rdt, zjulian )
       zjulian = zjulian - adatrj   !   set calendar origin to the beginning of the experiment
-      IF(lwp) WRITE(numout,*)' '  
-      IF(lwp) WRITE(numout,*)'               Date 0 used :',nit000,    &
+      IF(lwp) THEN
+         WRITE(numout,*)' '  
+         WRITE(numout,*)'               Date 0 used :',nit000,    &
          &                   ' YEAR ', nyear,' MONTH '      , nmonth,   &
          &                   ' DAY ' , nday, 'Julian day : ', zjulian
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
 
       ! II.3 Define the T grid trend file (nidvor)
       ! ---------------------------------
       CALL dia_nam( clhstnam, nn_trd, 'vort' )                  ! filename
-      IF(lwp) WRITE(numout,*) ' Name of NETCDF file ', clhstnam
+      IF(lwp) THEN
+         WRITE(numout,*) ' Name of NETCDF file ', clhstnam
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
       CALL histbeg( clhstnam, jpi, glamf, jpj, gphif,1, jpi,   &  ! Horizontal grid : glamt and gphit
          &          1, jpj, nit000-1, zjulian, rdt, nh_t, nidvor, domain_id=nidom, snc4chunks=snc4set )
@@ -562,5 +577,5 @@
       IF( ndebug /= 0 ) THEN
          WRITE(numout,*) ' debuging trd_vor_init: II. done'
-         CALL FLUSH(numout)
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ZDF/zdfdrg.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ZDF/zdfdrg.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ZDF/zdfdrg.F90	(revision 10986)
@@ -254,4 +254,5 @@
          WRITE(numout,*) '      logarithmic drag: Cd = vkarmn/log(z/z0)   ln_loglayer = ', ln_loglayer
          WRITE(numout,*) '      implicit friction                         ln_drgimp   = ', ln_drgimp
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -356,4 +357,5 @@
          WRITE(numout,*) '      set a regional boost of Cd0             ln_boost = ', ln_boost
          WRITE(numout,*) '         associated boost factor              rn_boost = ', rn_boost
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -367,7 +369,10 @@
       !
       IF( ln_boost ) THEN           !* regional boost:   boost factor = 1 + regional boost
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) '   ==>>>   use a regional boost read in ', TRIM(cl_file), ' file'
-         IF(lwp) WRITE(numout,*) '           using enhancement factor of ', rn_boost
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) '   ==>>>   use a regional boost read in ', TRIM(cl_file), ' file'
+            WRITE(numout,*) '           using enhancement factor of ', rn_boost
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          ! cl_varname is a coefficient in [0,1] giving where to apply the regional boost
          CALL iom_open ( TRIM(cl_file), inum )
@@ -451,4 +456,5 @@
          CALL ctl_stop( 'drg_init: bad flag value for ndrg ' )
       END SELECT
+      IF(lwp .AND. lflush) CALL FLUSH(numout)
       !
    END SUBROUTINE drg_init
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ZDF/zdfevd.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ZDF/zdfevd.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ZDF/zdfevd.F90	(revision 10986)
@@ -62,9 +62,10 @@
       !!----------------------------------------------------------------------
       !
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'zdf_evd : Enhanced Vertical Diffusion (evd)'
-         IF(lwp) WRITE(numout,*) '~~~~~~~ '
-         IF(lwp) WRITE(numout,*)
+      IF( kt == nit000 .AND. lwp) THEN
+          WRITE(numout,*)
+          WRITE(numout,*) 'zdf_evd : Enhanced Vertical Diffusion (evd)'
+          WRITE(numout,*) '~~~~~~~ '
+          WRITE(numout,*)
+          IF(lflush) CALL FLUSH(numout) 
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ZDF/zdfgls.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ZDF/zdfgls.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ZDF/zdfgls.F90	(revision 10986)
@@ -890,4 +890,5 @@
          WRITE(numout,*) '      Bottom seafloor     roughness (m)             rn_z0(_bot)   = ', r_z0_bot
          WRITE(numout,*)
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -982,5 +983,5 @@
          !
       END SELECT
-
+      IF(lflush .AND. lwp) CALL FLUSH(numout)
       !
       SELECT CASE ( nn_stab_func )     !* set the parameters of the stability functions
@@ -1058,4 +1059,5 @@
          !
       END SELECT
+      IF(lflush .AND. lwp) CALL FLUSH(numout)
     
       !                                !* Set Schmidt number for psi diffusion in the wave breaking case
@@ -1107,4 +1109,5 @@
          WRITE(numout,*) '      ra_sf    = ', ra_sf
          WRITE(numout,*) '      rl_sf    = ', rl_sf
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -1177,6 +1180,9 @@
                CALL iom_get( numror, jpdom_autoglo, 'hmxl_n', hmxl_n, ldxios = lrxios )
             ELSE                        
-               IF(lwp) WRITE(numout,*)
-               IF(lwp) WRITE(numout,*) '   ==>>   previous run without GLS scheme, set en and hmxl_n to background values'
+               IF(lwp) THEN
+                  WRITE(numout,*)
+                  WRITE(numout,*) '   ==>>   previous run without GLS scheme, set en and hmxl_n to background values'
+                  IF(lflush) CALL FLUSH(numout)
+               ENDIF
                en    (:,:,:) = rn_emin
                hmxl_n(:,:,:) = 0.05_wp
@@ -1184,6 +1190,9 @@
             ENDIF
          ELSE                                   !* Start from rest
-            IF(lwp) WRITE(numout,*)
-            IF(lwp) WRITE(numout,*) '   ==>>   start from rest, set en and hmxl_n by background values'
+            IF(lwp) THEN
+               WRITE(numout,*)
+               WRITE(numout,*) '   ==>>   start from rest, set en and hmxl_n by background values'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             en    (:,:,:) = rn_emin
             hmxl_n(:,:,:) = 0.05_wp
@@ -1193,5 +1202,8 @@
       ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN   ! Create restart file
          !                                   ! -------------------
-         IF(lwp) WRITE(numout,*) '---- gls-rst ----'
+         IF(lwp .AND. nprint > 0) THEN
+            WRITE(numout,*) '---- gls-rst ----'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          IF( lwxios ) CALL iom_swap(      cwxios_context         )
          CALL iom_rstput( kt, nitrst, numrow, 'en'    , en    , ldxios = lwxios )
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ZDF/zdfiwm.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ZDF/zdfiwm.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ZDF/zdfiwm.F90	(revision 10986)
@@ -328,4 +328,5 @@
             WRITE(numout,*)
             WRITE(numout,*) '      Total power consumption by av_wave =  ', zztmp * 1.e-12_wp, 'TW'
+            IF(lflush) CALL FLUSH(numout)
          ENDIF
       ENDIF
@@ -439,4 +440,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
       
@@ -451,4 +453,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
             
@@ -488,4 +491,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
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ZDF/zdfmxl.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ZDF/zdfmxl.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ZDF/zdfmxl.F90	(revision 10986)
@@ -86,4 +86,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' )
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ZDF/zdfosm.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ZDF/zdfosm.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ZDF/zdfosm.F90	(revision 10986)
@@ -1418,4 +1418,5 @@
         WRITE(numout,*) '     Use large mixing below BL when unstable       ln_convmix = ', ln_convmix
         WRITE(numout,*) '     diffusivity when unstable below BL     (m2/s) rn_difconv = ', rn_difconv
+        IF(lflush) CALL FLUSH(numout)
      ENDIF
 
@@ -1430,4 +1431,5 @@
            WRITE(numout,*) '    Double diffusion mixing on temperature and salinity '
            WRITE(numout,*) '    CAUTION : done in routine zdfosm, not in routine zdfddm '
+           IF(lflush) CALL FLUSH(numout)
         ENDIF
      ENDIF
@@ -1439,4 +1441,5 @@
      IF(lwp) THEN
         WRITE(numout,*)
+        IF(lflush) CALL FLUSH(numout)
      ENDIF
 
@@ -1495,5 +1498,5 @@
 
      END SELECT
-
+     IF(lwp .AND. lflush) CALL FLUSH(numout)
      ! Initialization of vertical eddy coef. to the background value
      ! -------------------------------------------------------------
@@ -1546,8 +1549,14 @@
         IF( id1 > 0 ) THEN                       ! 'wn' exists; read
            CALL iom_get( numror, jpdom_autoglo, 'wn', wn, ldxios = lrxios )
-           WRITE(numout,*) ' ===>>>> :  wn read from restart file'
+           IF(lwp) THEN
+              WRITE(numout,*) ' ===>>>> :  wn read from restart file'
+              IF(lflush) CALL FLUSH(numout)
+           ENDIF
         ELSE
            wn(:,:,:) = 0._wp
-           WRITE(numout,*) ' ===>>>> :  wn not in restart file, set to zero initially'
+           IF(lwp) THEN
+              WRITE(numout,*) ' ===>>>> :  wn not in restart file, set to zero initially'
+              IF(lflush) CALL FLUSH(numout)
+           ENDIF
         END IF
         id1 = iom_varid( numror, 'hbl'   , ldstop = .FALSE. )
@@ -1556,8 +1565,14 @@
            CALL iom_get( numror, jpdom_autoglo, 'hbl' , hbl , ldxios = lrxios )
            CALL iom_get( numror, jpdom_autoglo, 'hbli', hbli, ldxios = lrxios  )
-           WRITE(numout,*) ' ===>>>> :  hbl & hbli read from restart file'
+           IF(lwp) THEN
+              WRITE(numout,*) ' ===>>>> :  hbl & hbli read from restart file'
+              IF(lflush) CALL FLUSH(numout)
+           ENDIF
            RETURN
         ELSE                      ! 'hbl' & 'hbli' not in restart file, recalculate
-           WRITE(numout,*) ' ===>>>> : previous run without osmosis scheme, hbl computed from stratification'
+           IF(lwp) THEN
+              WRITE(numout,*) ' ===>>>> : previous run without osmosis scheme, hbl computed from stratification'
+              IF(lflush) CALL FLUSH(numout)
+           ENDIF
         END IF
      END IF
@@ -1567,5 +1582,8 @@
      !!-----------------------------------------------------------------------------
      IF( TRIM(cdrw) == 'WRITE') THEN     !* Write hbli into the restart file, then return
-        IF(lwp) WRITE(numout,*) '---- osm-rst ----'
+         IF(lwp .AND. nprint > 0) THEN
+            WRITE(numout,*) '---- osm-rst ----'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          CALL iom_rstput( kt, nitrst, numrow, 'wn'     , wn  , ldxios = lwxios )
          CALL iom_rstput( kt, nitrst, numrow, 'hbl'    , hbl , ldxios = lwxios )
@@ -1577,5 +1595,8 @@
      ! Getting hbl, no restart file with hbl, so calculate from surface stratification
      !!-----------------------------------------------------------------------------
-     IF( lwp ) WRITE(numout,*) ' ===>>>> : calculating hbl computed from stratification'
+     IF( lwp ) THEN
+        WRITE(numout,*) ' ===>>>> : calculating hbl computed from stratification'
+        IF(lflush) CALL FLUSH(numout)
+     ENDIF
      ALLOCATE( imld_rst(jpi,jpj) )
      ! w-level of the mixing and mixed layers
@@ -1606,5 +1627,8 @@
      hbli(:,:) = hbl(:,:)
      DEALLOCATE( imld_rst )
-     WRITE(numout,*) ' ===>>>> : hbl computed from stratification'
+     IF(lwp) THEN
+        WRITE(numout,*) ' ===>>>> : hbl computed from stratification'
+        IF(lflush) CALL FLUSH(numout)
+     ENDIF
    END SUBROUTINE osm_rst
 
@@ -1623,8 +1647,9 @@
       INTEGER :: ji, jj, jk
       !
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'tra_osm : OSM non-local tracer fluxes'
-         IF(lwp) WRITE(numout,*) '~~~~~~~   '
+      IF( kt == nit000 .AND. lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'tra_osm : OSM non-local tracer fluxes'
+         WRITE(numout,*) '~~~~~~~   '
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -1698,8 +1723,9 @@
       !!----------------------------------------------------------------------
       !
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'dyn_osm : OSM non-local velocity'
-         IF(lwp) WRITE(numout,*) '~~~~~~~   '
+      IF( kt == nit000 .AND. lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'dyn_osm : OSM non-local velocity'
+         WRITE(numout,*) '~~~~~~~   '
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !code saving tracer trends removed, replace with trdmxl_oce
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ZDF/zdfphy.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ZDF/zdfphy.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ZDF/zdfphy.F90	(revision 10986)
@@ -88,4 +88,5 @@
          WRITE(numout,*) 'zdf_phy_init: ocean vertical physics'
          WRITE(numout,*) '~~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -128,4 +129,5 @@
          WRITE(numout,*) '         constant background or profile          nn_avb    = ', nn_avb
          WRITE(numout,*) '         horizontal variation for avtb           nn_havtb  = ', nn_havtb
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -178,4 +180,5 @@
          ELSE                      ;   WRITE(numout,*) '   ==>>>   convection: no specific scheme used'
          ENDIF
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
@@ -185,4 +188,5 @@
          ELSE                   ;   WRITE(numout,*) '   ==>>>   No  double diffusive mixing: avs = avt'
          ENDIF
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
 
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ZDF/zdfric.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ZDF/zdfric.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ZDF/zdfric.F90	(revision 10986)
@@ -101,4 +101,5 @@
          WRITE(numout,*) '         Vertical eddy Diff. in the ML  rn_wtmix  = ', rn_wtmix
          WRITE(numout,*) '         Vertical eddy Visc. in the ML  rn_wvmix  = ', rn_wvmix
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -234,5 +235,8 @@
       ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN   ! Create restart file
          !                                   ! -------------------
-         IF(lwp) WRITE(numout,*) '---- ric-rst ----'
+         IF(lwp .AND. nprint > 0) THEN
+            WRITE(numout,*) '---- ric-rst ----'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          IF( lwxios ) CALL iom_swap(      cwxios_context          )
          CALL iom_rstput( kt, nitrst, numrow, 'avt_k', avt_k, ldxios = lwxios )
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ZDF/zdfswm.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ZDF/zdfswm.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ZDF/zdfswm.F90	(revision 10986)
@@ -88,4 +88,5 @@
          WRITE(numout,*) 'zdf_swm_init : surface wave-driven mixing'
          WRITE(numout,*) '~~~~~~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       IF(  .NOT.ln_wave .OR.   &
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ZDF/zdftke.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ZDF/zdftke.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/ZDF/zdftke.F90	(revision 10986)
@@ -699,4 +699,5 @@
          WRITE(numout,*) '   ==>>>   critical Richardson nb with your parameters  ri_cri = ', ri_cri
          WRITE(numout,*)
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -704,8 +705,14 @@
          rn_emin  = 1.e-10_wp             ! specific values of rn_emin & rmxl_min are used
          rmxl_min = 1.e-03_wp             ! associated avt minimum = molecular salt diffusivity (10^-9 m2/s)
-         IF(lwp) WRITE(numout,*) '   ==>>>   Internal wave-driven mixing case:   force   rn_emin = 1.e-10 and rmxl_min = 1.e-3'
+         IF(lwp) THEN
+            WRITE(numout,*) '   ==>>>   Internal wave-driven mixing case:   force   rn_emin = 1.e-10 and rmxl_min = 1.e-3'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
       ELSE                          ! standard case : associated avt minimum = molecular viscosity (10^-6 m2/s)
          rmxl_min = 1.e-6_wp / ( rn_ediff * SQRT( rn_emin ) )    ! resulting minimum length to recover molecular viscosity
-         IF(lwp) WRITE(numout,*) '   ==>>>   minimum mixing length with your parameters rmxl_min = ', rmxl_min
+         IF(lwp) THEN
+            WRITE(numout,*) '   ==>>>   minimum mixing length with your parameters rmxl_min = ', rmxl_min
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
       ENDIF
       !
@@ -720,6 +727,9 @@
       !
       IF( ln_mxl0 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) '   ==>>>   use a surface mixing length = F(stress) :   set rn_mxl0 = rmxl_min'
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) '   ==>>>   use a surface mixing length = F(stress) :   set rn_mxl0 = rmxl_min'
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          rn_mxl0 = rmxl_min
       ENDIF
@@ -781,6 +791,9 @@
                CALL iom_get( numror, jpdom_autoglo, 'dissl', dissl, ldxios = lrxios )
             ELSE                                          ! start TKE from rest
-               IF(lwp) WRITE(numout,*)
-               IF(lwp) WRITE(numout,*) '   ==>>>   previous run without TKE scheme, set en to background values'
+               IF(lwp) THEN
+                  WRITE(numout,*)
+                  WRITE(numout,*) '   ==>>>   previous run without TKE scheme, set en to background values'
+                  IF(lflush) CALL FLUSH(numout)
+               ENDIF
                en   (:,:,:) = rn_emin * wmask(:,:,:)
                dissl(:,:,:) = 1.e-12_wp
@@ -788,6 +801,9 @@
             ENDIF
          ELSE                                   !* Start from rest
-            IF(lwp) WRITE(numout,*)
-            IF(lwp) WRITE(numout,*) '   ==>>>   start from rest: set en to the background value'
+            IF(lwp) THEN
+               WRITE(numout,*)
+               WRITE(numout,*) '   ==>>>   start from rest: set en to the background value'
+               IF(lflush) CALL FLUSH(numout)
+            ENDIF
             en   (:,:,:) = rn_emin * wmask(:,:,:)
             dissl(:,:,:) = 1.e-12_wp
@@ -797,5 +813,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( lwxios ) CALL iom_swap(      cwxios_context          ) 
          CALL iom_rstput( kt, nitrst, numrow, 'en'   , en   , ldxios = lwxios )
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/nemogcm.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/nemogcm.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/nemogcm.F90	(revision 10986)
@@ -225,4 +225,5 @@
          WRITE(numout,*) '   ==>>>   nemo_gcm: a total of ', nstop, ' errors have been found'
          WRITE(numout,*)
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -261,5 +262,5 @@
       NAMELIST/namctl/ ln_ctl   , sn_cfctl, nn_print, nn_ictls, nn_ictle,   &
          &             nn_isplt , nn_jsplt, nn_jctls, nn_jctle,             &
-         &             ln_timing, ln_diacfl
+         &             ln_timing, ln_diacfl, ln_flush
       NAMELIST/namcfg/ ln_read_cfg, cn_domcfg, ln_closea, ln_write_cfg, cn_domcfg_out, ln_use_jattr
       !!----------------------------------------------------------------------
@@ -393,4 +394,5 @@
          !
          IF(nprint > 1) WRITE(numout,cform_aaa)                                        ! Flag AAAAAAA
+         IF(lflush) CALL FLUSH(numout)
          !
       ENDIF
@@ -497,5 +499,8 @@
       IF( lk_asminc    )   CALL asm_inc_init    ! Initialize assimilation increments
       !
-      IF(lwp .AND. nprint > 1) WRITE(numout,cform_aaa)           ! Flag AAAAAAA
+      IF(lwp .AND. nprint > 1) THEN
+         WRITE(numout,cform_aaa)           ! Flag AAAAAAA
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
       !
       IF( ln_timing    )   CALL timing_stop( 'nemo_init')
@@ -541,4 +546,5 @@
       ENDIF
       !
+      lflush    = ln_flush
       nictls    = nn_ictls
       nictle    = nn_ictle
@@ -557,4 +563,5 @@
          WRITE(numout,*) '         filename to be written                        cn_domcfg_out = ', TRIM(cn_domcfg_out)
          WRITE(numout,*) '      use file attribute if exists as i/p j-start   ln_use_jattr     = ', ln_use_jattr
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       IF( .NOT.ln_read_cfg )   ln_closea = .false.   ! dealing possible only with a domcfg file
@@ -572,6 +579,9 @@
             ijsplt = isplt * jsplt            ! total number of processors ijsplt
          ENDIF
-         IF(lwp) WRITE(numout,*)'          - The total number of processors over which the'
-         IF(lwp) WRITE(numout,*)'            print control will be done is ijsplt : ', ijsplt
+         IF(lwp) THEN
+            WRITE(numout,*)'          - The total number of processors over which the'
+            WRITE(numout,*)'            print control will be done is ijsplt : ', ijsplt
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          !
          !                              ! indices used for the SUM control
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/stpctl.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/stpctl.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/stpctl.F90	(revision 10986)
@@ -78,4 +78,5 @@
          WRITE(numout,*) 'stp_ctl : time-stepping control'
          WRITE(numout,*) '~~~~~~~'
+         IF(lflush) CALL FLUSH(numout)
          !                                ! open time.step file
          IF( lwm ) CALL ctl_opn( numstp, 'time.step', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea )
@@ -133,4 +134,5 @@
       IF( ll_wrtruns ) THEN
          WRITE(numrun,9500) kt, zmax(1), zmax(2), -zmax(3), zmax(4)
+         IF(lflush) CALL flush(numrun)
          istatus = NF90_PUT_VAR( idrun, idssh, (/ zmax(1)/), (/kt/), (/1/) )
          istatus = NF90_PUT_VAR( idrun,   idu, (/ zmax(2)/), (/kt/), (/1/) )
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/timing.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/timing.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/timing.F90	(revision 10986)
@@ -815,5 +815,8 @@
       !
       IF( ASSOCIATED(ptr%next) ) CALL timing_list(ptr%next)
-      IF(lwp) WRITE(numout,*)'   ', ptr%cname   
+      IF(lwp) THEN
+         WRITE(numout,*)'   ', ptr%cname   
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
       !
    END SUBROUTINE timing_list
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/trc_oce.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/trc_oce.F90	(revision 10985)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/trc_oce.F90	(revision 10986)
@@ -86,4 +86,5 @@
          WRITE(numout,*) '   trc_oce_rgb : Initialisation of the optical look-up table'
          WRITE(numout,*) '   ~~~~~~~~~~~ '
+         IF(lflush) CALL FLUSH(numout)
       ENDIF
       !
@@ -154,10 +155,16 @@
       !
       r_si2 = 1.e0 / zrgb(2, 1)        ! blue with the smallest chlorophyll concentration)
-      IF(lwp) WRITE(numout,*) '      RGB longest depth of extinction    r_si2 = ', r_si2
+      IF(lwp) THEN
+         WRITE(numout,*) '      RGB longest depth of extinction    r_si2 = ', r_si2
+         IF(lflush) CALL FLUSH(numout)
+      ENDIF
       !
       DO jc = 1, 61                         ! check
          zchl = zrgb(1,jc)
          irgb = NINT( 41 + 20.* LOG10( zchl ) + 1.e-15 )
-         IF(lwp .AND. nn_print >= 1 ) WRITE(numout,*) '    jc =', jc, '  Chl = ', zchl, '  irgb = ', irgb
+         IF(lwp .AND. nn_print >= 1 ) THEN
+            WRITE(numout,*) '    jc =', jc, '  Chl = ', zchl, '  irgb = ', irgb
+            IF(lflush) CALL FLUSH(numout)
+         ENDIF
          IF( irgb /= jc ) THEN
             IF(lwp) WRITE(numout,*) '    jc =', jc, '  Chl = ', zchl, '  Chl class = ', irgb
