Index: /branches/nemo_v3_3_beta/NEMOGCM/CONFIG/GYRE/EXP00/namelist
===================================================================
--- /branches/nemo_v3_3_beta/NEMOGCM/CONFIG/GYRE/EXP00/namelist	(revision 2398)
+++ /branches/nemo_v3_3_beta/NEMOGCM/CONFIG/GYRE/EXP00/namelist	(revision 2399)
@@ -719,6 +719,6 @@
    ln_subbas  = .false.    !  Atlantic/Pacific/Indian basins computation (T) or not 
                            !  (orca configuration only, need input basins mask file named "subbasins.nc"
-   nf_ptr     =  1         !  Frequency of ptr computation [time step]
-   nf_ptr_wri =  15        !  Frequency of ptr outputs
+   nn_fptr    =  1         !  Frequency of ptr computation [time step]
+   nn_fwri    =  15        !  Frequency of ptr outputs [time step]
 /
 !-----------------------------------------------------------------------
Index: /branches/nemo_v3_3_beta/NEMOGCM/CONFIG/GYRE_LOBSTER/EXP00/namelist
===================================================================
--- /branches/nemo_v3_3_beta/NEMOGCM/CONFIG/GYRE_LOBSTER/EXP00/namelist	(revision 2398)
+++ /branches/nemo_v3_3_beta/NEMOGCM/CONFIG/GYRE_LOBSTER/EXP00/namelist	(revision 2399)
@@ -719,6 +719,7 @@
    ln_subbas  = .false.    !  Atlantic/Pacific/Indian basins computation (T) or not 
                            !  (orca configuration only, need input basins mask file named "subbasins.nc"
-   nf_ptr     =  1         !  Frequency of ptr computation [time step]
-   nf_ptr_wri =  15        !  Frequency of ptr outputs
+   ln_ptrcomp = .false.    !  Add decomposition : overturning
+   nn_fptr    =  1         !  Frequency of ptr computation [time step]
+   nn_fwri    =  15        !  Frequency of ptr outputs [time step]
 /
 !-----------------------------------------------------------------------
Index: /branches/nemo_v3_3_beta/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/1_namelist
===================================================================
--- /branches/nemo_v3_3_beta/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/1_namelist	(revision 2398)
+++ /branches/nemo_v3_3_beta/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/1_namelist	(revision 2399)
@@ -727,6 +727,7 @@
    ln_subbas  = .false.    !  Atlantic/Pacific/Indian basins computation (T) or not 
                            !  (orca configuration only, need input basins mask file named "subbasins.nc"
-   nf_ptr     =  1         !  Frequency of ptr computation [time step]
-   nf_ptr_wri =  15        !  Frequency of ptr outputs
+   ln_ptrcomp = .false.    !  Add decomposition : overturning
+   nn_fptr    =  1         !  Frequency of ptr computation [time step]
+   nn_fwri    =  15        !  Frequency of ptr outputs [time step]
 /
 !-----------------------------------------------------------------------
Index: /branches/nemo_v3_3_beta/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist
===================================================================
--- /branches/nemo_v3_3_beta/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist	(revision 2398)
+++ /branches/nemo_v3_3_beta/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist	(revision 2399)
@@ -765,6 +765,6 @@
                            !  (orca configuration only, need input basins mask file named "subbasins.nc"
    ln_ptrcomp = .true.     !  Add decomposition : overturning
-   nf_ptr     =  1         !  Frequency of ptr computation [time step]
-   nf_ptr_wri =  15        !  Frequency of ptr outputs
+   nn_fptr    =  1         !  Frequency of ptr computation [time step]
+   nn_fwri    =  15        !  Frequency of ptr outputs [time step]
 /
 !-----------------------------------------------------------------------
Index: /branches/nemo_v3_3_beta/NEMOGCM/CONFIG/ORCA2_LIM/cpp_ORCA2_LIM.fcm
===================================================================
--- /branches/nemo_v3_3_beta/NEMOGCM/CONFIG/ORCA2_LIM/cpp_ORCA2_LIM.fcm	(revision 2398)
+++ /branches/nemo_v3_3_beta/NEMOGCM/CONFIG/ORCA2_LIM/cpp_ORCA2_LIM.fcm	(revision 2399)
@@ -1,1 +1,1 @@
- bld::tool::fppkeys  key_trabbl key_vectopt_loop key_orca_r2 key_lim2 key_dynspg_flt key_diaeiv key_ldfslp key_traldf_c2d key_traldf_eiv key_dynldf_c3d key_dtatem key_dtasal key_tradmp key_zdftke key_zdfddm key_iomput key_nproci=1 key_nprocj=1
+ bld::tool::fppkeys  key_trabbl key_vectopt_loop  key_dynspg_flt key_diaeiv key_ldfslp key_traldf_c2d key_traldf_eiv key_dynldf_c3d key_dtatem key_dtasal key_tradmp key_zdftke key_zdfddm key_iomput key_nproci=1 key_nprocj=1 
Index: /branches/nemo_v3_3_beta/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist
===================================================================
--- /branches/nemo_v3_3_beta/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist	(revision 2398)
+++ /branches/nemo_v3_3_beta/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist	(revision 2399)
@@ -765,6 +765,6 @@
                            !  (orca configuration only, need input basins mask file named "subbasins.nc"
    ln_ptrcomp = .true.     !  Add decomposition : overturning
-   nf_ptr     =  1         !  Frequency of ptr computation [time step]
-   nf_ptr_wri =  15        !  Frequency of ptr outputs
+   nn_fptr    =  1         !  Frequency of ptr computation [time step]
+   nn_fwri    =  15        !  Frequency of ptr outputs [time step]
 /
 !-----------------------------------------------------------------------
Index: /branches/nemo_v3_3_beta/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist
===================================================================
--- /branches/nemo_v3_3_beta/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist	(revision 2398)
+++ /branches/nemo_v3_3_beta/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist	(revision 2399)
@@ -749,11 +749,11 @@
 &namptr       !   Poleward Transport Diagnostic
 !-----------------------------------------------------------------------
-   ln_diaptr  = .false.     !  Poleward heat and salt transport (T) or not (F)
-   ln_diaznl  = .true.     !  Add zonal means and meridional stream functions
-   ln_subbas  = .true.     !  Atlantic/Pacific/Indian basins computation (T) or not 
+   ln_diaptr  = .false.    !  Poleward heat and salt transport (T) or not (F)
+   ln_diaznl  = .false.    !  Add zonal means and meridional stream functions
+   ln_subbas  = .false.    !  Atlantic/Pacific/Indian basins computation (T) or not 
                            !  (orca configuration only, need input basins mask file named "subbasins.nc"
-   ln_ptrcomp = .true.     !  Add decomposition : overturning
-   nf_ptr     =  1         !  Frequency of ptr computation [time step]
-   nf_ptr_wri =  15        !  Frequency of ptr outputs
+   ln_ptrcomp = .false.    !  Add decomposition : overturning
+   nn_fptr    =  1         !  Frequency of ptr computation [time step]
+   nn_fwri    =  15        !  Frequency of ptr outputs [time step]
 /
 !-----------------------------------------------------------------------
Index: /branches/nemo_v3_3_beta/NEMOGCM/CONFIG/POMME/EXP00/namelist
===================================================================
--- /branches/nemo_v3_3_beta/NEMOGCM/CONFIG/POMME/EXP00/namelist	(revision 2398)
+++ /branches/nemo_v3_3_beta/NEMOGCM/CONFIG/POMME/EXP00/namelist	(revision 2399)
@@ -760,6 +760,7 @@
    ln_subbas  = .false.    !  Atlantic/Pacific/Indian basins computation (T) or not 
                            !  (orca configuration only, need input basins mask file named "subbasins.nc"
-   nf_ptr     =  1         !  Frequency of ptr computation [time step]
-   nf_ptr_wri =  15        !  Frequency of ptr outputs
+   ln_ptrcomp = .false.    !  Add decomposition : overturning
+   nn_fptr    =  1         !  Frequency of ptr computation [time step]
+   nn_fwri    =  15        !  Frequency of ptr outputs [time step]
 /
 !-----------------------------------------------------------------------
Index: /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/ASM/asmtrj.F90
===================================================================
--- /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/ASM/asmtrj.F90	(revision 2398)
+++ /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/ASM/asmtrj.F90	(revision 2399)
@@ -2,7 +2,17 @@
    !!======================================================================
    !!                       ***  MODULE asmtrj  ***
-   !! Assimilation trajectory interface: Write to file the background state
-   !!                                    and the model state trajectory
+   !! Assimilation trajectory interface: Write to file the background state and the model state trajectory
    !!======================================================================
+   !! History :       ! 2007-03 (M. Martin)  Met. Office version
+   !!                 ! 2007-04 (A. Weaver)  asm_trj_wri, original code
+   !!                 ! 2007-03 (K. Mogensen)  Adapt to NEMOVAR and use IOM instead of IOIPSL
+   !!                 ! 2007-04 (A. Weaver)  Name change (formally asmbkg.F90). Distinguish
+   !!                                        background states in Jb term and at analysis time.
+   !!                                        Include state trajectory routine (currently empty)
+   !!                 ! 2007-07 (A. Weaver)  Add tke_rst and flt_rst for case nitbkg=0 
+   !!                 ! 2009-03 (F. Vigilant)  Add hmlp (zdfmxl) for no tracer nmldp=2 
+   !!                 ! 2009-06 (F. Vigilant) asm_trj_wri: special case when kt=nit000-1
+   !!                 ! 2009-07 (F. Vigilant) asm_trj_wri: add computation of eiv at restart
+   !!----------------------------------------------------------------------
 
    !!----------------------------------------------------------------------
@@ -12,5 +22,4 @@
    !!   asm_trj_wri  : Write out the model state trajectory (used with 4D-Var)
    !!----------------------------------------------------------------------
-   !! * Modules used   
    USE oce                ! Dynamics and active tracers defined in memory
    USE sbc_oce            ! Ocean surface boundary conditions
@@ -20,5 +29,4 @@
    USE ldfslp             ! Slopes of neutral surfaces
    USE tradmp             ! Tracer damping
-
 #if defined key_zdftke
    USE zdftke             ! TKE vertical physics
@@ -26,37 +34,29 @@
    USE eosbn2             ! Equation of state (eos_bn2 routine)
    USE zdfmxl             ! Mixed layer depth
-   USE sol_oce, ONLY : &  ! Solver variables defined in memory
-      & gcx
-   USE in_out_manager, ONLY : &  ! I/O manager
-      & lwp,     &
-      & numout
-   USE dom_oce, ONLY : &
-      & ndastp
-   USE iom                 ! I/O module
-   USE asmpar              ! Parameters for the assmilation interface
-   USE zdfmxl, ONLY : &   ! mixed layer depth
-      & hmlp
+   USE dom_oce, ONLY :   ndastp
+   USE sol_oce, ONLY :   gcx   ! Solver variables defined in memory
+   USE in_out_manager     ! I/O manager
+   USE iom                ! I/O module
+   USE asmpar             ! Parameters for the assmilation interface
+   USE zdfmxl             ! mixed layer depth
 #if defined key_traldf_c2d
-   USE ldfeiv          ! eddy induced velocity coef.      (ldf_eiv routine)
+   USE ldfeiv             ! eddy induced velocity coef.      (ldf_eiv routine)
 #endif
 
    IMPLICIT NONE
-
-   !! * Routine accessibility
    PRIVATE
-   PUBLIC asm_bkg_wri, &  !: Write out the background state
-      &   asm_trj_wri     !: Write out the background state
+   
+   PUBLIC   asm_bkg_wri   !: Write out the background state
+   PUBLIC   asm_trj_wri   !: Write out the background state
 
    !!----------------------------------------------------------------------
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
    SUBROUTINE asm_bkg_wri( kt )
       !!-----------------------------------------------------------------------
-      !!
       !!                  ***  ROUTINE asm_bkg_wri ***
       !!
@@ -68,22 +68,7 @@
       !!              in the cost function and for use with direct initialization
       !!              at analysis time.
-      !!
-      !! ** Action  :
-      !!                   
-      !! References : 
-      !!
-      !! History :
-      !!        ! 07-03 (M. Martin) Met. Office version
-      !!        ! 07-03 (K. Mogensen) Adapt to NEMOVAR and use IOM instead of IOIPSL
-      !!        ! 07-04 (A. Weaver) Name change (formally asmbkg.F90). Distinguish
-      !!                            background states in Jb term and at analysis time.
-      !!                            Include state trajectory routine (currently empty)
-      !!        ! 07-07 (A. Weaver) Add tke_rst and flt_rst for case nitbkg=0 
-      !!-----------------------------------------------------------------------
-
-      !! * Arguments
+      !!-----------------------------------------------------------------------
       INTEGER, INTENT( IN ) :: kt               ! Current time-step
-
-      !! * Local declarations
+      !
       CHARACTER (LEN=50) :: cl_asmbkg
       CHARACTER (LEN=50) :: cl_asmdin
@@ -91,36 +76,33 @@
       INTEGER :: inum          ! File unit number
       REAL(wp) :: zdate        ! Date
-
-      !--------------------------------------------------------------------
-      ! Write out background at time step nitbkg_r or nitdin_r
-      !--------------------------------------------------------------------
-
-      IF ( kt == nitbkg_r ) THEN
-
+      !!-----------------------------------------------------------------------
+
+      !                                !-------------------------------------------
+      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        
+            IF(lwp) WRITE(numout,*) ' Setting up assimilation background file '// TRIM( c_asmbkg )
+            !
+            !                                      ! Define the output file        
             CALL iom_open( c_asmbkg, inum, ldwrt = .TRUE., kiolib = jprstlib)
-
-            ! Treat special case when nitbkg = 0
-            IF ( nitbkg_r == nit000 - 1 ) THEN
-               zdate = REAL( ndastp )
-#if defined key_zdftke
+            !
+            IF( nitbkg_r == nit000 - 1 ) THEN      ! Treat special case when nitbkg = 0
+               zdate = REAL( ndastp )
+#if defined key_zdftke
+               ! lk_zdftke=T :   Read turbulent kinetic energy ( en )
                IF(lwp) WRITE(numout,*) ' Reading TKE (en) from restart...'
-               ! Read turbulent kinetic energy ( en )
-               CALL tke_rst( nit000, 'READ' )
+               CALL tke_rst( nit000, 'READ' )               ! lk_zdftke=T :   Read turbulent kinetic energy ( en )
+
 #endif
             ELSE
                zdate = REAL( ndastp )
             ENDIF
-
-            ! Write the information
+            !
+            !                                      ! Write the information
             CALL iom_rstput( kt, nitbkg_r, inum, 'rdastp' , zdate   )
             CALL iom_rstput( kt, nitbkg_r, inum, 'un'     , un      )
@@ -133,33 +115,32 @@
 #endif
             CALL iom_rstput( kt, nitbkg_r, inum, 'gcx'    , gcx     )
-
+            !
             CALL iom_close( inum )
-
          ENDIF
-
+         !
       ENDIF
 
-      IF ( kt == nitdin_r ) THEN
-
+      !                                !-------------------------------------------
+      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        
+            IF(lwp) WRITE(numout,*) ' Setting up assimilation background file '// TRIM( c_asmdin )
+            !
+            !                                      ! Define the output file        
             CALL iom_open( c_asmdin, inum, ldwrt = .TRUE., kiolib = jprstlib)
-
-            ! Treat special case when nitbkg = 0
-            IF ( nitdin_r == nit000 - 1) THEN
+            !
+            IF( nitdin_r == nit000 - 1 ) THEN      ! Treat special case when nitbkg = 0
+
                zdate = REAL( ndastp )
             ELSE
                zdate = REAL( ndastp )
             ENDIF
-
-            ! Write the information
+            !
+            !                                      ! Write the information
             CALL iom_rstput( kt, nitdin_r, inum, 'rdastp' , zdate   )
             CALL iom_rstput( kt, nitdin_r, inum, 'un'     , un      )
@@ -168,51 +149,34 @@
             CALL iom_rstput( kt, nitdin_r, inum, 'sn'     , sn      )
             CALL iom_rstput( kt, nitdin_r, inum, 'sshn'   , sshn    )
-
+            !
             CALL iom_close( inum )
-
          ENDIF
-
+         !
       ENDIF
-                                  
+      !                    
    END SUBROUTINE asm_bkg_wri
 
+
    SUBROUTINE asm_trj_wri( kt )
       !!-----------------------------------------------------------------------
-      !!
       !!                  ***  ROUTINE asm_trj_wri ***
       !!
-      !! ** Purpose : Write to file the model state trajectory for use with
-      !!              4D-Var.
-      !!
-      !! ** Method  : 
-      !!
-      !! ** Action  :
-      !!                   
-      !! References : 
-      !!
-      !! History :
-      !!        ! 07-04 (A. Weaver) 
-      !!        ! 09-03 (F. Vigilant) Add hmlp (zdfmxl) for no tracer nmldp=2 
-      !!        ! 09-06 (F. Vigilant) special case when kt=nit000-1
-      !!        ! 09-07 (F. Vigilant) add computation of eiv at restart
-      !!-----------------------------------------------------------------------
-
-      !! * Arguments
+      !! ** Purpose :   Write to file the model state trajectory for use with 4D-Var.
+      !!-----------------------------------------------------------------------
       INTEGER, INTENT( IN ) :: kt             ! Current time-step
-
-      !! * Local declarations
+      !
       INTEGER :: inum                  ! File unit number
       INTEGER :: it
       CHARACTER (LEN=50) :: cl_asmtrj
       REAL(wp) :: zdate            ! Date
+      !!-----------------------------------------------------------------------
 
       !------------------------------------------------------------------------
       ! Write a single file for each trajectory time step
       !------------------------------------------------------------------------
-      IF ( ( MOD( kt - nit000 + 1, nittrjfrq ) == 0 ) .OR. &
-         & ( kt == nitend ) ) THEN
+      IF( ( MOD( kt - nit000 + 1, nittrjfrq ) == 0 ) .OR. ( kt == nitend ) ) THEN
          
-         ! Treat special case when kt = nit000-1
-         IF ( kt == nit000 - 1 ) THEN
+         IF( kt == nit000 - 1 ) THEN         ! Treat special case when kt = nit000-1
+            !
 #if defined key_zdftke
             IF(lwp) WRITE(numout,*) ' Computing  zdf_tke coeff. form restart...'
@@ -238,15 +202,14 @@
             IF( lk_traldf_eiv )   CALL ldf_eiv( nit000 )
 #endif
-          ENDIF
-
-
+         ENDIF
+         !
          it = kt - nit000 + 1
-
-         ! Define the output file        
+         !
+         !                                   ! Define the output file        
          WRITE(cl_asmtrj, FMT='(A,A,I5.5)' ) TRIM( c_asmtrj ), '_', it
          cl_asmtrj = TRIM( cl_asmtrj )
          CALL iom_open( cl_asmtrj, inum, ldwrt = .TRUE., kiolib = jprstlib)
-
-         ! Output trajectory fields
+         !
+         !                                   ! Output trajectory fields
          CALL iom_rstput( it, it, inum, 'emp'   , emp    )
          CALL iom_rstput( it, it, inum, 'emps'  , emps   )
@@ -278,10 +241,10 @@
          CALL iom_rstput( it, it, inum, 'aeiv'  , aeiv   )
          CALL iom_rstput( it, it, inum, 'aeiw'  , aeiw   )
-
+         !
          CALL iom_close( inum )
-         
       ENDIF
-
+      !
    END SUBROUTINE asm_trj_wri
 
+   !!======================================================================
 END MODULE asmtrj
Index: /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/DIA/diaptr.F90
===================================================================
--- /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/DIA/diaptr.F90	(revision 2398)
+++ /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/DIA/diaptr.F90	(revision 2399)
@@ -6,5 +6,6 @@
    !! History :  1.0  ! 2003-09  (C. Talandier, G. Madec)  Original code
    !!            2.0  ! 2006-01  (A. Biastoch)  Allow sub-basins computation
-   !!            3.2  ! 2003-03  (O. Marti, S. Flavoni) Add fields
+   !!            3.2  ! 2010-03  (O. Marti, S. Flavoni) Add fields
+   !!            3.3  ! 2010-10  (G. Madec)  dynamical allocation
    !!----------------------------------------------------------------------
 
@@ -15,17 +16,17 @@
    !!   ptr_vjk      : "zonal" sum computation of a "meridional" flux array
    !!   ptr_tjk      : "zonal" mean computation of a tracer field
-   !!   ptr_vj       : "zonal" and vertical sum computation of a "meridional"
-   !!                : flux array; Generic interface: ptr_vj_3d, ptr_vj_2d
+   !!   ptr_vj       : "zonal" and vertical sum computation of a "meridional" flux array
+   !!                   (Generic interface to ptr_vj_3d, ptr_vj_2d)
    !!----------------------------------------------------------------------
-   USE oce           ! ocean dynamics and active tracers
-   USE dom_oce       ! ocean space and time domain
-   USE phycst        ! physical constants
-   USE ldftra_oce    ! ocean active tracers: lateral physics
-   USE dianam
-   USE iom
-   USE ioipsl         
-   USE in_out_manager
-   USE lib_mpp
-   USE lbclnk
+   USE oce              ! ocean dynamics and active tracers
+   USE dom_oce          ! ocean space and time domain
+   USE phycst           ! physical constants
+   USE ldftra_oce       ! ocean active tracers: lateral physics
+   USE dianam           !
+   USE iom              ! IOM library
+   USE ioipsl           ! IO-IPSL library
+   USE in_out_manager   ! I/O manager
+   USE lib_mpp          ! MPP library
+   USE lbclnk           ! lateral boundary condition - processor exchanges
 
    IMPLICIT NONE
@@ -46,54 +47,29 @@
    LOGICAL , PUBLIC ::   ln_diaznl  = .FALSE.   !: Add zonal means and meridional stream functions
    LOGICAL , PUBLIC ::   ln_ptrcomp = .FALSE.   !: Add decomposition : overturning (and gyre, soon ...)
-   INTEGER , PUBLIC ::   nf_ptr     = 15        !: frequency of ptr computation
-   INTEGER , PUBLIC ::   nf_ptr_wri = 15        !: frequency of ptr outputs
-
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   abasin, pbasin, ibasin, dbasin, sbasin   !: Sub basin masks
-
-   !                                                               !!! poleward heat and salt transport
-   REAL(wp), PUBLIC, DIMENSION(jpj) ::   pht_adv    , pst_adv       !: advection
-   REAL(wp), PUBLIC, DIMENSION(jpj) ::   pht_ldf    , pst_ldf       !: lateral diffusion
-   REAL(wp), PUBLIC, DIMENSION(jpj) ::   pht_ove_glo, pst_ove_glo   !: global       overturning
-   REAL(wp), PUBLIC, DIMENSION(jpj) ::   pht_ove_atl, pst_ove_atl   !: Atlantic     overturning
-   REAL(wp), PUBLIC, DIMENSION(jpj) ::   pht_ove_pac, pst_ove_pac   !: Pacific      overturning
-   REAL(wp), PUBLIC, DIMENSION(jpj) ::   pht_ove_ind, pst_ove_ind   !: Indian       overturning
-   REAL(wp), PUBLIC, DIMENSION(jpj) ::   pht_ove_ipc, pst_ove_ipc   !: Indo-Pacific overturning
-   REAL(wp), PUBLIC, DIMENSION(jpj) ::   ht_glo, ht_atl, ht_ind, ht_pac, ht_ipc   !: heat
-   REAL(wp), PUBLIC, DIMENSION(jpj) ::   st_glo, st_atl, st_ind, st_pac, st_ipc   !: salt
-
-   INTEGER ::   niter
-   INTEGER ::   nidom_ptr
-   INTEGER ::   numptr                                              !: logical unit for Poleward TRansports
-
-   REAL(wp), DIMENSION(jpj,jpk) ::   tn_jk_glo  , sn_jk_glo       ! global       i-mean temperature and salinity
-   REAL(wp), DIMENSION(jpj,jpk) ::   tn_jk_atl  , sn_jk_atl       ! Atlantic               -              -
-   REAL(wp), DIMENSION(jpj,jpk) ::   tn_jk_pac  , sn_jk_pac       ! Pacific                -              -
-   REAL(wp), DIMENSION(jpj,jpk) ::   tn_jk_ind  , sn_jk_ind       ! Indian                 -              -
-   REAL(wp), DIMENSION(jpj,jpk) ::   tn_jk_ipc  , sn_jk_ipc       ! Indo-Pacific           -              -
-   REAL(wp), DIMENSION(jpj,jpk) ::   v_msf_glo                    ! global       "meridional" Stream-Function
-   REAL(wp), DIMENSION(jpj,jpk) ::   v_msf_atl                    ! Atlantic               -              -
-   REAL(wp), DIMENSION(jpj,jpk) ::   v_msf_pac                    ! Pacific                -              -
-   REAL(wp), DIMENSION(jpj,jpk) ::   v_msf_ind                    ! Indian                 -              -
-   REAL(wp), DIMENSION(jpj,jpk) ::   v_msf_ipc                    ! Indo-Pacific           -              -
-   REAL(wp), DIMENSION(jpj,jpk) ::   surf_jk_glo, surf_jk_r_glo   ! surface of global       i-section and its inverse
-   REAL(wp), DIMENSION(jpj,jpk) ::   surf_jk_atl, surf_jk_r_atl   ! surface of Atlantic          -              -
-   REAL(wp), DIMENSION(jpj,jpk) ::   surf_jk_pac, surf_jk_r_pac   ! surface of Pacific           -              -
-   REAL(wp), DIMENSION(jpj,jpk) ::   surf_jk_ind, surf_jk_r_ind   ! surface of Indian            -              -
-   REAL(wp), DIMENSION(jpj,jpk) ::   surf_jk_ipc, surf_jk_r_ipc   ! surface of Indo-Pacific      -              -
-#if defined key_diaeiv
-   !                                                               !!! eddy induced velocity (bolus)
-   REAL(wp), PUBLIC, DIMENSION(jpj) ::   pht_eiv_glo, pst_eiv_glo   !: global       poleward heat and salt bolus advection
-   REAL(wp), PUBLIC, DIMENSION(jpj) ::   pht_eiv_atl, pst_eiv_atl   !: Atlantic         -                           -
-   REAL(wp), PUBLIC, DIMENSION(jpj) ::   pht_eiv_pac, pst_eiv_pac   !: Pacific          -                           -
-   REAL(wp), PUBLIC, DIMENSION(jpj) ::   pht_eiv_ind, pst_eiv_ind   !: Indian           -                           -
-   REAL(wp), PUBLIC, DIMENSION(jpj) ::   pht_eiv_ipc, pst_eiv_ipc   !: Indo-Pacific     -                           -
-
-   REAL(wp), DIMENSION(jpj,jpk) ::   v_msf_eiv_glo   ! global       "meridional" bolus Stream-Function
-   REAL(wp), DIMENSION(jpj,jpk) ::   v_msf_eiv_atl   ! Atlantic          -                   -
-   REAL(wp), DIMENSION(jpj,jpk) ::   v_msf_eiv_pac   ! Pacific           -                   -
-   REAL(wp), DIMENSION(jpj,jpk) ::   v_msf_eiv_ind   ! Indian            -                   -
-   REAL(wp), DIMENSION(jpj,jpk) ::   v_msf_eiv_ipc   ! Indo-Pacific      -                   -
-#endif
- 
+   INTEGER , PUBLIC ::   nn_fptr    = 15        !: frequency of ptr computation  [time step]
+   INTEGER , PUBLIC ::   nn_fwri    = 15        !: frequency of ptr outputs      [time step]
+
+   REAL(wp), PUBLIC, DIMENSION(:), ALLOCATABLE ::   htr_adv, htr_ldf, htr_ove   !: Heat TRansports (adv, diff, overturn.)
+   REAL(wp), PUBLIC, DIMENSION(:), ALLOCATABLE ::   str_adv, str_ldf, str_ove   !: Salt TRansports (adv, diff, overturn.)
+   
+   REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   btmsk                  ! T-point basin interior masks
+   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE ::   btm30                  ! mask out Southern Ocean (=0 south of 30°S)
+   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE ::   htr  , str             ! adv heat and salt transports (approx)
+   REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   tn_jk, sn_jk , v_msf   ! i-mean T and S, j-Stream-Function
+   REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   sjk  , r1_sjk          ! i-mean i-k-surface and its inverse        
+#if defined key_diaeiv
+   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE ::   htr_eiv, str_eiv   ! bolus adv heat ans salt transports    ('key_diaeiv')
+   REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   v_msf_eiv          ! bolus j-streamfuction                 ('key_diaeiv')
+#endif
+
+   INTEGER ::   niter       !
+   INTEGER ::   nidom_ptr   !
+   INTEGER ::   numptr      ! logical unit for Poleward TRansports
+   INTEGER ::   nptr        ! = 1 (ln_subbas=F) or = 5 (glo, atl, pac, ind, ipc) (ln_subbas=T) 
+
+   REAL(wp) ::   rc_sv    = 1.e-6_wp   ! conversion from m3/s to Sverdrup
+   REAL(wp) ::   rc_pwatt = 1.e-15_wp  ! conversion from W    to PW (further x rau0 x Cp)
+   REAL(wp) ::   rc_ggram = 1.e-6_wp   ! conversion from g    to Pg
+
    !! * Substitutions
 #  include "domzgr_substitute.h90"
@@ -102,7 +78,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -111,6 +86,5 @@
       !!                    ***  ROUTINE ptr_vj_3d  ***
       !!
-      !! ** Purpose :   "zonal" and vertical sum computation of a "meridional"
-      !!              flux array
+      !! ** Purpose :   i-k sum computation of a j-flux array
       !!
       !! ** Method  : - i-k sum of pva using the interior 2D vmask (vmask_i).
@@ -127,5 +101,5 @@
       !
       ijpj = jpj
-      p_fval(:) = 0.e0
+      p_fval(:) = 0._wp
       DO jk = 1, jpkm1
          DO jj = 2, jpjm1
@@ -137,5 +111,5 @@
       !
 #if defined key_mpp_mpi
-      CALL mpp_sum( p_fval, ijpj, ncomm_znl)     !!bug  I presume
+      CALL mpp_sum( p_fval, ijpj, ncomm_znl)
 #endif
       !
@@ -147,6 +121,5 @@
       !!                    ***  ROUTINE ptr_vj_2d  ***
       !!
-      !! ** Purpose :   "zonal" and vertical sum computation of a "meridional"
-      !!      flux array
+      !! ** Purpose :   "zonal" and vertical sum computation of a i-flux array
       !!
       !! ** Method  : - i-k sum of pva using the interior 2D vmask (vmask_i).
@@ -163,5 +136,5 @@
       ! 
       ijpj = jpj
-      p_fval(:) = 0.e0
+      p_fval(:) = 0._wp
       DO jj = 2, jpjm1
          DO ji = nldi, nlei   ! No vector optimisation here. Better use a mask ?
@@ -171,5 +144,5 @@
       !
 #if defined key_mpp_mpi
-      CALL mpp_sum( p_fval, ijpj, ncomm_znl )     !!bug  I presume
+      CALL mpp_sum( p_fval, ijpj, ncomm_znl )
 #endif
       ! 
@@ -177,17 +150,17 @@
 
 
-   FUNCTION ptr_vjk( pva, bmask )   RESULT ( p_fval )
+   FUNCTION ptr_vjk( pva, pmsk )   RESULT ( p_fval )
       !!----------------------------------------------------------------------
       !!                    ***  ROUTINE ptr_vjk  ***
       !!
-      !! ** Purpose :   "zonal" sum computation of a "meridional" flux array
+      !! ** Purpose :   i-sum computation of a j-velocity array
       !!
       !! ** Method  : - i-sum of pva using the interior 2D vmask (vmask_i).
-      !!      pva is supposed to be a masked flux (i.e. * vmask*e1v*e3v)
-      !!
-      !! ** Action  : - p_fval: i-k-mean poleward flux of pva
-      !!----------------------------------------------------------------------
-      REAL(wp) , INTENT(in), DIMENSION(jpi,jpj,jpk)           ::   pva     ! mask flux array at V-point
-      REAL(wp) , INTENT(in), DIMENSION(jpi,jpj)    , OPTIONAL ::   bmask   ! Optional 2D basin mask
+      !!              pva is supposed to be a masked flux (i.e. * vmask)
+      !!
+      !! ** Action  : - p_fval: i-mean poleward flux of pva
+      !!----------------------------------------------------------------------
+      REAL(wp) , INTENT(in), DIMENSION(jpi,jpj,jpk)           ::   pva    ! mask flux array at V-point
+      REAL(wp) , INTENT(in), DIMENSION(jpi,jpj)    , OPTIONAL ::   pmsk   ! Optional 2D basin mask
       !!
       INTEGER                      ::   ji, jj, jk   ! dummy loop arguments
@@ -200,13 +173,12 @@
       !!--------------------------------------------------------------------
       !
-      p_fval(:,:) = 0.e0
-      !
-      IF( PRESENT( bmask ) ) THEN 
+      p_fval(:,:) = 0._wp
+      !
+      IF( PRESENT( pmsk ) ) THEN 
          DO jk = 1, jpkm1
             DO jj = 2, jpjm1
 !!gm here, use of tmask_i  ==> no need of loop over nldi, nlei....
                DO ji =  nldi, nlei   ! No vector optimisation here. Better use a mask ?
-                  p_fval(jj,jk) = p_fval(jj,jk) + pva(ji,jj,jk) * e1v(ji,jj) * fse3v(ji,jj,jk)   &
-                     &                                          * tmask_i(ji,jj) * bmask(ji,jj)
+                  p_fval(jj,jk) = p_fval(jj,jk) + pva(ji,jj,jk) * e1v(ji,jj) * fse3v(ji,jj,jk) * pmsk(ji,jj)
                END DO
             END DO
@@ -216,6 +188,5 @@
             DO jj = 2, jpjm1
                DO ji =  nldi, nlei   ! No vector optimisation here. Better use a mask ?
-                  p_fval(jj,jk) = p_fval(jj,jk) + pva(ji,jj,jk) * e1v(ji,jj) * fse3v(ji,jj,jk)   &
-                     &                                          * tmask_i(ji,jj)
+                  p_fval(jj,jk) = p_fval(jj,jk) + pva(ji,jj,jk) * e1v(ji,jj) * fse3v(ji,jj,jk) * tmask_i(ji,jj)
                END DO
             END DO
@@ -233,18 +204,16 @@
 
 
-   FUNCTION ptr_tjk( pta, bmask )   RESULT ( p_fval )
+   FUNCTION ptr_tjk( pta, pmsk )   RESULT ( p_fval )
       !!----------------------------------------------------------------------
       !!                    ***  ROUTINE ptr_tjk  ***
       !!
-      !! ** Purpose :   "zonal" mean computation of a tracer field
+      !! ** Purpose :   i-sum computation of e1t*e3t * a tracer field
       !!
       !! ** Method  : - i-sum of mj(pta) using tmask
-      !!      multiplied by the inverse of the surface of the "zonal" ocean
-      !!      section
-      !!
-      !! ** Action  : - p_fval: i-k-mean poleward flux of pta
+      !!
+      !! ** Action  : - p_fval: i-sum of e1t*e3t*pta
       !!----------------------------------------------------------------------
       REAL(wp) , INTENT(in), DIMENSION(jpi,jpj,jpk) ::   pta    ! tracer flux array at T-point
-      REAL(wp) , INTENT(in), DIMENSION(jpi,jpj), OPTIONAL :: bmask ! Optional 2D basin mask
+      REAL(wp) , INTENT(in), DIMENSION(jpi,jpj)     ::   pmsk   ! Optional 2D basin mask
       !!
       INTEGER                     ::   ji, jj, jk   ! dummy loop arguments
@@ -257,33 +226,17 @@
       !!-------------------------------------------------------------------- 
       !
-      p_fval(:,:) = 0.e0
-      IF (PRESENT (bmask)) THEN 
-         DO jk = 1, jpkm1
-            DO jj = 2, jpjm1
-               DO ji =  nldi, nlei   ! No vector optimisation here. Better use a mask ?
-                  p_fval(jj,jk) = p_fval(jj,jk) + pta(ji,jj,jk)                  &
-                     &                          * e1t(ji,jj) * fse3t(ji,jj,jk)   &
-                     &                          * tmask_i(ji,jj)                 &
-                     &                          * bmask(ji,jj)
-               END DO
+      p_fval(:,:) = 0._wp
+      DO jk = 1, jpkm1
+         DO jj = 2, jpjm1
+            DO ji =  nldi, nlei   ! No vector optimisation here. Better use a mask ?
+               p_fval(jj,jk) = p_fval(jj,jk) + pta(ji,jj,jk) * e1t(ji,jj) * fse3t(ji,jj,jk) * pmsk(ji,jj)
             END DO
          END DO
-      ELSE 
-         DO jk = 1, jpkm1
-            DO jj = 2, jpjm1
-               DO ji =  nldi, nlei   ! No vector optimisation here. Better use a mask ?
-                  p_fval(jj,jk) = p_fval(jj,jk) + pta(ji,jj,jk)                  &
-                     &                          * e1t(ji,jj) * fse3t(ji,jj,jk)   &
-                     &                          * tmask_i(ji,jj)
-               END DO
-            END DO
-         END DO
-      END IF
-      p_fval(:,:) = p_fval(:,:) * 0.5
+      END DO
 #if defined key_mpp_mpi
       ish(1) = jpj*jpk   ;   ish2(1) = jpj   ;   ish2(2) = jpk
       zwork(:)= RESHAPE( p_fval, ish )
       CALL mpp_sum( zwork, jpj*jpk, ncomm_znl )
-      p_fval(:,:)= RESHAPE(zwork,ish2)
+      p_fval(:,:)= RESHAPE( zwork, ish2 )
 #endif
       !
@@ -295,195 +248,94 @@
       !!                  ***  ROUTINE dia_ptr  ***
       !!----------------------------------------------------------------------
+      USE oce,     vt  =>   ua   ! use ua as workspace
+      USE oce,     vs  =>   ua   ! use ua as workspace
+      !!
       INTEGER, INTENT(in) ::   kt   ! ocean time step index
-      !!
-      INTEGER  ::   jk, jj, ji   ! dummy loop
-      REAL(wp) ::   zsverdrup    ! conversion from m3/s to Sverdrup
-      REAL(wp) ::   zpwatt       ! conversion from W    to PW
-      REAL(wp) ::   zggram       ! conversion from g    to Pg
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   vt, vs   ! 3D workspace
-      !!----------------------------------------------------------------------
-
-      IF( kt == nit000 .OR. MOD( kt, nf_ptr ) == 0 )   THEN
-
-         IF ( MOD( kt, nf_ptr ) == 0 ) THEN 
-
-            zsverdrup = 1.e-6
-            zpwatt    = 1.e-15
-            zggram    = 1.e-6
-
-            IF ( ln_diaznl ) THEN
-               ! "zonal" mean temperature and salinity at V-points
-               tn_jk_glo(:,:) = ptr_tjk( tn(:,:,:) ) * surf_jk_r_glo(:,:)
-               sn_jk_glo(:,:) = ptr_tjk( sn(:,:,:) ) * surf_jk_r_glo(:,:)
-
-               IF (ln_subbas) THEN 
-                  tn_jk_atl(:,:) = ptr_tjk( tn(:,:,:), abasin(:,:) ) * surf_jk_r_atl(:,:)
-                  sn_jk_atl(:,:) = ptr_tjk( sn(:,:,:), abasin(:,:) ) * surf_jk_r_atl(:,:)
-                  tn_jk_pac(:,:) = ptr_tjk( tn(:,:,:), pbasin(:,:) ) * surf_jk_r_pac(:,:)
-                  sn_jk_pac(:,:) = ptr_tjk( sn(:,:,:), pbasin(:,:) ) * surf_jk_r_pac(:,:)
-                  tn_jk_ind(:,:) = ptr_tjk( tn(:,:,:), ibasin(:,:) ) * surf_jk_r_ind(:,:)
-                  sn_jk_ind(:,:) = ptr_tjk( sn(:,:,:), ibasin(:,:) ) * surf_jk_r_ind(:,:)
-                  tn_jk_ipc(:,:) = ptr_tjk( tn(:,:,:), dbasin(:,:) ) * surf_jk_r_ipc(:,:)
-                  sn_jk_ipc(:,:) = ptr_tjk( sn(:,:,:), dbasin(:,:) ) * surf_jk_r_ipc(:,:)
-               ENDIF
-            ENDIF
-
-            !--------------------------------------------------------
-            ! overturning calculation:
-
-            ! horizontal integral and vertical dz 
-
-#if defined key_diaeiv
-            v_msf_glo(:,:) = ptr_vjk( vn(:,:,:)+v_eiv(:,:,:) ) 
-            IF( ln_subbas .AND. ln_diaznl ) THEN
-               v_msf_atl(:,:) = ptr_vjk( vn(:,:,:)+v_eiv(:,:,:), abasin(:,:)*sbasin(:,:) ) 
-               v_msf_pac(:,:) = ptr_vjk( vn(:,:,:)+v_eiv(:,:,:), pbasin(:,:)*sbasin(:,:) ) 
-               v_msf_ind(:,:) = ptr_vjk( vn(:,:,:)+v_eiv(:,:,:), ibasin(:,:)*sbasin(:,:) ) 
-               v_msf_ipc(:,:) = ptr_vjk( vn(:,:,:)+v_eiv(:,:,:), dbasin(:,:)*sbasin(:,:) ) 
-            ENDIF
-#else
-            v_msf_glo(:,:) = ptr_vjk( vn(:,:,:) ) 
-            IF( ln_subbas .AND. ln_diaznl ) THEN
-               v_msf_atl(:,:) = ptr_vjk( vn(:,:,:), abasin(:,:)*sbasin(:,:) ) 
-               v_msf_pac(:,:) = ptr_vjk( vn(:,:,:), pbasin(:,:)*sbasin(:,:) ) 
-               v_msf_ind(:,:) = ptr_vjk( vn(:,:,:), ibasin(:,:)*sbasin(:,:) ) 
-               v_msf_ipc(:,:) = ptr_vjk( vn(:,:,:), dbasin(:,:)*sbasin(:,:) ) 
-            ENDIF
-#endif
-
-#if defined key_diaeiv
-            v_msf_eiv_glo(:,:) = ptr_vjk( v_eiv(:,:,:) )
-            IF (ln_subbas ) THEN 
-               v_msf_eiv_atl(:,:) = ptr_vjk( v_eiv(:,:,:), abasin(:,:)*sbasin(:,:) )
-               v_msf_eiv_pac(:,:) = ptr_vjk( v_eiv(:,:,:), pbasin(:,:)*sbasin(:,:) )
-               v_msf_eiv_ind(:,:) = ptr_vjk( v_eiv(:,:,:), ibasin(:,:)*sbasin(:,:) )
-               v_msf_eiv_ipc(:,:) = ptr_vjk( v_eiv(:,:,:), dbasin(:,:)*sbasin(:,:) )
-            END IF
-#endif
-
-            ! Transports
-            ! T times V on T points (include bolus velocities)
-#if defined key_diaeiv 
-            DO jj = 2, jpj
-               DO ji = 1, jpi
-                  vt(ji,jj,:) = tn(ji,jj,:) * ( vn(ji,jj,:) + vn(ji,jj-1,:) + u_eiv(ji,jj,:) + u_eiv(ji,jj-1,:) )*0.5
-                  vs(ji,jj,:) = sn(ji,jj,:) * ( vn(ji,jj,:) + vn(ji,jj-1,:) + v_eiv(ji,jj,:) + v_eiv(ji,jj-1,:) )*0.5
-               END DO
-            END DO
-#else
-            DO jj = 2, jpj
-               DO ji = 1, jpi
-                  vt(ji,jj,:) = tn(ji,jj,:) * ( vn(ji,jj,:) + vn(ji,jj-1,:) )*0.5
-                  vs(ji,jj,:) = sn(ji,jj,:) * ( vn(ji,jj,:) + vn(ji,jj-1,:) )*0.5
-               END DO
-            END DO
-#endif 
-            CALL lbc_lnk( vs, 'V', -1. )   ;   CALL lbc_lnk( vt, 'V', -1. )
-
-            ht_glo(:) = SUM( ptr_vjk( vt(:,:,:)), 2 )
-            st_glo(:) = SUM( ptr_vjk( vs(:,:,:)), 2 )
-
-            IF ( ln_subbas ) THEN 
-               ht_atl(:) = SUM( ptr_vjk( vt (:,:,:), abasin(:,:)*sbasin(:,:)), 2 )
-               ht_pac(:) = SUM( ptr_vjk( vt (:,:,:), pbasin(:,:)*sbasin(:,:)), 2 )
-               ht_ind(:) = SUM( ptr_vjk( vt (:,:,:), ibasin(:,:)*sbasin(:,:)), 2 )
-               ht_ipc(:) = SUM( ptr_vjk( vt (:,:,:), dbasin(:,:)*sbasin(:,:)), 2 )
-               st_atl(:) = SUM( ptr_vjk( vs (:,:,:), abasin(:,:)*sbasin(:,:)), 2 )
-               st_pac(:) = SUM( ptr_vjk( vs (:,:,:), pbasin(:,:)*sbasin(:,:)), 2 )
-               st_ind(:) = SUM( ptr_vjk( vs (:,:,:), ibasin(:,:)*sbasin(:,:)), 2 )
-               st_ipc(:) = SUM( ptr_vjk( vs (:,:,:), dbasin(:,:)*sbasin(:,:)), 2 )
-            ENDIF
-
-            ! poleward tracer transports: 
-            ! overturning components:
-            IF ( ln_ptrcomp ) THEN 
-               pht_ove_glo(:) = SUM( v_msf_glo(:,:) * tn_jk_glo(:,:), 2 )   ! SUM over jk
-               pst_ove_glo(:) = SUM( v_msf_glo(:,:) * sn_jk_glo(:,:), 2 )  
-               IF ( ln_subbas ) THEN 
-                  pht_ove_atl(:) = SUM( v_msf_atl(:,:) * tn_jk_atl(:,:), 2 )   ! SUM over jk
-                  pst_ove_atl(:) = SUM( v_msf_atl(:,:) * sn_jk_atl(:,:), 2 )  
-                  pht_ove_pac(:) = SUM( v_msf_pac(:,:) * tn_jk_pac(:,:), 2 )   ! SUM over jk
-                  pst_ove_pac(:) = SUM( v_msf_pac(:,:) * sn_jk_pac(:,:), 2 )  
-                  pht_ove_ind(:) = SUM( v_msf_ind(:,:) * tn_jk_ind(:,:), 2 )   ! SUM over jk
-                  pst_ove_ind(:) = SUM( v_msf_ind(:,:) * sn_jk_ind(:,:), 2 )  
-                  pht_ove_ipc(:) = SUM( v_msf_ipc(:,:) * tn_jk_ipc(:,:), 2 )   ! SUM over jk
-                  pst_ove_ipc(:) = SUM( v_msf_ipc(:,:) * sn_jk_ipc(:,:), 2 )  
-               END IF
-            END IF
-
-            ! Bolus component
-#if defined key_diaeiv
-            pht_eiv_glo(:) = SUM( v_msf_eiv_glo(:,:) * tn_jk_glo(:,:), 2 )   ! SUM over jk
-            pst_eiv_glo(:) = SUM( v_msf_eiv_glo(:,:) * sn_jk_glo(:,:), 2 )   ! SUM over jk
-            IF ( ln_subbas ) THEN 
-               pht_eiv_atl(:) = SUM( v_msf_eiv_glo(:,:) * tn_jk_atl(:,:), 2 )   ! SUM over jk
-               pst_eiv_atl(:) = SUM( v_msf_eiv_glo(:,:) * sn_jk_atl(:,:), 2 )   ! SUM over jk
-               pht_eiv_pac(:) = SUM( v_msf_eiv_pac(:,:) * tn_jk_pac(:,:), 2 )   ! SUM over jk
-               pst_eiv_pac(:) = SUM( v_msf_eiv_pac(:,:) * sn_jk_pac(:,:), 2 )   ! SUM over jk
-               pht_eiv_ind(:) = SUM( v_msf_eiv_ind(:,:) * tn_jk_ind(:,:), 2 )   ! SUM over jk
-               pst_eiv_ind(:) = SUM( v_msf_eiv_ind(:,:) * sn_jk_ind(:,:), 2 )   ! SUM over jk
-               pht_eiv_ipc(:) = SUM( v_msf_eiv_ipc(:,:) * tn_jk_ipc(:,:), 2 )   ! SUM over jk
-               pst_eiv_ipc(:) = SUM( v_msf_eiv_ipc(:,:) * sn_jk_ipc(:,:), 2 )   ! SUM over jk
-            ENDIF
-#endif
-
-            ! conversion in PW and G g
-            zpwatt = zpwatt * rau0 * rcp
-            pht_adv(:) = pht_adv(:) * zpwatt  
-            pht_ldf(:) = pht_ldf(:) * zpwatt
-            pst_adv(:) = pst_adv(:) * zggram
-            pst_ldf(:) = pst_ldf(:) * zggram
-            IF ( ln_ptrcomp ) THEN 
-               pht_ove_glo(:) = pht_ove_glo(:) * zpwatt
-               pst_ove_glo(:) = pst_ove_glo(:) * zggram
-            END IF
-#if defined key_diaeiv
-            pht_eiv_glo(:) = pht_eiv_glo(:) * zpwatt
-            pst_eiv_glo(:) = pst_eiv_glo(:) * zggram
-#endif
-            IF( ln_subbas ) THEN
-               ht_atl(:) = ht_atl(:) * zpwatt
-               ht_pac(:) = ht_pac(:) * zpwatt
-               ht_ind(:) = ht_ind(:) * zpwatt
-               ht_ipc(:) = ht_ipc(:) * zpwatt
-               st_atl(:) = st_atl(:) * zggram 
-               st_pac(:) = st_pac(:) * zggram
-               st_ind(:) = st_ind(:) * zggram
-               st_ipc(:) = st_ipc(:) * zggram
-            ENDIF
-
-            ! "Meridional" Stream-Function
-            DO jk = 2,jpk 
-               v_msf_glo(:,jk) = v_msf_glo(:,jk-1) + v_msf_glo(:,jk)
-            END DO
-            v_msf_glo(:,:) = v_msf_glo(:,:) * zsverdrup
-#if defined key_diaeiv
-            ! Bolus "Meridional" Stream-Function
-            DO jk = 2,jpk
-               v_msf_eiv_glo(:,jk) = v_msf_eiv_glo(:,jk-1) + v_msf_eiv_glo(:,jk)
-            END DO
-            v_msf_eiv_glo(:,:) = v_msf_eiv_glo(:,:) * zsverdrup
-            IF ( ln_subbas ) THEN 
-               DO jk = 2,jpk
-                  v_msf_eiv_atl(:,jk) = v_msf_eiv_atl(:,jk-1) + v_msf_eiv_atl(:,jk)
-                  v_msf_eiv_pac(:,jk) = v_msf_eiv_pac(:,jk-1) + v_msf_eiv_pac(:,jk)
-                  v_msf_eiv_ind(:,jk) = v_msf_eiv_ind(:,jk-1) + v_msf_eiv_ind(:,jk)
-                  v_msf_eiv_ipc(:,jk) = v_msf_eiv_ipc(:,jk-1) + v_msf_eiv_ipc(:,jk)
+      !
+      INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices
+      REAL(wp) ::   zv               ! local scalar
+      !!----------------------------------------------------------------------
+      !
+      IF( kt == nit000 .OR. MOD( kt, nn_fptr ) == 0 )   THEN
+         !
+         IF( MOD( kt, nn_fptr ) == 0 ) THEN 
+            !
+            IF( ln_diaznl ) THEN               ! i-mean temperature and salinity
+               DO jn = 1, nptr
+                  tn_jk(:,:,jn) = ptr_tjk( tn(:,:,:), btmsk(:,:,jn) ) * r1_sjk(:,:,jn)
                END DO
             ENDIF
-#endif
             !
-            IF( ln_subbas .AND. ln_diaznl ) THEN
-               DO jk = 2,jpk 
-                  v_msf_atl(:,jk) = v_msf_atl(:,jk-1) + v_msf_atl(:,jk)
-                  v_msf_pac(:,jk) = v_msf_pac(:,jk-1) + v_msf_pac(:,jk)
-                  v_msf_ind(:,jk) = v_msf_ind(:,jk-1) + v_msf_ind(:,jk)
-                  v_msf_ipc(:,jk) = v_msf_ipc(:,jk-1) + v_msf_ipc(:,jk)
+            !                          ! horizontal integral and vertical dz 
+            !                                ! eulerian velocity
+            v_msf(:,:,1) = ptr_vjk( vn(:,:,:) ) 
+            DO jn = 2, nptr
+               v_msf(:,:,jn) = ptr_vjk( vn(:,:,:), btmsk(:,:,jn)*btm30(:,:) ) 
+            END DO
+#if defined key_diaeiv
+            DO jn = 1, nptr                  ! bolus velocity
+               v_msf_eiv(:,:,jn) = ptr_vjk( v_eiv(:,:,:), btmsk(:,:,jn) )   ! here no btm30 for MSFeiv
+            END DO
+            !                                ! add bolus stream-function to the eulerian one
+            v_msf(:,:,:) = v_msf(:,:,:) + v_msf_eiv(:,:,:)
+#endif
+            !
+            !                          ! Transports
+            !                                ! local heat & salt transports at T-points  ( tn*mj[vn+v_eiv] )
+            vt(:,:,jpk) = 0._wp   ;   vs(:,:,jpk) = 0._wp
+            DO jk= 1, jpkm1
+               DO jj = 2, jpj
+                  DO ji = 1, jpi
+#if defined key_diaeiv 
+                     zv = ( vn(ji,jj,jk) + vn(ji,jj-1,jk) + u_eiv(ji,jj,jk) + u_eiv(ji,jj-1,jk) ) * 0.5_wp
+#else
+                     zv = ( vn(ji,jj,jk) + vn(ji,jj-1,jk) ) * 0.5_wp
+#endif 
+                     vt(:,jj,jk) = zv * tn(:,jj,jk)
+                     vs(:,jj,jk) = zv * sn(:,jj,jk)
+                  END DO
                END DO
-               v_msf_atl(:,:) = v_msf_atl(:,:) * zsverdrup
-               v_msf_pac(:,:) = v_msf_pac(:,:) * zsverdrup
-               v_msf_ind(:,:) = v_msf_ind(:,:) * zsverdrup
-               v_msf_ipc(:,:) = v_msf_ipc(:,:) * zsverdrup
-            ENDIF
+            END DO
+!!gm useless as overlap areas are not used in ptr_vjk
+            CALL lbc_lnk( vs, 'V', -1. )   ;   CALL lbc_lnk( vt, 'V', -1. )
+!!gm
+            !                                ! heat & salt advective transports (approximation)
+            htr(:,1) = SUM( ptr_vjk( vt(:,:,:) ) , 2 ) * rc_pwatt   ! SUM over jk + conversion
+            str(:,1) = SUM( ptr_vjk( vs(:,:,:) ) , 2 ) * rc_ggram
+            DO jn = 2, nptr 
+               htr(:,jn) = SUM( ptr_vjk( vt(:,:,:), btmsk(:,:,jn)*btm30(:,:) ) , 2 ) * rc_pwatt   ! mask Southern Ocean
+               str(:,jn) = SUM( ptr_vjk( vs(:,:,:), btmsk(:,:,jn)*btm30(:,:) ) , 2 ) * rc_ggram   ! mask Southern Ocean
+            END DO
+
+            IF( ln_ptrcomp ) THEN            ! overturning transport
+               htr_ove(:) = SUM( v_msf(:,:,1) * tn_jk(:,:,1), 2 ) * rc_pwatt   ! SUM over jk + conversion
+               str_ove(:) = SUM( v_msf(:,:,1) * sn_jk(:,:,1), 2 ) * rc_ggram
+            END IF
+            !                                ! Advective and diffusive transport
+            htr_adv(:) = htr_adv(:) * rc_pwatt        ! these are computed in tra_adv... and tra_ldf... routines 
+            htr_ldf(:) = htr_ldf(:) * rc_pwatt        ! here just the conversion in PW and Gg
+            str_adv(:) = str_adv(:) * rc_ggram
+            str_ldf(:) = str_ldf(:) * rc_ggram
+
+#if defined key_diaeiv
+            DO jn = 1, nptr                  ! Bolus component
+               htr_eiv(:,jn) = SUM( v_msf_eiv(:,:,jn) * tn_jk(:,:,jn), 2 ) * rc_pwatt   ! SUM over jk
+               str_eiv(:,jn) = SUM( v_msf_eiv(:,:,jn) * sn_jk(:,:,jn), 2 ) * rc_ggram   ! SUM over jk
+            END DO
+#endif
+            !                                ! "Meridional" Stream-Function
+            DO jn = 1, nptr
+               DO jk = 2, jpk 
+                  v_msf    (:,jk,jn) = v_msf    (:,jk-1,jn) + v_msf    (:,jk,jn)       ! Eulerian j-Stream-Function
+#if defined key_diaeiv
+                  v_msf_eiv(:,jk,jn) = v_msf_eiv(:,jk-1,jn) + v_msf_eiv(:,jk,jn)       ! Bolus    j-Stream-Function
+
+#endif
+               END DO
+            END DO
+            v_msf    (:,:,:) = v_msf    (:,:,:) * rc_sv       ! converte in Sverdrups
+#if defined key_diaeiv
+            v_msf_eiv(:,:,:) = v_msf_eiv(:,:,:) * rc_sv
+#endif
          ENDIF
          !
@@ -503,71 +355,87 @@
       !! ** Purpose :   Initialization, namelist read
       !!----------------------------------------------------------------------
-      INTEGER ::   inum       ! temporary logical unit
+      INTEGER ::   jn           ! dummy loop indices 
+      INTEGER ::   inum, ierr   ! local integers
 #if defined key_mpp_mpi
       INTEGER, DIMENSION(1) :: iglo, iloc, iabsf, iabsl, ihals, ihale, idid
 #endif
       !!
-      NAMELIST/namptr/ ln_diaptr, ln_diaznl, ln_subbas, ln_ptrcomp, nf_ptr, nf_ptr_wri
-      !!----------------------------------------------------------------------
-
-      REWIND ( numnam )              ! Read Namelist namptr : poleward transport parameters
-      READ   ( numnam, namptr )
-
-      IF(lwp) THEN                   ! Control print
+      NAMELIST/namptr/ ln_diaptr, ln_diaznl, ln_subbas, ln_ptrcomp, nn_fptr, nn_fwri
+      !!----------------------------------------------------------------------
+
+      REWIND( numnam )                 ! Read Namelist namptr : poleward transport parameters
+      READ  ( numnam, namptr )
+
+      IF(lwp) THEN                     ! Control print
          WRITE(numout,*)
          WRITE(numout,*) 'dia_ptr_init : poleward transport and msf initialization'
          WRITE(numout,*) '~~~~~~~~~~~~'
          WRITE(numout,*) '   Namelist namptr : set ptr parameters'
-         WRITE(numout,*) '      Switch for ptr diagnostic (T) or not (F)  ln_diaptr  = ', ln_diaptr
-         WRITE(numout,*) '      Atl/Pac/Ind basins computation            ln_subbas  = ', ln_subbas
-         WRITE(numout,*) '      Frequency of computation                  nf_ptr     = ', nf_ptr
-         WRITE(numout,*) '      Frequency of outputs                      nf_ptr_wri = ', nf_ptr_wri
+         WRITE(numout,*) '      Poleward heat & salt transport (T) or not (F)      ln_diaptr  = ', ln_diaptr
+         WRITE(numout,*) '      Overturning heat & salt transport                  ln_ptrcomp = ', ln_ptrcomp
+         WRITE(numout,*) '      T & S zonal mean and meridional stream function    ln_diaznl  = ', ln_diaznl 
+         WRITE(numout,*) '      Global (F) or glo/Atl/Pac/Ind/Indo-Pac basins      ln_subbas  = ', ln_subbas
+         WRITE(numout,*) '      Frequency of computation                           nn_fptr    = ', nn_fptr
+         WRITE(numout,*) '      Frequency of outputs                               nn_fwri    = ', nn_fwri
       ENDIF
 
-      IF( .NOT. ln_diaptr )   RETURN
-      
-      IF( lk_mpp )   CALL mpp_ini_znl      ! Define MPI communicator for zonal sum
-
-      IF( ln_subbas ) THEN                 ! load sub-basin mask
-         CALL iom_open( 'subbasins', inum )
-         CALL iom_get( inum, jpdom_data, 'atlmsk', abasin )      ! Atlantic basin
-         CALL iom_get( inum, jpdom_data, 'pacmsk', pbasin )      ! Pacific basin
-         CALL iom_get( inum, jpdom_data, 'indmsk', ibasin )      ! Indian basin
-         CALL iom_close( inum )
-         dbasin(:,:) = MAX ( pbasin(:,:), ibasin(:,:) )
-         sbasin(:,:) = tmask (:,:,1)
-         WHERE ( gphit (:,:) < -30.e0) sbasin(:,:) = 0.e0
+      IF( ln_subbas ) THEN   ;   nptr = 5       ! Global, Atlantic, Pacific, Indian, Indo-Pacific
+      ELSE                   ;   nptr = 1       ! Global only
+      ENDIF
+
+      rc_pwatt = rc_pwatt * rau0 * rcp          ! conversion from K.s-1 to PetaWatt
+
+      IF( .NOT. ln_diaptr ) THEN       ! diaptr not used
+        RETURN
+      ELSE                             ! Allocate the diaptr arrays
+         ALLOCATE( btmsk(jpi,jpj,nptr) ,                                                                      &
+            &      htr_adv(jpj) , str_adv(jpj) , htr_ldf(jpj) , str_ldf(jpj) , htr_ove(jpj) , str_ove(jpj),   &
+            &      htr(jpj,nptr) , str(jpj,nptr) ,                                                              &
+            &      tn_jk(jpj,jpk,nptr) , sn_jk (jpj,jpk,nptr) , v_msf(jpj,jpk,nptr) ,                         &
+            &      sjk  (jpj,jpk,nptr) , r1_sjk(jpj,jpk,nptr)                       , STAT=ierr  )
+         !
+         IF( ierr > 0 ) THEN
+            CALL ctl_stop( 'dia_ptr_init : unable to allocate standard arrays' )   ;   RETURN
+         ENDIF
+#if defined key_diaeiv
+!!       IF( lk_diaeiv )   &              ! eddy induced velocity arrays
+            ALLOCATE( htr_eiv(jpj,nptr) , str_eiv(jpj,nptr) , v_msf_eiv(jpj,jpk,nptr) , STAT=ierr )
+         !
+         IF( ierr > 0 ) THEN
+            CALL ctl_stop( 'dia_ptr_init : unable to allocate eiv arrays' )   ;   RETURN
+         ENDIF
+#endif
       ENDIF
       
-!!gm CAUTION : this is only valid in fixed volume case !
-
-      ! inverse of the ocean "zonal" v-point section
-      surf_jk_glo(:,:) = ptr_tjk( tmask(:,:,:) )
-      surf_jk_r_glo(:,:) = 0.e0
-      WHERE( surf_jk_glo(:,:) /= 0.e0 )   surf_jk_r_glo(:,:) = 1.e0 / surf_jk_glo(:,:)
+      IF( lk_mpp )   CALL mpp_ini_znl     ! Define MPI communicator for zonal sum
+
+      IF( ln_subbas ) THEN                ! load sub-basin mask
+         CALL iom_open( 'subbasins', inum )
+         CALL iom_get( inum, jpdom_data, 'atlmsk', btmsk(:,:,2) )   ! Atlantic basin
+         CALL iom_get( inum, jpdom_data, 'pacmsk', btmsk(:,:,3) )   ! Pacific  basin
+         CALL iom_get( inum, jpdom_data, 'indmsk', btmsk(:,:,4) )   ! Indian   basin
+         CALL iom_close( inum )
+         btmsk(:,:,5) = MAX ( btmsk(:,:,3), btmsk(:,:,4) )          ! Indo-Pacific basin
+         WHERE( gphit(:,:) < -30._wp)   ;   btm30(:,:) = 0._wp      ! mask out Southern Ocean
+         ELSE WHERE                     ;   btm30(:,:) = tmask(:,:,1)
+         END WHERE
+      ENDIF
+      btmsk(:,:,1) = tmask_i(:,:)                                   ! global ocean
       
-      IF (ln_subbas) THEN
-         surf_jk_atl(:,:) = ptr_tjk( tmask (:,:,:), abasin(:,:) )
-         surf_jk_r_atl(:,:) = 0.e0
-         WHERE( surf_jk_atl(:,:) /= 0.e0 )   surf_jk_r_atl(:,:) = 1.e0 / surf_jk_atl(:,:)
-         !
-         surf_jk_pac(:,:) = ptr_tjk( tmask (:,:,:), pbasin(:,:) )
-         surf_jk_r_pac(:,:) = 0.e0
-         WHERE( surf_jk_pac(:,:) /= 0.e0 )   surf_jk_r_pac(:,:) = 1.e0 / surf_jk_pac(:,:)
-         ! 
-         surf_jk_ind(:,:) = ptr_tjk( tmask (:,:,:), ibasin(:,:) )
-         surf_jk_r_ind(:,:) = 0.e0
-         WHERE( surf_jk_ind(:,:) /= 0.e0 )   surf_jk_r_ind(:,:) = 1.e0 / surf_jk_ind(:,:)
-         !
-         surf_jk_ipc(:,:) = ptr_tjk( tmask (:,:,:), dbasin(:,:) )
-         surf_jk_r_ipc(:,:) = 0.e0
-         WHERE( surf_jk_ipc(:,:) /= 0.e0 )   surf_jk_r_ipc(:,:) = 1.e0 / surf_jk_ipc(:,:)
-      END IF
-
+      DO jn = 1, nptr
+         btmsk(:,:,jn) = btmsk(:,:,jn) * tmask_i(:,:)               ! interior domain only
+      END DO
       
-      !!----------------------------------------------------------------------
+      IF( lk_vvl )   CALL ctl_stop( 'diaptr: error in vvl case as constant i-mean surface is used' )
+
+      !                                   ! i-sum of e1v*e3v surface and its inverse
+      DO jn = 1, nptr
+         sjk(:,:,jn) = ptr_tjk( tmask(:,:,:), btmsk(:,:,jn) )
+         r1_sjk(:,:,jn) = 0._wp
+         WHERE( sjk(:,:,jn) /= 0._wp )   r1_sjk(:,:,jn) = 1._wp / sjk(:,:,jn)
+      END DO
 
 #if defined key_mpp_mpi 
-      iglo (1) = jpjglo
+      iglo (1) = jpjglo                   ! MPP case using MPI  ('key_mpp_mpi')
       iloc (1) = nlcj
       iabsf(1) = njmppt(narea)
@@ -576,14 +444,5 @@
       ihale(1) = nlcj - nlej
       idid (1) = 2
-
-!-$$      IF(lwp) THEN
-!-$$          WRITE(numout,*)
-!-$$          WRITE(numout,*) 'dia_ptr_init :   iloc  = ', iloc 
-!-$$          WRITE(numout,*) '~~~~~~~~~~~~     iabsf = ', iabsf
-!-$$          WRITE(numout,*) '                 ihals = ', ihals
-!-$$          WRITE(numout,*) '                 ihale = ', ihale
-!-$$      ENDIF 
-
-      CALL flio_dom_set ( jpnj, nproc/jpni, idid, iglo, iloc, iabsf, iabsl, ihals, ihale, 'BOX', nidom_ptr)
+      CALL flio_dom_set( jpnj, nproc/jpni, idid, iglo, iloc, iabsf, iabsl, ihals, ihale, 'BOX', nidom_ptr )
 #else
       nidom_ptr = FLIO_DOM_NONE
@@ -610,5 +469,5 @@
       INTEGER, SAVE, DIMENSION (jpj*jpk) ::         ndex_atl_30  , ndex_pac_30  , ndex_ind_30  , ndex_ipc_30
       INTEGER, SAVE, DIMENSION (jpj)     :: ndex_h, ndex_h_atl_30, ndex_h_pac_30, ndex_h_ind_30, ndex_h_ipc_30
-
+      !!
       CHARACTER (len=40)       ::   clhstnam, clop, clop_once, cl_comment   ! temporary names
       INTEGER                  ::   iline, it, itmod, ji, jj, jk            !
@@ -622,34 +481,25 @@
 
       ! define time axis
-      it    = kt / nf_ptr
+      it    = kt / nn_fptr
       itmod = kt - nit000 + 1
       
-!-$$      IF(lwp) THEN
-!-$$         WRITE(numout,*)
-!-$$         WRITE(numout,*) 'dia_ptr_wri : kt = ', kt, 'it = ', it, ' itmod = ', itmod, ' niter = ', niter
-!-$$         WRITE(numout,*) '~~~~~~~~~~~~'
-!-$$      ENDIF
-
       ! Initialization
       ! --------------
       IF( kt == nit000 ) THEN
-
-         niter = (nit000 - 1) / nf_ptr
-
-!-$$         IF(lwp) THEN
-!-$$            WRITE(numout,*)
-!-$$            WRITE(numout,*) 'dia_ptr_wri : poleward transport and msf writing: initialization , niter = ', niter
-!-$$            WRITE(numout,*) '~~~~~~~~~~~~'
-!-$$         ENDIF
-
+         niter = ( nit000 - 1 ) / nn_fptr
          zdt = rdt
          IF( nacc == 1 )   zdt = rdtmin
-
-         ! Reference latitude
+         !
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) 'dia_ptr_wri : poleward transport and msf writing: initialization , niter = ', niter
+            WRITE(numout,*) '~~~~~~~~~~~~'
+         ENDIF
+
+         ! Reference latitude (used in plots)
          ! ------------------
          !                                           ! =======================
          IF( cp_cfg == "orca" ) THEN                 !   ORCA configurations
             !                                        ! =======================
-
             IF( jp_cfg == 05  )   iline = 192   ! i-line that passes near the North Pole
             IF( jp_cfg == 025 )   iline = 384   ! i-line that passes near the North Pole
@@ -657,5 +507,5 @@
             IF( jp_cfg == 2   )   iline =  48   ! i-line that passes near the North Pole
             IF( jp_cfg == 4   )   iline =  24   ! i-line that passes near the North Pole
-            zphi(:) = 0.e0
+            zphi(:) = 0._wp
             DO ji = mi0(iline), mi1(iline) 
                zphi(:) = gphiv(ji,:)         ! if iline is in the local domain
@@ -663,14 +513,14 @@
                IF( jp_cfg == 05 ) THEN
                   DO jj = mj0(jpjdta), mj1(jpjdta) 
-                     zphi( jj ) = zphi(mj0(jpjdta-1)) + (zphi(mj0(jpjdta-1))-zphi(mj0(jpjdta-2)))/2.
-                     zphi( jj ) = MIN( zphi(jj), 90.)
+                     zphi( jj ) = zphi(mj0(jpjdta-1)) + ( zphi(mj0(jpjdta-1))-zphi(mj0(jpjdta-2)) ) * 0.5_wp
+                     zphi( jj ) = MIN( zphi(jj), 90._wp )
                   END DO
                END IF
                IF( jp_cfg == 1 .OR. jp_cfg == 2 .OR. jp_cfg == 4 ) THEN
                   DO jj = mj0(jpjdta-1), mj1(jpjdta-1) 
-                     zphi( jj ) = 88.5e0
+                     zphi( jj ) = 88.5_wp
                   END DO
                   DO jj = mj0(jpjdta  ), mj1(jpjdta  ) 
-                     zphi( jj ) = 89.5e0
+                     zphi( jj ) = 89.5_wp
                   END DO
                END IF
@@ -680,5 +530,4 @@
             CALL mpp_sum( zphi, jpj, ncomm_znl )        
 #endif
-
             !                                        ! =======================
          ELSE                                        !   OTHER configurations 
@@ -690,5 +539,5 @@
          ! Work only on westmost processor (will not work if mppini2 is used)
 #if defined key_mpp_mpi
-         IF ( l_znl_root ) THEN 
+         IF( l_znl_root ) THEN 
 #endif
             !
@@ -696,5 +545,5 @@
             ! ----------------
             ! Define frequency of output and means
-            zsto = nf_ptr * zdt
+            zsto = nn_fptr * zdt
             IF( ln_mskland )   THEN    ! put 1.e+20 on land (very expensive!!)
                clop      = "ave(only(x))"
@@ -705,6 +554,6 @@
             ENDIF
 
-            zout = nf_ptr_wri * zdt
-            zfoo(:) = 0.e0
+            zout = nn_fwri * zdt
+            zfoo(:) = 0._wp
 
             ! Compute julian date from starting date of the run
@@ -716,5 +565,5 @@
             ! Requested by IPSL people, use by their postpro...
             IF(lwp) THEN
-               CALL dia_nam( clhstnam, nf_ptr_wri,' ' )
+               CALL dia_nam( clhstnam, nn_fwri,' ' )
                CALL ctl_opn( inum, 'date.file', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea )
                WRITE(inum,*) clhstnam
@@ -723,45 +572,43 @@
 #endif
 
-            CALL dia_nam( clhstnam, nf_ptr_wri, 'diaptr' )
+            CALL dia_nam( clhstnam, nn_fwri, 'diaptr' )
             IF(lwp)WRITE( numout,*)" Name of diaptr NETCDF file : ", clhstnam
 
             ! Horizontal grid : zphi()
             CALL histbeg(clhstnam, 1, zfoo, jpj, zphi,   &
-               1, 1, 1, jpj, niter, zjulian, zdt*nf_ptr, nhoridz, numptr, domain_id=nidom_ptr, snc4chunks=snc4set)
+               1, 1, 1, jpj, niter, zjulian, zdt*nn_fptr, nhoridz, numptr, domain_id=nidom_ptr)
             ! Vertical grids : gdept_0, gdepw_0
             CALL histvert( numptr, "deptht", "Vertical T levels",   &
-               "m", jpk, gdept_0, ndepidzt, "down" )
+               &                   "m", jpk, gdept_0, ndepidzt, "down" )
             CALL histvert( numptr, "depthw", "Vertical W levels",   &
-               "m", jpk, gdepw_0, ndepidzw, "down" )
+               &                   "m", jpk, gdepw_0, ndepidzw, "down" )
 
             !
-            CALL wheneq ( jpj*jpk, MIN(surf_jk_glo(:,:), 1.e0), 1, 1., ndex  , ndim  )      ! Lat-Depth
-            CALL wheneq ( jpj    , MIN(surf_jk_glo(:,1), 1.e0), 1, 1., ndex_h, ndim_h )     ! Lat
-
-            IF (ln_subbas) THEN
-               z_1 (:,1) = 1.0e0
-               WHERE ( gphit (jpi/2,:) .LT. -30 ) z_1 (:,1) = 0.e0
+            CALL wheneq ( jpj*jpk, MIN(sjk(:,:,1), 1._wp), 1, 1., ndex  , ndim  )      ! Lat-Depth
+            CALL wheneq ( jpj    , MIN(sjk(:,1,1), 1._wp), 1, 1., ndex_h, ndim_h )     ! Lat
+
+            IF( ln_subbas ) THEN
+               z_1(:,1) = 1._wp
+               WHERE ( gphit(jpi/2,:) < -30._wp )   z_1(:,1) = 0._wp
                DO jk = 2, jpk
-                  z_1 (:,jk) = z_1 (:,1)
+                  z_1(:,jk) = z_1(:,1)
                END DO
-
-               CALL wheneq ( jpj*jpk, MIN(surf_jk_atl(:,:)         , 1.e0), 1, 1., ndex_atl     , ndim_atl      ) ! Lat-Depth
-               CALL wheneq ( jpj*jpk, MIN(surf_jk_atl(:,:)*z_1(:,:), 1.e0), 1, 1., ndex_atl_30  , ndim_atl_30   ) ! Lat-Depth
-               CALL wheneq ( jpj    , MIN(surf_jk_atl(:,1)*z_1(:,1), 1.e0), 1, 1., ndex_h_atl_30, ndim_h_atl_30 ) ! Lat
-
-               CALL wheneq ( jpj*jpk, MIN(surf_jk_pac(:,:)         , 1.e0), 1, 1., ndex_pac     , ndim_pac      ) ! Lat-Depth
-               CALL wheneq ( jpj*jpk, MIN(surf_jk_pac(:,:)*z_1(:,:), 1.e0), 1, 1., ndex_pac_30  , ndim_pac_30   ) ! Lat-Depth
-               CALL wheneq ( jpj    , MIN(surf_jk_pac(:,1)*z_1(:,1), 1.e0), 1, 1., ndex_h_pac_30, ndim_h_pac_30 ) ! Lat
-
-               CALL wheneq ( jpj*jpk, MIN(surf_jk_ind(:,:)         , 1.e0), 1, 1., ndex_ind     , ndim_ind      ) ! Lat-Depth
-               CALL wheneq ( jpj*jpk, MIN(surf_jk_ind(:,:)*z_1(:,:), 1.e0), 1, 1., ndex_ind_30  , ndim_ind_30   ) ! Lat-Depth
-               CALL wheneq ( jpj    , MIN(surf_jk_ind(:,1)*z_1(:,1), 1.e0), 1, 1., ndex_h_ind_30, ndim_h_ind_30 ) ! Lat
-
-               CALL wheneq ( jpj*jpk, MIN(surf_jk_ipc(:,:)         , 1.e0), 1, 1., ndex_ipc     , ndim_ipc      ) ! Lat-Depth
-               CALL wheneq ( jpj*jpk, MIN(surf_jk_ipc(:,:)*z_1(:,:), 1.e0), 1, 1., ndex_ipc_30  , ndim_ipc_30   ) ! Lat-Depth
-               CALL wheneq ( jpj    , MIN(surf_jk_ipc(:,1)*z_1(:,1), 1.e0), 1, 1., ndex_h_ipc_30, ndim_h_ipc_30 ) ! Lat
-
+               !                       ! Atlantic (jn=2)
+               CALL wheneq ( jpj*jpk, MIN(sjk(:,:,2)         , 1._wp), 1, 1., ndex_atl     , ndim_atl      ) ! Lat-Depth
+               CALL wheneq ( jpj*jpk, MIN(sjk(:,:,2)*z_1(:,:), 1._wp), 1, 1., ndex_atl_30  , ndim_atl_30   ) ! Lat-Depth
+               CALL wheneq ( jpj    , MIN(sjk(:,1,2)*z_1(:,1), 1._wp), 1, 1., ndex_h_atl_30, ndim_h_atl_30 ) ! Lat
+               !                       ! Pacific (jn=3)
+               CALL wheneq ( jpj*jpk, MIN(sjk(:,:,3)         , 1._wp), 1, 1., ndex_pac     , ndim_pac      ) ! Lat-Depth
+               CALL wheneq ( jpj*jpk, MIN(sjk(:,:,3)*z_1(:,:), 1._wp), 1, 1., ndex_pac_30  , ndim_pac_30   ) ! Lat-Depth
+               CALL wheneq ( jpj    , MIN(sjk(:,1,3)*z_1(:,1), 1._wp), 1, 1., ndex_h_pac_30, ndim_h_pac_30 ) ! Lat
+               !                       ! Indian (jn=4)
+               CALL wheneq ( jpj*jpk, MIN(sjk(:,:,4)         , 1._wp), 1, 1., ndex_ind     , ndim_ind      ) ! Lat-Depth
+               CALL wheneq ( jpj*jpk, MIN(sjk(:,:,4)*z_1(:,:), 1._wp), 1, 1., ndex_ind_30  , ndim_ind_30   ) ! Lat-Depth
+               CALL wheneq ( jpj    , MIN(sjk(:,1,4)*z_1(:,1), 1._wp), 1, 1., ndex_h_ind_30, ndim_h_ind_30 ) ! Lat
+               !                       ! Indo-Pacific (jn=5)
+               CALL wheneq ( jpj*jpk, MIN(sjk(:,:,5)         , 1._wp), 1, 1., ndex_ipc     , ndim_ipc      ) ! Lat-Depth
+               CALL wheneq ( jpj*jpk, MIN(sjk(:,:,5)*z_1(:,:), 1._wp), 1, 1., ndex_ipc_30  , ndim_ipc_30   ) ! Lat-Depth
+               CALL wheneq ( jpj    , MIN(sjk(:,1,5)*z_1(:,1), 1._wp), 1, 1., ndex_h_ipc_30, ndim_h_ipc_30 ) ! Lat
             ENDIF
-
             ! 
 #if defined key_diaeiv
@@ -772,5 +619,5 @@
             !  Zonal mean T and S
 
-            IF ( ln_diaznl ) THEN 
+            IF( ln_diaznl ) THEN 
                CALL histdef( numptr, "zotemglo", "Zonal Mean Temperature","C" ,   &
                   1, jpj, nhoridz, jpk, 1, jpk, ndepidzt, 32, clop, zsto, zout )
@@ -880,5 +727,5 @@
             ENDIF
 
-            CALL histend( numptr, snc4set )
+            CALL histend( numptr )
 
          END IF
@@ -888,76 +735,67 @@
 
 #if defined key_mpp_mpi
-      IF( MOD( itmod, nf_ptr ) == 0 .AND. l_znl_root ) THEN
+      IF( MOD( itmod, nn_fptr ) == 0 .AND. l_znl_root ) THEN
 #else
-      IF( MOD( itmod, nf_ptr ) == 0  ) THEN
+      IF( MOD( itmod, nn_fptr ) == 0  ) THEN
 #endif
          niter = niter + 1
 
-!-$$         IF(lwp) THEN
-!-$$            WRITE(numout,*)
-!-$$            WRITE(numout,*) 'dia_ptr_wri : write Poleward Transports at time-step : kt = ', kt, &
-!-$$               & 'it = ', it, ' itmod = ', itmod, ' niter = ', niter
-!-$$            WRITE(numout,*) '~~~~~~~~~~'
-!-$$            WRITE(numout,*)
-!-$$         ENDIF
-
-         IF (ln_diaznl ) THEN 
-            CALL histwrite( numptr, "zosrfglo", niter, surf_jk_glo , ndim, ndex )
-            CALL histwrite( numptr, "zotemglo", niter, tn_jk_glo  , ndim, ndex )
-            CALL histwrite( numptr, "zosalglo", niter, sn_jk_glo  , ndim, ndex )
+         IF( ln_diaznl ) THEN 
+            CALL histwrite( numptr, "zosrfglo", niter, sjk  (:,:,1) , ndim, ndex )
+            CALL histwrite( numptr, "zotemglo", niter, tn_jk(:,:,1)  , ndim, ndex )
+            CALL histwrite( numptr, "zosalglo", niter, sn_jk(:,:,1)  , ndim, ndex )
 
             IF (ln_subbas) THEN 
-               CALL histwrite( numptr, "zosrfatl", niter, surf_jk_atl, ndim_atl, ndex_atl )
-               CALL histwrite( numptr, "zosrfpac", niter, surf_jk_pac, ndim_pac, ndex_pac )
-               CALL histwrite( numptr, "zosrfind", niter, surf_jk_ind, ndim_ind, ndex_ind )
-               CALL histwrite( numptr, "zosrfipc", niter, surf_jk_ipc, ndim_ipc, ndex_ipc )
-
-               CALL histwrite( numptr, "zotematl", niter, tn_jk_atl  , ndim_atl, ndex_atl )
-               CALL histwrite( numptr, "zosalatl", niter, sn_jk_atl  , ndim_atl, ndex_atl )
-               CALL histwrite( numptr, "zotempac", niter, tn_jk_pac  , ndim_pac, ndex_pac )
-               CALL histwrite( numptr, "zosalpac", niter, sn_jk_pac  , ndim_pac, ndex_pac )
-               CALL histwrite( numptr, "zotemind", niter, tn_jk_ind  , ndim_ind, ndex_ind )
-               CALL histwrite( numptr, "zosalind", niter, sn_jk_ind  , ndim_ind, ndex_ind )
-               CALL histwrite( numptr, "zotemipc", niter, tn_jk_ipc  , ndim_ipc, ndex_ipc )
-               CALL histwrite( numptr, "zosalipc", niter, sn_jk_ipc  , ndim_ipc, ndex_ipc )
+               CALL histwrite( numptr, "zosrfatl", niter, sjk(:,:,2), ndim_atl, ndex_atl )
+               CALL histwrite( numptr, "zosrfpac", niter, sjk(:,:,3), ndim_pac, ndex_pac )
+               CALL histwrite( numptr, "zosrfind", niter, sjk(:,:,4), ndim_ind, ndex_ind )
+               CALL histwrite( numptr, "zosrfipc", niter, sjk(:,:,5), ndim_ipc, ndex_ipc )
+
+               CALL histwrite( numptr, "zotematl", niter, tn_jk(:,:,2)  , ndim_atl, ndex_atl )
+               CALL histwrite( numptr, "zosalatl", niter, sn_jk(:,:,2)  , ndim_atl, ndex_atl )
+               CALL histwrite( numptr, "zotempac", niter, tn_jk(:,:,3)  , ndim_pac, ndex_pac )
+               CALL histwrite( numptr, "zosalpac", niter, sn_jk(:,:,3)  , ndim_pac, ndex_pac )
+               CALL histwrite( numptr, "zotemind", niter, tn_jk(:,:,4)  , ndim_ind, ndex_ind )
+               CALL histwrite( numptr, "zosalind", niter, sn_jk(:,:,4)  , ndim_ind, ndex_ind )
+               CALL histwrite( numptr, "zotemipc", niter, tn_jk(:,:,5)  , ndim_ipc, ndex_ipc )
+               CALL histwrite( numptr, "zosalipc", niter, sn_jk(:,:,5)  , ndim_ipc, ndex_ipc )
             END IF
          ENDIF
 
          ! overturning outputs:
-         CALL histwrite( numptr, "zomsfglo", niter, v_msf_glo, ndim, ndex )
+         CALL histwrite( numptr, "zomsfglo", niter, v_msf(:,:,1), ndim, ndex )
          IF( ln_subbas .AND. ln_diaznl ) THEN
-            CALL histwrite( numptr, "zomsfatl", niter, v_msf_atl , ndim_atl_30, ndex_atl_30 )
-            CALL histwrite( numptr, "zomsfpac", niter, v_msf_pac , ndim_pac_30, ndex_pac_30 )
-            CALL histwrite( numptr, "zomsfind", niter, v_msf_ind , ndim_ind_30, ndex_ind_30 )
-            CALL histwrite( numptr, "zomsfipc", niter, v_msf_ipc , ndim_ipc_30, ndex_ipc_30 )
+            CALL histwrite( numptr, "zomsfatl", niter, v_msf(:,:,2) , ndim_atl_30, ndex_atl_30 )
+            CALL histwrite( numptr, "zomsfpac", niter, v_msf(:,:,3) , ndim_pac_30, ndex_pac_30 )
+            CALL histwrite( numptr, "zomsfind", niter, v_msf(:,:,4) , ndim_ind_30, ndex_ind_30 )
+            CALL histwrite( numptr, "zomsfipc", niter, v_msf(:,:,5) , ndim_ipc_30, ndex_ipc_30 )
          ENDIF
 #if defined key_diaeiv
-         CALL histwrite( numptr, "zomsfeiv", niter, v_msf_eiv_glo, ndim  , ndex   )
-#endif
-
+         CALL histwrite( numptr, "zomsfeiv", niter, v_msf_eiv(:,:,1), ndim  , ndex   )
+#endif
 
          ! heat transport outputs:
          IF( ln_subbas ) THEN
-            CALL histwrite( numptr, "sohtatl", niter, ht_atl  , ndim_h_atl_30, ndex_h_atl_30 )
-            CALL histwrite( numptr, "sohtpac", niter, ht_pac  , ndim_h_pac_30, ndex_h_pac_30 )
-            CALL histwrite( numptr, "sohtind", niter, ht_ind  , ndim_h_ind_30, ndex_h_ind_30 )
-            CALL histwrite( numptr, "sohtipc", niter, ht_ipc  , ndim_h_ipc_30, ndex_h_ipc_30 )
-            CALL histwrite( numptr, "sostatl", niter, st_atl  , ndim_h_atl_30, ndex_h_atl_30 )
-            CALL histwrite( numptr, "sostpac", niter, st_pac  , ndim_h_pac_30, ndex_h_pac_30 )
-            CALL histwrite( numptr, "sostind", niter, st_ind  , ndim_h_ind_30, ndex_h_ind_30 )
-            CALL histwrite( numptr, "sostipc", niter, st_ipc  , ndim_h_ipc_30, ndex_h_ipc_30 )
+            CALL histwrite( numptr, "sohtatl", niter, htr(:,2)  , ndim_h_atl_30, ndex_h_atl_30 )
+            CALL histwrite( numptr, "sohtpac", niter, htr(:,3)  , ndim_h_pac_30, ndex_h_pac_30 )
+            CALL histwrite( numptr, "sohtind", niter, htr(:,4)  , ndim_h_ind_30, ndex_h_ind_30 )
+            CALL histwrite( numptr, "sohtipc", niter, htr(:,5)  , ndim_h_ipc_30, ndex_h_ipc_30 )
+            CALL histwrite( numptr, "sostatl", niter, str(:,2)  , ndim_h_atl_30, ndex_h_atl_30 )
+            CALL histwrite( numptr, "sostpac", niter, str(:,3)  , ndim_h_pac_30, ndex_h_pac_30 )
+            CALL histwrite( numptr, "sostind", niter, str(:,4)  , ndim_h_ind_30, ndex_h_ind_30 )
+            CALL histwrite( numptr, "sostipc", niter, str(:,5)  , ndim_h_ipc_30, ndex_h_ipc_30 )
          ENDIF
 
-         CALL histwrite( numptr, "sophtadv", niter, pht_adv     , ndim_h, ndex_h )
-         CALL histwrite( numptr, "sophtldf", niter, pht_ldf     , ndim_h, ndex_h )
-         CALL histwrite( numptr, "sopstadv", niter, pst_adv     , ndim_h, ndex_h )
-         CALL histwrite( numptr, "sopstldf", niter, pst_ldf     , ndim_h, ndex_h )
-         IF ( ln_ptrcomp ) THEN 
-            CALL histwrite( numptr, "sopstove", niter, pst_ove_glo , ndim_h, ndex_h )
-            CALL histwrite( numptr, "sophtove", niter, pht_ove_glo , ndim_h, ndex_h )
+         CALL histwrite( numptr, "sophtadv", niter, htr_adv     , ndim_h, ndex_h )
+         CALL histwrite( numptr, "sophtldf", niter, htr_ldf     , ndim_h, ndex_h )
+         CALL histwrite( numptr, "sopstadv", niter, str_adv     , ndim_h, ndex_h )
+         CALL histwrite( numptr, "sopstldf", niter, str_ldf     , ndim_h, ndex_h )
+         IF( ln_ptrcomp ) THEN 
+            CALL histwrite( numptr, "sopstove", niter, str_ove(:) , ndim_h, ndex_h )
+            CALL histwrite( numptr, "sophtove", niter, htr_ove(:) , ndim_h, ndex_h )
          ENDIF
 #if defined key_diaeiv
-         CALL histwrite( numptr, "sophteiv", niter, pht_eiv_glo  , ndim_h, ndex_h )
-         CALL histwrite( numptr, "sopsteiv", niter, pst_eiv_glo  , ndim_h, ndex_h )
+         CALL histwrite( numptr, "sophteiv", niter, htr_eiv(:,1)  , ndim_h, ndex_h )
+         CALL histwrite( numptr, "sopsteiv", niter, str_eiv(:,1)  , ndim_h, ndex_h )
 #endif
          !
Index: /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen2.F90
===================================================================
--- /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen2.F90	(revision 2398)
+++ /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen2.F90	(revision 2399)
@@ -48,10 +48,9 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
-   SUBROUTINE tra_adv_cen2( kt, cdtype, pun, pvn, pwn, &
+   SUBROUTINE tra_adv_cen2( kt, cdtype, pun, pvn, pwn,        &
       &                                 ptb, ptn, pta, kjpt   ) 
       !!----------------------------------------------------------------------
@@ -257,7 +256,7 @@
          END IF
          !                                 ! "Poleward" heat and salt transports (contribution of upstream fluxes)
-         IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( MOD( kt, nf_ptr ) == 0 ) ) THEN  
-           IF( jn == jp_tem )  pht_adv(:) = ptr_vj( zwy(:,:,:) )
-           IF( jn == jp_sal )  pst_adv(:) = ptr_vj( zwy(:,:,:) )
+         IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( MOD( kt, nn_fptr ) == 0 ) ) THEN  
+           IF( jn == jp_tem )  htr_adv(:) = ptr_vj( zwy(:,:,:) )
+           IF( jn == jp_sal )  str_adv(:) = ptr_vj( zwy(:,:,:) )
          ENDIF
          !
Index: /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl.F90
===================================================================
--- /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl.F90	(revision 2398)
+++ /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl.F90	(revision 2399)
@@ -40,11 +40,10 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
    SUBROUTINE tra_adv_muscl( kt, cdtype, p2dt, pun, pvn, pwn, &
-      &                                        ptb, pta, kjpt   )
+      &                                        ptb, pta, kjpt )
       !!----------------------------------------------------------------------
       !!                    ***  ROUTINE tra_adv_muscl  ***
@@ -179,7 +178,7 @@
          END IF
          !                                 ! "Poleward" heat and salt transports (contribution of upstream fluxes)
-         IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( MOD( kt, nf_ptr ) == 0 ) ) THEN  
-            IF( jn == jp_tem )  pht_adv(:) = ptr_vj( zwy(:,:,:) )
-            IF( jn == jp_sal )  pst_adv(:) = ptr_vj( zwy(:,:,:) )
+         IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( MOD( kt, nn_fptr ) == 0 ) ) THEN  
+            IF( jn == jp_tem )  htr_adv(:) = ptr_vj( zwy(:,:,:) )
+            IF( jn == jp_sal )  str_adv(:) = ptr_vj( zwy(:,:,:) )
          ENDIF
 
