Index: /branches/UKMO/dev_r5518_GO6_package_FOAMv14/NEMOGCM/NEMO/OPA_SRC/C1D/step_c1d.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package_FOAMv14/NEMOGCM/NEMO/OPA_SRC/C1D/step_c1d.F90	(revision 15279)
+++ /branches/UKMO/dev_r5518_GO6_package_FOAMv14/NEMOGCM/NEMO/OPA_SRC/C1D/step_c1d.F90	(revision 15280)
@@ -10,8 +10,8 @@
    !!----------------------------------------------------------------------
    !!   'key_c1d'                                       1D Configuration
-   !!----------------------------------------------------------------------  
+   !!----------------------------------------------------------------------
    !!   stp_c1d        : NEMO system time-stepping in c1d case
    !!----------------------------------------------------------------------
-   USE step_oce        ! time stepping definition modules 
+   USE step_oce        ! time stepping definition modules
 #if defined key_top
    USE trcstp          ! passive tracer time-stepping      (trc_stp routine)
@@ -20,5 +20,5 @@
    USE dynnxt_c1d      ! time-stepping                    (dyn_nxt routine)
    USE dyndmp          ! U & V momentum damping           (dyn_dmp routine)
-   USE restart         ! restart 
+   USE restart         ! restart
 
    IMPLICIT NONE
@@ -40,13 +40,13 @@
       !!----------------------------------------------------------------------
       !!                     ***  ROUTINE stp_c1d  ***
-      !!                      
+      !!
       !! ** Purpose :  - Time stepping of SBC including LIM (dynamic and thermodynamic eqs.)
       !!               - Time stepping of OPA (momentum and active tracer eqs.)
       !!               - Time stepping of TOP (passive tracer eqs.)
-      !! 
-      !! ** Method  : -1- Update forcings and data  
-      !!              -2- Update vertical ocean physics 
-      !!              -3- Compute the t and s trends 
-      !!              -4- Update t and s 
+      !!
+      !! ** Method  : -1- Update forcings and data
+      !!              -2- Update vertical ocean physics
+      !!              -3- Compute the t and s trends
+      !!              -4- Update t and s
       !!              -5- Compute the momentum trends
       !!              -6- Update the horizontal velocity
@@ -76,5 +76,5 @@
                          CALL bn2( tsb, rab_b, rn2b ) ! before Brunt-Vaisala frequency
                          CALL bn2( tsn, rab_n, rn2  ) ! now    Brunt-Vaisala frequency
-      !  VERTICAL PHYSICS   
+      !  VERTICAL PHYSICS
                          CALL zdf_bfr( kstp )         ! bottom friction
       !                                               ! Vertical eddy viscosity and diffusivity coefficients
@@ -98,5 +98,5 @@
       IF( lk_zdfddm .AND. .NOT. lk_zdfkpp )   &
          &               CALL zdf_ddm( kstp )         ! double diffusive mixing
-         
+
                          CALL zdf_mxl( kstp )         ! mixed layer depth
 
@@ -125,4 +125,6 @@
                         tsa(:,:,:,:) = 0._wp       ! set tracer trends to zero
 
+      IF( lk_asminc .AND. ln_asmiau .AND.  ln_trainc )   &
+                        CALL tra_asm_inc( kstp )   ! apply tracer assimilation increment
                         CALL tra_sbc( kstp )       ! surface boundary condition
       IF( ln_traqsr )   CALL tra_qsr( kstp )       ! penetrative solar radiation qsr
@@ -141,4 +143,6 @@
                         ua(:,:,:) = 0._wp          ! set dynamics trends to zero
                         va(:,:,:) = 0._wp
+
+      IF( ln_bkgwri )   CALL asm_bkg_wri( kstp )     ! output background fields
 
       IF( ln_dyndmp )   CALL dyn_dmp    ( kstp )   ! internal damping trends- momentum
