Index: branches/UKMO/dev_r5518_GO6_package/NEMOGCM/ARCH/CMCC/arch-ifort_athena_xios.fcm
===================================================================
--- branches/UKMO/dev_r5518_GO6_package/NEMOGCM/ARCH/CMCC/arch-ifort_athena_xios.fcm	(revision 6792)
+++ branches/UKMO/dev_r5518_GO6_package/NEMOGCM/ARCH/CMCC/arch-ifort_athena_xios.fcm	(revision 6793)
@@ -34,13 +34,13 @@
 
 # required modules
-# module load  INTEL/intel_xe_2013 NETCDF/netcdf-4.3_parallel NETCDF/parallel-netcdf-1.3.1 HDF5/hdf5-1.8.11_parallel
+# module load  INTEL/intel_xe_2013 NETCDF/netcdf-4.3_parallel NETCDF/parallel-netcdf-1.7.0 HDF5/hdf5-1.8.11_parallel
 
-# Environment variables set by user. Others should automatically define when loading modules.
+# NETCDF and PNETCDF should be set automatically when loading modules.
+# The following environment variables must be set by the user.
 #export XIOS=/users/home/models/nemo/xios
 #export HDF5=/users/home/opt/hdf5/hdf5-1.8.11_parallel
-#export NETCDF=/users/home/opt/netcdf/netcdf-4.3_parallel
 
-%NCDF_INC            -I${NETCDF}/include 
-%NCDF_LIB            -L${NETCDF}/lib -lnetcdff -lnetcdf
+%NCDF_INC            -I${NETCDF}/include -I${PNETCDF}/include
+%NCDF_LIB            -L${NETCDF}/lib -lnetcdff -lnetcdf -L${PNETCDF}/lib -lpnetcdf
 %HDF5_INC            -I${HDF5}/include
 %HDF5_LIB            -L${HDF5}/lib -lhdf5_hl -lhdf5
Index: branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/DIA/diaar5.F90
===================================================================
--- branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/DIA/diaar5.F90	(revision 6792)
+++ branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/DIA/diaar5.F90	(revision 6793)
@@ -211,21 +211,4 @@
       REAL(wp) ::   zztmp  
       REAL(wp), POINTER, DIMENSION(:,:,:,:) ::   zsaldta   ! Jan/Dec levitus salinity
-      ! reading initial file
-      LOGICAL  ::   ln_tsd_init      !: T & S data flag
-      LOGICAL  ::   ln_tsd_tradmp    !: internal damping toward input data flag
-      CHARACTER(len=100)            ::   cn_dir
-      TYPE(FLD_N)                   ::  sn_tem,sn_sal
-      INTEGER  ::   ios=0
-
-      NAMELIST/namtsd/ ln_tsd_init,ln_tsd_tradmp,cn_dir,sn_tem,sn_sal
-      !
-
-      REWIND( numnam_ref )              ! Namelist namtsd in reference namelist :
-      READ  ( numnam_ref, namtsd, IOSTAT = ios, ERR = 901)
-901   IF( ios /= 0 ) CALL ctl_nam ( ios , ' namtsd in reference namelist for dia_ar5', lwp )
-      REWIND( numnam_cfg )              ! Namelist namtsd in configuration namelist : Parameters of the run
-      READ  ( numnam_cfg, namtsd, IOSTAT = ios, ERR = 902 )
-902   IF( ios /= 0 ) CALL ctl_nam ( ios , ' namtsd in configuration namelist for dia_ar5', lwp )
-      IF(lwm) WRITE ( numond, namtsd )
       !
       !!----------------------------------------------------------------------
@@ -233,5 +216,5 @@
       IF( nn_timing == 1 )   CALL timing_start('dia_ar5_init')
       !
-      CALL wrk_alloc( jpi , jpj , jpk, jpts, zsaldta )
+      CALL wrk_alloc( jpi, jpj, jpk, 2, zsaldta )
       !                                      ! allocate dia_ar5 arrays
       IF( dia_ar5_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'dia_ar5_init : unable to allocate arrays' )
@@ -249,8 +232,9 @@
       IF( lk_mpp )   CALL mpp_sum( vol0 )
 
