Index: /NEMO/trunk/src/OCE/ASM/asmbkg.F90
===================================================================
--- /NEMO/trunk/src/OCE/ASM/asmbkg.F90	(revision 15397)
+++ /NEMO/trunk/src/OCE/ASM/asmbkg.F90	(revision 15398)
@@ -74,85 +74,88 @@
       !!-----------------------------------------------------------------------
 
-      !                                !-------------------------------------------
-      IF( kt == nitbkg_r ) THEN        ! Write out background at time step nitbkg_r
-         !                             !-----------------------------------========
-         !
-         WRITE(cl_asmbkg, FMT='(A,".nc")' ) TRIM( c_asmbkg )
-         cl_asmbkg = TRIM( cl_asmbkg )
-         INQUIRE( FILE = cl_asmbkg, EXIST = llok )
-         !
-         IF( .NOT. llok ) THEN
-            IF(lwp) WRITE(numout,*) ' Setting up assimilation background file '// TRIM( c_asmbkg )
-            !
-            !                                      ! Define the output file        
-            CALL iom_open( c_asmbkg, inum, ldwrt = .TRUE. )
-            !
-            IF( nitbkg_r == nit000 - 1 ) THEN      ! Treat special case when nitbkg = 0
-               zdate = REAL( ndastp )
-               IF( ln_zdftke ) THEN                   ! read turbulent kinetic energy ( en )
-                  IF(lwp) WRITE(numout,*) ' Reading TKE (en) from restart...'
-                  CALL tke_rst( nit000, 'READ' )
-               ENDIF
-            ELSE
-               zdate = REAL( ndastp )
-            ENDIF
-            !
-            !                                      ! Write the information
-            CALL iom_rstput( kt, nitbkg_r, inum, 'rdastp' , zdate                )
-            CALL iom_rstput( kt, nitbkg_r, inum, 'un'     , uu(:,:,:,Kmm)        )
-            CALL iom_rstput( kt, nitbkg_r, inum, 'vn'     , vv(:,:,:,Kmm)        )
-            CALL iom_rstput( kt, nitbkg_r, inum, 'tn'     , ts(:,:,:,jp_tem,Kmm) )
-            CALL iom_rstput( kt, nitbkg_r, inum, 'sn'     , ts(:,:,:,jp_sal,Kmm) )
-            CALL iom_rstput( kt, nitbkg_r, inum, 'sshn'   , ssh(:,:,Kmm)         )
-            IF( ln_zdftke )   CALL iom_rstput( kt, nitbkg_r, inum, 'en'     , en )
-            !
-            CALL iom_close( inum )
-         ENDIF
-         !
-      ENDIF
 