Index: /branches/UKMO/dev_r5518_GO6_package_FOAMv14/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package_FOAMv14/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 15279)
+++ /branches/UKMO/dev_r5518_GO6_package_FOAMv14/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 15280)
@@ -29,5 +29,5 @@
    !!            3.3.1! 2011-01  (A. R. Porter, STFC Daresbury) dynamical allocation
    !!            3.4  ! 2011-11  (C. Harris) decomposition changes for running with CICE
-   !!                 ! 2012-05  (C. Calone, J. Simeon, G. Madec, C. Ethe) Add grid coarsening 
+   !!                 ! 2012-05  (C. Calone, J. Simeon, G. Madec, C. Ethe) Add grid coarsening
    !!----------------------------------------------------------------------
 
@@ -59,5 +59,5 @@
    USE phycst          ! physical constant                  (par_cst routine)
    USE trdini          ! dyn/tra trends initialization     (trd_init routine)
-   USE asminc          ! assimilation increments     
+   USE asminc          ! assimilation increments
    USE asmbkg          ! writing out state trajectory
    USE asmbgc          ! biogeochemical assimilation increments
@@ -69,5 +69,5 @@
    USE icbini          ! handle bergs, initialisation
    USE icbstp          ! handle bergs, calving, themodynamics and transport
-   USE sbccpl 
+   USE sbccpl
    USE cpl_oasis3      ! OASIS3 coupling
    USE c1d             ! 1D configuration
@@ -84,5 +84,5 @@
    USE sbctide, ONLY: lk_tide
    USE crsini          ! initialise grid coarsening utility
-   USE lbcnfd, ONLY: isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges 
+   USE lbcnfd, ONLY: isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges
    USE sbc_oce, ONLY: lk_oasis
    USE stopack
@@ -132,5 +132,5 @@
 #if defined key_agrif
       CALL Agrif_Declare_Var_dom   ! AGRIF: set the meshes for DOM
-      CALL Agrif_Declare_Var       !  "      "   "   "      "  DYN/TRA 
+      CALL Agrif_Declare_Var       !  "      "   "   "      "  DYN/TRA
 # if defined key_top
       CALL Agrif_Declare_Var_top   !  "      "   "   "      "  TOP
@@ -150,30 +150,40 @@
       !                            !-----------------------!
       istp = nit000
+
 #if defined key_c1d
-         DO WHILE ( istp <= nitend .AND. nstop == 0 )
-            CALL stp_c1d( istp )
-            istp = istp + 1
-         END DO
+
+      IF( lk_asminc ) THEN
+         IF( ln_bkgwri ) CALL asm_bkg_wri( nit000 - 1 )    ! Output background fields
+         IF( ln_asmdin ) THEN                        ! Direct initialization
+            IF( ln_trainc ) CALL tra_asm_inc( nit000 - 1 )    ! Tracers
+         ENDIF
+      ENDIF
+
+      DO WHILE ( istp <= nitend .AND. nstop == 0 )
+         CALL stp_c1d( istp )
+         istp = istp + 1
+      END DO
 #else
-          IF( lk_asminc ) THEN
-             IF( ln_bkgwri ) CALL asm_bkg_wri( nit000 - 1 )    ! Output background fields
-             IF( ln_asmdin ) THEN                        ! Direct initialization
-                IF( ln_trainc ) CALL tra_asm_inc( nit000 - 1 )    ! Tracers
-                IF( ln_dyninc ) CALL dyn_asm_inc( nit000 - 1 )    ! Dynamics
-                IF( ln_sshinc ) CALL ssh_asm_inc( nit000 - 1 )    ! SSH
-                IF( lk_bgcinc ) CALL bgc_asm_inc( nit000 - 1 )    ! BGC
-             ENDIF
-          ENDIF
+
+      IF( lk_asminc ) THEN
+         IF( ln_bkgwri ) CALL asm_bkg_wri( nit000 - 1 )    ! Output background fields
+         IF( ln_asmdin ) THEN                        ! Direct initialization
+            IF( ln_trainc ) CALL tra_asm_inc( nit000 - 1 )    ! Tracers
+            IF( ln_dyninc ) CALL dyn_asm_inc( nit000 - 1 )    ! Dynamics
+            IF( ln_sshinc ) CALL ssh_asm_inc( nit000 - 1 )    ! SSH
+            IF( lk_bgcinc ) CALL bgc_asm_inc( nit000 - 1 )    ! BGC
+         ENDIF
+      ENDIF
 
 #if defined key_agrif
