Index: NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/trcbc.F90
===================================================================
--- NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/trcbc.F90	(revision 10740)
+++ NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/trcbc.F90	(revision 10963)
@@ -55,5 +55,5 @@
 CONTAINS
 
-   SUBROUTINE trc_bc_ini( ntrc )
+   SUBROUTINE trc_bc_ini( ntrc, Kmm )
       !!----------------------------------------------------------------------
       !!                   ***  ROUTINE trc_bc_ini  ***
@@ -64,5 +64,6 @@
       !!              - allocates passive tracer BC data structure 
       !!----------------------------------------------------------------------
-      INTEGER,INTENT(in) :: ntrc                           ! number of tracers
+      INTEGER, INTENT(in) :: ntrc                          ! number of tracers
+      INTEGER, INTENT(in) ::   Kmm                         ! time level index
       !
       INTEGER            :: jl, jn , ib, ibd, ii, ij, ik   ! dummy loop indices
@@ -267,5 +268,5 @@
                         ii = idx_bdy(ib)%nbi(ibd,igrd)
                         ij = idx_bdy(ib)%nbj(ibd,igrd)
-                        trcdta_bdy(jn,ib)%trc(ibd,ik) = trn(ii,ij,ik,jn) * tmask(ii,ij,ik)
+                        trcdta_bdy(jn,ib)%trc(ibd,ik) = tr(ii,ij,ik,jn,Kmm) * tmask(ii,ij,ik)
                      END DO
                   END DO
@@ -333,5 +334,5 @@
 
 
-   SUBROUTINE trc_bc(kt, jit)
+   SUBROUTINE trc_bc(kt, Kmm, Krhs, jit)
       !!----------------------------------------------------------------------
       !!                   ***  ROUTINE trc_bc  ***
@@ -344,6 +345,7 @@
       USE fldread
       !!      
-      INTEGER, INTENT(in)           ::   kt    ! ocean time-step index
-      INTEGER, INTENT(in), OPTIONAL ::   jit   ! subcycle time-step index (for timesplitting option)
+      INTEGER, INTENT(in)           ::   kt        ! ocean time-step index
+      INTEGER, INTENT(in)           ::   Kmm, Krhs ! time level indices
+      INTEGER, INTENT(in), OPTIONAL ::   jit       ! subcycle time-step index (for timesplitting option)
       !!
       INTEGER  :: ji, jj, jk, jn, jl             ! Loop index
@@ -412,5 +414,5 @@
                   DO jk = 1, nk_rnf(ji,jj)
                      zrnf = (rnf(ji,jj) + rnf_b(ji,jj)) * 0.5_wp * r1_rau0 / h_rnf(ji,jj)
-                     tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn)  + (trn(ji,jj,jk,jn) * zrnf)
+                     tr(ji,jj,jk,jn,Krhs) = tr(ji,jj,jk,jn,Krhs)  + (tr(ji,jj,jk,jn,Kmm) * zrnf)
                   END DO
                END DO
@@ -425,6 +427,6 @@
             DO jj = 2, jpj
                DO ji = fs_2, fs_jpim1   ! vector opt.
-                  zfact = 1. / ( e3t_n(ji,jj,1) * rn_bc_time )
-                  tra(ji,jj,1,jn) = tra(ji,jj,1,jn) + rf_trsfac(jl) * sf_trcsbc(jl)%fnow(ji,jj,1) * zfact
+                  zfact = 1. / ( e3t(ji,jj,1,Kmm) * rn_bc_time )
+                  tr(ji,jj,1,jn,Krhs) = tr(ji,jj,1,jn,Krhs) + rf_trsfac(jl) * sf_trcsbc(jl)%fnow(ji,jj,1) * zfact
                END DO
             END DO
@@ -438,5 +440,5 @@
                   DO jk = 1, nk_rnf(ji,jj)
                      zfact = rn_rfact / ( e1e2t(ji,jj) * h_rnf(ji,jj) * rn_bc_time ) 
-                     tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + rf_trcfac(jl) * sf_trccbc(jl)%fnow(ji,jj,1) * zfact
+                     tr(ji,jj,jk,jn,Krhs) = tr(ji,jj,jk,jn,Krhs) + rf_trcfac(jl) * sf_trccbc(jl)%fnow(ji,jj,1) * zfact
                   END DO
                END DO
@@ -455,9 +457,11 @@
    !!----------------------------------------------------------------------
 CONTAINS
-   SUBROUTINE trc_bc_ini( ntrc )        ! Empty routine
-      INTEGER,INTENT(IN) :: ntrc                           ! number of tracers
+   SUBROUTINE trc_bc_ini( ntrc, Kmm )        ! Empty routine
+      INTEGER, INTENT(IN) :: ntrc                           ! number of tracers
+      INTEGER, INTENT(in) :: Kmm                            ! time level index
       WRITE(*,*) 'trc_bc_ini: You should not have seen this print! error?', kt
    END SUBROUTINE trc_bc_ini
-   SUBROUTINE trc_bc( kt )        ! Empty routine
+   SUBROUTINE trc_bc( kt, Kmm, Krhs )        ! Empty routine
+      INTEGER, INTENT(in) :: Kmm, Krhs ! time level indices
       WRITE(*,*) 'trc_bc: You should not have seen this print! error?', kt
    END SUBROUTINE trc_bc