Index: /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl2.F90
===================================================================
--- /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl2.F90	(revision 2398)
+++ /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl2.F90	(revision 2399)
@@ -38,11 +38,10 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
-   SUBROUTINE tra_adv_muscl2( kt, cdtype, p2dt, pun, pvn, pwn, &
-      &                                         ptb, ptn, pta, kjpt   )
+   SUBROUTINE tra_adv_muscl2( kt, cdtype, p2dt, pun, pvn, pwn,      &
+      &                                         ptb, ptn, pta, kjpt )
       !!----------------------------------------------------------------------
       !!                   ***  ROUTINE tra_adv_muscl2  ***
@@ -201,7 +200,7 @@
 
          !                                 ! "Poleward" heat and salt transports (contribution of upstream fluxes)
-         IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( MOD( kt, nf_ptr ) == 0 ) ) THEN
-            IF( jn == jp_tem )  pht_adv(:) = ptr_vj( zwy(:,:,:) )
-            IF( jn == jp_sal )  pst_adv(:) = ptr_vj( zwy(:,:,:) )
+         IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( MOD( kt, nn_fptr ) == 0 ) ) THEN
+            IF( jn == jp_tem )  htr_adv(:) = ptr_vj( zwy(:,:,:) )
+            IF( jn == jp_sal )  str_adv(:) = ptr_vj( zwy(:,:,:) )
          ENDIF
 