-      CALL iom_open ( TRIM( cn_dir )//TRIM(sn_sal%clname), inum )
-      CALL iom_get  ( inum, jpdom_data, TRIM(sn_sal%clvar), zsaldta(:,:,:,1), 1  )
-      CALL iom_get  ( inum, jpdom_data, TRIM(sn_sal%clvar), zsaldta(:,:,:,2), 12 )
+      CALL iom_open ( 'sali_ref_clim_monthly', inum )
+      CALL iom_get  ( inum, jpdom_data, 'vosaline' , zsaldta(:,:,:,1), 1  )
+      CALL iom_get  ( inum, jpdom_data, 'vosaline' , zsaldta(:,:,:,2), 12 )
       CALL iom_close( inum )
+
       sn0(:,:,:) = 0.5_wp * ( zsaldta(:,:,:,1) + zsaldta(:,:,:,2) )        
       sn0(:,:,:) = sn0(:,:,:) * tmask(:,:,:)
@@ -267,5 +251,5 @@
       ENDIF
       !
-      CALL wrk_dealloc( jpi , jpj , jpk, jpts, zsaldta )
+      CALL wrk_dealloc( jpi, jpj, jpk, 2, zsaldta )
       !
       IF( nn_timing == 1 )   CALL timing_stop('dia_ar5_init')
Index: branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/LDF/ldfeiv.F90
===================================================================
--- branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/LDF/ldfeiv.F90	(revision 6792)
+++ branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/LDF/ldfeiv.F90	(revision 6793)
@@ -157,4 +157,14 @@
          END DO
       ENDIF
+
+      ! ORCA R1: Take the minimum between aeiw  and aeiv0
+      IF( cp_cfg == "orca" .AND. jp_cfg == 1 ) THEN
+         DO jj = 2, jpjm1
+            DO ji = fs_2, fs_jpim1   ! vector opt.
+               aeiw(ji,jj) = MIN( aeiw(ji,jj), aeiv0 )
+            END DO
+         END DO
+      ENDIF
+
       CALL lbc_lnk( aeiw, 'W', 1. )      ! lateral boundary condition on aeiw 
 
Index: branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/TRA/eosbn2.F90
===================================================================
--- branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/TRA/eosbn2.F90	(revision 6792)
+++ branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/TRA/eosbn2.F90	(revision 6793)
@@ -1018,5 +1018,5 @@
          DO jj = 1, jpj
             DO ji = 1, jpi
-               zs= SQRT( ABS( psal(ji,jj) ) * r1_S0 )           ! square root salinity
+               zs= SQRT( ABS( psal(ji,jj) ) / 35.16504_wp )           ! square root salinity
                ptf(ji,jj) = ((((1.46873e-03_wp*zs-9.64972e-03_wp)*zs+2.28348e-02_wp)*zs &
                   &          - 3.12775e-02_wp)*zs+2.07679e-02_wp)*zs-5.87701e-02_wp
@@ -1066,5 +1066,5 @@
       CASE ( -1, 1 )                !==  CT,SA (TEOS-10 formulation) ==!
          !
-         zs  = SQRT( ABS( psal ) * r1_S0 )           ! square root salinity
+         zs  = SQRT( ABS( psal ) / 35.16504_wp )           ! square root salinity
          ptf = ((((1.46873e-03_wp*zs-9.64972e-03_wp)*zs+2.28348e-02_wp)*zs &
                   &          - 3.12775e-02_wp)*zs+2.07679e-02_wp)*zs-5.87701e-02_wp
Index: branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_tvd.F90
===================================================================
--- branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_tvd.F90	(revision 6792)
+++ branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_tvd.F90	(revision 6793)
@@ -173,12 +173,11 @@
             DO jj = 2, jpjm1
                DO ji = fs_2, fs_jpim1   ! vector opt.
-                  zbtr = 1. / ( e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,jk) )
                   ! total intermediate advective trends
-                  ztra = - zbtr * (  zwx(ji,jj,jk) - zwx(ji-1,jj  ,jk  )   &
-                     &             + zwy(ji,jj,jk) - zwy(ji  ,jj-1,jk  )   &
-                     &             + zwz(ji,jj,jk) - zwz(ji  ,jj  ,jk+1) )
+                  ztra = - (  zwx(ji,jj,jk) - zwx(ji-1,jj  ,jk  )   &
+                     &      + zwy(ji,jj,jk) - zwy(ji  ,jj-1,jk  )   &
+                     &      + zwz(ji,jj,jk) - zwz(ji  ,jj  ,jk+1) ) / e1e2t(ji,jj)
                   ! update and guess with monotonic sheme
-                  pta(ji,jj,jk,jn) =   pta(ji,jj,jk,jn)         + ztra   * tmask(ji,jj,jk)
-                  zwi(ji,jj,jk)    = ( ptb(ji,jj,jk,jn) + z2dtt * ztra ) * tmask(ji,jj,jk)
+                  pta(ji,jj,jk,jn) =                       pta(ji,jj,jk,jn) +         ztra   / fse3t_n(ji,jj,jk) * tmask(ji,jj,jk)
+                  zwi(ji,jj,jk)    = ( fse3t_b(ji,jj,jk) * ptb(ji,jj,jk,jn) + z2dtt * ztra ) / fse3t_a(ji,jj,jk) * tmask(ji,jj,jk)
                END DO
             END DO
@@ -410,12 +409,11 @@
             DO jj = 2, jpjm1
                DO ji = fs_2, fs_jpim1   ! vector opt.
-                  zbtr = 1._wp / ( e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,jk) )
                   ! total intermediate advective trends
