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 10968)
+++ 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 10968)
+++ 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 10968)
+++ 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 10968)
+++ 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 10968)
+++ 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 10968)
+++ 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 10968)
+++ 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 10968)
+++ 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 10968)
+++ 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 10968)
+++ 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 10968)
+++ 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 10968)
+++ 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 10968)
+++ 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
 