Index: /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_qck.F90
===================================================================
--- /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_qck.F90	(revision 2398)
+++ /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_qck.F90	(revision 2399)
@@ -41,11 +41,10 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
-   SUBROUTINE tra_adv_qck ( kt, cdtype, p2dt, pun, pvn, pwn, &
-      &                                       ptb, ptn, pta, kjpt   )
+   SUBROUTINE tra_adv_qck ( kt, cdtype, p2dt, pun, pvn, pwn,      &
+      &                                       ptb, ptn, pta, kjpt )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE tra_adv_qck  ***
@@ -82,5 +81,4 @@
       !! ** Reference : Leonard (1979, 1991)
       !!----------------------------------------------------------------------
-      !!
       INTEGER                              , INTENT(in   ) ::   kt              ! ocean time-step index
       CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype          ! =TRA or TRC (tracer indicator)
@@ -112,5 +110,5 @@
 
 
-   SUBROUTINE tra_adv_qck_i( kt, cdtype, p2dt, pun,    &
+   SUBROUTINE tra_adv_qck_i( kt, cdtype, p2dt, pun,                  &
       &                                        ptb, ptn, pta, kjpt   )
       !!----------------------------------------------------------------------
@@ -152,5 +150,4 @@
          END DO
          CALL lbc_lnk( zfc(:,:,:), 'T', 1. )   ;   CALL lbc_lnk( zfd(:,:,:), 'T', 1. )   ! Lateral boundary conditions 
-
          
          !
@@ -231,10 +228,9 @@
 
 
-   SUBROUTINE tra_adv_qck_j( kt, cdtype, p2dt, pvn,   &
-      &                                        ptb, ptn, pta, kjpt   )
-      !!----------------------------------------------------------------------
-      !!
-      !!----------------------------------------------------------------------
-      !!
+   SUBROUTINE tra_adv_qck_j( kt, cdtype, p2dt, pvn,                &
+      &                                        ptb, ptn, pta, kjpt )
+      !!----------------------------------------------------------------------
+      !!
+      !!----------------------------------------------------------------------
       USE oce         , zwy => ua   ! use ua as workspace
       !!
@@ -312,5 +308,5 @@
                DO ji = fs_2, fs_jpim1   ! vector opt.               
                   zfu(ji,jj,jk) = tmask(ji,jj-1,jk) + tmask(ji,jj,jk) + tmask(ji,jj+1,jk) - 2.
-               ENDDO
+               END DO
             END DO
          END DO
@@ -347,7 +343,7 @@
          IF( l_trd )  CALL trd_tra( kt, cdtype, jn, jptra_trd_yad, zwy, pvn, ptn(:,:,:,jn) )
          !                                 ! "Poleward" heat and salt transports (contribution of upstream fluxes)
-         IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( MOD( kt, nf_ptr ) == 0 ) ) THEN  
-           IF( jn == jp_tem )  pht_adv(:) = ptr_vj( zwy(:,:,:) )
-           IF( jn == jp_sal )  pst_adv(:) = ptr_vj( zwy(:,:,:) )
+         IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( MOD( kt, nn_fptr ) == 0 ) ) THEN  
+           IF( jn == jp_tem )  htr_adv(:) = ptr_vj( zwy(:,:,:) )
+           IF( jn == jp_sal )  str_adv(:) = ptr_vj( zwy(:,:,:) )
          ENDIF
          !
