Index: /branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90
===================================================================
--- /branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90	(revision 6605)
+++ /branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90	(revision 6606)
@@ -35,5 +35,5 @@
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   restotr   ! restoring coeff. on tracers (s-1)
 
-   INTEGER, PARAMETER           ::   npncts   = 5        ! number of closed sea
+   INTEGER, PARAMETER           ::   npncts   = 8        ! number of closed sea
    INTEGER, DIMENSION(npncts)   ::   nctsi1, nctsj1      ! south-west closed sea limits (i,j)
    INTEGER, DIMENSION(npncts)   ::   nctsi2, nctsj2      ! north-east closed sea limits (i,j)
@@ -85,5 +85,5 @@
       CHARACTER (len=22) :: charout
       REAL(wp), POINTER, DIMENSION(:,:,:) ::   ztrtrd
-      REAL(wp), POINTER, DIMENSION(:,:,:) ::  ztrcdta   ! 3D  workspace
+      REAL(wp), POINTER, DIMENSION(:,:,:,:) ::  ztrcdta   ! 3D  workspace
       !!----------------------------------------------------------------------
       !
@@ -98,5 +98,6 @@
       IF( nb_trcdta > 0 ) THEN  ! Initialisation of tracer from a file that may also be used for damping
          !
-         CALL wrk_alloc( jpi, jpj, jpk, ztrcdta )    ! Memory allocation
+         CALL wrk_alloc( jpi, jpj, jpk, nb_trcdta, ztrcdta )    ! Memory allocation
+         CALL trc_dta( kt, ztrcdta )   ! read tracer data at nit000
          !                                                          ! ===========
          DO jn = 1, jptra                                           ! tracer loop
@@ -105,9 +106,5 @@
             !
             IF( ln_trc_ini(jn) ) THEN      ! update passive tracers arrays with input data read from file
-               
                jl = n_trc_index(jn) 
-               CALL trc_dta( kt, sf_trcdta(jl) )   ! read tracer data at nit000
-               ztrcdta(:,:,:) = sf_trcdta(jl)%fnow(:,:,:) * tmask(:,:,:) * rf_trfac(jl)
-
                SELECT CASE ( nn_zdmp_tr )
                !
@@ -116,5 +113,5 @@
                      DO jj = 2, jpjm1
                         DO ji = fs_2, fs_jpim1   ! vector opt.
-                           ztra = restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk) - trb(ji,jj,jk,jn) )
+                           ztra = restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk,jl) * rf_trfac(jl) - trb(ji,jj,jk,jn) )
                            tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra
                         END DO
@@ -127,5 +124,5 @@
                         DO ji = fs_2, fs_jpim1   ! vector opt.
                            IF( avt(ji,jj,jk) <= 5.e-4_wp )  THEN 
-                              ztra = restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk) - trb(ji,jj,jk,jn) )
+                              ztra = restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk,jl) * rf_trfac(jl) - trb(ji,jj,jk,jn) )
                               tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra
                            ENDIF
@@ -139,5 +136,5 @@
                         DO ji = fs_2, fs_jpim1   ! vector opt.
                            IF( fsdept(ji,jj,jk) >= hmlp (ji,jj) ) THEN
-                              ztra = restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk) - trb(ji,jj,jk,jn) )
+                              ztra = restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk,jl) * rf_trfac(jl) - trb(ji,jj,jk,jn) )
                               tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra
                            END IF
@@ -157,5 +154,5 @@
          END DO                                                     ! tracer loop
          !                                                          ! ===========
-         CALL wrk_dealloc( jpi, jpj, jpk, ztrcdta )
+         CALL wrk_dealloc( jpi, jpj, jpk, nb_trcdta, ztrcdta )
       ENDIF
       !
@@ -187,4 +184,5 @@
       INTEGER :: ji , jj, jk, jn, jl, jc                     ! dummy loop indicesa
       INTEGER :: isrow                                      ! local index
+      REAL(wp), POINTER, DIMENSION(:,:,:,:) ::  ztrcdta   ! 3D  workspace
 
       !!----------------------------------------------------------------------
@@ -207,7 +205,28 @@
             !
                                                         ! Caspian Sea
