Index: /branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90	(revision 10891)
+++ /branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90	(revision 10892)
@@ -801,7 +801,9 @@
          CALL histend( nid_W, snc4chunks=snc4set )
 
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'End of NetCDF Initialization'
-         IF(lwp .AND. lflush) CALL flush(numout)
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) 'End of NetCDF Initialization'
+            IF(lflush) CALL flush(numout)
+         ENDIF
 
       ENDIF
Index: /branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/FLO/flodom.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/FLO/flodom.F90	(revision 10891)
+++ /branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/FLO/flodom.F90	(revision 10892)
@@ -151,6 +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
-         IF(lwp .AND. lflush) 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)
Index: /branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ICB/icbdia.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ICB/icbdia.F90	(revision 10891)
+++ /branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/ICB/icbdia.F90	(revision 10892)
@@ -498,5 +498,5 @@
       IF ( PRESENT(kbergs) ) THEN
          IF(numicb.NE.-1) & 
-            &        WRITE(numicb,100) cd_budgetstr // ' state:',                        &
+                     WRITE(numicb,100) cd_budgetstr // ' state:',                        &
                            cd_startstr  // ' start',  pstartval,         cd_budgetunits, &
                            cd_endstr    // ' end',    pendval,           cd_budgetunits, &
@@ -505,5 +505,5 @@
       ELSE
          IF(numicb.NE.-1) &
-            &        WRITE(numicb,100) cd_budgetstr // ' state:',                       &
+                     WRITE(numicb,100) cd_budgetstr // ' state:',                       &
                            cd_startstr  // ' start', pstartval,         cd_budgetunits, &
                            cd_endstr    // ' end',   pendval,           cd_budgetunits, &
@@ -522,5 +522,5 @@
       !
       IF(numicb.NE.-1) &
-         &        WRITE(numicb,200) cd_budgetstr // ' check:',     &
+                  WRITE(numicb,200) cd_budgetstr // ' check:',     &
                         cd_startstr,    pstartval, cd_budgetunits, &
                         cd_endstr,      pendval,   cd_budgetunits, &
Index: /branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90	(revision 10891)
+++ /branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90	(revision 10892)
@@ -112,6 +112,8 @@
                IF(nprint > 1) THEN
                   IF ( snc4set%luse )      WRITE(numout,*) '             opened for NetCDF4 chunking and compression'
-                  IF( kt == nitrst - 1) THEN   ;   WRITE(numout,*) '             kt = nitrst - 1 = ', kt
-                  ELSE                          ;   WRITE(numout,*) '             kt = '             , kt
+                  IF( kt == nitrst - 1) THEN
+                     WRITE(numout,*) '             kt = nitrst - 1 = ', kt
+                  ELSE                          
+                     WRITE(numout,*) '             kt = '             , kt
                   ENDIF
                ENDIF
Index: /branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/LDF/ldfdyn_smag.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/LDF/ldfdyn_smag.F90	(revision 10891)
+++ /branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/LDF/ldfdyn_smag.F90	(revision 10892)
@@ -106,8 +106,10 @@
 
 
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'ldf_dyn_smag : 3D lateral eddy viscosity coefficient'
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
-         IF(lwp .AND. lflush) CALL flush(numout)
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) 'ldf_dyn_smag : 3D lateral eddy viscosity coefficient'
+            WRITE(numout,*) '~~~~~~~~~~~'
+            IF(lflush) CALL flush(numout)
+         ENDIF
 
       ENDIF
@@ -173,10 +175,13 @@
 
          ENDDO ! jpk
-            ahm1(:,:,jpk) = ahm1(:,:,jpkm1)
-            ahm2(:,:,jpk) = ahm2(:,:,jpkm1)
-            IF(lwp.and.kt==nit000) THEN
-               WRITE(numout,'(36x," ahm ", 7x)') 
-               IF(lflush) CALL flush(numout)
-            ENDIF
+
+         ahm1(:,:,jpk) = ahm1(:,:,jpkm1)
+         ahm2(:,:,jpk) = ahm2(:,:,jpkm1)
+
+         IF(lwp.and.kt==nit000) THEN
+            WRITE(numout,'(36x," ahm ", 7x)') 
+            IF(lflush) CALL flush(numout)
+         ENDIF
+
          IF(lwp.and.kt==nit000) THEN
             DO jk = 1, jpk