-                  ztra = - zbtr * (  zwx(ji,jj,jk) - zwx(ji-1,jj  ,jk  )   &
-                     &             + zwy(ji,jj,jk) - zwy(ji  ,jj-1,jk  )   &
-                     &             + zwz(ji,jj,jk) - zwz(ji  ,jj  ,jk+1) )
+                  ztra = - (  zwx(ji,jj,jk) - zwx(ji-1,jj  ,jk  )   &
+                     &      + zwy(ji,jj,jk) - zwy(ji  ,jj-1,jk  )   &
+                     &      + zwz(ji,jj,jk) - zwz(ji  ,jj  ,jk+1) ) / e1e2t(ji,jj)
                   ! update and guess with monotonic sheme
-                  pta(ji,jj,jk,jn) =   pta(ji,jj,jk,jn)         + ztra
-                  zwi(ji,jj,jk)    = ( ptb(ji,jj,jk,jn) + z2dtt * ztra ) * tmask(ji,jj,jk)
+                  pta(ji,jj,jk,jn) =                       pta(ji,jj,jk,jn) +         ztra   / fse3t_n(ji,jj,jk) * tmask(ji,jj,jk)
+                  zwi(ji,jj,jk)    = ( fse3t_b(ji,jj,jk) * ptb(ji,jj,jk,jn) + z2dtt * ztra ) / fse3t_a(ji,jj,jk) * tmask(ji,jj,jk)
                END DO
             END DO
@@ -438,8 +436,7 @@
          ! --------------------------------------------------
          ! antidiffusive flux on i and j
-
-
-         DO jk = 1, jpkm1
-
+         !
+         DO jk = 1, jpkm1
+            !
             DO jj = 1, jpjm1
                DO ji = 1, fs_jpim1   ! vector opt.
@@ -572,4 +569,5 @@
    END SUBROUTINE tra_adv_tvd_zts
 
+
    SUBROUTINE nonosc( pbef, paa, pbb, pcc, paft, p2dt )
       !!---------------------------------------------------------------------
Index: branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/TRA/trasbc.F90
===================================================================
--- branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/TRA/trasbc.F90	(revision 6792)
+++ branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/TRA/trasbc.F90	(revision 6793)
@@ -158,4 +158,5 @@
          ELSE                                         ! No restart or restart not found: Euler forward time stepping
             zfact = 1._wp
+            sbc_tsc(:,:,:) = 0._wp
             sbc_tsc_b(:,:,:) = 0._wp
          ENDIF
Index: branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zopt.F90
===================================================================
--- branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zopt.F90	(revision 6792)
+++ branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zopt.F90	(revision 6793)
@@ -76,5 +76,6 @@
       REAL(wp) ::   zchl
       REAL(wp) ::   zc0 , zc1 , zc2, zc3, z1_dep
-      REAL(wp), POINTER, DIMENSION(:,:  ) :: zdepmoy, zetmp1, zetmp2, zetmp3, zetmp4, zqsr100
+      REAL(wp), POINTER, DIMENSION(:,:  ) :: zdepmoy, zetmp1, zetmp2, zetmp3, zetmp4
+      REAL(wp), POINTER, DIMENSION(:,:  ) :: zqsr100, zqsr_corr
       REAL(wp), POINTER, DIMENSION(:,:,:) :: zpar, ze0, ze1, ze2, ze3
       !!---------------------------------------------------------------------
@@ -83,5 +84,6 @@
       !
       ! Allocate temporary workspace
-      CALL wrk_alloc( jpi, jpj,      zqsr100, zdepmoy, zetmp1, zetmp2, zetmp3, zetmp4 )
+      CALL wrk_alloc( jpi, jpj,      zdepmoy, zetmp1, zetmp2, zetmp3, zetmp4 )
+      CALL wrk_alloc( jpi, jpj,      zqsr100, zqsr_corr )
       CALL wrk_alloc( jpi, jpj, jpk, zpar, ze0, ze1, ze2, ze3 )
 
@@ -112,8 +114,10 @@
       !                                        !  --------------------------------------
       IF( l_trcdm2dc ) THEN                     !  diurnal cycle
-         ! 1% of qsr to compute euphotic layer
+         !                                       ! 1% of qsr to compute euphotic layer
          zqsr100(:,:) = 0.01 * qsr_mean(:,:)     !  daily mean qsr
          !
-         CALL p4z_opt_par( kt, qsr_mean, ze1, ze2, ze3 ) 
+         zqsr_corr(:,:) = qsr_mean(:,:) / ( 1. - fr_i(:,:) + rtrn )
+         !
+         CALL p4z_opt_par( kt, zqsr_corr, ze1, ze2, ze3 ) 
          !
          DO jk = 1, nksrp      
@@ -123,5 +127,7 @@
          END DO
          !