-            nctsi1(1)   = 332  ; nctsj1(1)   = 243 - isrow
-            nctsi2(1)   = 344  ; nctsj2(1)   = 275 - isrow
-            !                                        
+            nctsi1(1)   = 333  ; nctsj1(1)   = 243 - isrow
+            nctsi2(1)   = 342  ; nctsj2(1)   = 274 - isrow
+            !                                           ! Lake Superior
+            nctsi1(2)   = 198  ; nctsj1(2)   = 258 - isrow
+            nctsi2(2)   = 204  ; nctsj2(2)   = 262 - isrow
+            !                                           ! Lake Michigan
+            nctsi1(3)   = 201  ; nctsj1(3)   = 250 - isrow
+            nctsi2(3)   = 203  ; nctsj2(3)   = 256 - isrow
+            !                                           ! Lake Huron
+            nctsi1(4)   = 204  ; nctsj1(4)   = 252 - isrow
+            nctsi2(4)   = 209  ; nctsj2(4)   = 256 - isrow
+            !                                           ! Lake Erie
+            nctsi1(5)   = 206  ; nctsj1(5)   = 249 - isrow
+            nctsi2(5)   = 209  ; nctsj2(5)   = 251 - isrow
+            !                                           ! Lake Ontario
+            nctsi1(6)   = 210  ; nctsj1(6)   = 252 - isrow
+            nctsi2(6)   = 212  ; nctsj2(6)   = 252 - isrow
+            !                                           ! Victoria Lake
+            nctsi1(7)   = 321  ; nctsj1(7)   = 180 - isrow
+            nctsi2(7)   = 322  ; nctsj2(7)   = 189 - isrow
+            !                                           ! Baltic Sea
+            nctsi1(8)   = 297  ; nctsj1(8)   = 270 - isrow
+            nctsi2(8)   = 308  ; nctsj2(8)   = 293 - isrow
+                                
             !                                           ! =======================
             CASE ( 2 )                                  !  ORCA_R2 configuration
@@ -277,13 +296,16 @@
          IF(lwp)  WRITE(numout,*)
          !
+         CALL wrk_alloc( jpi, jpj, jpk, nb_trcdta, ztrcdta )    ! Memory allocation
+         CALL trc_dta( kt, ztrcdta )   ! read tracer data at nit000
+         !
          DO jn = 1, jptra
             IF( ln_trc_ini(jn) ) THEN      ! update passive tracers arrays with input data read from file
                 jl = n_trc_index(jn)
-                CALL trc_dta( kt, sf_trcdta(jl) )   ! read tracer data at nit000
+                IF(lwp)  WRITE(numout,*)
                 DO jc = 1, npncts
                    DO jk = 1, jpkm1
                       DO jj = nctsj1(jc), nctsj2(jc)
                          DO ji = nctsi1(jc), nctsi2(jc)
-                            trn(ji,jj,jk,jn) = sf_trcdta(jl)%fnow(ji,jj,jk) * tmask(ji,jj,jk) * rf_trfac(jl)
+                            trn(ji,jj,jk,jn) = ztrcdta(ji,jj,jk,jl) * rf_trfac(jl)
                             trb(ji,jj,jk,jn) = trn(ji,jj,jk,jn)
                          ENDDO
@@ -293,4 +315,5 @@
              ENDIF
           ENDDO
+          CALL wrk_dealloc( jpi, jpj, jpk, nb_trcdta, ztrcdta )    ! Memory allocation
           !
       ENDIF
Index: /branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/TOP_SRC/trcdta.F90
===================================================================
--- /branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/TOP_SRC/trcdta.F90	(revision 6605)
+++ /branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/TOP_SRC/trcdta.F90	(revision 6606)
@@ -151,5 +151,5 @@
 
 
-   SUBROUTINE trc_dta( kt, sf_dta )
+   SUBROUTINE trc_dta( kt, ptrc )
       !!----------------------------------------------------------------------
       !!                   ***  ROUTINE trc_dta  ***
@@ -161,8 +161,8 @@
       !!              - ln_trcdmp=F: deallocates the data structure as they are not used
       !!
-      !! ** Action  :   sf_dta   passive tracer data on medl mesh and interpolated at time-step kt
-      !!----------------------------------------------------------------------
-      INTEGER                     , INTENT(in   ) ::   kt     ! ocean time-step
-      TYPE(FLD), DIMENSION(1)   , INTENT(inout) ::   sf_dta     ! array of information on the field to read
+      !! ** Action  :   sf_trcdta   passive tracer data on medl mesh and interpolated at time-step kt
+      !!----------------------------------------------------------------------
+      INTEGER                       , INTENT(in   ) ::   kt     ! ocean time-step
+      REAL(wp), DIMENSION(jpi,jpj,jpk,nb_trcdta), INTENT(inout) ::   ptrc     ! array of information on the field to read
       !
       INTEGER ::   ji, jj, jk, jl, jkk, ik    ! dummy loop indices
@@ -176,5 +176,9 @@
       IF( nb_trcdta > 0 ) THEN
          !
