Index: branches/2012/dev_r3387_LOCEAN6_AGRIF_LIM/NEMOGCM/NEMO/TOP_SRC/TRP/trcnxt.F90
===================================================================
--- branches/2012/dev_r3387_LOCEAN6_AGRIF_LIM/NEMOGCM/NEMO/TOP_SRC/TRP/trcnxt.F90	(revision 3388)
+++ branches/2012/dev_r3387_LOCEAN6_AGRIF_LIM/NEMOGCM/NEMO/TOP_SRC/TRP/trcnxt.F90	(revision 3566)
@@ -34,5 +34,4 @@
    USE tranxt
 # if defined key_agrif
-   USE agrif_top_update
    USE agrif_top_interp
 # endif
@@ -146,9 +145,4 @@
       ENDIF
 
-#if defined key_agrif
-      ! Update tracer at AGRIF zoom boundaries
-      IF( .NOT.Agrif_Root() )    CALL Agrif_Update_Trc( kt )      ! children only
-#endif      
-
       ! trends computation
       IF( l_trdtrc ) THEN                                      ! trends
Index: branches/2012/dev_r3387_LOCEAN6_AGRIF_LIM/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90
===================================================================
--- branches/2012/dev_r3387_LOCEAN6_AGRIF_LIM/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90	(revision 3388)
+++ branches/2012/dev_r3387_LOCEAN6_AGRIF_LIM/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90	(revision 3566)
@@ -29,5 +29,6 @@
 
 #if defined key_agrif
-   USE agrif_top_sponge ! Momemtum and tracers sponges
+   USE agrif_top_sponge ! tracers sponges
+   USE agrif_top_update ! tracers updates
 #endif
 
@@ -76,4 +77,8 @@
                                 CALL trc_nxt( kstp )            ! tracer fields at next time step     
          IF( ln_trcrad )        CALL trc_rad( kstp )            ! Correct artificial negative concentrations
+
+#if defined key_agrif
+      IF( .NOT. Agrif_Root())   CALL Agrif_Update_Trc( kstp )   ! Update tracer at AGRIF zoom boundaries : children only
+#endif
          IF( ln_zps    )        CALL zps_hde( kstp, jptra, trn, gtru, gtrv )  ! Partial steps: now horizontal gradient of passive
                                                                 ! tracers at the bottom ocean level
@@ -98,7 +103,7 @@
    !!----------------------------------------------------------------------
 CONTAINS
-   SUBROUTINE trc_trp( kt )              ! Empty routine
-      INTEGER, INTENT(in) ::   kt
-      WRITE(*,*) 'trc_trp: You should not have seen this print! error?', kt
+   SUBROUTINE trc_trp( kstp )              ! Empty routine
+      INTEGER, INTENT(in) ::   kstp
+      WRITE(*,*) 'trc_trp: You should not have seen this print! error?', kstp
    END SUBROUTINE trc_trp
 #endif
Index: branches/2012/dev_r3387_LOCEAN6_AGRIF_LIM/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90
===================================================================
--- branches/2012/dev_r3387_LOCEAN6_AGRIF_LIM/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90	(revision 3388)
+++ branches/2012/dev_r3387_LOCEAN6_AGRIF_LIM/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90	(revision 3566)
@@ -56,131 +56,5 @@
 
    !* model domain *