@@ -357,5 +353,5 @@
 
 
-   SUBROUTINE tra_adv_cen2_k( kt, cdtype, pwn,   &
+   SUBROUTINE tra_adv_cen2_k( kt, cdtype, pwn,           &
      &                                    ptn, pta, kjpt )
       !!----------------------------------------------------------------------
Index: /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_tvd.F90
===================================================================
--- /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_tvd.F90	(revision 2398)
+++ /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_tvd.F90	(revision 2399)
@@ -47,11 +47,10 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
-   SUBROUTINE tra_adv_tvd ( kt, cdtype, p2dt, pun, pvn, pwn,   &
-      &                                       ptb, ptn, pta, kjpt   )
+   SUBROUTINE tra_adv_tvd ( kt, cdtype, p2dt, pun, pvn, pwn,      &
+      &                                       ptb, ptn, pta, kjpt )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE tra_adv_tvd  ***
@@ -169,7 +168,7 @@
          END IF
          !                                 ! "Poleward" heat and salt transports (contribution of upstream fluxes)
-         IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( MOD( kt, nf_ptr ) == 0 ) ) THEN  
-           IF( jn == jp_tem )  pht_adv(:) = ptr_vj( zwy(:,:,:) )
-           IF( jn == jp_sal )  pst_adv(:) = ptr_vj( zwy(:,:,:) )
+         IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( MOD( kt, nn_fptr ) == 0 ) ) THEN  
+           IF( jn == jp_tem )  htr_adv(:) = ptr_vj( zwy(:,:,:) )
+           IF( jn == jp_sal )  str_adv(:) = ptr_vj( zwy(:,:,:) )
          ENDIF
 