-          CALL Agrif_Regrid()
-#endif
-
-         DO WHILE ( istp <= nitend .AND. nstop == 0 )
+      CALL Agrif_Regrid()
+#endif
+
+      DO WHILE ( istp <= nitend .AND. nstop == 0 )
 #if defined key_agrif
-            CALL stp                         ! AGRIF: time stepping
+         CALL stp                         ! AGRIF: time stepping
 #else
-            IF (lk_oasis) CALL sbc_cpl_snd( istp )  ! Coupling to atmos
- 	    CALL stp( istp )
+         IF (lk_oasis) CALL sbc_cpl_snd( istp )  ! Coupling to atmos
+ 	      CALL stp( istp )
             ! We don't couple on the final timestep because
             ! our restart file has already been written
@@ -186,9 +196,9 @@
             !    sbc_cpl_snd call prior to the main DO loop
             ! This solution produces identical results
-            ! with fewer lines of code. 
-#endif
-            istp = istp + 1
-            IF( lk_mpp )   CALL mpp_max( nstop )
-         END DO
+            ! with fewer lines of code.
+#endif
+         istp = istp + 1
+         IF( lk_mpp )   CALL mpp_max( nstop )
+      END DO
 #endif
 
@@ -225,5 +235,5 @@
       IF( lk_oasis ) CALL cpl_finalize    ! end coupling and mpp communications with OASIS
 #else
-      IF( lk_oasis ) THEN 
+      IF( lk_oasis ) THEN
          CALL cpl_finalize              ! end coupling and mpp communications with OASIS
       ELSE
@@ -233,5 +243,5 @@
       !
       ! Met Office addition: if failed, return non-zero exit code
-      IF( nstop /= 0 )  CALL exit( 9 ) 
+      IF( nstop /= 0 )  CALL exit( 9 )
       !
    END SUBROUTINE nemo_gcm
@@ -278,5 +288,5 @@
       REWIND( numnam_cfg )              ! Namelist namcfg in confguration namelist : Control prints & Benchmark
       READ  ( numnam_cfg, namcfg, IOSTAT = ios, ERR = 904 )
-904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist', .TRUE. )   
+904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist', .TRUE. )
 
 ! Force values for AGRIF zoom (cf. agrif_user.F90)
@@ -357,14 +367,14 @@
 #if defined key_nemocice_decomp
          jpi = ( nx_global+2-2*jpreci + (jpni-1) ) / jpni + 2*jpreci ! first  dim.