@@ -185,4 +190,5 @@
             IF(lflush) CALL flush(numout)
          ENDIF
+
       CALL lbc_lnk( ahm1, 'T', 1. )   ! Lateral boundary conditions on ( ahtt )
       CALL lbc_lnk( ahm2, 'F', 1. )   ! Lateral boundary conditions on ( ahtt )
Index: /branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/SBC/cpl_oasis3.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/SBC/cpl_oasis3.F90	(revision 10891)
+++ /branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/SBC/cpl_oasis3.F90	(revision 10892)
@@ -357,6 +357,6 @@
 #endif
                   IF( ln_ctl ) THEN
-                    WRITE(numout,*) "Define", ji, jc, jm, " "//TRIM(zclname), " for ", OASIS_In
-                    IF(lflush) CALL flush(numout)
+                     WRITE(numout,*) "Define", ji, jc, jm, " "//TRIM(zclname), " for ", OASIS_In
+                     IF(lflush) CALL flush(numout)
                   ENDIF
 
@@ -402,7 +402,7 @@
                   ENDIF
                   IF(ln_ctl) THEN
-                    IF(srcv(ji)%nid(jc,jm) /= -1 ) WRITE(numout,*) "variable defined in the namcouple"
-                    IF(srcv(ji)%nid(jc,jm) == -1 ) WRITE(numout,*) "variable NOT defined in the namcouple"
-                    IF(lflush) CALL flush(numout)
+                     IF(srcv(ji)%nid(jc,jm) /= -1 ) WRITE(numout,*) "variable defined in the namcouple"
+                     IF(srcv(ji)%nid(jc,jm) == -1 ) WRITE(numout,*) "variable NOT defined in the namcouple"
+                     IF(lflush) CALL flush(numout)
                   ENDIF
                END DO
Index: /branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/SBC/fldread.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/SBC/fldread.F90	(revision 10891)
+++ /branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/SBC/fldread.F90	(revision 10892)
@@ -785,5 +785,5 @@
                      sd(ju)%rotn(jn) = .TRUE.               ! vector was rotated 
                      IF( lwp .AND. kt == nit000 )   THEN
-                       WRITE(numout,*)   &
+                        WRITE(numout,*)   &
                         &   'fld_read: vector pair ('//TRIM(sd(ju)%clvar)//', '//TRIM(sd(iv)%clvar)//') rotated on to model grid'
                         IF(lflush) CALL flush(numout)
Index: /branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 10891)
+++ /branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 10892)
@@ -1475,9 +1475,11 @@
             greenland_icesheet_timelapsed = 0.0_wp       
          ENDIF
-         IF(lwp .AND. ll_wrtstp) WRITE(numout,*) 'Greenland icesheet mass (kg) read in is ', zgreenland_icesheet_mass_in
-         IF(lwp .AND. ll_wrtstp) WRITE(numout,*) 'Greenland icesheet mass (kg) used is    ', greenland_icesheet_mass
-         IF(lwp .AND. ll_wrtstp) WRITE(numout,*) 'Greenland icesheet mass rate of change (kg/s) is ', greenland_icesheet_mass_rate_of_change
-         IF(lwp .AND. ll_wrtstp) WRITE(numout,*) 'Greenland icesheet seconds lapsed since last change is ', greenland_icesheet_timelapsed
-         IF(lwp .AND. lflush .AND. ll_wrtstp) CALL flush(numout)
+         IF(lwp .AND. ll_wrtstp) THEN
+            WRITE(numout,*) 'Greenland icesheet mass (kg) read in is ', zgreenland_icesheet_mass_in
+            WRITE(numout,*) 'Greenland icesheet mass (kg) used is    ', greenland_icesheet_mass
+            WRITE(numout,*) 'Greenland icesheet mass rate of change (kg/s) is ', greenland_icesheet_mass_rate_of_change
+            WRITE(numout,*) 'Greenland icesheet seconds lapsed since last change is ', greenland_icesheet_timelapsed
+            IF(lflush) CALL flush(numout)
+         ENDIF
       ELSE IF ( nn_coupled_iceshelf_fluxes == 2 ) THEN
          greenland_icesheet_mass_rate_of_change = rn_greenland_total_fw_flux