-      !                                !-------------------------------------------
-      IF( kt == nitdin_r ) THEN        ! Write out background at time step nitdin_r
-         !                             !-----------------------------------========
-         !
-         WRITE(cl_asmdin, FMT='(A,".nc")' ) TRIM( c_asmdin )
-         cl_asmdin = TRIM( cl_asmdin )
-         INQUIRE( FILE = cl_asmdin, EXIST = llok )
-         !
-         IF( .NOT. llok ) THEN
-            IF(lwp) WRITE(numout,*) ' Setting up assimilation background file '// TRIM( c_asmdin )
-            !
-            !                                      ! Define the output file        
-            CALL iom_open( c_asmdin, inum, ldwrt = .TRUE. )
-            !
-            IF( nitdin_r == nit000 - 1 ) THEN      ! Treat special case when nitbkg = 0
-
-               zdate = REAL( ndastp )
-            ELSE
-               zdate = REAL( ndastp )
-            ENDIF
-            !
-            !                                      ! Write the information
-            CALL iom_rstput( kt, nitdin_r, inum, 'rdastp' , zdate                )
-            CALL iom_rstput( kt, nitdin_r, inum, 'un'     , uu(:,:,:,Kmm)        )
-            CALL iom_rstput( kt, nitdin_r, inum, 'vn'     , vv(:,:,:,Kmm)        )
-            CALL iom_rstput( kt, nitdin_r, inum, 'tn'     , ts(:,:,:,jp_tem,Kmm) )
-            CALL iom_rstput( kt, nitdin_r, inum, 'sn'     , ts(:,:,:,jp_sal,Kmm) )
-            CALL iom_rstput( kt, nitdin_r, inum, 'sshn'   , ssh(:,:,Kmm)         )
-#if defined key_si3
-            IF( nn_ice == 2 ) THEN
-	            IF( ALLOCATED(at_i) ) THEN
-                  CALL iom_rstput( kt, nitdin_r, inum, 'iceconc', at_i(:,:)   )
-               ELSE
-		            CALL ctl_warn('asm_bkg_wri: Ice concentration not written to background ',   &
-		               &          'as ice variable at_i not allocated on this timestep')
-	            ENDIF
-            ENDIF
-#endif
-            !
-            CALL iom_close( inum )
-         ENDIF
-         !
-      ENDIF
+      IF( .NOT. l_istiled .OR. ntile == nijtile ) THEN                       ! Do only on the last tile
+          !                                !-------------------------------------------
+          IF( kt == nitbkg_r ) THEN        ! Write out background at time step nitbkg_r
+             !                             !-----------------------------------========
+             !
+             WRITE(cl_asmbkg, FMT='(A,".nc")' ) TRIM( c_asmbkg )
+             cl_asmbkg = TRIM( cl_asmbkg )
+             INQUIRE( FILE = cl_asmbkg, EXIST = llok )
+             !
+             IF( .NOT. llok ) THEN
+                IF(lwp) WRITE(numout,*) ' Setting up assimilation background file '// TRIM( c_asmbkg )
+                !
+                !                                      ! Define the output file        
+                CALL iom_open( c_asmbkg, inum, ldwrt = .TRUE. )
+                !
+                IF( nitbkg_r == nit000 - 1 ) THEN      ! Treat special case when nitbkg = 0
+                   zdate = REAL( ndastp )
+                   IF( ln_zdftke ) THEN                   ! read turbulent kinetic energy ( en )
+                      IF(lwp) WRITE(numout,*) ' Reading TKE (en) from restart...'
+                      CALL tke_rst( nit000, 'READ' )
+                   ENDIF
+                ELSE
+                   zdate = REAL( ndastp )
+                ENDIF
+                !
+                !                                      ! Write the information
+                CALL iom_rstput( kt, nitbkg_r, inum, 'rdastp' , zdate                )
+                CALL iom_rstput( kt, nitbkg_r, inum, 'un'     , uu(:,:,:,Kmm)        )
+                CALL iom_rstput( kt, nitbkg_r, inum, 'vn'     , vv(:,:,:,Kmm)        )
+                CALL iom_rstput( kt, nitbkg_r, inum, 'tn'     , ts(:,:,:,jp_tem,Kmm) )
+                CALL iom_rstput( kt, nitbkg_r, inum, 'sn'     , ts(:,:,:,jp_sal,Kmm) )
+                CALL iom_rstput( kt, nitbkg_r, inum, 'sshn'   , ssh(:,:,Kmm)         )
+                IF( ln_zdftke )   CALL iom_rstput( kt, nitbkg_r, inum, 'en'     , en )
+                !
+                CALL iom_close( inum )
+             ENDIF
+             !
+          ENDIF
+    
+          !                                !-------------------------------------------
+          IF( kt == nitdin_r ) THEN        ! Write out background at time step nitdin_r
+             !                             !-----------------------------------========
+             !
+             WRITE(cl_asmdin, FMT='(A,".nc")' ) TRIM( c_asmdin )
+             cl_asmdin = TRIM( cl_asmdin )
+             INQUIRE( FILE = cl_asmdin, EXIST = llok )
+             !
+             IF( .NOT. llok ) THEN
+                IF(lwp) WRITE(numout,*) ' Setting up assimilation background file '// TRIM( c_asmdin )
+                !
+                !                                      ! Define the output file        
+                CALL iom_open( c_asmdin, inum, ldwrt = .TRUE. )
+                !
+                IF( nitdin_r == nit000 - 1 ) THEN      ! Treat special case when nitbkg = 0
+    
+                   zdate = REAL( ndastp )
+                ELSE
+                   zdate = REAL( ndastp )
+                ENDIF
+                !
+                !                                      ! Write the information
+                CALL iom_rstput( kt, nitdin_r, inum, 'rdastp' , zdate                )
+                CALL iom_rstput( kt, nitdin_r, inum, 'un'     , uu(:,:,:,Kmm)        )
+                CALL iom_rstput( kt, nitdin_r, inum, 'vn'     , vv(:,:,:,Kmm)        )
+                CALL iom_rstput( kt, nitdin_r, inum, 'tn'     , ts(:,:,:,jp_tem,Kmm) )
+                CALL iom_rstput( kt, nitdin_r, inum, 'sn'     , ts(:,:,:,jp_sal,Kmm) )
+                CALL iom_rstput( kt, nitdin_r, inum, 'sshn'   , ssh(:,:,Kmm)         )
+    #if defined key_si3
+                IF( nn_ice == 2 ) THEN
+    	            IF( ALLOCATED(at_i) ) THEN
+                      CALL iom_rstput( kt, nitdin_r, inum, 'iceconc', at_i(:,:)   )
+                   ELSE
+    		            CALL ctl_warn('asm_bkg_wri: Ice concentration not written to background ',   &
+    		               &          'as ice variable at_i not allocated on this timestep')
+    	            ENDIF
+                ENDIF
+    #endif
+                !
+                CALL iom_close( inum )
+             ENDIF
+             !
+          ENDIF
+      ENDIF ! check for last tile
       !                    
    END SUBROUTINE asm_bkg_wri
Index: /NEMO/trunk/src/OCE/step.F90
===================================================================
--- /NEMO/trunk/src/OCE/step.F90	(revision 15397)
+++ /NEMO/trunk/src/OCE/step.F90	(revision 15398)
@@ -229,4 +229,5 @@
          IF(  lk_asminc .AND. ln_asmiau .AND. ln_dyninc )   &
                   &         CALL dyn_asm_inc   ( kstp, Nbb, Nnn, uu, vv, Nrhs )  ! apply dynamics assimilation increment
+         IF( ln_bkgwri )    CALL asm_bkg_wri( kstp, Nnn )     ! output background fields
          IF( ln_bdy     )   CALL bdy_dyn3d_dmp ( kstp, Nbb,      uu, vv, Nrhs )  ! bdy damping trends
 #if defined key_agrif
Index: /NEMO/trunk/src/OCE/stpmlf.F90
===================================================================
--- /NEMO/trunk/src/OCE/stpmlf.F90	(revision 15397)
+++ /NEMO/trunk/src/OCE/stpmlf.F90	(revision 15398)
@@ -241,4 +241,5 @@
          IF(  lk_asminc .AND. ln_asmiau .AND. ln_dyninc )   &
                   &         CALL dyn_asm_inc   ( kstp, Nbb, Nnn, uu, vv, Nrhs )  ! apply dynamics assimilation increment
+         IF( ln_bkgwri )    CALL asm_bkg_wri( kstp, Nnn )     ! output background fields
          IF( ln_bdy     )   CALL bdy_dyn3d_dmp ( kstp, Nbb,      uu, vv, Nrhs )  ! bdy damping trends
 #if defined key_agrif