-         CALL p4z_opt_par( kt, qsr, ze1, ze2, ze3 ) 
+         zqsr_corr(:,:) = qsr(:,:) / ( 1. - fr_i(:,:) + rtrn )
+         !
+         CALL p4z_opt_par( kt, zqsr_corr, ze1, ze2, ze3 ) 
          !
          DO jk = 1, nksrp      
@@ -133,5 +139,7 @@
          zqsr100(:,:) = 0.01 * qsr(:,:)
          !
-         CALL p4z_opt_par( kt, qsr, ze1, ze2, ze3 ) 
+         zqsr_corr(:,:) = qsr(:,:) / ( 1. - fr_i(:,:) + rtrn )
+         !
+         CALL p4z_opt_par( kt, zqsr_corr, ze1, ze2, ze3 ) 
          !
          DO jk = 1, nksrp      
@@ -226,5 +234,6 @@
       ENDIF
       !
-      CALL wrk_dealloc( jpi, jpj,      zqsr100, zdepmoy, zetmp1, zetmp2, zetmp3, zetmp4 )
+      CALL wrk_dealloc( jpi, jpj,      zdepmoy, zetmp1, zetmp2, zetmp3, zetmp4 )
+      CALL wrk_dealloc( jpi, jpj,      zqsr100, zqsr_corr )
       CALL wrk_dealloc( jpi, jpj, jpk, zpar,  ze0, ze1, ze2, ze3 )
       !
Index: branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zprod.F90
===================================================================
--- branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zprod.F90	(revision 6792)
+++ branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zprod.F90	(revision 6793)
@@ -136,5 +136,5 @@
                   zval = MAX( 1., zstrn(ji,jj) )
                   zval = 1.5 * zval / ( 12. + zval )
-                  zprbio(ji,jj,jk) = prmax(ji,jj,jk) * zval
+                  zprbio(ji,jj,jk) = prmax(ji,jj,jk) * zval * ( 1. - fr_i(ji,jj) )
                   zprdia(ji,jj,jk) = zprbio(ji,jj,jk)
                ENDIF
Index: branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90
===================================================================
--- branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90	(revision 6792)
+++ branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90	(revision 6793)
@@ -35,5 +35,5 @@
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   restotr   ! restoring coeff. on tracers (s-1)
 
-   INTEGER, PARAMETER           ::   npncts   = 5        ! number of closed sea
+   INTEGER, PARAMETER           ::   npncts   = 8        ! number of closed sea
    INTEGER, DIMENSION(npncts)   ::   nctsi1, nctsj1      ! south-west closed sea limits (i,j)
    INTEGER, DIMENSION(npncts)   ::   nctsi2, nctsj2      ! north-east closed sea limits (i,j)
@@ -107,6 +107,5 @@
                
                jl = n_trc_index(jn) 
-               CALL trc_dta( kt, sf_trcdta(jl) )   ! read tracer data at nit000
-               ztrcdta(:,:,:) = sf_trcdta(jl)%fnow(:,:,:) * tmask(:,:,:) * rf_trfac(jl)
+               CALL trc_dta( kt, sf_trcdta(jl), rf_trfac(jl), ztrcdta )   ! read tracer data at nit000
 
                SELECT CASE ( nn_zdmp_tr )
@@ -187,4 +186,5 @@
       INTEGER :: ji , jj, jk, jn, jl, jc                     ! dummy loop indicesa
       INTEGER :: isrow                                      ! local index
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::  ztrcdta       ! 3D  workspace
 
       !!----------------------------------------------------------------------
@@ -207,6 +207,27 @@
             !
                                                         ! Caspian Sea
-            nctsi1(1)   = 332  ; nctsj1(1)   = 243 - isrow
-            nctsi2(1)   = 344  ; nctsj2(1)   = 275 - isrow
+            nctsi1(1)   = 333  ; nctsj1(1)   = 243 - isrow
+            nctsi2(1)   = 342  ; nctsj2(1)   = 274 - isrow
+            !                                           ! Lake Superior
+            nctsi1(2)   = 198  ; nctsj1(2)   = 258 - isrow
+            nctsi2(2)   = 204  ; nctsj2(2)   = 262 - isrow
+            !                                           ! Lake Michigan
+            nctsi1(3)   = 201  ; nctsj1(3)   = 250 - isrow
+            nctsi2(3)   = 203  ; nctsj2(3)   = 256 - isrow
+            !                                           ! Lake Huron
+            nctsi1(4)   = 204  ; nctsj1(4)   = 252 - isrow
+            nctsi2(4)   = 209  ; nctsj2(4)   = 256 - isrow
+            !                                           ! Lake Erie
+            nctsi1(5)   = 206  ; nctsj1(5)   = 249 - isrow
+            nctsi2(5)   = 209  ; nctsj2(5)   = 251 - isrow
+            !                                           ! Lake Ontario
+            nctsi1(6)   = 210  ; nctsj1(6)   = 252 - isrow
+            nctsi2(6)   = 212  ; nctsj2(6)   = 252 - isrow
+            !                                           ! Victoria Lake
+            nctsi1(7)   = 321  ; nctsj1(7)   = 180 - isrow
+            nctsi2(7)   = 322  ; nctsj2(7)   = 189 - isrow
+            !                                           ! Baltic Sea
+            nctsi1(8)   = 297  ; nctsj1(8)   = 270 - isrow
+            nctsi2(8)   = 308  ; nctsj2(8)   = 293 - isrow
             !                                        
             !                                           ! =======================