@@ -231,7 +230,7 @@
          END IF
          !                                 ! "Poleward" heat and salt transports (contribution of upstream fluxes)
-         IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( MOD( kt, nf_ptr ) == 0 ) ) THEN  
-           IF( jn == jp_tem )  pht_adv(:) = ptr_vj( zwy(:,:,:) ) + pht_adv(:)
-           IF( jn == jp_sal )  pst_adv(:) = ptr_vj( zwy(:,:,:) ) + pst_adv(:)
+         IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( MOD( kt, nn_fptr ) == 0 ) ) THEN  
+           IF( jn == jp_tem )  htr_adv(:) = ptr_vj( zwy(:,:,:) ) + htr_adv(:)
+           IF( jn == jp_sal )  str_adv(:) = ptr_vj( zwy(:,:,:) ) + str_adv(:)
          ENDIF
          !
Index: /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_ubs.F90
===================================================================
--- /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_ubs.F90	(revision 2398)
+++ /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_ubs.F90	(revision 2399)
@@ -36,11 +36,10 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
-   SUBROUTINE tra_adv_ubs ( kt, cdtype, p2dt, pun, pvn, pwn,   &
-      &                                       ptb, ptn, pta, kjpt   )
+   SUBROUTINE tra_adv_ubs ( kt, cdtype, p2dt, pun, pvn, pwn,      &
+      &                                       ptb, ptn, pta, kjpt )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE tra_adv_ubs  ***
@@ -183,7 +182,7 @@
          END IF
          !                                 ! "Poleward" heat and salt transports (contribution of upstream fluxes)
