Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/DIA/diaptr.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/DIA/diaptr.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/DIA/diaptr.F90	(revision 4409)
@@ -146,5 +146,5 @@
 !! DCSE_NEMO: work around deficiency in ftrans
 !     REAL(wp) , INTENT(in), DIMENSION(jpi,jpj,jpk) ::   pva   ! mask flux array at V-point
-      REAL(wp) , INTENT(in)    ::   pva(jpi,jpj,jpk)           ! mask flux array at V-point
+      REAL(wp) , INTENT(in)    ::   pva(jpi,jpj,jpkorig)           ! mask flux array at V-point
       !!
       INTEGER                  ::   ji, jj, jk   ! dummy loop arguments
@@ -237,5 +237,5 @@
 !! DCSE_NEMO: work around a deficiency in ftrans
 !     REAL(wp) , INTENT(in), DIMENSION(jpi,jpj,jpk)           ::   pva    ! mask flux array at V-point
-      REAL(wp) , INTENT(in)             ::   pva(jpi,jpj,jpk)             ! mask flux array at V-point
+      REAL(wp) , INTENT(in)             ::   pva(jpi,jpj,jpkorig)             ! mask flux array at V-point
       REAL(wp) , INTENT(in), DIMENSION(jpi,jpj)    , OPTIONAL ::   pmsk   ! Optional 2D basin mask
       !!
@@ -317,5 +317,5 @@
 !! DCSE_NEMO: work around a deficiency in ftrans
 !     REAL(wp) , INTENT(in), DIMENSION(jpi,jpj,jpk) ::   pta    ! tracer flux array at T-point
-      REAL(wp) , INTENT(in)             :: pta(jpi,jpj,jpk)     ! tracer flux array at T-point
+      REAL(wp) , INTENT(in)             :: pta(jpi,jpj,jpkorig)     ! tracer flux array at T-point
       REAL(wp) , INTENT(in), DIMENSION(jpi,jpj)     ::   pmsk   ! Optional 2D basin mask
       !!
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90	(revision 4409)
@@ -807,5 +807,5 @@
                                     STATUS=ierr)
       IF( ierr == 0)THEN
-         READ(lstr,FMT="(I)",IOSTAT=ierr) lztrim
+         READ(lstr,FMT="(I10)",IOSTAT=ierr) lztrim
          IF(ierr == 0)THEN
             IF (lztrim == 0) domtrim_z = .FALSE.
@@ -817,4 +817,5 @@
       ! Compute and store the deepest bottom level of any grid-type at each grid
       ! point. For use in removing data below ocean floor from compute loops
+      jpkorig = jpk
       IF( domtrim_z ) THEN
          mbkmax(:,:) = MAX(mbkt(:,:)+1, mbku(:,:), mbkv(:,:))
@@ -823,4 +824,8 @@
          WRITE(*,*) narea,': ARPDBG: shallowest pt and jpkf = ', &
                     MINVAL(mbkmax(:,:)), jpkf
+         ! Play rather fast and loose and just change the value of jpk
+         ! here...
+         jpk = jpkf
+         jpkm1 = jpk - 1
       ELSE
          WRITE(*,*) narea,': ARPDBG: NOT trimming domain in z'
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/DTA/dtasal.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/DTA/dtasal.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/DTA/dtasal.F90	(revision 4409)
@@ -96,11 +96,11 @@
 
                                    ! Allocate salinity data array 
-                                ALLOCATE( s_dta(jpi,jpj,jpk)           , STAT=ierr  )
+                                ALLOCATE( s_dta(jpi,jpj,jpkorig)           , STAT=ierr  )
          IF( ierr > 0              )   CALL ctl_stop( 'STOP', 'dta_sal: unable to allocate s_dta array' )
                                    ! Allocate sf_tem structure
                                 ierr2 = 0
-                                ALLOCATE( sf_sal(1)                    , STAT=ierr0 )
-                                ALLOCATE( sf_sal(1)%fnow(jpi,jpj,jpk)  , STAT=ierr1 )
-         IF( sn_sal%ln_tint )   ALLOCATE( sf_sal(1)%fdta(jpi,jpj,jpk,2), STAT=ierr2 )
+                                ALLOCATE( sf_sal(1)                        , STAT=ierr0 )
+                                ALLOCATE( sf_sal(1)%fnow(jpi,jpj,jpkorig)  , STAT=ierr1 )
+         IF( sn_sal%ln_tint )   ALLOCATE( sf_sal(1)%fdta(jpi,jpj,jpkorig,2), STAT=ierr2 )
          IF( ierr0+ierr1+ierr2 > 0 )   CALL ctl_stop( 'STOP', 'dta_sal: unable to allocate sf_sal structure' )
          !                         ! fill sf_sal with sn_sal and control print
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/DTA/dtatem.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/DTA/dtatem.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/DTA/dtatem.F90	(revision 4409)
@@ -103,11 +103,11 @@
 
                                    ! Allocate temperature data array 
-                                ALLOCATE( t_dta(jpi,jpj,jpk)           , STAT=ierr  )
+                                ALLOCATE( t_dta(jpi,jpj,jpkorig)           , STAT=ierr  )
          IF( ierr > 0              )   CALL ctl_stop( 'STOP', 'dta_tem: unable to allocate t_dta array' )
                                    ! Allocate sf_tem structure
                                 ierr2 = 0
-                                ALLOCATE( sf_tem(1)                    , STAT=ierr0 )
-                                ALLOCATE( sf_tem(1)%fnow(jpi,jpj,jpk)  , STAT=ierr1 )
-         IF( sn_tem%ln_tint )   ALLOCATE( sf_tem(1)%fdta(jpi,jpj,jpk,2), STAT=ierr2 )
+                                ALLOCATE( sf_tem(1)                        , STAT=ierr0 )
+                                ALLOCATE( sf_tem(1)%fnow(jpi,jpj,jpkorig)  , STAT=ierr1 )
+         IF( sn_tem%ln_tint )   ALLOCATE( sf_tem(1)%fdta(jpi,jpj,jpkorig,2), STAT=ierr2 )
          IF( ierr0+ierr1+ierr2 > 0 )   CALL ctl_stop( 'STOP', 'dta_tem: unable to allocate sf_tem structure' )
          !                         ! fill sf_tem with sn_tem and control print
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_bilapg.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_bilapg.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_bilapg.F90	(revision 4409)
@@ -211,9 +211,9 @@
 !     REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in   ) ::   pu , pv    ! 1st call: before horizontal velocity 
       !                                                               ! 2nd call: ahm x these fields
-      REAL(wp), INTENT(in   ) ::   pu(jpi,jpj,jpk) , pv(jpi,jpj,jpk)
+      REAL(wp), INTENT(in   ) ::   pu(jpi,jpj,jpkorig) , pv(jpi,jpj,jpkorig)
 !     REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(  out) ::   plu, plv   ! partial harmonic operator applied to
       !                                                               ! pu and pv (all the components except
       !                                                               ! second order vertical derivative term)
-      REAL(wp), INTENT(  out) ::   plu(jpi,jpj,jpk), plv(jpi,jpj,jpk) ! partial harmonic operator applied to
+      REAL(wp), INTENT(  out) ::   plu(jpi,jpj,jpkorig), plv(jpi,jpj,jpkorig) ! partial harmonic operator applied to
       INTEGER                         , INTENT(in   ) ::   kahm       ! =1 1st call ; =2 2nd call
       !
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/DYN/dynvor.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/DYN/dynvor.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/DYN/dynvor.F90	(revision 4409)
@@ -223,6 +223,6 @@
 !     REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pua    ! total u-trend
 !     REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pva    ! total v-trend
-      REAL(wp), INTENT(inout) ::   pua(jpi,jpj,jpk)    ! total u-trend
-      REAL(wp), INTENT(inout) ::   pva(jpi,jpj,jpk)    ! total v-trend
+      REAL(wp), INTENT(inout) ::   pua(jpi,jpj,jpkorig)    ! total u-trend
+      REAL(wp), INTENT(inout) ::   pva(jpi,jpj,jpkorig)    ! total v-trend
       !
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
@@ -459,6 +459,6 @@
 !     REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pua    ! total u-trend
 !     REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pva    ! total v-trend
-      REAL(wp), INTENT(inout) ::   pua(jpi,jpj,jpk)    ! total u-trend
-      REAL(wp), INTENT(inout) ::   pva(jpi,jpj,jpk)    ! total v-trend
+      REAL(wp), INTENT(inout) ::   pua(jpi,jpj,jpkorig)    ! total u-trend
+      REAL(wp), INTENT(inout) ::   pva(jpi,jpj,jpkorig)    ! total v-trend
       !
       INTEGER  ::   ji, jj, jk           ! dummy loop indices
@@ -582,6 +582,6 @@
 !     REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pua    ! total u-trend
 !     REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pva    ! total v-trend