-   USE dom_oce , ONLY :   lzoom      => lzoom        !: zoom flag
-   USE dom_oce , ONLY :   lzoom_e    => lzoom_e      !: East  zoom type flag
-   USE dom_oce , ONLY :   lzoom_w    => lzoom_w      !: West  zoom type flag
-   USE dom_oce , ONLY :   lzoom_s    => lzoom_s      !: South zoom type flag
-   USE dom_oce , ONLY :   lzoom_n    => lzoom_n      !: North zoom type flag
-   USE dom_oce , ONLY :   lzoom_arct => lzoom_arct   !: ORCA    arctic zoom flag
-   USE dom_oce , ONLY :   lzoom_anta => lzoom_anta   !: ORCA antarctic zoom flag
-   USE dom_oce , ONLY :   nperio     =>   nperio     !: type of lateral boundary condition       
-   USE dom_oce , ONLY :   nimpp      =>   nimpp      !: i index for mpp-subdomain left bottom
-   USE dom_oce , ONLY :   njmpp      =>   njmpp      !: j index for mpp-subdomain left bottom
-   USE dom_oce , ONLY :   nproc      =>   nproc      !: number for local processor
-   USE dom_oce , ONLY :   narea      =>   narea      !: number for local area
-   USE dom_oce , ONLY :   mig        =>   mig        !: local  ==> global  domain i-indice
-   USE dom_oce , ONLY :   mjg        =>   mjg        !: local  ==> global  domain i-indice
-   USE dom_oce , ONLY :   mi0        =>   mi0        !: global ==> local domain i-indice 
-   USE dom_oce , ONLY :   mi1        =>   mi1        !: (mi0=1 and mi1=0 if the global indice is not in the local one)
-   USE dom_oce , ONLY :   mj0        =>   mj0        !: global ==> local domain j-indice 
-   USE dom_oce , ONLY :   mj1        =>   mj1        !: (mj0=1 and mj1=0 if the global indice is not in the local one)
-   USE dom_oce , ONLY :   nidom      =>   nidom
-   USE dom_oce , ONLY :   nimppt     => nimppt     !:i-indexes for each processor
-   USE dom_oce , ONLY :   njmppt     => njmppt       !:j-indexes for each processor
-   USE dom_oce , ONLY :   ibonit     => ibonit       !:i-processor neighbour existence
-   USE dom_oce , ONLY :   ibonjt     => ibonjt       !:j- processor neighbour existence 
-   USE dom_oce , ONLY :   nlci       => nlci         !:i- & j-dimensions of the local subdomain
-   USE dom_oce , ONLY :   nlcj       => nlcj         !:
-   USE dom_oce , ONLY :   nldi       => nldi         !:first and last indoor i- and j-indexes
-   USE dom_oce , ONLY :   nlei       => nlei         !:
-   USE dom_oce , ONLY :   nldj       => nldj         !:
-   USE dom_oce , ONLY :   nlej       => nlej         !:
-   USE dom_oce , ONLY :   nlcit      => nlcit        !:dimensions of every i-subdomain
-   USE dom_oce , ONLY :   nlcjt      => nlcjt        !:dimensions of every j-subdomain
-   USE dom_oce , ONLY :   nldit      => nldit        !:first indoor index for each i-domain 
-   USE dom_oce , ONLY :   nleit      => nleit        !:last indoor index for each i-domain 
-   USE dom_oce , ONLY :   nldjt      => nldjt        !:first indoor index for each j-domain 
-   USE dom_oce , ONLY :   nlejt      => nlejt        !:last indoor index for each j-domain 
- 
-   !* horizontal mesh *
-   USE dom_oce , ONLY :   glamt      =>   glamt      !: longitude of t-point (degre)  
-   USE dom_oce , ONLY :   glamu      =>   glamu      !: longitude of t-point (degre)  
-   USE dom_oce , ONLY :   glamv      =>   glamv      !: longitude of t-point (degre)  
-   USE dom_oce , ONLY :   glamf      =>   glamf      !: longitude of t-point (degre)  
-   USE dom_oce , ONLY :   gphit      =>   gphit      !: latitude  of t-point (degre)   
-   USE dom_oce , ONLY :   gphiu      =>   gphiu      !: latitude  of t-point (degre)   
-   USE dom_oce , ONLY :   gphiv      =>   gphiv      !: latitude  of t-point (degre)   
-   USE dom_oce , ONLY :   gphif      =>   gphif      !: latitude  of t-point (degre)   
-   USE dom_oce , ONLY :   e1t        =>   e1t        !: horizontal scale factors at t-point (m)  
-   USE dom_oce , ONLY :   e2t        =>   e2t        !: horizontal scale factors at t-point (m)   
-   USE dom_oce , ONLY :   e1e2t      =>   e1e2t      !: cell surface at t-point (m2)
-   USE dom_oce , ONLY :   e1u        =>   e1u        !: horizontal scale factors at u-point (m)
-   USE dom_oce , ONLY :   e2u        =>   e2u        !: horizontal scale factors at u-point (m)
-   USE dom_oce , ONLY :   e1v        =>   e1v        !: horizontal scale factors at v-point (m)
-   USE dom_oce , ONLY :   e2v        =>   e2v        !: horizontal scale factors at v-point (m)  
-
-   !* vertical mesh *
-   USE dom_oce , ONLY :   gdept_0    =>   gdept_0    !: reference depth of t-points (m)
-   USE dom_oce , ONLY :   e3t_0      =>   e3t_0      !: reference depth of t-points (m)  
-   USE dom_oce , ONLY :   e3w_0      =>   e3w_0      !: reference depth of w-points (m)
-   USE dom_oce , ONLY :   gdepw_0    =>   gdepw_0    !: reference depth of w-points (m)
-# if ! defined key_zco
-   USE dom_oce , ONLY :   gdep3w     =>  gdep3w      !: ???
-   USE dom_oce , ONLY :   gdept      =>  gdept       !: depth of t-points (m)
-   USE dom_oce , ONLY :   gdepw      =>  gdepw       !: depth of t-points (m)
-   USE dom_oce , ONLY :   e3t        =>  e3t         !: vertical scale factors at t-
-   USE dom_oce , ONLY :   e3u        =>  e3u         !: vertical scale factors at u-
-   USE dom_oce , ONLY :   e3v        =>  e3v         !: vertical scale factors v-
-   USE dom_oce , ONLY :   e3w        =>  e3w         !: w-points (m)
-   USE dom_oce , ONLY :   e3f        =>  e3f         !: f-points (m)
-   USE dom_oce , ONLY :   e3uw       =>  e3uw        !: uw-points (m)
-   USE dom_oce , ONLY :   e3vw       =>  e3vw        !: vw-points (m)
-# endif
-   USE dom_oce , ONLY :   ln_zps     =>  ln_zps      !: partial steps flag
-   USE dom_oce , ONLY :   ln_sco     =>  ln_sco      !: s-coordinate flag
-   USE dom_oce , ONLY :   ln_zco     =>  ln_zco      !: z-coordinate flag
-   USE dom_oce , ONLY :   hbatt      =>  hbatt       !: ocean depth at the vertical of  t-point (m)
-   USE dom_oce , ONLY :   hbatu      =>  hbatu       !: ocean depth at the vertical of  u-point (m)
-   USE dom_oce , ONLY :   hbatv      =>  hbatv       !: ocean depth at the vertical of w-point (m)
-   USE dom_oce , ONLY :   gsigt      =>  gsigt       !: model level depth coefficient at T-levels
-   USE dom_oce , ONLY :   gsigw      =>  gsigw       !: model level depth coefficient at W-levels
-   USE dom_oce , ONLY :   gsi3w      =>  gsi3w       !: model level depth coef at w-levels (defined as the sum of e3w)
-   USE dom_oce , ONLY :   esigt      =>  esigt       !: vertical scale factor coef. at t-levels
-   USE dom_oce , ONLY :   esigw      =>  esigw       !: vertical scale factor coef. at w-levels
-   USE dom_oce , ONLY :   lk_vvl     =>  lk_vvl      !: variable grid flag
-# if defined key_vvl
-   USE dom_oce , ONLY :   gdep3w_1   =>  gdep3w_1    !: ???
-   USE dom_oce , ONLY :   gdept_1    =>  gdept_1     !: depth of t-points (m)
-   USE dom_oce , ONLY :   gdepw_1    =>  gdepw_1     !: depth of t-points (m)
-   USE dom_oce , ONLY :   e3t_1      =>  e3t_1       !: vertical scale factors at t-
-   USE dom_oce , ONLY :   e3u_1      =>  e3u_1       !: vertical scale factors at u-
-   USE dom_oce , ONLY :   e3v_1      =>  e3v_1       !: vertical scale factors v-
-   USE dom_oce , ONLY :   e3w_1      =>  e3w_1       !: w-points (m)
-   USE dom_oce , ONLY :   e3f_1      =>  e3f_1       !: f-points (m)
-   USE dom_oce , ONLY :   e3uw_1     =>  e3uw_1      !: uw-points (m)
-   USE dom_oce , ONLY :   e3vw_1     =>  e3vw_1      !: vw-points (m)
-# endif
-   !* masks, bathymetry *
-   USE dom_oce , ONLY :   mbkt       =>   mbkt       !: vertical index of the bottom last T- ocean level
-   USE dom_oce , ONLY :   mbku       =>   mbku       !: vertical index of the bottom last U- ocean level
-   USE dom_oce , ONLY :   mbkv       =>   mbkv       !: vertical index of the bottom last V- ocean level
-   USE dom_oce , ONLY :   tmask_i    =>   tmask_i    !: Interior mask at t-points
-   USE dom_oce , ONLY :   tmask      =>   tmask      !: land/ocean mask at t-points
-   USE dom_oce , ONLY :   umask      =>   umask      !: land/ocean mask at u-points   
-   USE dom_oce , ONLY :   vmask      =>   vmask      !: land/ocean mask at v-points 
-   USE dom_oce , ONLY :   fmask      =>   fmask      !: land/ocean mask at f-points 
-
-   !* time domain *
-   USE dom_oce , ONLY :   neuler     =>   neuler     !: restart euler forward option (0=Euler)
-   USE dom_oce , ONLY :   rdt        =>   rdt        !: time step for the dynamics 
-   USE dom_oce , ONLY :   atfp       =>   atfp       !: asselin time filter parameter
-   USE dom_oce , ONLY :   atfp1      =>   atfp1      !: asselin time filter coeff. (atfp1= 1-2*atfp)
-   USE dom_oce , ONLY :   rdttra     =>   rdttra     !: vertical profile of tracer time step
-   !                                                 !: it is the accumulated duration of previous runs
-   !                                                 !: that may have been run with different time steps.
-   !* calendar variables *
-   USE dom_oce , ONLY :   nyear      =>   nyear      !: current year
-   USE dom_oce , ONLY :   nmonth     =>   nmonth     !: current month
-   USE dom_oce , ONLY :   nday       =>   nday       !: current day of the month
-   USE dom_oce , ONLY :   ndastp     =>   ndastp     !: time step date in yyyymmdd format
-   USE dom_oce , ONLY :   nday_year  =>   nday_year  !: current day counted from jan 1st of the current year
-   USE dom_oce , ONLY :   nsec_year  =>   nsec_year  !: current time step counted in second since 00h jan 1st of the current year
-   USE dom_oce , ONLY :   nsec_month =>   nsec_month !: current time step counted in second since 00h 1st day of the current month
-   USE dom_oce , ONLY :   nsec_day   =>   nsec_day   !: current time step counted in second since 00h of the current day
-   USE dom_oce , ONLY :   fjulday    =>   fjulday    !: julian day
-   USE dom_oce , ONLY :   adatrj     =>   adatrj     !: number of elapsed days since the begining of the whole simulation
-                                                     !: (cumulative duration of previous runs 
-                                                     !: that may have used different time-step size)
-   USE dom_oce , ONLY :   nyear_len  =>   nyear_len  !: length in days of the previous/current year
-   USE dom_oce , ONLY :   nmonth_len =>   nmonth_len !: length in days of the months of the current year
+   USE dom_oce 
 
 
@@ -217,6 +91,4 @@
    USE oce , ONLY :   grv     =>    grv     !: 
 #endif