-         IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( MOD( kt, nf_ptr ) == 0 ) ) THEN  
-            IF( jn == jp_tem )  pht_adv(:) = ptr_vj( zwy(:,:,:) )
-            IF( jn == jp_sal )  pst_adv(:) = ptr_vj( zwy(:,:,:) )
+         IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( MOD( kt, nn_fptr ) == 0 ) ) THEN  
+            IF( jn == jp_tem )  htr_adv(:) = ptr_vj( zwy(:,:,:) )
+            IF( jn == jp_sal )  str_adv(:) = ptr_vj( zwy(:,:,:) )
          ENDIF
          
Index: /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traldf.F90
===================================================================
--- /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traldf.F90	(revision 2398)
+++ /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traldf.F90	(revision 2399)
@@ -47,7 +47,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -57,5 +56,4 @@
       !! 
       !! ** Purpose :   compute the lateral ocean tracer physics.
-      !!
       !!----------------------------------------------------------------------
       INTEGER, INTENT( in ) ::   kt   ! ocean time-step index
@@ -70,23 +68,22 @@
 
       SELECT CASE ( nldf )                       ! compute lateral mixing trend and add it to the general trend
-      CASE ( 0 )   ;   CALL tra_ldf_lap   ( kt, 'TRA', gtsu, gtsv, tsb, tsa, jpts        )  ! iso-level laplacian
-      CASE ( 1 )    
-         IF ( ln_traldf_grif ) THEN
-
-            CALL tra_ldf_iso_grif    ( kt, 'TRA', gtsu, gtsv, tsb, tsa, jpts, ahtb0  )           ! Griffies quarter-cell formulation
-         ELSE
-            CALL tra_ldf_iso   ( kt, 'TRA', gtsu, gtsv, tsb, tsa, jpts, ahtb0 )  ! rotated laplacian
-         ENDIF
-      CASE ( 2 )   ;   CALL tra_ldf_bilap ( kt, 'TRA', gtsu, gtsv, tsb, tsa, jpts        )  ! iso-level bilaplacian
-      CASE ( 3 )   ;   CALL tra_ldf_bilapg( kt, 'TRA',             tsb, tsa, jpts        )  ! s-coord. horizontal bilap.
+      CASE ( 0 )   ;   CALL tra_ldf_lap     ( kt, 'TRA', gtsu, gtsv, tsb, tsa, jpts        )  ! iso-level laplacian
+      CASE ( 1 )                                                                              ! rotated laplacian
+         IF( ln_traldf_grif ) THEN                                                          
+                       CALL tra_ldf_iso_grif( kt, 'TRA', gtsu, gtsv, tsb, tsa, jpts, ahtb0 )      ! Griffies operator
+         ELSE                                                                                
+                       CALL tra_ldf_iso     ( kt, 'TRA', gtsu, gtsv, tsb, tsa, jpts, ahtb0 )      ! Madec operator
+         ENDIF
+      CASE ( 2 )   ;   CALL tra_ldf_bilap   ( kt, 'TRA', gtsu, gtsv, tsb, tsa, jpts        )  ! iso-level bilaplacian
+      CASE ( 3 )   ;   CALL tra_ldf_bilapg  ( kt, 'TRA',             tsb, tsa, jpts        )  ! s-coord. geopot. bilap.
          !