@@ -277,13 +298,15 @@
          IF(lwp)  WRITE(numout,*)
          !
+         CALL wrk_alloc( jpi, jpj, jpk, ztrcdta )   ! Memory allocation
+         !
          DO jn = 1, jptra
             IF( ln_trc_ini(jn) ) THEN      ! update passive tracers arrays with input data read from file
                 jl = n_trc_index(jn)
-                CALL trc_dta( kt, sf_trcdta(jl) )   ! read tracer data at nit000
+                CALL trc_dta( kt, sf_trcdta(jl), rf_trfac(jl), ztrcdta )   ! read tracer data at nit000
                 DO jc = 1, npncts
                    DO jk = 1, jpkm1
                       DO jj = nctsj1(jc), nctsj2(jc)
                          DO ji = nctsi1(jc), nctsi2(jc)
-                            trn(ji,jj,jk,jn) = sf_trcdta(jl)%fnow(ji,jj,jk) * tmask(ji,jj,jk) * rf_trfac(jl)
+                            trn(ji,jj,jk,jn) = ztrcdta(ji,jj,jk)
                             trb(ji,jj,jk,jn) = trn(ji,jj,jk,jn)
                          ENDDO
@@ -293,5 +316,5 @@
              ENDIF
           ENDDO
-          !
+          CALL wrk_dealloc( jpi, jpj, jpk, ztrcdta )
       ENDIF
       !
@@ -313,4 +336,6 @@
       IF( nn_timing == 1 )  CALL timing_start('trc_dmp_init')
       !
+      !Allocate arrays
+      IF( trc_dmp_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'trc_dmp_init: unable to allocate arrays' )
 
       IF( lzoom )   nn_zdmp_tr = 0           ! restoring to climatology at closed north or south boundaries
Index: branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/trcdta.F90
===================================================================
--- branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/trcdta.F90	(revision 6792)
+++ branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/trcdta.F90	(revision 6793)
@@ -77,5 +77,5 @@
       ALLOCATE( n_trc_index(ntrc), slf_i(ntrc), STAT=ierr0 )
       IF( ierr0 > 0 ) THEN
-         CALL ctl_stop( 'trc_nam: unable to allocate n_trc_index' )   ;   RETURN
+         CALL ctl_stop( 'trc_dta_init: unable to allocate n_trc_index' )   ;   RETURN
       ENDIF
       nb_trcdta      = 0
@@ -91,4 +91,6 @@
       IF(lwp) THEN
          WRITE(numout,*) ' '
+         WRITE(numout,*) 'trc_dta_init : Passive tracers Initial Conditions '
+         WRITE(numout,*) '~~~~~~~~~~~~~~ '
          WRITE(numout,*) ' number of passive tracers to be initialize by data :', ntra
          WRITE(numout,*) ' '
@@ -107,14 +109,18 @@
          DO jn = 1, ntrc
             IF( ln_trc_ini(jn) )  THEN    ! open input file only if ln_trc_ini(jn) is true
-               clndta = TRIM( sn_trcdta(jn)%clvar ) 
-               clntrc = TRIM( ctrcnm   (jn)       ) 
+               clndta = TRIM( sn_trcdta(jn)%clvar )
+               if (jn > jptra) then
+                  clntrc='Dummy' ! By pass weird formats in ocean.output if ntrc > jptra
+               else
+                  clntrc = TRIM( ctrcnm   (jn)       )
+               endif
                zfact  = rn_trfac(jn)