-
-   USE dom_oce , ONLY :   nn_cla    =>  nn_cla        !: flag (0/1) for cross land advection 
 
    !* surface fluxes *
Index: branches/2012/dev_r3387_LOCEAN6_AGRIF_LIM/NEMOGCM/NEMO/TOP_SRC/prtctl_trc.F90
===================================================================
--- branches/2012/dev_r3387_LOCEAN6_AGRIF_LIM/NEMOGCM/NEMO/TOP_SRC/prtctl_trc.F90	(revision 3388)
+++ branches/2012/dev_r3387_LOCEAN6_AGRIF_LIM/NEMOGCM/NEMO/TOP_SRC/prtctl_trc.F90	(revision 3566)
@@ -17,4 +17,5 @@
    USE par_trc          ! TOP parameters
    USE oce_trc          ! ocean space and time domain variables
+   USE prtctl           ! print control for OPA
 
    IMPLICIT NONE
@@ -296,157 +297,4 @@
    END SUBROUTINE prt_ctl_trc_init
 
-
-   SUBROUTINE sub_dom
-      !!----------------------------------------------------------------------
-      !!                  ***  ROUTINE sub_dom  ***
-      !!                    
-      !! ** Purpose :   Lay out the global domain over processors. 
-      !!                CAUTION: 
-      !!                This part has been extracted from the mpp_init
-      !!                subroutine and names of variables/arrays have been 
-      !!                slightly changed to avoid confusion but the computation
-      !!                is exactly the same. Any modification about indices of
-      !!                each sub-domain in the mppini.F90 module should be reported 
-      !!                here.
-      !!
-      !! ** Method  :   Global domain is distributed in smaller local domains.
-      !!                Periodic condition is a function of the local domain position
-      !!                (global boundary or neighbouring domain) and of the global
-      !!                periodic
-      !!                Type :         jperio global periodic condition
-      !!                               nperio local  periodic condition
-      !!
-      !! ** Action  : - set domain parameters
-      !!                    nimpp     : longitudinal index 
-      !!                    njmpp     : latitudinal  index
-      !!                    nperio    : lateral condition type 
-      !!                    narea     : number for local area
-      !!                    nlcil      : first dimension
-      !!                    nlcjl      : second dimension
-      !!                    nbondil    : mark for "east-west local boundary"
-      !!                    nbondjl    : mark for "north-south local boundary"
-      !!----------------------------------------------------------------------
-      INTEGER ::   ji, jj, js               ! dummy loop indices
-      INTEGER ::   ii, ij                   ! temporary integers
-      INTEGER ::   irestil, irestjl         !    "          "
-      INTEGER ::   ijpi  , ijpj, nlcil      ! temporary logical unit
-      INTEGER ::   nlcjl , nbondil, nbondjl
-      INTEGER ::   nrecil, nrecjl, nldil, nleil, nldjl, nlejl
-      REAL(wp) ::   zidom, zjdom            ! temporary scalars
-      INTEGER, POINTER, DIMENSION(:,:) ::   iimpptl, ijmpptl, ilcitl, ilcjtl   ! temporary workspace
-      !!----------------------------------------------------------------------
-      !
-      CALL wrk_alloc( isplt, jsplt, ilcitl, ilcjtl, iimpptl, ijmpptl )
-      !
-      ! Dimension arrays for subdomains
-      ! -------------------------------
-      !  Computation of local domain sizes ilcitl() ilcjtl()
-      !  These dimensions depend on global sizes isplt,jsplt and jpiglo,jpjglo
-      !  The subdomains are squares leeser than or equal to the global
-      !  dimensions divided by the number of processors minus the overlap
-      !  array (cf. par_oce.F90).
-
-      ijpi = ( jpiglo-2*jpreci + (isplt-1) ) / isplt + 2*jpreci
-      ijpj = ( jpjglo-2*jprecj + (jsplt-1) ) / jsplt + 2*jprecj
-
-      nrecil  = 2 * jpreci
-      nrecjl  = 2 * jprecj
-      irestil = MOD( jpiglo - nrecil , isplt )
-      irestjl = MOD( jpjglo - nrecjl , jsplt )
-
-      IF(  irestil == 0 )   irestil = isplt
-      DO jj = 1, jsplt
-         DO ji = 1, irestil
-            ilcitl(ji,jj) = ijpi
-         END DO
-         DO ji = irestil+1, isplt
-            ilcitl(ji,jj) = ijpi -1
-         END DO
-      END DO
-      
-      IF( irestjl == 0 )   irestjl = jsplt
-      DO ji = 1, isplt
-         DO jj = 1, irestjl
-            ilcjtl(ji,jj) = ijpj
-         END DO
-         DO jj = irestjl+1, jsplt
-            ilcjtl(ji,jj) = ijpj -1
-         END DO
-      END DO
-      
-      zidom = nrecil
-      DO ji = 1, isplt
-         zidom = zidom + ilcitl(ji,1) - nrecil
-      END DO
-      
-      zjdom = nrecjl
-      DO jj = 1, jsplt
-         zjdom = zjdom + ilcjtl(1,jj) - nrecjl
-      END DO
-
-      ! Index arrays for subdomains
-      ! ---------------------------
-
-      iimpptl(:,:) = 1
-      ijmpptl(:,:) = 1
-      
-      IF( isplt > 1 ) THEN
-         DO jj = 1, jsplt
-            DO ji = 2, isplt
-               iimpptl(ji,jj) = iimpptl(ji-1,jj) + ilcitl(ji-1,jj) - nrecil
-            END DO
-         END DO
-      ENDIF
-
-      IF( jsplt > 1 ) THEN
-         DO jj = 2, jsplt
-            DO ji = 1, isplt
-               ijmpptl(ji,jj) = ijmpptl(ji,jj-1)+ilcjtl(ji,jj-1)-nrecjl
-            END DO
-         END DO
-      ENDIF
-      
-      ! Subdomain description
-      ! ---------------------
-
-      DO js = 1, ijsplt
-         ii = 1 + MOD( js-1, isplt )
-         ij = 1 + (js-1) / isplt
-         nimpptl(js) = iimpptl(ii,ij)
-         njmpptl(js) = ijmpptl(ii,ij)
-         nlcitl (js) = ilcitl (ii,ij)     
-         nlcil       = nlcitl (js)     
-         nlcjtl (js) = ilcjtl (ii,ij)     
-         nlcjl       = nlcjtl (js)
-         nbondjl = -1                                    ! general case
-         IF( js   >  isplt          )   nbondjl = 0      ! first row of processor
-         IF( js   >  (jsplt-1)*isplt )  nbondjl = 1     ! last  row of processor
-         IF( jsplt == 1             )   nbondjl = 2      ! one processor only in j-direction
-         ibonjtl(js) = nbondjl
-         
-         nbondil = 0                                     ! 
-         IF( MOD( js, isplt ) == 1 )   nbondil = -1      !
-         IF( MOD( js, isplt ) == 0 )   nbondil =  1      !
-         IF( isplt            == 1 )   nbondil =  2      ! one processor only in i-direction
-         ibonitl(js) = nbondil
-         
-         nldil =  1   + jpreci
-         nleil = nlcil - jpreci
-         IF( nbondil == -1 .OR. nbondil == 2 )   nldil = 1
-         IF( nbondil ==  1 .OR. nbondil == 2 )   nleil = nlcil
-         nldjl =  1   + jprecj
-         nlejl = nlcjl - jprecj
-         IF( nbondjl == -1 .OR. nbondjl == 2 )   nldjl = 1
-         IF( nbondjl ==  1 .OR. nbondjl == 2 )   nlejl = nlcjl
-         nlditl(js) = nldil
-         nleitl(js) = nleil
-         nldjtl(js) = nldjl
-         nlejtl(js) = nlejl
-      END DO
-      !
-      CALL wrk_dealloc( isplt, jsplt, ilcitl, ilcjtl, iimpptl, ijmpptl )
-      !
-   END SUBROUTINE sub_dom
- 
 #else
    !!----------------------------------------------------------------------