@@ -1523,9 +1525,11 @@
             antarctica_icesheet_timelapsed = 0.0_wp       
          ENDIF
-         IF(lwp .AND. ll_wrtstp) WRITE(numout,*) 'Antarctica icesheet mass (kg) read in is ', zantarctica_icesheet_mass_in
-         IF(lwp .AND. ll_wrtstp) WRITE(numout,*) 'Antarctica icesheet mass (kg) used is    ', antarctica_icesheet_mass
-         IF(lwp .AND. ll_wrtstp) WRITE(numout,*) 'Antarctica icesheet mass rate of change (kg/s) is ', antarctica_icesheet_mass_rate_of_change
-         IF(lwp .AND. ll_wrtstp) WRITE(numout,*) 'Antarctica icesheet seconds lapsed since last change is ', antarctica_icesheet_timelapsed
-         IF(lwp .AND. lflush .AND. ll_wrtstp) CALL flush(numout)
+         IF(lwp .AND. ll_wrtstp) THEN
+            WRITE(numout,*) 'Antarctica icesheet mass (kg) read in is ', zantarctica_icesheet_mass_in
+            WRITE(numout,*) 'Antarctica icesheet mass (kg) used is    ', antarctica_icesheet_mass
+            WRITE(numout,*) 'Antarctica icesheet mass rate of change (kg/s) is ', antarctica_icesheet_mass_rate_of_change
+            WRITE(numout,*) 'Antarctica icesheet seconds lapsed since last change is ', antarctica_icesheet_timelapsed
+            IF(lflush) CALL flush(numout)
+         ENDIF
       ELSE IF ( nn_coupled_iceshelf_fluxes == 2 ) THEN
          antarctica_icesheet_mass_rate_of_change = rn_antarctica_total_fw_flux
Index: /branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90	(revision 10891)
+++ /branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90	(revision 10892)
@@ -183,6 +183,6 @@
       !
       IF(lwp .AND. nprint>1) THEN
-        WRITE(numout,*)'cice_sbc_init'
-        IF(lflush) CALL flush(numout)
+         WRITE(numout,*)'cice_sbc_init'
+         IF(lflush) CALL flush(numout)
       ENDIF
 
@@ -346,6 +346,6 @@
       IF( kt == nit000 )  THEN
          IF(lwp .AND. nprint>1) THEN
-           WRITE(numout,*)'cice_sbc_in'
-           IF(lflush) CALL flush(numout)
+            WRITE(numout,*)'cice_sbc_in'
+            IF(lflush) CALL flush(numout)
          ENDIF
       ENDIF
@@ -590,6 +590,6 @@
       IF( kt == nit000 )  THEN
          IF(lwp .AND. nprint>1) THEN
-           WRITE(numout,*)'cice_sbc_out'
-           IF(lflush) CALL flush(numout)
+            WRITE(numout,*)'cice_sbc_out'
+            IF(lflush) CALL flush(numout)
          ENDIF
       ENDIF
@@ -830,6 +830,6 @@
 
       IF(lwp .AND. nprint > 1) THEN
-        WRITE(numout,*)'cice_sbc_final'
-        IF(lflush) CALL flush(numout)
+         WRITE(numout,*)'cice_sbc_final'
+         IF(lflush) CALL flush(numout)
       ENDIF
 
Index: /branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 10891)
+++ /branches/UKMO/dev_r5518_GO6_package_text_diagnostics/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 10892)
@@ -297,5 +297,4 @@
       nprint    = nn_print          ! convert DOCTOR namelist names into OLD names
       lflush    = ln_flush          ! convert namelist variable to model variable
-      !do it here because output.namelist.dyn is opened before nprint was set earlier
       !
       !                             !--------------------------------------------!