-      CASE ( -1 )                                     ! esopa: test all possibility with control print
+      CASE ( -1 )                                ! esopa: test all possibility with control print
          CALL tra_ldf_lap   ( kt, 'TRA', gtsu, gtsv, tsb, tsa, jpts        ) 
          CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' ldf0 - Ta: ', mask1=tmask,               &
          &             tab3d_2=tsa(:,:,:,jp_sal), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' )
-         IF ( ln_traldf_grif ) THEN
-            CALL tra_ldf_iso_grif    ( kt, 'TRA', gtsu, gtsv, tsb, tsa, jpts, ahtb0  )
+         IF( ln_traldf_grif ) THEN
+            CALL tra_ldf_iso_grif( kt, 'TRA', gtsu, gtsv, tsb, tsa, jpts, ahtb0 )
          ELSE
-            CALL tra_ldf_iso   ( kt, 'TRA', gtsu, gtsv, tsb, tsa, jpts, ahtb0 )  
+            CALL tra_ldf_iso     ( kt, 'TRA', gtsu, gtsv, tsb, tsa, jpts, ahtb0 )  
          ENDIF
          CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' ldf1 - Ta: ', mask1=tmask,               &
Index: /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_bilap.F90
===================================================================
--- /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_bilap.F90	(revision 2398)
+++ /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_bilap.F90	(revision 2399)
@@ -42,10 +42,9 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
  