-         CALL fld_read( kt, 1, sf_dta )      !==   read data at kt time step   ==!
+         CALL fld_read( kt, 1, sf_trcdta )      !==   read data at kt time step   ==!
+         !
+         DO jl = 1, nb_trcdta
+            ptrc(:,:,:,jl) = sf_trcdta(jl)%fnow(:,:,:) * tmask(:,:,:)    ! Mask
+         ENDDO
          !
          IF( ln_sco ) THEN                   !==   s- or mixed s-zps-coordinate   ==!
@@ -184,5 +188,5 @@
                WRITE(numout,*) 'trc_dta: interpolates passive tracer data onto the s- or mixed s-z-coordinate mesh'
             ENDIF
-            !
+            DO jl = 1, nb_trcdta
                DO jj = 1, jpj                         ! vertical interpolation of T & S
                   DO ji = 1, jpi
@@ -190,13 +194,12 @@
                         zl = fsdept_n(ji,jj,jk)
                         IF(     zl < gdept_1d(1  ) ) THEN         ! above the first level of data
-                           ztp(jk) =  sf_dta(1)%fnow(ji,jj,1)
+                           ztp(jk) =  ptrc(ji,jj,1,jl)
                         ELSEIF( zl > gdept_1d(jpk) ) THEN         ! below the last level of data
-                           ztp(jk) =  sf_dta(1)%fnow(ji,jj,jpkm1)
+                           ztp(jk) =  ptrc(ji,jj,jpkm1,jl)
                         ELSE                                      ! inbetween : vertical interpolation between jkk & jkk+1
                            DO jkk = 1, jpkm1                                  ! when  gdept(jkk) < zl < gdept(jkk+1)
                               IF( (zl-gdept_1d(jkk)) * (zl-gdept_1d(jkk+1)) <= 0._wp ) THEN
                                  zi = ( zl - gdept_1d(jkk) ) / (gdept_1d(jkk+1)-gdept_1d(jkk))
-                                 ztp(jk) = sf_dta(1)%fnow(ji,jj,jkk) + ( sf_dta(1)%fnow(ji,jj,jkk+1) - &
-                                           sf_dta(1)%fnow(ji,jj,jkk) ) * zi 
+                                 ztp(jk) = ptrc(ji,jj,jkk,jl) + ( ptrc(ji,jj,jkk+1,jl) - ptrc(ji,jj,jkk,jl) ) * zi 
                               ENDIF
                            END DO
@@ -204,15 +207,16 @@
                      END DO
                      DO jk = 1, jpkm1
-                        sf_dta(1)%fnow(ji,jj,jk) = ztp(jk) * tmask(ji,jj,jk)     ! mask required for mixed zps-s-coord
+                        ptrc(ji,jj,jk,jl) = ztp(jk) * tmask(ji,jj,jk)     ! mask required for mixed zps-s-coord
                      END DO
-                     sf_dta(1)%fnow(ji,jj,jpk) = 0._wp
+                     ptrc(ji,jj,jpk,jl) = 0._wp
                   END DO
                END DO
+            END DO
             ! 
          ELSE                                !==   z- or zps- coordinate   ==!
             !                             
-               sf_dta(1)%fnow(:,:,:) = sf_dta(1)%fnow(:,:,:) * tmask(:,:,:)    ! Mask
-               !
-               IF( ln_zps ) THEN                      ! zps-coordinate (partial steps) interpolation at the last ocean level
+            IF( ln_zps ) THEN                      ! zps-coordinate (partial steps) interpolation at the last ocean level
+               DO jl = 1, nb_trcdta
+                  !
                   DO jj = 1, jpj
                      DO ji = 1, jpi
@@ -220,29 +224,27 @@
                         IF( ik > 1 ) THEN
                            zl = ( gdept_1d(ik) - fsdept_n(ji,jj,ik) ) / ( gdept_1d(ik) - gdept_1d(ik-1) )
-                           sf_dta(1)%fnow(ji,jj,ik) = (1.-zl) * sf_dta(1)%fnow(ji,jj,ik) + zl * sf_dta(1)%fnow(ji,jj,ik-1)
+                           ptrc(ji,jj,ik,jl) = (1.-zl) * ptrc(ji,jj,ik,jl) + zl * ptrc(ji,jj,ik-1,jl)
                         ENDIF
                         ik = mikt(ji,jj)
                         IF( ik > 1 ) THEN
                            zl = ( gdept_0(ji,jj,ik) - gdept_1d(ik) ) / ( gdept_1d(ik+1) - gdept_1d(ik) )
-                           sf_dta(1)%fnow(ji,jj,ik) = (1.-zl) * sf_dta(1)%fnow(ji,jj,ik) + zl * sf_dta(1)%fnow(ji,jj,ik+1)
+                           ptrc(ji,jj,ik,jl) = (1.-zl) * ptrc(ji,jj,ik,jl) + zl * ptrc(ji,jj,ik+1,jl)
                         ENDIF
                      END DO
                   END DO