-      REAL(wp), INTENT(inout) ::   pua(jpi,jpj,jpk)    ! total u-trend
-      REAL(wp), INTENT(inout) ::   pva(jpi,jpj,jpk)   ! total v-trend
+      REAL(wp), INTENT(inout) ::   pua(jpi,jpj,jpkorig)    ! total u-trend
+      REAL(wp), INTENT(inout) ::   pva(jpi,jpj,jpkorig)   ! total v-trend
       !!
       INTEGER  ::   ji, jj, jk         ! dummy loop indices
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90	(revision 4409)
@@ -863,5 +863,5 @@
             ELSEIF( PRESENT(pv_r3d) .AND. idom /= jpdom_unknown ) THEN
                ! this if could be simplified with the new lbc_lnk that works with any size of the 3rd dimension
-               IF( icnt(3) == jpk ) THEN
+               IF( icnt(3) == jpkorig ) THEN
                   CALL lbc_lnk( pv_r3d,'Z',-999.,'no0' )
                ELSE   ! put some arbitrary value (a call to lbc_lnk will be done later...)
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/LBC/exchmod.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/LBC/exchmod.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/LBC/exchmod.F90	(revision 4409)
@@ -1,4 +1,4 @@
 MODULE exchmod
-  USE par_oce, ONLY: wp, jpiglo, jpjglo, jpkdta, jpi, jpj, jpk
+  USE par_oce, ONLY: wp, jpiglo, jpjglo, jpkdta, jpi, jpj, jpk, jpkorig
 #if defined key_mpp_mpi
   USE mpi ! For better interface checking
@@ -359,5 +359,5 @@
        ! we can limit the length of our z loops to the
        ! no. of levels above the ocean floor.
-       IF(kdim1 == jpk)kdim1 = jpkf
+       IF(kdim1 == jpkorig)kdim1 = jpkf
     ELSEIF ( PRESENT(ib3) ) THEN
 #if defined key_z_first
@@ -2756,5 +2756,5 @@
       !!----------------------------------------------------------------------
 !FTRANS ptab3d :I :I :z
-      REAL(wp),                         INTENT(inout) ::   ptab3d(jpi,jpj,jpk)
+      REAL(wp),                         INTENT(inout) ::   ptab3d(:,:,:)
       CHARACTER(len=1)                , INTENT(in   ) ::   cd_type  ! define the nature of ptab array grid-points
       !                                                             ! = T , U , V , F , W points
@@ -3757,4 +3757,9 @@
              pack_patches3r: DO ipatch=1,npatchsend(isend,1)
 
+                IF(nzsendp(ipatch,isend,1) > SIZE(b3,3))THEN
+                   CALL MPI_Abort(mpi_comm_opa,-1,ierr)
+                   CALL ctl_stop('STOP','exchs_generic: b3 has wrong z dimension')
+                END IF
+
                 jstart = jsrcsendp(ipatch,isend,1)
                 istart = isrcsendp(ipatch,isend,1)
@@ -3914,4 +3919,11 @@
                 istart = idesrecvp(ipatch,irecv,1)!+nhalo
                 iend   = istart+nxrecvp(ipatch,irecv,1)-1
+
+                IF(nzrecvp(ipatch,irecv,1) > SIZE(b3,3))THEN
+                   CALL MPI_Abort(mpi_comm_opa,-1,ierr)
+                   CALL ctl_stop('STOP', &
+                                 'exchs_generic: wrong z dim for b3 in recv')
+                END IF
+
 #if defined key_z_first
                 DO j=jstart, jend, 1
@@ -4397,10 +4409,10 @@
     IF(.not. ALLOCATED(ztab))THEN
 