-               IF( clndta /=  clntrc ) THEN 
-                  CALL ctl_warn( 'trc_dta_init: passive tracer data initialisation :  ',   &
-                  &              'the variable name in the data file : '//clndta//   & 
-                  &              '  must be the same than the name of the passive tracer : '//clntrc//' ')
+               IF( clndta /=  clntrc ) THEN
+                  CALL ctl_warn( 'trc_dta_init: passive tracer data initialisation    ',   &
+                  &              'Input name of data file : '//TRIM(clndta)//   &
+                  &              ' differs from that of tracer : '//TRIM(clntrc)//' ')
                ENDIF
-               WRITE(numout,*) ' read an initial file for passive tracer number :', jn, ' name : ', clndta, & 
-               &               ' multiplicative factor : ', zfact
+               WRITE(numout,'(a, i4,3a,e11.3)') ' Read IC file for tracer number :', &
+               &            jn, ', name : ', TRIM(clndta), ', Multiplicative Scaling factor : ', zfact
             ENDIF
          END DO
@@ -124,5 +130,5 @@
          ALLOCATE( sf_trcdta(nb_trcdta), rf_trfac(nb_trcdta), STAT=ierr1 )
          IF( ierr1 > 0 ) THEN
-            CALL ctl_stop( 'trc_dta_ini: unable to allocate  sf_trcdta structure' )   ;   RETURN
+            CALL ctl_stop( 'trc_dta_init: unable to allocate  sf_trcdta structure' )   ;   RETURN
          ENDIF
          !
@@ -135,5 +141,5 @@
                IF( sn_trcdta(jn)%ln_tint )  ALLOCATE( sf_trcdta(jl)%fdta(jpi,jpj,jpk,2) , STAT=ierr3 )
                IF( ierr2 + ierr3 > 0 ) THEN
-                 CALL ctl_stop( 'trc_dta : unable to allocate passive tracer data arrays' )   ;   RETURN
+                 CALL ctl_stop( 'trc_dta_init : unable to allocate passive tracer data arrays' )   ;   RETURN
                ENDIF
             ENDIF
@@ -141,5 +147,5 @@
          ENDDO
          !                         ! fill sf_trcdta with slf_i and control print
-         CALL fld_fill( sf_trcdta, slf_i, cn_dir, 'trc_dta', 'Passive tracer data', 'namtrc' )
+         CALL fld_fill( sf_trcdta, slf_i, cn_dir, 'trc_dta_init', 'Passive tracer data', 'namtrc' )
          !
       ENDIF
@@ -151,5 +157,5 @@
 
 
-   SUBROUTINE trc_dta( kt, sf_dta )
+   SUBROUTINE trc_dta( kt, sf_dta, ptrfac, ptrc)
       !!----------------------------------------------------------------------
       !!                   ***  ROUTINE trc_dta  ***
@@ -164,9 +170,12 @@
       !!----------------------------------------------------------------------
       INTEGER                     , INTENT(in   ) ::   kt     ! ocean time-step
-      TYPE(FLD), DIMENSION(1)   , INTENT(inout) ::   sf_dta     ! array of information on the field to read
+      TYPE(FLD), DIMENSION(1)     , INTENT(inout) ::   sf_dta     ! array of information on the field to read
+      REAL(wp)                    , INTENT(in   ) ::   ptrfac  ! multiplication factor
+      REAL(wp), DIMENSION(jpi,jpj,jpk), OPTIONAL  , INTENT(out  ) ::   ptrc
       !
       INTEGER ::   ji, jj, jk, jl, jkk, ik    ! dummy loop indices
       REAL(wp)::   zl, zi
       REAL(wp), DIMENSION(jpk) ::  ztp                ! 1D workspace
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::  ztrcdta   ! 3D  workspace
       CHARACTER(len=100) :: clndta
       !!----------------------------------------------------------------------
@@ -176,5 +185,8 @@
       IF( nb_trcdta > 0 ) THEN
          !
+         CALL wrk_alloc( jpi, jpj, jpk, ztrcdta )    ! Memory allocation
+         !
          CALL fld_read( kt, 1, sf_dta )      !==   read data at kt time step   ==!
+         ztrcdta(:,:,:) = sf_dta(1)%fnow(:,:,:) * tmask(:,:,:)    ! Mask
          !
          IF( ln_sco ) THEN                   !==   s- or mixed s-zps-coordinate   ==!
@@ -185,51 +197,58 @@
             ENDIF
             !
-               DO jj = 1, jpj                         ! vertical interpolation of T & S
+            DO jj = 1, jpj                         ! vertical interpolation of T & S
+               DO ji = 1, jpi
+                  DO jk = 1, jpk                        ! determines the intepolated T-S profiles at each (i,j) points
+                     zl = fsdept_n(ji,jj,jk)
+                     IF(     zl < gdept_1d(1  ) ) THEN         ! above the first level of data
+                        ztp(jk) = ztrcdta(ji,jj,1)
+                     ELSEIF( zl > gdept_1d(jpk) ) THEN         ! below the last level of data
+                        ztp(jk) =  ztrcdta(ji,jj,jpkm1)
+                     ELSE                                      ! inbetween : vertical interpolation between jkk & jkk+1
+                        DO jkk = 1, jpkm1                                  ! when  gdept(jkk) < zl < gdept(jkk+1)
+                           IF( (zl-gdept_1d(jkk)) * (zl-gdept_1d(jkk+1)) <= 0._wp ) THEN
+                              zi = ( zl - gdept_1d(jkk) ) / (gdept_1d(jkk+1)-gdept_1d(jkk))
+                              ztp(jk) = ztrcdta(ji,jj,jkk) + ( ztrcdta(ji,jj,jkk+1) - &
+                                        ztrcdta(ji,jj,jkk) ) * zi 
+                           ENDIF
+                        END DO
+                     ENDIF
+                  END DO
+                  DO jk = 1, jpkm1
+                    ztrcdta(ji,jj,jk) = ztp(jk) * tmask(ji,jj,jk)     ! mask required for mixed zps-s-coord
+                  END DO
+                  ztrcdta(ji,jj,jpk) = 0._wp
+                END DO
+            END DO
+            ! 
+         ELSE                                !==   z- or zps- coordinate   ==!
+            !
+            IF( ln_zps ) THEN                      ! zps-coordinate (partial steps) interpolation at the last ocean level
+               DO jj = 1, jpj
                   DO ji = 1, jpi
-                     DO jk = 1, jpk                        ! determines the intepolated T-S profiles at each (i,j) points
-                        zl = fsdept_n(ji,jj,jk)
-                        IF(     zl < gdept_1d(1  ) ) THEN         ! above the first level of data
-                           ztp(jk) =  sf_dta(1)%fnow(ji,jj,1)
-                        ELSEIF( zl > gdept_1d(jpk) ) THEN         ! below the last level of data
-                           ztp(jk) =  sf_dta(1)%fnow(ji,jj,jpkm1)
-                        ELSE                                      ! inbetween : vertical interpolation between jkk & jkk+1
-                           DO jkk = 1, jpkm1                                  ! when  gdept(jkk) < zl < gdept(jkk+1)
-                              IF( (zl-gdept_1d(jkk)) * (zl-gdept_1d(jkk+1)) <= 0._wp ) THEN
-                                 zi = ( zl - gdept_1d(jkk) ) / (gdept_1d(jkk+1)-gdept_1d(jkk))
-                                 ztp(jk) = sf_dta(1)%fnow(ji,jj,jkk) + ( sf_dta(1)%fnow(ji,jj,jkk+1) - &
-                                           sf_dta(1)%fnow(ji,jj,jkk) ) * zi 
-                              ENDIF
-                           END DO
-                        ENDIF
-                     END DO
-                     DO jk = 1, jpkm1
-                        sf_dta(1)%fnow(ji,jj,jk) = ztp(jk) * tmask(ji,jj,jk)     ! mask required for mixed zps-s-coord
-                     END DO
-                     sf_dta(1)%fnow(ji,jj,jpk) = 0._wp
+                     ik = mbkt(ji,jj) 
+                     IF( ik > 1 ) THEN
+                        zl = ( gdept_1d(ik) - fsdept_n(ji,jj,ik) ) / ( gdept_1d(ik) - gdept_1d(ik-1) )
+                        ztrcdta(ji,jj,ik) = (1.-zl) * ztrcdta(ji,jj,ik) + zl * ztrcdta(ji,jj,ik-1)
+                     ENDIF
+                     ik = mikt(ji,jj)
+                     IF( ik > 1 ) THEN
+                        zl = ( fsdept_n(ji,jj,ik) - gdept_1d(ik) ) / ( gdept_1d(ik+1) - gdept_1d(ik) )
+                        ztrcdta(ji,jj,ik) = (1.-zl) * ztrcdta(ji,jj,ik) + zl * ztrcdta(ji,jj,ik+1)
+                     ENDIF
                   END DO
                END DO
-            ! 
-         ELSE                                !==   z- or zps- coordinate   ==!
-            !                             
-               sf_dta(1)%fnow(:,:,:) = sf_dta(1)%fnow(:,:,:) * tmask(:,:,:)    ! Mask
-               !
-               IF( ln_zps ) THEN                      ! zps-coordinate (partial steps) interpolation at the last ocean level
-                  DO jj = 1, jpj
-                     DO ji = 1, jpi
-                        ik = mbkt(ji,jj) 
-                        IF( ik > 1 ) THEN
-                           zl = ( gdept_1d(ik) - fsdept_n(ji,jj,ik) ) / ( gdept_1d(ik) - gdept_1d(ik-1) )
-                           sf_dta(1)%fnow(ji,jj,ik) = (1.-zl) * sf_dta(1)%fnow(ji,jj,ik) + zl * sf_dta(1)%fnow(ji,jj,ik-1)
-                        ENDIF
-                        ik = mikt(ji,jj)
-                        IF( ik > 1 ) THEN
-                           zl = ( gdept_0(ji,jj,ik) - gdept_1d(ik) ) / ( gdept_1d(ik+1) - gdept_1d(ik) )
-                           sf_dta(1)%fnow(ji,jj,ik) = (1.-zl) * sf_dta(1)%fnow(ji,jj,ik) + zl * sf_dta(1)%fnow(ji,jj,ik+1)
-                        ENDIF
-                     END DO
-                  END DO
-               ENDIF
-            !
-         ENDIF
+            ENDIF
+            !
+         ENDIF
+         !
+         ! Add multiplicative factor
+         ztrcdta(:,:,:) = ztrcdta(:,:,:) * ptrfac
+         !
+         ! Data structure for trc_ini (and BFMv5.1 coupling)
+         IF( .NOT. PRESENT(ptrc) ) sf_dta(1)%fnow(:,:,:) = ztrcdta(:,:,:)
+         !
+         ! Data structure for trc_dmp
+         IF( PRESENT(ptrc) )  ptrc(:,:,:) = ztrcdta(:,:,:)
          !
          IF( lwp .AND. kt == nit000 ) THEN
@@ -238,11 +257,14 @@
                WRITE(numout,*)
                WRITE(numout,*)'  level = 1'
-               CALL prihre( sf_dta(1)%fnow(:,:,1), jpi, jpj, 1, jpi, 20, 1, jpj, 20, 1., numout )
+               CALL prihre( ztrcdta(:,:,1), jpi, jpj, 1, jpi, 20, 1, jpj, 20, 1., numout )
                WRITE(numout,*)'  level = ', jpk/2
-               CALL prihre( sf_dta(1)%fnow(:,:,jpk/2), jpi, jpj, 1, jpi, 20, 1, jpj, 20, 1., numout )
+               CALL prihre( ztrcdta(:,:,jpk/2), jpi, jpj, 1, jpi, 20, 1, jpj, 20, 1., numout )
                WRITE(numout,*)'  level = ', jpkm1
-               CALL prihre( sf_dta(1)%fnow(:,:,jpkm1), jpi, jpj, 1, jpi, 20, 1, jpj, 20, 1., numout )
+               CALL prihre( ztrcdta(:,:,jpkm1), jpi, jpj, 1, jpi, 20, 1, jpj, 20, 1., numout )
                WRITE(numout,*)
          ENDIF
+         !
+         CALL wrk_dealloc( jpi, jpj, jpk, ztrcdta )
+         !
       ENDIF
       !
@@ -255,5 +277,5 @@
    !!----------------------------------------------------------------------
 CONTAINS
-   SUBROUTINE trc_dta( kt, sf_dta, zrf_trfac )        ! Empty routine
+   SUBROUTINE trc_dta( kt, sf_dta, ptrfac, ptrc)        ! Empty routine
       WRITE(*,*) 'trc_dta: You should not have seen this print! error?', kt
    END SUBROUTINE trc_dta
Index: branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/trcini.F90
===================================================================
--- branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/trcini.F90	(revision 6792)
+++ branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/trcini.F90	(revision 6793)
@@ -123,7 +123,6 @@
                IF( ln_trc_ini(jn) ) THEN      ! update passive tracers arrays with input data read from file
                   jl = n_trc_index(jn) 
-                  CALL trc_dta( nit000, sf_trcdta(jl) )   ! read tracer data at nit000
-                  trn(:,:,:,jn) = sf_trcdta(jl)%fnow(:,:,:) * tmask(:,:,:) * rf_trfac(jl)
-                  !
+                  CALL trc_dta( nit000, sf_trcdta(jl), rf_trfac(jl) )   ! read tracer data at nit000
+                  trn(:,:,:,jn) = sf_trcdta(jl)%fnow(:,:,:) 
                   IF( .NOT.ln_trcdmp .AND. .NOT.ln_trcdmp_clo ) THEN      !== deallocate data structure   ==!
                      !                                                    (data used only for initialisation)
Index: branches/UKMO/dev_r5518_GO6_package/NEMOGCM/TOOLS/REBUILD_NEMO/icb_combrest.py
===================================================================
--- branches/UKMO/dev_r5518_GO6_package/NEMOGCM/TOOLS/REBUILD_NEMO/icb_combrest.py	(revision 6792)
+++ branches/UKMO/dev_r5518_GO6_package/NEMOGCM/TOOLS/REBUILD_NEMO/icb_combrest.py	(revision 6793)
@@ -169,13 +169,15 @@
     sys.exit(15)
   fo = Dataset(pathout, 'w')
-  for dim in ['x','y','c']:
+  for dim in ['x','y','c','k']:
     indim = fi.dimensions[dim]
     fo.createDimension(dim, len(indim))
-  for var in ['calving','calving_hflx','stored_ice','stored_heat']:
+  for var in ['kount','calving','calving_hflx','stored_ice','stored_heat']:
     invar = fi.variables[var]
     fo.createVariable(var, invar.datatype, invar.dimensions)
     fo.variables[var][:] = invar[:]
-    fo.variables[var].long_name = invar.long_name
-    fo.variables[var].units = invar.units
+    if "long_name" in invar.ncattrs():
+        fo.variables[var].long_name = invar.long_name
+    if "units" in invar.ncattrs():
+        fo.variables[var].units = invar.units
     os.remove(pathout.replace('.nc','_WORK.nc'))
 #