-         jpj = ( ny_global+2-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj ! second dim. 
+         jpj = ( ny_global+2-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj ! second dim.
 #else
          jpi = ( jpiglo-2*jpreci + (jpni-1) ) / jpni + 2*jpreci   ! first  dim.
          jpj = ( jpjglo-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj   ! second dim.
 #endif
-      ENDIF         
+      ENDIF
          jpk = jpkdta                                             ! third dim
 #if defined key_agrif
          ! simple trick to use same vertical grid as parent
-         ! but different number of levels: 
+         ! but different number of levels:
          ! Save maximum number of levels in jpkdta, then define all vertical grids
          ! with this number.
@@ -435,5 +445,5 @@
 
                             CALL dyn_nept_init  ! simplified form of Neptune effect
-      !     
+      !
       IF( ln_crs        )   CALL     crs_init   ! Domain initialization of coarsened grid
       !
@@ -477,5 +487,5 @@
                             CALL sto_par_init   ! Stochastic parametrization
       IF( ln_sto_eos     )  CALL sto_pts_init   ! RRandom T/S fluctuations
-     
+
 #if defined key_top
       !                                     ! Passive tracers
@@ -498,5 +508,5 @@
                             CALL    bias_init   ! Pressure correction bias
       IF(lwp) WRITE(numout,*) 'Euler time step switch is ', neuler
-      
+
       IF (nstop > 0) THEN
         CALL CTL_STOP('STOP','Critical errors in NEMO initialisation')
@@ -557,5 +567,5 @@
          WRITE(numout,*) '      left bottom i index of the zoom (in data domain) jpizoom = ', jpizoom
          WRITE(numout,*) '      left bottom j index of the zoom (in data domain) jpizoom = ', jpjzoom
-         WRITE(numout,*) '      lateral cond. type (between 0 and 6) jperio = ', jperio   
+         WRITE(numout,*) '      lateral cond. type (between 0 and 6) jperio = ', jperio
          WRITE(numout,*) '      use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr
       ENDIF
@@ -639,5 +649,5 @@
       IF( numdct_salt     /= -1 )   CLOSE( numdct_salt     )   ! salt transports
 #if defined key_top
-      IF( numstr          /= -1 )   CLOSE( numstr          )   ! tracer statistics 
+      IF( numstr          /= -1 )   CLOSE( numstr          )   ! tracer statistics
 #endif
       !
@@ -661,7 +671,7 @@
       USE ldftra_oce, ONLY: ldftra_oce_alloc
       USE trc_oce   , ONLY: trc_oce_alloc
-#if defined key_diadct 
-      USE diadct    , ONLY: diadct_alloc 
-#endif 
+#if defined key_diadct
+      USE diadct    , ONLY: diadct_alloc
+#endif
 #if defined key_bdy
       USE bdy_oce   , ONLY: bdy_oce_alloc
@@ -681,7 +691,7 @@
       ierr = ierr + trc_oce_alloc   ()          ! shared TRC / TRA arrays
       !
-#if defined key_diadct 
-      ierr = ierr + diadct_alloc    ()          ! 
-#endif 
+#if defined key_diadct
+      ierr = ierr + diadct_alloc    ()          !
+#endif
 #if defined key_bdy
       ierr = ierr + bdy_oce_alloc   ()          ! bdy masks (incl. initialization)
@@ -813,5 +823,5 @@
       !!======================================================================
       !!                     ***  ROUTINE  nemo_northcomms  ***
-      !! nemo_northcomms    :  Setup for north fold exchanges with explicit 
+      !! nemo_northcomms    :  Setup for north fold exchanges with explicit
       !!                       point-to-point messaging
       !!=====================================================================
@@ -821,5 +831,5 @@
       !!----------------------------------------------------------------------
       !!    1.0  ! 2011-10  (A. C. Coward, NOCS & J. Donners, PRACE)
-      !!    2.0  ! 2013-06 Setup avoiding MPI communication (I. Epicoco, S. Mocavero, CMCC) 
+      !!    2.0  ! 2013-06 Setup avoiding MPI communication (I. Epicoco, S. Mocavero, CMCC)
       !!----------------------------------------------------------------------
 
@@ -828,5 +838,5 @@
 
       njmppmax = MAXVAL( njmppt )
-    
+
       !initializes the north-fold communication variables
       isendto(:) = 0
@@ -844,5 +854,5 @@
           !loop over the other north-fold processes to find the processes
           !managing the points belonging to the sxT-dxT range
-  
+
           DO jn = 1, jpni
                 !sxT is the first point (in the global domain) of the jn
@@ -887,4 +897,2 @@
    !!======================================================================
 END MODULE nemogcm
-
-