-       ALLOCATE(ztab(jpiglo,maxExchItems*ijpj,jpk),                 &
-                iztab(jpiglo,maxExchItems*ijpj,jpk),                &
-                znorthgloio(nwidthmax,maxExchItems*ijpj,jpk,jpni),  &
-                znorthloc(nwidthmax,maxExchItems*ijpj,jpk),         &
-                iznorthgloio(nwidthmax,maxExchItems*ijpj,jpk,jpni), &
-                iznorthloc(nwidthmax,maxExchItems*ijpj,jpk),        &
+       ALLOCATE(ztab(jpiglo,maxExchItems*ijpj,jpkorig),                 &
+                iztab(jpiglo,maxExchItems*ijpj,jpkorig),                &
+                znorthgloio(nwidthmax,maxExchItems*ijpj,jpkorig,jpni),  &
+                znorthloc(nwidthmax,maxExchItems*ijpj,jpkorig),         &
+                iznorthgloio(nwidthmax,maxExchItems*ijpj,jpkorig,jpni), &
+                iznorthloc(nwidthmax,maxExchItems*ijpj,jpkorig),        &
                 STAT=ierr)
        IF(ierr .ne. 0)THEN
@@ -5930,5 +5942,5 @@
      CHARACTER(len=1), INTENT( in ) :: cd_type ! nature of pt3d grid-points
      !                                         ! = T,  U, V, F or W gridp'ts
-     REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( inout ) ::   &
+     REAL(wp), DIMENSION(:,:,:), INTENT( inout ) ::   &
           pt3d          ! 3D array on which the boundary condition is applied
      REAL(wp), INTENT( in ) ::   &
@@ -5962,7 +5974,7 @@
      IF(.not. ALLOCATED(ztab))THEN
 
-        ALLOCATE(ztab(jpiglo,ijpj,jpk),                &
-                 znorthgloio(nwidthmax,ijpj,jpk,jpni), &
-                 znorthloc(nwidthmax,ijpj,jpk),        &
+        ALLOCATE(ztab(jpiglo,ijpj,jpkorig),                &
+                 znorthgloio(nwidthmax,ijpj,jpkorig,jpni), &
+                 znorthloc(nwidthmax,ijpj,jpkorig),        &
                  STAT=ierr)
         IF(ierr .ne. 0)THEN
@@ -6006,5 +6018,5 @@
        not done : compiler error
 #elif defined key_mpp_mpi
-       itaille=nwidthmax*jpk*ijpj
+       itaille=nwidthmax*jpkorig*ijpj
        CALL MPI_GATHER(znorthloc,itaille,MPI_DOUBLE_PRECISION,   &
                        znorthgloio,itaille,MPI_DOUBLE_PRECISION, &
@@ -6316,5 +6328,5 @@
 #elif key_mpp_mpi
     IF ( npolj /= 0 ) THEN
-       itaille=nwidthmax*jpk*ijpj
+       itaille=nwidthmax*jpkorig*ijpj
        CALL MPI_SCATTER(znorthgloio,itaille,MPI_DOUBLE_PRECISION, &
                         znorthloc,  itaille,MPI_DOUBLE_PRECISION, &
@@ -6375,5 +6387,5 @@
      CHARACTER(len=1), INTENT( in ) :: cd_type ! nature of pt3d grid-points
      !                                         ! = T,  U, V, F or W gridp'ts
-     INTEGER, DIMENSION(jpi,jpj,jpk), INTENT( inout ) ::   &
+     INTEGER, DIMENSION(:,:,:), INTENT( inout ) ::   &
           ib3          ! 3D array on which the boundary condition is applied
      INTEGER, INTENT( in ) ::   &
@@ -6408,7 +6420,7 @@
      IF(.not. ALLOCATED(ztab))THEN
 
-        ALLOCATE(ztab(jpiglo,ijpj,jpk),                &
-                 znorthgloio(nwidthmax,ijpj,jpk,jpni), &
-                 znorthloc(nwidthmax,ijpj,jpk),        &
+        ALLOCATE(ztab(jpiglo,ijpj,jpkorig),                &
+                 znorthgloio(nwidthmax,ijpj,jpkorig,jpni), &
+                 znorthloc(nwidthmax,ijpj,jpkorig),        &
                  STAT=ierr)
         IF(ierr .ne. 0)THEN
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/LBC/exchtestmod.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/LBC/exchtestmod.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/LBC/exchtestmod.F90	(revision 4409)
@@ -67,5 +67,5 @@
 
   SUBROUTINE mpp_test_comms(depth, lmaxdepth)
-    USE par_oce,      ONLY: jpi, jpj, jpk, jpreci
+    USE par_oce,      ONLY: jpi, jpj, jpk, jpkorig, jpreci
     USE par_kind,     ONLY: wp
     USE mapcomm_mod,  ONLY: Iminus, Iplus, Jminus, Jplus, NONE
@@ -97,5 +97,5 @@
     test_failed = .FALSE.
 
-    ALLOCATE(r3d(jpi,jpj,jpk), r3d_2(jpi,jpj,jpk), r3d_3(jpi,jpj,jpk), &
+    ALLOCATE(r3d(jpi,jpj,jpkorig), r3d_2(jpi,jpj,jpkorig), r3d_3(jpi,jpj,jpkorig), &
              r2d(jpi,jpj), r2d_2(jpi,jpj), Stat=ierr)
 
@@ -242,5 +242,5 @@
     DEALLOCATE(r3d, r3d_2, r3d_3, r2d)
     ! and allocate that for integer-array tests
-    ALLOCATE(i3d(jpi,jpj,jpk), i3d_2(jpi,jpj,jpk), &
+    ALLOCATE(i3d(jpi,jpj,jpkorig), i3d_2(jpi,jpj,jpkorig), &
              i2d(jpi,jpj), i2d_2(jpi,jpj), Stat=ierr)
 
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/LBC/lbclnk.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/LBC/lbclnk.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/LBC/lbclnk.F90	(revision 4409)
@@ -96,5 +96,5 @@
 ! DCSE_NEMO: work around a deficiency in ftrans
 !     REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   pt3d1   , pt3d2      ! 3D array on which the lbc is applied
-      REAL(wp), INTENT(inout)   ::   pt3d1(jpi,jpj,jpk)   , pt3d2(jpi,jpj,jpk)
+      REAL(wp), INTENT(inout)   ::   pt3d1(jpi,jpj,jpkorig), pt3d2(jpi,jpj,jpkorig)
       REAL(wp), INTENT(in   )   ::   psgn                 ! control of the sign 
       !!----------------------------------------------------------------------
@@ -123,5 +123,5 @@
 !! DCSE_NEMO: work around a deficiency in ftrans
 !     REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout)           ::   pt3d      ! 3D array on which the lbc is applied
-      REAL(wp), INTENT(inout)                                   ::   pt3d(jpi,jpj,jpk)
+      REAL(wp), INTENT(inout)                                   ::   pt3d(jpi,jpj,jpkorig)
       REAL(wp)                        , INTENT(in   )           ::   psgn      ! control of the sign 
       CHARACTER(len=3)                , INTENT(in   ), OPTIONAL ::   cd_mpp    ! MPP only (here do nothing)
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90	(revision 4409)
@@ -133,11 +133,11 @@
    
    ! North fold condition in mpp_mpi with jpni > 1
-   INTEGER ::   ngrp_world        ! group ID for the world processors
-   INTEGER ::   ngrp_opa          ! group ID for the opa processors
-   INTEGER ::   ngrp_north        ! group ID for the northern processors (to be fold)
-   INTEGER ::   ncomm_north       ! communicator made by the processors belonging to ngrp_north
-   INTEGER ::   ndim_rank_north   ! number of 'sea' processor in the northern line (can be /= jpni !)
-   INTEGER ::   njmppmax          ! value of njmpp for the processors of the northern line
-   INTEGER ::   north_root        ! number (in the comm_opa) of proc 0 in the northern comm
+   INTEGER, SAVE ::   ngrp_world      ! group ID for the world processors
+   INTEGER, SAVE ::   ngrp_opa        ! group ID for the opa processors
+   INTEGER, SAVE ::   ngrp_north      ! group ID for the northern processors (to be fold)
+   INTEGER, SAVE ::   ncomm_north     ! communicator made by the processors belonging to ngrp_north
+   INTEGER, SAVE ::   ndim_rank_north ! number of 'sea' processor in the northern line (can be /= jpni !)
+   INTEGER, SAVE ::   njmppmax        ! value of njmpp for the processors of the northern line
+   INTEGER, SAVE ::   north_root      ! number (in the comm_opa) of proc 0 in the northern comm
    INTEGER, DIMENSION(:), ALLOCATABLE, SAVE ::   nrank_north   ! dimension ndim_rank_north
 
@@ -453,5 +453,5 @@
 !! DCSE_NEMO: work around a deficiency in ftrans
 !     REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   ptab3d   ! 3D array on which the boundary condition is applied
-      REAL(wp),                         INTENT(inout) ::   ptab3d(jpi,jpj,jpk)
+      REAL(wp),                         INTENT(inout) ::   ptab3d(jpi,jpj,jpkorig)
       CHARACTER(len=1)                , INTENT(in   ) ::   cd_type  ! define the nature of ptab array grid-points
       !                                                             ! = T , U , V , F , W points
@@ -890,6 +890,6 @@
 !     REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   ptab1     ! first and second 3D array on which 
 !     REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   ptab2     ! the boundary condition is applied
-      REAL(wp),                         INTENT(inout) ::   ptab1(jpi,jpj,jpk)
-      REAL(wp),                         INTENT(inout) ::   ptab2(jpi,jpj,jpk)
+      REAL(wp),                         INTENT(inout) ::   ptab1(jpi,jpj,jpkorig)
+      REAL(wp),                         INTENT(inout) ::   ptab2(jpi,jpj,jpkorig)
       CHARACTER(len=1)                , INTENT(in   ) ::   cd_type1  ! nature of ptab1 and ptab2 arrays 
       CHARACTER(len=1)                , INTENT(in   ) ::   cd_type2  ! i.e. grid-points = T , U , V , F or W points
@@ -1721,6 +1721,6 @@
 !     REAL(wp), DIMENSION (jpi,jpj,jpk), INTENT(in   ) ::   ptab3d       ! Local 3D array
 !     REAL(wp), DIMENSION (jpi,jpj,jpk), INTENT(in   ) ::   pmask3d      ! Local mask
-      REAL(wp), INTENT(in   )                          ::   ptab3d(jpi,jpj,jpk)
-      REAL(wp), INTENT(in   )                          ::   pmask3d(jpi,jpj,jpk)
+      REAL(wp), INTENT(in   )                          ::   ptab3d(jpi,jpj,jpkorig)
+      REAL(wp), INTENT(in   )                          ::   pmask3d(jpi,jpj,jpkorig)
       REAL(wp)                         , INTENT(  out) ::   pmin         ! Global minimum of ptab
       INTEGER                          , INTENT(  out) ::   ki, kj, kk   ! index of minimum in global frame
@@ -1813,6 +1813,6 @@
 !     REAL(wp), DIMENSION (jpi,jpj,jpk), INTENT(in   ) ::   ptab3d       ! Local 2D array
 !     REAL(wp), DIMENSION (jpi,jpj,jpk), INTENT(in   ) ::   pmask3d      ! Local mask
-      REAL(wp), INTENT(in   )                          ::   ptab3d(jpi,jpj,jpk)       ! Local 2D array
-      REAL(wp), INTENT(in   )                          ::   pmask3d(jpi,jpj,jpk)      ! Local mask
+      REAL(wp), INTENT(in   )                          ::   ptab3d(jpi,jpj,jpkorig)       ! Local 2D array
+      REAL(wp), INTENT(in   )                          ::   pmask3d(jpi,jpj,jpkorig)      ! Local mask
       REAL(wp)                         , INTENT(  out) ::   pmax         ! Global maximum of ptab
       INTEGER                          , INTENT(  out) ::   ki, kj, kk   ! index of maximum in global frame
@@ -2368,5 +2368,5 @@
 !! DCSE_NEMO: work around a deficiency in ftrans
 !     REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   pt3d      ! 3D array on which the b.c. is applied
-      REAL(wp),                         INTENT(inout) ::   pt3d(jpi,jpj,jpk)
+      REAL(wp),                         INTENT(inout) ::   pt3d(jpi,jpj,jpkorig)
       CHARACTER(len=1)                , INTENT(in   ) ::   cd_type   ! nature of pt3d grid-points
       !                                                              !   = T ,  U , V , F or W  gridpoints
@@ -2873,8 +2873,8 @@
          IF( PRESENT(cd10) )   WRITE(numout,*) cd10
       ENDIF
-                               CALL FLUSH(numout    )
-      IF( numstp     /= -1 )   CALL FLUSH(numstp    )
-      IF( numsol     /= -1 )   CALL FLUSH(numsol    )
-      IF( numevo_ice /= -1 )   CALL FLUSH(numevo_ice)
+                                FLUSH(numout    )
+      IF( numstp     /= -1 )    FLUSH(numstp    )
+      IF( numsol     /= -1 )    FLUSH(numsol    )
+      IF( numevo_ice /= -1 )    FLUSH(numevo_ice)
       !
       IF( cd1 == 'STOP' ) THEN
@@ -2912,5 +2912,5 @@
          IF( PRESENT(cd10) ) WRITE(numout,*) cd10
       ENDIF
-      CALL FLUSH(numout)
+      FLUSH(numout)
       !
    END SUBROUTINE ctl_warn
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/LDF/ldfdyn.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/LDF/ldfdyn.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/LDF/ldfdyn.F90	(revision 4409)
@@ -171,6 +171,6 @@
       REAL(wp), INTENT(in   )                 ::   pwam       ! width of inflection
       REAL(wp), INTENT(in   )                 ::   pbot       ! bottom value (0<pbot<= 1)
-      REAL(wp), INTENT(in   ), DIMENSION(jpk) ::   pdep       ! depth of the gridpoint (T, U, V, F)
-      REAL(wp), INTENT(inout), DIMENSION(jpk) ::   pah        ! adimensional vertical profile
+      REAL(wp), INTENT(in   ), DIMENSION(jpkorig) ::   pdep       ! depth of the gridpoint (T, U, V, F)
+      REAL(wp), INTENT(inout), DIMENSION(jpkorig) ::   pah        ! adimensional vertical profile
       !!
       INTEGER  ::   jk           ! dummy loop indices
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/LDF/ldfslp.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/LDF/ldfslp.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/LDF/ldfslp.F90	(revision 4409)
@@ -928,6 +928,8 @@
       
       IF( ln_traldf_grif ) THEN        ! Griffies operator : triad of slopes
-         ALLOCATE( triadi_g(jpi,jpj,jpk,0:1,0:1) , triadj_g(jpi,jpj,jpk,0:1,0:1) , wslp2(jpi,jpj,jpk) , STAT=ierr )
-         ALLOCATE( triadi  (jpi,jpj,jpk,0:1,0:1) , triadj  (jpi,jpj,jpk,0:1,0:1)                      , STAT=ierr )
+         ALLOCATE(triadi_g(jpi,jpj,jpkorig,0:1,0:1), triadj_g(jpi,jpj,jpkorig,0:1,0:1), &
+                  wslp2(jpi,jpj,jpkorig) , STAT=ierr)
+         ALLOCATE(triadi  (jpi,jpj,jpkorig,0:1,0:1), triadj  (jpi,jpj,jpkorig,0:1,0:1), &
+                  STAT=ierr)
          IF( ierr > 0             )   CALL ctl_stop( 'STOP', 'ldf_slp_init : unable to allocate Griffies operator slope' )
          IF( ldf_slp_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'ldf_slp_init : unable to allocate workspace arrays' )
@@ -939,6 +941,8 @@
          !
       ELSE                             ! Madec operator : slopes at u-, v-, and w-points
-         ALLOCATE( uslp(jpi,jpj,jpk) , vslp(jpi,jpj,jpk) , wslpi(jpi,jpj,jpk) , wslpj(jpi,jpj,jpk) ,                &
-            &   omlmask(jpi,jpj,jpk) , uslpml(jpi,jpj)   , vslpml(jpi,jpj)    , wslpiml(jpi,jpj)   , wslpjml(jpi,jpj) , STAT=ierr )
+         ALLOCATE(uslp(jpi,jpj,jpkorig), vslp(jpi,jpj,jpkorig),   &
+                  wslpi(jpi,jpj,jpkorig), wslpj(jpi,jpj,jpkorig), &
+                  omlmask(jpi,jpj,jpkorig), &
+                  uslpml(jpi,jpj), vslpml(jpi,jpj), wslpiml(jpi,jpj), wslpjml(jpi,jpj), STAT=ierr)
          IF( ierr > 0 )   CALL ctl_stop( 'STOP', 'ldf_slp_init : unable to allocate Madec operator slope ' )
 
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/eosbn2.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/eosbn2.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/eosbn2.F90	(revision 4409)
@@ -297,8 +297,8 @@
 !     REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(  out) ::   prd    ! in situ density            [-]
 !     REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(  out) ::   prhop  ! potential density (surface referenced)
-      REAL(wp), INTENT(in   ) ::   pts(jpi,jpj,jpk,jpts)   ! 1 : potential temperature  [Celcius]
+      REAL(wp), INTENT(in   ) ::   pts(jpi,jpj,jpkorig,jpts)   ! 1 : potential temperature  [Celcius]
       !                                                    ! 2 : salinity               [psu]
-      REAL(wp), INTENT(  out) ::   prd(jpi,jpj,jpk)        ! in situ density            [-]
-      REAL(wp), INTENT(  out) ::   prhop(jpi,jpj,jpk)      ! potential density (surface referenced)
+      REAL(wp), INTENT(  out) ::   prd(jpi,jpj,jpkorig)        ! in situ density            [-]
+      REAL(wp), INTENT(  out) ::   prhop(jpi,jpj,jpkorig)      ! potential density (surface referenced)
       !
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
@@ -599,7 +599,7 @@
 !     REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(  out) ::   pn2   ! Brunt-Vaisala frequency    [s-1]
 
-      REAL(wp), INTENT(in   ) ::   pts(jpi,jpj,jpk,jpts)   ! 1 : potential temperature  [Celcius]
+      REAL(wp), INTENT(in   ) ::   pts(jpi,jpj,jpkorig,jpts)   ! 1 : potential temperature  [Celcius]
       !                                                    ! 2 : salinity               [psu]
-      REAL(wp), INTENT(  out) ::   pn2(jpi,jpj,jpk)        ! Brunt-Vaisala frequency    [s-1]
+      REAL(wp), INTENT(  out) ::   pn2(jpi,jpj,jpkorig)        ! Brunt-Vaisala frequency    [s-1]
       !!
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
@@ -764,7 +764,7 @@
 !     REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in   ) ::   pts            ! pot. temperature & salinity
 !     REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(  out) ::   palph, pbeta   ! thermal & haline expansion coeff.
-      REAL(wp), INTENT(in   ) ::   pts(jpi,jpj,jpk,jpts)            ! pot. temperature & salinity
-      REAL(wp), INTENT(  out) ::   palph(jpi,jpj,jpk)               ! thermal expansion coeff.
-      REAL(wp), INTENT(  out) ::   pbeta(jpi,jpj,jpk)               ! haline  expansion coeff.
+      REAL(wp), INTENT(in   ) ::   pts(jpi,jpj,jpkorig,jpts)            ! pot. temperature & salinity
+      REAL(wp), INTENT(  out) ::   palph(jpi,jpj,jpkorig)               ! thermal expansion coeff.
+      REAL(wp), INTENT(  out) ::   pbeta(jpi,jpj,jpkorig)               ! haline  expansion coeff.
       !
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen2.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen2.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen2.F90	(revision 4409)
@@ -134,11 +134,11 @@
 
 !FTRANS pun pvn pwn :I :I :z
-      REAL(wp), INTENT(in   ) ::   pun(jpi,jpj,jpk)         ! ocean velocity component
-      REAL(wp), INTENT(in   ) ::   pvn(jpi,jpj,jpk)         ! ocean velocity component
-      REAL(wp), INTENT(in   ) ::   pwn(jpi,jpj,jpk)         ! ocean velocity component
+      REAL(wp), INTENT(in   ) ::   pun(jpi,jpj,jpkorig)         ! ocean velocity component
+      REAL(wp), INTENT(in   ) ::   pvn(jpi,jpj,jpkorig)         ! ocean velocity component
+      REAL(wp), INTENT(in   ) ::   pwn(jpi,jpj,jpkorig)         ! ocean velocity component
 !FTRANS ptb ptn pta :I :I :z :
-      REAL(wp), INTENT(in   ) ::   ptb(jpi,jpj,jpk,kjpt)    ! tracer field (before)
-      REAL(wp), INTENT(in   ) ::   ptn(jpi,jpj,jpk,kjpt)    ! tracer field (now)
-      REAL(wp), INTENT(inout) ::   pta(jpi,jpj,jpk,kjpt)    ! tracer trend 
+      REAL(wp), INTENT(in   ) ::   ptb(jpi,jpj,jpkorig,kjpt)    ! tracer field (before)
+      REAL(wp), INTENT(in   ) ::   ptn(jpi,jpj,jpkorig,kjpt)    ! tracer field (now)
+      REAL(wp), INTENT(inout) ::   pta(jpi,jpj,jpkorig,kjpt)    ! tracer trend 
       !
       INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_eiv.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_eiv.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_eiv.F90	(revision 4409)
@@ -84,7 +84,7 @@
 
 !FTRANS pun pvn pwn :I :I :z
-      REAL(wp), INTENT(inout) ::   pun(jpi,jpj,jpk)      ! in : 3 ocean velocity components 
-      REAL(wp), INTENT(inout) ::   pvn(jpi,jpj,jpk)      ! out: 3 ocean velocity components
-      REAL(wp), INTENT(inout) ::   pwn(jpi,jpj,jpk)      ! increased by the eiv
+      REAL(wp), INTENT(inout) ::   pun(jpi,jpj,jpkorig)      ! in : 3 ocean velocity components 
+      REAL(wp), INTENT(inout) ::   pvn(jpi,jpj,jpkorig)      ! out: 3 ocean velocity components
+      REAL(wp), INTENT(inout) ::   pwn(jpi,jpj,jpkorig)      ! increased by the eiv
       !!
       INTEGER  ::   ji, jj, jk                 ! dummy loop indices
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl.F90	(revision 4409)
@@ -77,5 +77,5 @@
       CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype          ! =TRA or TRC (tracer indicator)
       INTEGER                              , INTENT(in   ) ::   kjpt            ! number of tracers
-      REAL(wp), DIMENSION(        jpk     ), INTENT(in   ) ::   p2dt            ! vertical profile of tracer time-step
+      REAL(wp), DIMENSION(       jpkorig  ), INTENT(in   ) ::   p2dt            ! vertical profile of tracer time-step
 
       !! DCSE_NEMO: This style defeats ftrans
@@ -87,9 +87,9 @@
 !FTRANS ptb :I :I :z :
 !FTRANS pta :I :I :z :
-      REAL(wp), INTENT(in   ) ::   pun(jpi,jpj,jpk)        ! ocean velocity component (u)
-      REAL(wp), INTENT(in   ) ::   pvn(jpi,jpj,jpk)        ! ocean velocity component (v)
-      REAL(wp), INTENT(in   ) ::   pwn(jpi,jpj,jpk)        ! ocean velocity component (w)
-      REAL(wp), INTENT(in   ) ::   ptb(jpi,jpj,jpk,kjpt)   ! tracer fields (before)
-      REAL(wp), INTENT(inout) ::   pta(jpi,jpj,jpk,kjpt)   ! tracer trend 
+      REAL(wp), INTENT(in   ) ::   pun(jpi,jpj,jpkorig)        ! ocean velocity component (u)
+      REAL(wp), INTENT(in   ) ::   pvn(jpi,jpj,jpkorig)        ! ocean velocity component (v)
+      REAL(wp), INTENT(in   ) ::   pwn(jpi,jpj,jpkorig)        ! ocean velocity component (w)
+      REAL(wp), INTENT(in   ) ::   ptb(jpi,jpj,jpkorig,kjpt)   ! tracer fields (before)
+      REAL(wp), INTENT(inout) ::   pta(jpi,jpj,jpkorig,kjpt)   ! tracer trend 
 
       !
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl2.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl2.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl2.F90	(revision 4409)
@@ -74,5 +74,5 @@
       CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype          ! =TRA or TRC (tracer indicator)
       INTEGER                              , INTENT(in   ) ::   kjpt            ! number of tracers
-      REAL(wp), DIMENSION(        jpk     ), INTENT(in   ) ::   p2dt            ! vertical profile of tracer time-step
+      REAL(wp), DIMENSION(      jpkorig   ), INTENT(in   ) ::   p2dt            ! vertical profile of tracer time-step
 
       !! DCSE_NEMO: This style defeats ftrans
@@ -84,10 +84,10 @@
 !FTRANS ptb ptn :I :I :z :
 !FTRANS pta :I :I :z :
-      REAL(wp), INTENT(in   ) ::   pun(jpi,jpj,jpk)        ! ocean velocity component (u)
-      REAL(wp), INTENT(in   ) ::   pvn(jpi,jpj,jpk)        ! ocean velocity component (v)
-      REAL(wp), INTENT(in   ) ::   pwn(jpi,jpj,jpk)        ! ocean velocity component (w)
-      REAL(wp), INTENT(in   ) ::   ptb(jpi,jpj,jpk,kjpt)   ! tracer fields (before)
-      REAL(wp), INTENT(in   ) ::   ptn(jpi,jpj,jpk,kjpt)   ! tracer fields (now)
-      REAL(wp), INTENT(inout) ::   pta(jpi,jpj,jpk,kjpt)   ! tracer trend 
+      REAL(wp), INTENT(in   ) ::   pun(jpi,jpj,jpkorig)        ! ocean velocity component (u)
+      REAL(wp), INTENT(in   ) ::   pvn(jpi,jpj,jpkorig)        ! ocean velocity component (v)
+      REAL(wp), INTENT(in   ) ::   pwn(jpi,jpj,jpkorig)        ! ocean velocity component (w)
+      REAL(wp), INTENT(in   ) ::   ptb(jpi,jpj,jpkorig,kjpt)   ! tracer fields (before)
+      REAL(wp), INTENT(in   ) ::   ptn(jpi,jpj,jpkorig,kjpt)   ! tracer fields (now)
+      REAL(wp), INTENT(inout) ::   pta(jpi,jpj,jpkorig,kjpt)   ! tracer trend 
 
       !!
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_qck.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_qck.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_qck.F90	(revision 4409)
@@ -89,5 +89,5 @@
       CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype          ! =TRA or TRC (tracer indicator)
       INTEGER                              , INTENT(in   ) ::   kjpt            ! number of tracers
-      REAL(wp), DIMENSION(        jpk     ), INTENT(in   ) ::   p2dt            ! vertical profile of tracer time-step
+      REAL(wp), DIMENSION(       jpkorig  ), INTENT(in   ) ::   p2dt            ! vertical profile of tracer time-step
 
       !! DCSE_NEMO: This style defeats ftrans
@@ -99,10 +99,10 @@
 !FTRANS ptb ptn :I :I :z :
 !FTRANS pta :I :I :z :
-      REAL(wp), INTENT(in   ) ::   pun(jpi,jpj,jpk)        ! ocean velocity component (u)
-      REAL(wp), INTENT(in   ) ::   pvn(jpi,jpj,jpk)        ! ocean velocity component (v)
-      REAL(wp), INTENT(in   ) ::   pwn(jpi,jpj,jpk)        ! ocean velocity component (w)
-      REAL(wp), INTENT(in   ) ::   ptb(jpi,jpj,jpk,kjpt)   ! tracer fields (before)
-      REAL(wp), INTENT(in   ) ::   ptn(jpi,jpj,jpk,kjpt)   ! tracer fields (now)
-      REAL(wp), INTENT(inout) ::   pta(jpi,jpj,jpk,kjpt)   ! tracer trend 
+      REAL(wp), INTENT(in   ) ::   pun(jpi,jpj,jpkorig)        ! ocean velocity component (u)
+      REAL(wp), INTENT(in   ) ::   pvn(jpi,jpj,jpkorig)        ! ocean velocity component (v)
+      REAL(wp), INTENT(in   ) ::   pwn(jpi,jpj,jpkorig)        ! ocean velocity component (w)
+      REAL(wp), INTENT(in   ) ::   ptb(jpi,jpj,jpkorig,kjpt)   ! tracer fields (before)
+      REAL(wp), INTENT(in   ) ::   ptn(jpi,jpj,jpkorig,kjpt)   ! tracer fields (now)
+      REAL(wp), INTENT(inout) ::   pta(jpi,jpj,jpkorig,kjpt)   ! tracer trend 
 
       !!----------------------------------------------------------------------
@@ -151,5 +151,5 @@
       CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype     ! =TRA or TRC (tracer indicator)
       INTEGER                              , INTENT(in   ) ::   kjpt       ! number of tracers
-      REAL(wp), DIMENSION(        jpk     ), INTENT(in   ) ::   p2dt       ! vertical profile of tracer time-step
+      REAL(wp), DIMENSION(       jpkorig  ), INTENT(in   ) ::   p2dt       ! vertical profile of tracer time-step
 
       !! DCSE_NEMO: This style defeats ftrans
@@ -160,8 +160,8 @@
 !FTRANS pun :I :I :z
 !FTRANS ptb ptn pta :I :I :z :
-      REAL(wp), INTENT(in   ) ::   pun(jpi,jpj,jpk)         ! i-velocity component
-      REAL(wp), INTENT(in   ) ::   ptb(jpi,jpj,jpk,kjpt)    ! tracer field (before)
-      REAL(wp), INTENT(in   ) ::   ptn(jpi,jpj,jpk,kjpt)    ! tracer field (now)
-      REAL(wp), INTENT(inout) ::   pta(jpi,jpj,jpk,kjpt)    ! tracer trend 
+      REAL(wp), INTENT(in   ) ::   pun(jpi,jpj,jpkorig)         ! i-velocity component
+      REAL(wp), INTENT(in   ) ::   ptb(jpi,jpj,jpkorig,kjpt)    ! tracer field (before)
+      REAL(wp), INTENT(in   ) ::   ptn(jpi,jpj,jpkorig,kjpt)    ! tracer field (now)
+      REAL(wp), INTENT(inout) ::   pta(jpi,jpj,jpkorig,kjpt)    ! tracer trend 
 
       !!
@@ -334,5 +334,5 @@
       CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype     ! =TRA or TRC (tracer indicator)
       INTEGER                              , INTENT(in   ) ::   kjpt       ! number of tracers
-      REAL(wp), DIMENSION(        jpk     ), INTENT(in   ) ::   p2dt       ! vertical profile of tracer time-step
+      REAL(wp), DIMENSION(        jpkorig     ), INTENT(in   ) ::   p2dt       ! vertical profile of tracer time-step
 
       !! DCSE_NEMO: This style defeats ftrans
@@ -343,8 +343,8 @@
 !FTRANS pvn :I :I :z
 !FTRANS ptb ptn pta :I :I :z :
-      REAL(wp), INTENT(in   ) ::   pvn(jpi,jpj,jpk)         ! j-velocity component
-      REAL(wp), INTENT(in   ) ::   ptb(jpi,jpj,jpk,kjpt)    ! tracer field (before)
-      REAL(wp), INTENT(in   ) ::   ptn(jpi,jpj,jpk,kjpt)    ! tracer field (now)
-      REAL(wp), INTENT(inout) ::   pta(jpi,jpj,jpk,kjpt)    ! tracer trend 
+      REAL(wp), INTENT(in   ) ::   pvn(jpi,jpj,jpkorig)         ! j-velocity component
+      REAL(wp), INTENT(in   ) ::   ptb(jpi,jpj,jpkorig,kjpt)    ! tracer field (before)
+      REAL(wp), INTENT(in   ) ::   ptn(jpi,jpj,jpkorig,kjpt)    ! tracer field (now)
+      REAL(wp), INTENT(inout) ::   pta(jpi,jpj,jpkorig,kjpt)    ! tracer trend 
 
       !!
@@ -532,7 +532,7 @@
 !FTRANS pwn :I :I :z
 !FTRANS ptn pta :I :I :z :
-      REAL(wp), INTENT(in   ) ::   pwn(jpi,jpj,jpk)         ! vertical velocity
-      REAL(wp), INTENT(in   ) ::   ptn(jpi,jpj,jpk,kjpt)    ! tracer fields (now)
-      REAL(wp), INTENT(inout) ::   pta(jpi,jpj,jpk,kjpt)    ! tracer trend 
+      REAL(wp), INTENT(in   ) ::   pwn(jpi,jpj,jpkorig)         ! vertical velocity
+      REAL(wp), INTENT(in   ) ::   ptn(jpi,jpj,jpkorig,kjpt)    ! tracer fields (now)
+      REAL(wp), INTENT(inout) ::   pta(jpi,jpj,jpkorig,kjpt)    ! tracer trend 
 
       !
@@ -614,8 +614,8 @@
 
 !FTRANS pfu pfd pfc puc :I :I :z
-      REAL(wp), INTENT(in   ) ::   pfu(jpi,jpj,jpk)   ! second upwind point
-      REAL(wp), INTENT(in   ) ::   pfd(jpi,jpj,jpk)   ! first douwning point
-      REAL(wp), INTENT(in   ) ::   pfc(jpi,jpj,jpk)   ! the central point (or the first upwind point)
-      REAL(wp), INTENT(inout) ::   puc(jpi,jpj,jpk)   ! input as Courant number ; output as flux
+      REAL(wp), INTENT(in   ) ::   pfu(jpi,jpj,jpkorig)   ! second upwind point
+      REAL(wp), INTENT(in   ) ::   pfd(jpi,jpj,jpkorig)   ! first douwning point
+      REAL(wp), INTENT(in   ) ::   pfc(jpi,jpj,jpkorig)   ! the central point (or the first upwind point)
+      REAL(wp), INTENT(inout) ::   puc(jpi,jpj,jpkorig)   ! input as Courant number ; output as flux
 
       !!
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_tvd.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_tvd.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_tvd.F90	(revision 4409)
@@ -83,5 +83,5 @@
       CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype          ! =TRA or TRC (tracer indicator)
       INTEGER                              , INTENT(in   ) ::   kjpt            ! number of tracers
-      REAL(wp), DIMENSION(        jpk     ), INTENT(in   ) ::   p2dt            ! vertical profile of tracer time-step
+      REAL(wp), DIMENSION(     jpkorig    ), INTENT(in   ) ::   p2dt            ! vertical profile of tracer time-step
 
       !! DCSE_NEMO: This style defeats ftrans
@@ -92,10 +92,10 @@
 !FTRANS pun pvn pwn :I :I :z
 !FTRANS ptb ptn pta :I :I :z :
-      REAL(wp), INTENT(in   ) ::   pun(jpi,jpj,jpk)        ! ocean velocity component (u)
-      REAL(wp), INTENT(in   ) ::   pvn(jpi,jpj,jpk)        ! ocean velocity component (v)
-      REAL(wp), INTENT(in   ) ::   pwn(jpi,jpj,jpk)        ! ocean velocity component (w)
-      REAL(wp), INTENT(in   ) ::   ptb(jpi,jpj,jpk,kjpt)   ! tracer fields (before)
-      REAL(wp), INTENT(in   ) ::   ptn(jpi,jpj,jpk,kjpt)   ! tracer fields (now)
-      REAL(wp), INTENT(inout) ::   pta(jpi,jpj,jpk,kjpt)   ! tracer trend 
+      REAL(wp), INTENT(in   ) ::   pun(jpi,jpj,jpkorig)        ! ocean velocity component (u)
+      REAL(wp), INTENT(in   ) ::   pvn(jpi,jpj,jpkorig)        ! ocean velocity component (v)
+      REAL(wp), INTENT(in   ) ::   pwn(jpi,jpj,jpkorig)        ! ocean velocity component (w)
+      REAL(wp), INTENT(in   ) ::   ptb(jpi,jpj,jpkorig,kjpt)   ! tracer fields (before)
+      REAL(wp), INTENT(in   ) ::   ptn(jpi,jpj,jpkorig,kjpt)   ! tracer fields (now)
+      REAL(wp), INTENT(inout) ::   pta(jpi,jpj,jpkorig,kjpt)   ! tracer trend 
 
       !
@@ -367,5 +367,5 @@
 
       !
-      REAL(wp), DIMENSION(jpk)         , INTENT(in   ) ::   p2dt            ! vertical profile of tracer time-step
+      REAL(wp), DIMENSION(jpkorig)      , INTENT(in   ) ::   p2dt            ! vertical profile of tracer time-step
 
       !! DCSE_NEMO: This style defeats ftrans
@@ -375,8 +375,8 @@
 !FTRANS pbef paft :I :I :z
 !FTRANS paa pbb pcc :I :I :z
-      REAL(wp), INTENT(in   ) ::   pbef(jpi,jpj,jpk), paft(jpi,jpj,jpk)     ! before & after field
-      REAL(wp), INTENT(inout) ::   paa(jpi,jpj,jpk)                         ! monotonic fluxes in the 1st direction
-      REAL(wp), INTENT(inout) ::   pbb(jpi,jpj,jpk)                         ! monotonic fluxes in the 2nd direction
-      REAL(wp), INTENT(inout) ::   pcc(jpi,jpj,jpk)                         ! monotonic fluxes in the 3rd direction
+      REAL(wp), INTENT(in   ) ::   pbef(jpi,jpj,jpkorig), paft(jpi,jpj,jpkorig)     ! before & after field
+      REAL(wp), INTENT(inout) ::   paa(jpi,jpj,jpkorig)                         ! monotonic fluxes in the 1st direction
+      REAL(wp), INTENT(inout) ::   pbb(jpi,jpj,jpkorig)                         ! monotonic fluxes in the 2nd direction
+      REAL(wp), INTENT(inout) ::   pcc(jpi,jpj,jpkorig)                         ! monotonic fluxes in the 3rd direction
       !
       INTEGER ::   ji, jj, jk   ! dummy loop indices
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_ubs.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_ubs.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_ubs.F90	(revision 4409)
@@ -91,5 +91,5 @@
       CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype          ! =TRA or TRC (tracer indicator)
       INTEGER                              , INTENT(in   ) ::   kjpt            ! number of tracers
-      REAL(wp), DIMENSION(        jpk     ), INTENT(in   ) ::   p2dt            ! vertical profile of tracer time-step
+      REAL(wp), DIMENSION(       jpkorig  ), INTENT(in   ) ::   p2dt            ! vertical profile of tracer time-step
 
 !     REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(in   ) ::   pun, pvn, pwn   ! 3 ocean velocity components
@@ -99,13 +99,13 @@
 !FTRANS pun pvn pwn :I :I :z
 !FTRANS ptb ptn pta :I :I :z :
-      REAL(wp), INTENT(in   ) ::   pun(jpi,jpj,jpk)        ! ocean velocity component (u)
-      REAL(wp), INTENT(in   ) ::   pvn(jpi,jpj,jpk)        ! ocean velocity component (v)
-      REAL(wp), INTENT(in   ) ::   pwn(jpi,jpj,jpk)        ! ocean velocity component (w)
+      REAL(wp), INTENT(in   ) ::   pun(jpi,jpj,jpkorig)        ! ocean velocity component (u)
+      REAL(wp), INTENT(in   ) ::   pvn(jpi,jpj,jpkorig)        ! ocean velocity component (v)
+      REAL(wp), INTENT(in   ) ::   pwn(jpi,jpj,jpkorig)        ! ocean velocity component (w)
 !! DCSE_NEMO: Next two arguments made inout to silence the cray compile,
 !! which rightly complains about the call to nonosc_v (which also has them
 !! as inout) 
-      REAL(wp), INTENT(inout) ::   ptb(jpi,jpj,jpk,kjpt)   ! tracer fields (before)
-      REAL(wp), INTENT(inout) ::   ptn(jpi,jpj,jpk,kjpt)   ! tracer fields (now)
-      REAL(wp), INTENT(inout) ::   pta(jpi,jpj,jpk,kjpt)   ! tracer trend 
+      REAL(wp), INTENT(inout) ::   ptb(jpi,jpj,jpkorig,kjpt)   ! tracer fields (before)
+      REAL(wp), INTENT(inout) ::   ptn(jpi,jpj,jpkorig,kjpt)   ! tracer fields (now)
+      REAL(wp), INTENT(inout) ::   pta(jpi,jpj,jpkorig,kjpt)   ! tracer trend 
 
       !
@@ -381,5 +381,5 @@
 
       !
-      REAL(wp), INTENT(in   ), DIMENSION(jpk)          ::   p2dt   ! vertical profile of tracer time-step
+      REAL(wp), INTENT(in   ), DIMENSION(jpkorig)          ::   p2dt   ! vertical profile of tracer time-step
 
       !! DCSE_NEMO: This style defeats ftrans
@@ -389,7 +389,7 @@
 
 !FTRANS pbef paft pcc :I :I :z
-      REAL(wp), INTENT(inout) ::   pbef(jpi,jpj,jpk)   ! before field
-      REAL(wp), INTENT(inout) ::   paft(jpi,jpj,jpk)   ! after field
-      REAL(wp), INTENT(inout) ::   pcc(jpi,jpj,jpk)    ! monotonic flux in the k direction
+      REAL(wp), INTENT(inout) ::   pbef(jpi,jpj,jpkorig)   ! before field
+      REAL(wp), INTENT(inout) ::   paft(jpi,jpj,jpkorig)   ! after field
+      REAL(wp), INTENT(inout) ::   pcc(jpi,jpj,jpkorig)    ! monotonic flux in the k direction
       !
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/tradmp.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/tradmp.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/tradmp.F90	(revision 4409)
@@ -282,5 +282,5 @@
 !     REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout)  ::   presto   ! restoring coeff. (s-1)
 !FTRANS presto :I :I :z
-      REAL(wp), INTENT(inout)  ::   presto(jpi,jpj,jpk)   ! restoring coeff. (s-1)
+      REAL(wp), INTENT(inout)  ::   presto(jpi,jpj,jpkorig)   ! restoring coeff. (s-1)
       !
       INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices
@@ -388,5 +388,5 @@
 !     REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout)  ::   presto   ! restoring coeff. (s-1)
 !FTRANS presto :I :I :z
-      REAL(wp), INTENT(inout)  ::   presto(jpi,jpj,jpk)   ! restoring coeff. (s-1)
+      REAL(wp), INTENT(inout)  ::   presto(jpi,jpj,jpkorig)   ! restoring coeff. (s-1)
 
       !
@@ -656,5 +656,5 @@
 !     REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( out ) ::   pdct   ! distance to the coastline
 !FTRANS pdct :I :I :z
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( out ) ::   pdct   ! distance to the coastline
+      REAL(wp), DIMENSION(jpi,jpj,jpkorig), INTENT( out ) ::   pdct   ! distance to the coastline
 
       !!
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_exp.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_exp.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_exp.F90	(revision 4409)
@@ -91,5 +91,5 @@
       INTEGER                              , INTENT(in   ) ::   kjpt        ! number of tracers
       INTEGER                              , INTENT(in   ) ::   kn_zdfexp   ! number of sub-time step
-      REAL(wp), DIMENSION(        jpk     ), INTENT(in   ) ::   p2dt        ! vertical profile of tracer time-step
+      REAL(wp), DIMENSION(       jpkorig  ), INTENT(in   ) ::   p2dt        ! vertical profile of tracer time-step
 
       !! DCSE_NEMO: This style defeats ftrans
@@ -98,6 +98,6 @@
 
 !FTRANS ptb pta :I :I :z :
-      REAL(wp), INTENT(in   ) ::   ptb(jpi,jpj,jpk,kjpt)         ! before and now tracer fields
-      REAL(wp), INTENT(inout) ::   pta(jpi,jpj,jpk,kjpt)         ! tracer trend 
+      REAL(wp), INTENT(in   ) ::   ptb(jpi,jpj,jpkorig,kjpt)         ! before and now tracer fields
+      REAL(wp), INTENT(inout) ::   pta(jpi,jpj,jpkorig,kjpt)         ! tracer trend 
       !
       INTEGER  ::  ji, jj, jk, jn, jl        ! dummy loop indices
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_imp.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_imp.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_imp.F90	(revision 4409)
@@ -97,5 +97,5 @@
       CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype   ! =TRA or TRC (tracer indicator)
       INTEGER                              , INTENT(in   ) ::   kjpt     ! number of tracers
-      REAL(wp), DIMENSION(        jpk     ), INTENT(in   ) ::   p2dt     ! vertical profile of tracer time-step
+      REAL(wp), DIMENSION(       jpkorig  ), INTENT(in   ) ::   p2dt     ! vertical profile of tracer time-step
 
       !! DCSE_NEMO: This style defeats ftrans
@@ -104,6 +104,6 @@
 
 !FTRANS ptb pta :I :I :z :
-      REAL(wp), INTENT(in   ) ::   ptb(jpi,jpj,jpk,kjpt)      ! before and now tracer fields
-      REAL(wp), INTENT(inout) ::   pta(jpi,jpj,jpk,kjpt)      ! tracer trend 
+      REAL(wp), INTENT(in   ) ::   ptb(jpi,jpj,jpkorig,kjpt)      ! before and now tracer fields
+      REAL(wp), INTENT(inout) ::   pta(jpi,jpj,jpkorig,kjpt)      ! tracer trend 
       !
       INTEGER  ::  ji, jj, jk, jn   ! dummy loop indices
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/zpshde.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/zpshde.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRA/zpshde.F90	(revision 4409)
@@ -95,5 +95,5 @@
 !     REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   )           ::  pta         ! 4D tracers fields
 !FTRANS pta :I :I :z :
-      REAL(wp), INTENT(in   )                      ::  pta(jpi,jpj,jpk,kjpt)         ! 4D tracers fields
+      REAL(wp), INTENT(in   )                      ::  pta(jpi,jpj,jpkorig,kjpt)         ! 4D tracers fields
 
       REAL(wp), DIMENSION(jpi,jpj,    kjpt), INTENT(  out)           ::  pgtu, pgtv  ! hor. grad. of ptra at u- & v-pts 
@@ -101,5 +101,5 @@
 !     REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(in   ), OPTIONAL ::  prd         ! 3D density anomaly fields
 !FTRANS prd :I :I :z
-      REAL(wp), INTENT(in   ), OPTIONAL            ::  prd(jpi,jpj,jpk)              ! 3D density anomaly fields
+      REAL(wp), INTENT(in   ), OPTIONAL            ::  prd(jpi,jpj,jpkorig)              ! 3D density anomaly fields
 
       REAL(wp), DIMENSION(jpi,jpj         ), INTENT(  out), OPTIONAL ::  pgru, pgrv  ! hor. grad. of prd at u- & v-pts 
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRD/trdicp.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRD/trdicp.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRD/trdicp.F90	(revision 4409)
@@ -135,6 +135,6 @@
 
 !FTRANS ptrd3dx ptrd3dy :I :I :z
-      REAL(wp), INTENT(inout) ::   ptrd3dx(jpi,jpj,jpk)   ! Temperature or U trend 
-      REAL(wp), INTENT(inout) ::   ptrd3dy(jpi,jpj,jpk)   ! Salinity    or V trend
+      REAL(wp), INTENT(inout) ::   ptrd3dx(jpi,jpj,jpkorig)   ! Temperature or U trend 
+      REAL(wp), INTENT(inout) ::   ptrd3dy(jpi,jpj,jpkorig)   ! Salinity    or V trend
 
       INTEGER,                          INTENT(in   ) ::   ktrd      ! momentum or tracer trend index
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRD/trdmld.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRD/trdmld.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRD/trdmld.F90	(revision 4409)
@@ -113,6 +113,6 @@
 
 !FTRANS pttrdmld pstrdmld :I :I :z
-      REAL(wp), INTENT( in ) ::   pttrdmld(jpi,jpj,jpk)   ! temperature trend 
-      REAL(wp), INTENT( in ) ::   pstrdmld(jpi,jpj,jpk)   ! salinity trend 
+      REAL(wp), INTENT( in ) ::   pttrdmld(jpi,jpj,jpkorig)   ! temperature trend 
+      REAL(wp), INTENT( in ) ::   pstrdmld(jpi,jpj,jpkorig)   ! salinity trend 
       !
       INTEGER ::   ji, jj, jk, isum
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRD/trdtra.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRD/trdtra.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRD/trdtra.F90	(revision 4409)
@@ -84,7 +84,7 @@
 
 !FTRANS ptrd pun ptra :I :I :z
-      REAL(wp), INTENT(in)           ::  ptrd(jpi,jpj,jpk)    ! tracer trend  or flux
-      REAL(wp), INTENT(in), OPTIONAL ::  pun(jpi,jpj,jpk)     ! velocity 
-      REAL(wp), INTENT(in), OPTIONAL ::  ptra(jpi,jpj,jpk)    ! Tracer variable 
+      REAL(wp), INTENT(in)           ::  ptrd(jpi,jpj,jpkorig)   ! tracer trend  or flux
+      REAL(wp), INTENT(in), OPTIONAL ::  pun(jpi,jpj,jpkorig)    ! velocity 
+      REAL(wp), INTENT(in), OPTIONAL ::  ptra(jpi,jpj,jpkorig)   ! Tracer variable 
       !!----------------------------------------------------------------------
 
@@ -180,12 +180,12 @@
 
 !FTRANS pf pun ptn :I :I :z
-      REAL(wp)        , INTENT(in )            ::   pf(jpi,jpj,jpk)      ! advective flux in one direction
-      REAL(wp)        , INTENT(in )            ::   pun(jpi,jpj,jpk)     ! now velocity  in one direction
-      REAL(wp)        , INTENT(in )            ::   ptn(jpi,jpj,jpk)     ! now or before tracer 
+      REAL(wp)        , INTENT(in )            ::   pf(jpi,jpj,jpkorig)      ! advective flux in one direction
+      REAL(wp)        , INTENT(in )            ::   pun(jpi,jpj,jpkorig)     ! now velocity  in one direction
+      REAL(wp)        , INTENT(in )            ::   ptn(jpi,jpj,jpkorig)     ! now or before tracer 
       CHARACTER(len=1), INTENT(in )                         ::   cdir    ! X/Y/Z direction
 
 !     REAL(wp)        , INTENT(out), DIMENSION(jpi,jpj,jpk) ::   ptrd    ! advective trend in one direction
 !FTRANS ptrd :I :I :z
-      REAL(wp)        , INTENT(out)            ::   ptrd(jpi,jpj,jpk)    ! advective trend in one direction
+      REAL(wp)        , INTENT(out)            ::   ptrd(jpi,jpj,jpkorig)    ! advective trend in one direction
       !
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
@@ -242,7 +242,7 @@
 
 !FTRANS ptrd pu ptra :I :I :z
-      REAL(wp), INTENT(in)           ::  ptrd(jpi,jpj,jpk)    ! tracer trend  or flux
-      REAL(wp), INTENT(in), OPTIONAL ::  pu(jpi,jpj,jpk)      ! velocity 
-      REAL(wp), INTENT(in), OPTIONAL ::  ptra(jpi,jpj,jpk)    ! Tracer variable 
+      REAL(wp), INTENT(in)           ::  ptrd(jpi,jpj,jpkorig)    ! tracer trend  or flux
+      REAL(wp), INTENT(in), OPTIONAL ::  pu(jpi,jpj,jpkorig)      ! velocity 
+      REAL(wp), INTENT(in), OPTIONAL ::  ptra(jpi,jpj,jpkorig)    ! Tracer variable 
 
       WRITE(*,*) 'trd_3d: You should not have seen this print! error ?', ptrd(1,1,1), ptra(1,1,1), pu(1,1,1),   &
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRD/trdvor.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRD/trdvor.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/TRD/trdvor.F90	(revision 4409)
@@ -216,6 +216,6 @@
 
 !FTRANS putrdvor pvtrdvor :I :I :z
-      REAL(wp), INTENT(inout) ::   putrdvor(jpi,jpj,jpk)   ! u vorticity trend 
-      REAL(wp), INTENT(inout) ::   pvtrdvor(jpi,jpj,jpk)   ! v vorticity trend
+      REAL(wp), INTENT(inout) ::   putrdvor(jpi,jpj,jpkorig) ! u vorticity trend
+      REAL(wp), INTENT(inout) ::   pvtrdvor(jpi,jpj,jpkorig) ! v vorticity trend
       !
       INTEGER ::   ji, jj, jk   ! dummy loop indices
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90	(revision 4409)
@@ -118,10 +118,12 @@
       !!                ***  FUNCTION zdf_tke_alloc  ***
       !!----------------------------------------------------------------------
+      ! Use jpkorig rather than jpk because this routine not called until first
+      ! time-step by which time jpk has been adjusted.
       ALLOCATE(                                                                    &
 #if defined key_c1d
-         &      e_dis(jpi,jpj,jpk) , e_mix(jpi,jpj,jpk) ,                          &
-         &      e_pdl(jpi,jpj,jpk) , e_ric(jpi,jpj,jpk) ,                          &
-#endif
-         &      en   (jpi,jpj,jpk) , htau (jpi,jpj)     , dissl(jpi,jpj,jpk) , STAT= zdf_tke_alloc )
+         &      e_dis(jpi,jpj,jpkorig) , e_mix(jpi,jpj,jpkorig) ,                          &
+         &      e_pdl(jpi,jpj,jpkorig) , e_ric(jpi,jpj,jpkorig) ,                          &
+#endif
+         &      en   (jpi,jpj,jpkorig) , htau (jpi,jpj)     , dissl(jpi,jpj,jpkorig) , STAT= zdf_tke_alloc )
          !
       IF( lk_mpp             )   CALL mpp_sum ( zdf_tke_alloc )
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftmx.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftmx.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftmx.F90	(revision 4409)
@@ -68,5 +68,6 @@
       !!                ***  FUNCTION zdf_tmx_alloc  ***
       !!----------------------------------------------------------------------
-      ALLOCATE(en_tmx(jpi,jpj), mask_itf(jpi,jpj), az_tmx(jpi,jpj,jpk), STAT=zdf_tmx_alloc )
+      ALLOCATE(en_tmx(jpi,jpj), mask_itf(jpi,jpj), az_tmx(jpi,jpj,jpkorig), &
+               STAT=zdf_tmx_alloc )
       !
       IF( lk_mpp             )   CALL mpp_sum ( zdf_tmx_alloc )
@@ -262,5 +263,5 @@
 !     REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pav  ! Tidal mixing coef.
 !FTRANS pav :I :I :z
-      REAL(wp), INTENT(inout)            ::   pav(jpi,jpj,jpk)  ! Tidal mixing coef.
+      REAL(wp), INTENT(inout)            ::   pav(jpi,jpj,jpkorig)  ! Tidal mixing coef.
       !! 
       INTEGER  ::   ji, jj, jk    ! dummy loop indices
Index: /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
===================================================================
--- /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 4408)
+++ /branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 4409)
@@ -241,4 +241,7 @@
          jpk = jpkdta                                             ! third dim
          jpkm1 = jpk-1                                            ! inner domain indices