-   SUBROUTINE tra_ldf_bilap( kt, cdtype, pgu, pgv,  &
+   SUBROUTINE tra_ldf_bilap( kt, cdtype, pgu, pgv,      &
       &                                  ptb, pta, kjpt )  
       !!----------------------------------------------------------------------
@@ -74,5 +73,4 @@
       !!               biharmonic mixing trend.
       !!----------------------------------------------------------------------
-      !!
       USE oce         , ztu => ua   ! use ua as workspace
       USE oce         , ztv => va   ! use va as workspace
@@ -159,7 +157,7 @@
          !                                                
          ! "zonal" mean lateral diffusive heat and salt transport
-         IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( MOD( kt, nf_ptr ) == 0 ) ) THEN  
-           IF( jn == jp_tem )  pht_ldf(:) = ptr_vj( ztv(:,:,:) )
-           IF( jn == jp_sal )  pst_ldf(:) = ptr_vj( ztv(:,:,:) )
+         IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( MOD( kt, nn_fptr ) == 0 ) ) THEN  
+           IF( jn == jp_tem )  htr_ldf(:) = ptr_vj( ztv(:,:,:) )
+           IF( jn == jp_sal )  str_ldf(:) = ptr_vj( ztv(:,:,:) )
          ENDIF
          !                                                ! ===========
Index: /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_bilapg.F90
===================================================================
--- /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_bilapg.F90	(revision 2398)
+++ /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_bilapg.F90	(revision 2399)
@@ -4,7 +4,7 @@
    !! Ocean  tracers:  horizontal component of the lateral tracer mixing trend
    !!==============================================================================
-   !! History : 8.0   !  1997-07  (G. Madec)  Original code
-   !!           NEMO  !  2002-08  (G. Madec)  F90: Free form and module
-   !!           3.3   !  2010-06  (C. Ethe, G. Madec) Merge TRA-TRC
+   !! History : 8.0   ! 1997-07  (G. Madec)  Original code
+   !!   NEMO    1.0   ! 2002-08  (G. Madec)  F90: Free form and module
+   !!           3.3   ! 2010-06  (C. Ethe, G. Madec) Merge TRA-TRC
    !!==============================================================================
 #if defined key_ldfslp   ||   defined key_esopa
@@ -37,7 +37,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-   
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -66,9 +65,9 @@
       !!               biharmonic mixing trend.
       !!----------------------------------------------------------------------
-      INTEGER         , INTENT(in   )                                ::   kt             ! ocean time-step index
-      CHARACTER(len=3), INTENT(in   )                                ::   cdtype         ! =TRA or TRC (tracer indicator)
-      INTEGER         , INTENT(in   )                                ::   kjpt            ! number of tracers
-      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb          ! before and now tracer fields
-      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta          ! tracer trend 
+      INTEGER         , INTENT(in   )                      ::   kt       ! ocean time-step index
+      CHARACTER(len=3), INTENT(in   )                      ::   cdtype   ! =TRA or TRC (tracer indicator)
+      INTEGER         , INTENT(in   )                      ::   kjpt     ! number of tracers
+      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb      ! before and now tracer fields
+      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta      ! tracer trend 
       !!
       INTEGER ::   ji, jj, jk, jn                 ! dummy loop indices
@@ -81,6 +80,4 @@
          IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~'
       ENDIF
-      !
-      !
 
       ! 1. Laplacian of ptb * aht
@@ -100,9 +97,6 @@
       ! 3. Update the tracer trends                    (j-slab :   2, jpj-1)
       ! ---------------------------
-      !
       DO jn = 1, kjpt
-         !                                                ! ===============
-         DO jj = 2, jpjm1                                 !  Vertical slab
-            !                                             ! ===============
+         DO jj = 2, jpjm1
             DO jk = 1, jpkm1
                DO ji = 2, jpim1
@@ -111,9 +105,7 @@
                END DO
             END DO
-            !                                             ! ===============
-         END DO                                           !   End of slab
-         !                                                ! ===============
+         END DO
       END DO
-
+      !
    END SUBROUTINE tra_ldf_bilapg
 
@@ -238,7 +230,7 @@
          !                                                ! ===============
          ! "Poleward" diffusive heat or salt transport
-         IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( kaht == 2 ) .AND. ( MOD( kt, nf_ptr ) == 0 ) ) THEN
-            IF( jn == jp_tem)   pht_ldf(:) = ptr_vj( zftv(:,:,:) )
-            IF( jn == jp_sal)   pst_ldf(:) = ptr_vj( zftv(:,:,:) )
+         IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( kaht == 2 ) .AND. ( MOD( kt, nn_fptr ) == 0 ) ) THEN
+            IF( jn == jp_tem)   htr_ldf(:) = ptr_vj( zftv(:,:,:) )
+            IF( jn == jp_sal)   str_ldf(:) = ptr_vj( zftv(:,:,:) )
          ENDIF
 
Index: /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso.F90
===================================================================
--- /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso.F90	(revision 2398)
+++ /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso.F90	(revision 2399)
@@ -45,10 +45,9 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
-   SUBROUTINE tra_ldf_iso( kt, cdtype, pgu, pgv,  &
+   SUBROUTINE tra_ldf_iso( kt, cdtype, pgu, pgv,              &
       &                                ptb, pta, kjpt, pahtb0 )
       !!----------------------------------------------------------------------
@@ -209,7 +208,7 @@
          !
          ! "Poleward" diffusive heat or salt transports (T-S case only)
-         IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( MOD( kt, nf_ptr ) == 0 ) ) THEN
-            IF( jn == jp_tem)   pht_ldf(:) = ptr_vj( zftv(:,:,:) )
-            IF( jn == jp_sal)   pst_ldf(:) = ptr_vj( zftv(:,:,:) )
+         IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( MOD( kt, nn_fptr ) == 0 ) ) THEN
+            IF( jn == jp_tem)   htr_ldf(:) = ptr_vj( zftv(:,:,:) )
+            IF( jn == jp_sal)   str_ldf(:) = ptr_vj( zftv(:,:,:) )
          ENDIF
  
Index: /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso_grif.F90
===================================================================
--- /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso_grif.F90	(revision 2398)
+++ /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso_grif.F90	(revision 2399)
@@ -47,11 +47,10 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
-  SUBROUTINE tra_ldf_iso_grif( kt, cdtype, pgu, pgv,  &
-       &                                ptb, pta, kjpt, pahtb0 )
+  SUBROUTINE tra_ldf_iso_grif( kt, cdtype, pgu, pgv,              &
+       &                                   ptb, pta, kjpt, pahtb0 )
     !!----------------------------------------------------------------------
     !!                  ***  ROUTINE tra_ldf_iso_grif  ***
@@ -316,7 +315,7 @@
        !
        !                            ! "Poleward" diffusive heat or salt transports (T-S case only)
-       IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( MOD( kt, nf_ptr ) == 0 ) ) THEN
-         IF( jn == jp_tem)   pht_ldf(:) = ptr_vj( zftv(:,:,:) )        ! 3.3  names
-         IF( jn == jp_sal)   pst_ldf(:) = ptr_vj( zftv(:,:,:) )
+       IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( MOD( kt, nn_fptr ) == 0 ) ) THEN
+         IF( jn == jp_tem)   htr_ldf(:) = ptr_vj( zftv(:,:,:) )        ! 3.3  names
+         IF( jn == jp_sal)   str_ldf(:) = ptr_vj( zftv(:,:,:) )
        ENDIF
 
Index: /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_lap.F90
===================================================================
--- /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_lap.F90	(revision 2398)
+++ /branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_lap.F90	(revision 2399)
@@ -39,10 +39,9 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-   
 CONTAINS
 
-   SUBROUTINE tra_ldf_lap( kt, cdtype, pgu, pgv,   &
+   SUBROUTINE tra_ldf_lap( kt, cdtype, pgu, pgv,      &
       &                                ptb, pta, kjpt ) 
       !!----------------------------------------------------------------------
@@ -134,7 +133,7 @@
          !
          ! "Poleward" diffusive heat or salt transports
-         IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( MOD( kt, nf_ptr ) == 0 ) ) THEN
-            IF( jn  == jp_tem)   pht_ldf(:) = ptr_vj( ztv(:,:,:) )
-            IF( jn  == jp_sal)   pst_ldf(:) = ptr_vj( ztv(:,:,:) )
+         IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( MOD( kt, nn_fptr ) == 0 ) ) THEN
+            IF( jn  == jp_tem)   htr_ldf(:) = ptr_vj( ztv(:,:,:) )
+            IF( jn  == jp_sal)   str_ldf(:) = ptr_vj( ztv(:,:,:) )
          ENDIF
          !                                                  ! ==================