-               ENDIF
+              END DO
+            ENDIF
             !
          ENDIF
          !
-         IF( lwp .AND. kt == nit000 ) THEN
-               clndta = TRIM( sf_dta(1)%clvar ) 
-               WRITE(numout,*) ''//clndta//' data '
-               WRITE(numout,*)
-               WRITE(numout,*)'  level = 1'
-               CALL prihre( sf_dta(1)%fnow(:,:,1), jpi, jpj, 1, jpi, 20, 1, jpj, 20, 1., numout )
-               WRITE(numout,*)'  level = ', jpk/2
-               CALL prihre( sf_dta(1)%fnow(:,:,jpk/2), jpi, jpj, 1, jpi, 20, 1, jpj, 20, 1., numout )
-               WRITE(numout,*)'  level = ', jpkm1
-               CALL prihre( sf_dta(1)%fnow(:,:,jpkm1), jpi, jpj, 1, jpi, 20, 1, jpj, 20, 1., numout )
-               WRITE(numout,*)
-         ENDIF
+      ENDIF
+      ! 
+      IF( .NOT.ln_trcdmp .AND. .NOT.ln_trcdmp_clo ) THEN      !== deallocate data structure   ==!
+        !                                                    (data used only for initialisation)
+        IF(lwp) WRITE(numout,*) 'trc_dta: deallocate data arrays as they are only used to initialize the run'
+        DO jl = 1, nb_trcdta
+                                        DEALLOCATE( sf_trcdta(jl)%fnow)     !  arrays in the structure
+           IF( sf_trcdta(jl)%ln_tint )  DEALLOCATE( sf_trcdta(jl)%fdta)
+        ENDDO
       ENDIF
       !
@@ -255,5 +257,5 @@
    !!----------------------------------------------------------------------
 CONTAINS
-   SUBROUTINE trc_dta( kt, sf_dta, zrf_trfac )        ! Empty routine
+   SUBROUTINE trc_dta( kt, sf_trcdta, zrf_trfac )        ! Empty routine
       WRITE(*,*) 'trc_dta: You should not have seen this print! error?', kt
    END SUBROUTINE trc_dta
Index: /branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/TOP_SRC/trcini.F90
===================================================================
--- /branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/TOP_SRC/trcini.F90	(revision 6605)
+++ /branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/TOP_SRC/trcini.F90	(revision 6606)
@@ -30,4 +30,5 @@
    USE trcsub          ! variables to substep passive tracers
    USE lib_mpp         ! distribued memory computing library
+   USE wrk_nemo
    USE sbc_oce
    USE trcice          ! tracers in sea ice
@@ -61,4 +62,5 @@
       INTEGER ::   jk, jn, jl    ! dummy loop indices
       CHARACTER (len=25) :: charout
+      REAL(wp), POINTER, DIMENSION(:,:,:,:) :: ztrcdta
       !!---------------------------------------------------------------------
       !
@@ -120,20 +122,17 @@
         IF( ln_trcdta .AND. nb_trcdta > 0 ) THEN  ! Initialisation of tracer from a file that may also be used for damping
             !
+            CALL wrk_alloc( jpi, jpj, jpk, nb_trcdta, ztrcdta )
+            !
+            CALL trc_dta( nit000, ztrcdta )   ! read tracer data at nit000
+            !
             DO jn = 1, jptra
                IF( ln_trc_ini(jn) ) THEN      ! update passive tracers arrays with input data read from file
                   jl = n_trc_index(jn) 
-                  CALL trc_dta( nit000, sf_trcdta(jl) )   ! read tracer data at nit000
-                  trn(:,:,:,jn) = sf_trcdta(jl)%fnow(:,:,:) * tmask(:,:,:) * rf_trfac(jl)
-                  !
-                  IF( .NOT.ln_trcdmp .AND. .NOT.ln_trcdmp_clo ) THEN      !== deallocate data structure   ==!
-                     !                                                    (data used only for initialisation)
-                     IF(lwp) WRITE(numout,*) 'trc_dta: deallocate data arrays as they are only used to initialize the run'
-                                                  DEALLOCATE( sf_trcdta(jl)%fnow )     !  arrays in the structure
-                     IF( sf_trcdta(jl)%ln_tint )  DEALLOCATE( sf_trcdta(jl)%fdta )
-                     !
-                  ENDIF
+                  trn(:,:,:,jn) = ztrcdta(:,:,:,jl) * rf_trfac(jl)
                ENDIF
             ENDDO
             !
+            CALL wrk_dealloc( jpi, jpj, jpk, nb_trcdta, ztrcdta )
+            ! 
         ENDIF
         !