+         jpkorig = jpk                        ! Copy of jpk that is NOT modified
+         jpkf    = jpk                        ! Max depth of this sub-domain. Initially set to jpk here
+                                              ! but altered later in domzgr
       ENDIF
 
@@ -263,5 +266,7 @@
 #if   defined key_mpp_rkpart
       ELSE
-         CALL ctl_stop( 'STOP', 'nemo_init : invalid inputs in namelist - cannot specify jpn{i,j}>0 when using recursive k-section paritioning!' )
+         CALL ctl_stop( 'STOP', &
+                        'nemo_init : invalid inputs in namelist - cannot specify jpn{i,j}>0 &
+                        & when using recursive k-section paritioning!' )
 #endif
       END IF
@@ -593,5 +598,5 @@
    SUBROUTINE nemo_recursive_partition( num_pes )
       USE in_out_manager, ONLY: numnam
-      USE dom_oce,        ONLY: ln_zco, ntopo
+      USE dom_oce,        ONLY: ln_zco
       USE dom_oce,        ONLY: gdepw_0, gdept_0, e3w_0, e3t_0, &
                                 mig, mjg, mi0, mi1, mj0, mj1,  mbathy, bathy
@@ -626,5 +631,4 @@
       INTEGER :: inum                          ! temporary logical unit
       INTEGER :: ii,jj,iproc                   ! Loop index
-      INTEGER :: jparray(2)                    ! Small array for gathering 
       CHARACTER(LEN=8) :: lstr                 ! Local string for reading env. var.
       INTEGER          :: lztrim               ! Local int for      "      "    "
@@ -653,5 +657,5 @@
                                     STATUS=ierr)
       IF( ierr == 0)THEN
-         READ(lstr,FMT="(I)",IOSTAT=ierr) lztrim
+         READ(lstr,FMT="(I10)",IOSTAT=ierr) lztrim
          IF(ierr == 0)THEN
             IF (lztrim == 0) msgtrim_z = .FALSE.
