Index: NEMO/branches/UKMO/NEMO_4.0_mirror_SI3_GPU/src/ICE/icedyn_adv_umx.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_SI3_GPU/src/ICE/icedyn_adv_umx.F90	(revision 13148)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_SI3_GPU/src/ICE/icedyn_adv_umx.F90	(revision 13149)
@@ -48,5 +48,16 @@
    REAL(wp)           ::   z1_120 = 1._wp / 120._wp   ! =1/120
    !
-   INTEGER, ALLOCATABLE, DIMENSION(:,:,:) ::   imsk_small, jmsk_small
+   INTEGER,  ALLOCATABLE, DIMENSION(:,:,:)   ::   imsk_small, jmsk_small
+   REAL(wp), ALLOCATABLE, DIMENSION(:, :, :) ::   zfu_ho , zfv_ho , zpt
+   REAL(wp), ALLOCATABLE, DIMENSION(:, :, :) ::   zfu_ups, zfv_ups, zt_ups
+   REAL(wp), ALLOCATABLE, DIMENSION(:, :, :) ::   ztu1, ztu2, ztu3, ztu4
+   REAL(wp), ALLOCATABLE, DIMENSION(:, :, :) ::   ztv1, ztv2, ztv3, ztv4 
+   REAL(wp), ALLOCATABLE, DIMENSION(:, :)    ::   zswitch
+   REAL(wp), ALLOCATABLE, DIMENSION(:, :, :) ::   zslpy       ! tracer slopes
+   REAL(wp), ALLOCATABLE, DIMENSION(:, :, :) ::   zslpx       ! tracer slopes
+   REAL(wp), ALLOCATABLE, DIMENSION(:, :   ) ::   zbup, zbdo
+   REAL(wp), ALLOCATABLE, DIMENSION(:, :, :) ::   zbetup, zbetdo, zti_ups, ztj_ups
+   REAL(wp), ALLOCATABLE, DIMENSION(:, :, :) ::   zt_u, zt_v
+
    !
    !! * Substitutions
@@ -93,15 +104,39 @@
       REAL(wp) ::   zdt, zvi_cen
       REAL(wp), DIMENSION(1)           ::   zcflprv, zcflnow   ! for global communication
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zudy, zvdx, zcu_box, zcv_box
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zati1, zati2
-      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zu_cat, zv_cat
-      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zua_ho, zva_ho, zua_ups, zva_ups
-      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   z1_ai , z1_aip, zhvar
-      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zhi_max, zhs_max, zhip_max
-      !
-      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   zuv_ho, zvv_ho, zuv_ups, zvv_ups, z1_vi, z1_vs 
-      !!----------------------------------------------------------------------
-      !
-      IF( kt == nit000 .AND. lwp )   WRITE(numout,*) '-- ice_dyn_adv_umx: Ultimate-Macho advection scheme'
+!     REAL(wp), DIMENSION(jpi,jpj)     ::   zudy, zvdx, zcu_box, zcv_box
+!     REAL(wp), DIMENSION(jpi,jpj)     ::   zati1, zati2
+!     REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zu_cat, zv_cat
+!     REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zua_ho, zva_ho, zua_ups, zva_ups
+!     REAL(wp), DIMENSION(jpi,jpj,jpl) ::   z1_ai , z1_aip, zhvar
+!     REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zhi_max, zhs_max, zhip_max
+      REAL(wp), ALLOCATABLE, DIMENSION(:, :)    ::   zudy, zvdx, zcu_box, zcv_box
+      REAL(wp), ALLOCATABLE, DIMENSION(:, :)    ::   zati1, zati2
+      REAL(wp), ALLOCATABLE, DIMENSION(:, :, :) ::   zu_cat, zv_cat
+      REAL(wp), ALLOCATABLE, DIMENSION(:, :, :) ::   zua_ho, zva_ho, zua_ups, zva_ups
+      REAL(wp), ALLOCATABLE, DIMENSION(:, :, :) ::   z1_ai , z1_aip, zhvar
+      REAL(wp), ALLOCATABLE, DIMENSION(:, :, :) ::   zhi_max, zhs_max, zhip_max
+      !
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:)   ::   zuv_ho, zvv_ho, zuv_ups, zvv_ups, z1_vi, z1_vs 
+      !!----------------------------------------------------------------------
+      !
+      IF( kt == nit000) THEN
+         IF( lwp )   WRITE(numout,*) '-- ice_dyn_adv_umx: Ultimate-Macho advection scheme'
+         ALLOCATE( zudy(jpi,jpj), zvdx(jpi,jpj), zcu_box(jpi,jpj), zcv_box(jpi,jpj) )
+         ALLOCATE( zati1(jpi,jpj), zati2(jpi,jpj) )
+         ALLOCATE( zu_cat(jpi,jpj,jpl), zv_cat(jpi,jpj,jpl) )
+         ALLOCATE( zua_ho(jpi,jpj,jpl), zva_ho(jpi,jpj,jpl), zua_ups(jpi,jpj,jpl), zva_ups(jpi,jpj,jpl) )
+         ALLOCATE( z1_ai(jpi,jpj,jpl), z1_aip(jpi,jpj,jpl), zhvar(jpi,jpj,jpl) )
+         ALLOCATE( zhi_max(jpi,jpj,jpl), zhs_max(jpi,jpj,jpl), zhip_max(jpi,jpj,jpl) )
+         ALLOCATE( zfu_ho(jpi,jpj,jpl), zfv_ho(jpi,jpj,jpl), zpt(jpi,jpj,jpl))
+         ALLOCATE( zfu_ups(jpi,jpj,jpl), zfv_ups(jpi,jpj,jpl), zt_ups(jpi,jpj,jpl))
+         ALLOCATE( ztu1(jpi,jpj,jpl), ztu2(jpi,jpj,jpl), ztu3(jpi,jpj,jpl), ztu4(jpi,jpj,jpl))
+         ALLOCATE( ztv1(jpi,jpj,jpl), ztv2(jpi,jpj,jpl), ztv3(jpi,jpj,jpl), ztv4(jpi,jpj,jpl))
+         ALLOCATE( zswitch(jpi,jpj))
+         ALLOCATE( zslpy(jpi,jpj,jpl))
+         ALLOCATE( zslpx(jpi,jpj,jpl))
+         ALLOCATE( zbup(jpi,jpj), zbdo(jpi,jpj))
+         ALLOCATE( zbetup(jpi,jpj,jpl), zbetdo(jpi,jpj,jpl), zti_ups(jpi,jpj,jpl), ztj_ups(jpi,jpj,jpl))
+         ALLOCATE( zt_u(jpi,jpj,jpl), zt_v(jpi,jpj,jpl))
+      ENDIF
       !
       ! --- Record max of the surrounding 9-pts ice thick. (for call Hbig) --- !
@@ -421,6 +456,6 @@
       INTEGER  ::   ji, jj, jl       ! dummy loop indices  
       REAL(wp) ::   ztra             ! local scalar
-      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zfu_ho , zfv_ho , zpt
-      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zfu_ups, zfv_ups, zt_ups
+!     REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zfu_ho , zfv_ho , zpt
+!     REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zfu_ups, zfv_ups, zt_ups
       !!----------------------------------------------------------------------
       !
@@ -537,5 +572,5 @@
       INTEGER  ::   ji, jj, jl    ! dummy loop indices
       REAL(wp) ::   ztra          ! local scalar
-      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zpt
+!     REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zpt
       !!----------------------------------------------------------------------
 
@@ -653,5 +688,5 @@
       INTEGER  ::   ji, jj, jl    ! dummy loop indices
       REAL(wp) ::   ztra          ! local scalar
-      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zpt
+!     REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zpt
       !!----------------------------------------------------------------------
       !
@@ -771,5 +806,5 @@
       !
       INTEGER  ::   ji, jj, jl    ! dummy loop indices
-      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zt_u, zt_v, zpt
+!     REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zt_u, zt_v, zpt
       !!----------------------------------------------------------------------
       !
@@ -858,5 +893,5 @@
       INTEGER  ::   ji, jj, jl             ! dummy loop indices
       REAL(wp) ::   zcu, zdx2, zdx4        !   -      -
-      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   ztu1, ztu2, ztu3, ztu4
+!     REAL(wp), DIMENSION(jpi,jpj,jpl) ::   ztu1, ztu2, ztu3, ztu4
       !!----------------------------------------------------------------------
       !
@@ -1015,5 +1050,5 @@
       INTEGER  ::   ji, jj, jl         ! dummy loop indices
       REAL(wp) ::   zcv, zdy2, zdy4    !   -      -
-      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   ztv1, ztv2, ztv3, ztv4
+!     REAL(wp), DIMENSION(jpi,jpj,jpl) ::   ztv1, ztv2, ztv3, ztv4
       !!----------------------------------------------------------------------
       !
@@ -1169,6 +1204,6 @@
       REAL(wp) ::   zpos, zneg, zbig, zup, zdo, z1_dt              ! local scalars
       REAL(wp) ::   zau, zbu, zcu, zav, zbv, zcv, zcoef, zzt       !   -      -
-      REAL(wp), DIMENSION(jpi,jpj    ) :: zbup, zbdo
-      REAL(wp), DIMENSION(jpi,jpj,jpl) :: zbetup, zbetdo, zti_ups, ztj_ups
+!     REAL(wp), DIMENSION(jpi,jpj    ) :: zbup, zbdo
+!     REAL(wp), DIMENSION(jpi,jpj,jpl) :: zbetup, zbetdo, zti_ups, ztj_ups
       !!----------------------------------------------------------------------
       zbig = 1.e+40_wp
@@ -1339,5 +1374,5 @@
       REAL(wp) ::   Cr, Rjm, Rj, Rjp, uCFL, zpsi, zh3, zlimiter, Rr
       INTEGER  ::   ji, jj, jl    ! dummy loop indices
-      REAL(wp), DIMENSION (jpi,jpj,jpl) ::   zslpx       ! tracer slopes 
+!     REAL(wp), DIMENSION (jpi,jpj,jpl) ::   zslpx       ! tracer slopes 
       !!----------------------------------------------------------------------
       !
@@ -1434,5 +1469,4 @@
       REAL(wp) ::   Cr, Rjm, Rj, Rjp, vCFL, zpsi, zh3, zlimiter, Rr
       INTEGER  ::   ji, jj, jl    ! dummy loop indices
-      REAL(wp), DIMENSION (jpi,jpj,jpl) ::   zslpy       ! tracer slopes 
       !!----------------------------------------------------------------------
       !
@@ -1541,5 +1575,5 @@
       INTEGER  ::   ji, jj, jk, jl         ! dummy loop indices
       REAL(wp) ::   z1_dt, zhip, zhi, zhs, zvs_excess, zfra
-      REAL(wp), DIMENSION(jpi,jpj) ::   zswitch
+!     REAL(wp), DIMENSION(jpi,jpj) ::   zswitch
       !!-------------------------------------------------------------------
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_SI3_GPU/src/OCE/DYN/dynldf_lap_blp.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_SI3_GPU/src/OCE/DYN/dynldf_lap_blp.F90	(revision 13148)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_SI3_GPU/src/OCE/DYN/dynldf_lap_blp.F90	(revision 13149)
@@ -56,10 +56,14 @@
       REAL(wp) ::   zua, zva     ! local scalars
       REAL(wp), DIMENSION(jpi,jpj) ::   zcur, zdiv
+!     REAL(wp), ALLOCATABLE, DIMENSION(:, :) :: zcur, zdiv
       !!----------------------------------------------------------------------
       !
-      IF( kt == nit000 .AND. lwp ) THEN
-         WRITE(numout,*)
-         WRITE(numout,*) 'dyn_ldf : iso-level harmonic (laplacian) operator, pass=', kpass
-         WRITE(numout,*) '~~~~~~~ '
+      IF( kt == nit000 ) THEN
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) 'dyn_ldf : iso-level harmonic (laplacian) operator, pass=', kpass
+            WRITE(numout,*) '~~~~~~~ '
+         ENDIF
+!        ALLOCATE(zcur(jpi,jpj), zdiv(jpi,jpj))
       ENDIF
       !
@@ -122,5 +126,6 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   pua, pva   ! momentum trend
       !
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zulap, zvlap   ! laplacian at u- and v-point
+!     REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zulap, zvlap   ! laplacian at u- and v-point
+      REAL(wp), ALLOCATABLE, DIMENSION(:, :, :) :: zulap, zvlap
       !!----------------------------------------------------------------------
       !
@@ -129,4 +134,5 @@
          IF(lwp) WRITE(numout,*) 'dyn_ldf_blp : bilaplacian operator momentum '
          IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~'
+         ALLOCATE(zulap(jpi,jpj,jpk), zvlap(jpi,jpj,jpk))
       ENDIF
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_SI3_GPU/src/OCE/ICB/icbrst.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_SI3_GPU/src/OCE/ICB/icbrst.F90	(revision 13148)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_SI3_GPU/src/OCE/ICB/icbrst.F90	(revision 13149)
@@ -200,5 +200,5 @@
       TYPE(point)  , POINTER :: pt
       !!----------------------------------------------------------------------
-
+      RETURN
       ! Following the normal restart procedure, this routine will be called
       ! the timestep before a restart stage as well as the restart timestep.
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_SI3_GPU/src/OCE/IOM/iom.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_SI3_GPU/src/OCE/IOM/iom.F90	(revision 13148)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_SI3_GPU/src/OCE/IOM/iom.F90	(revision 13149)
@@ -1506,5 +1506,5 @@
       LOGICAL :: llx                ! local xios write flag
       INTEGER :: ivid   ! variable id
-
+      RETURN
       llx = .FALSE.
       IF(PRESENT(ldxios)) llx = ldxios
@@ -1536,5 +1536,5 @@
       LOGICAL :: llx                ! local xios write flag
       INTEGER :: ivid   ! variable id
-
+      RETURN
       llx = .FALSE.
       IF(PRESENT(ldxios)) llx = ldxios
@@ -1566,5 +1566,5 @@
       LOGICAL :: llx
       INTEGER :: ivid   ! variable id
-
+      RETURN
       llx = .FALSE.
       IF(PRESENT(ldxios)) llx = ldxios
@@ -1596,5 +1596,5 @@
       LOGICAL :: llx                 ! local xios write flag
       INTEGER :: ivid   ! variable id
-
+      RETURN
       llx = .FALSE.
       IF(PRESENT(ldxios)) llx = ldxios
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_SI3_GPU/src/OCE/LDF/ldfslp.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_SI3_GPU/src/OCE/LDF/ldfslp.F90	(revision 13148)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_SI3_GPU/src/OCE/LDF/ldfslp.F90	(revision 13149)
@@ -70,4 +70,14 @@
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   vslpml, wslpjml   ! j_slope at V- and W-points just below the mixed layer
 
+   REAL(wp), ALLOCATABLE, DIMENSION(:, :)    ::  zslpml_hmlpu, zslpml_hmlpv
+   REAL(wp), ALLOCATABLE, DIMENSION(:, :, :) ::  zgru, zwz, zdzr
+   REAL(wp), ALLOCATABLE, DIMENSION(:, :, :) ::  zgrv, zww
+
+   REAL(wp), ALLOCATABLE, DIMENSION(:, :)       ::   z1_mlbw
+   REAL(wp), ALLOCATABLE, DIMENSION(:, :, :)    ::   zalbet
+   REAL(wp), ALLOCATABLE, DIMENSION(:, :, :, :) ::   zdxrho , zdyrho, zdzrho     ! Horizontal and vertical density gradients
+   REAL(wp), ALLOCATABLE, DIMENSION(:, :, :, :) ::   zti_mlb, ztj_mlb            ! for Griffies operator only
+
+
    REAL(wp) ::   repsln = 1.e-25_wp       ! tiny value used as minium of di(rho), dj(rho) and dk(rho)
 
@@ -118,7 +128,7 @@
       REAL(wp) ::   zck, zfk,      zbw             !   -      -
       REAL(wp) ::   zdepu, zdepv                   !   -      -
-      REAL(wp), DIMENSION(jpi,jpj)     ::  zslpml_hmlpu, zslpml_hmlpv
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::  zgru, zwz, zdzr
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::  zgrv, zww
+!     REAL(wp), DIMENSION(jpi,jpj)     ::  zslpml_hmlpu, zslpml_hmlpv
+!     REAL(wp), DIMENSION(jpi,jpj,jpk) ::  zgru, zwz, zdzr
+!     REAL(wp), DIMENSION(jpi,jpj,jpk) ::  zgrv, zww
       !!----------------------------------------------------------------------
       !
@@ -401,8 +411,8 @@
       REAL(wp) ::   zdzrho_raw
       REAL(wp) ::   zbeta0, ze3_e1, ze3_e2
-      REAL(wp), DIMENSION(jpi,jpj)     ::   z1_mlbw
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zalbet
-      REAL(wp), DIMENSION(jpi,jpj,jpk,0:1) ::   zdxrho , zdyrho, zdzrho     ! Horizontal and vertical density gradients
-      REAL(wp), DIMENSION(jpi,jpj,0:1,0:1) ::   zti_mlb, ztj_mlb            ! for Griffies operator only
+!     REAL(wp), DIMENSION(jpi,jpj)     ::   z1_mlbw
+!     REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zalbet
+!     REAL(wp), DIMENSION(jpi,jpj,jpk,0:1) ::   zdxrho , zdyrho, zdzrho     ! Horizontal and vertical density gradients
+!     REAL(wp), DIMENSION(jpi,jpj,0:1,0:1) ::   zti_mlb, ztj_mlb            ! for Griffies operator only
       !!----------------------------------------------------------------------
       !
@@ -750,4 +760,8 @@
       ALLOCATE( ah_wslp2(jpi,jpj,jpk) , akz(jpi,jpj,jpk) , STAT=ierr )
       IF( ierr > 0 )   CALL ctl_stop( 'STOP', 'ldf_slp_init : unable to allocate ah_slp2 or akz' )
+      ALLOCATE(zslpml_hmlpu(jpi,jpj), zslpml_hmlpv(jpi,jpj))
+      ALLOCATE(zgru(jpi,jpj,jpk), zwz(jpi,jpj,jpk), zdzr(jpi,jpj,jpk))
+      ALLOCATE(zgrv(jpi,jpj,jpk), zww(jpi,jpj,jpk))
+
       !
       IF( ln_traldf_triad ) THEN        ! Griffies operator : triad of slopes
@@ -765,4 +779,9 @@
             &      vslp(jpi,jpj,jpk) , vslpml(jpi,jpj) , wslpj(jpi,jpj,jpk) , wslpjml(jpi,jpj) , STAT=ierr )
          IF( ierr > 0 )   CALL ctl_stop( 'STOP', 'ldf_slp_init : unable to allocate Madec operator slope ' )
+
+          ALLOCATE(z1_mlbw(jpi,jpj))
+          ALLOCATE(zalbet(jpi,jpj,jpk))
+          ALLOCATE(zdxrho(jpi,jpj,jpk,0:1) , zdyrho(jpi,jpj,jpk,0:1), zdzrho(jpi,jpj,jpk,0:1) )
+          ALLOCATE(zti_mlb(jpi,jpj,0:1,0:1), ztj_mlb(jpi,jpj,0:1,0:1))
 
          ! Direction of lateral diffusion (tracers and/or momentum)
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_SI3_GPU/src/OCE/LDF/ldftra.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_SI3_GPU/src/OCE/LDF/ldftra.F90	(revision 13148)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_SI3_GPU/src/OCE/LDF/ldftra.F90	(revision 13149)
@@ -830,24 +830,30 @@
       zw3d(:,:,jpk) = 0._wp                                    ! bottom value always 0
       !
-      DO jk = 1, jpkm1                                         ! e2u e3u u_eiv = -dk[psi_uw]
-         zw3d(:,:,jk) = ( psi_uw(:,:,jk+1) - psi_uw(:,:,jk) ) / ( e2u(:,:) * e3u_n(:,:,jk) )
-      END DO
-      CALL iom_put( "uoce_eiv", zw3d )
-      !
-      DO jk = 1, jpkm1                                         ! e1v e3v v_eiv = -dk[psi_vw]
-         zw3d(:,:,jk) = ( psi_vw(:,:,jk+1) - psi_vw(:,:,jk) ) / ( e1v(:,:) * e3v_n(:,:,jk) )
-      END DO
-      CALL iom_put( "voce_eiv", zw3d )
-      !
-      DO jk = 1, jpkm1                                         ! e1 e2 w_eiv = dk[psix] + dk[psix]
-         DO jj = 2, jpjm1
-            DO ji = fs_2, fs_jpim1  ! vector opt.
-               zw3d(ji,jj,jk) = (  psi_vw(ji,jj,jk) - psi_vw(ji  ,jj-1,jk)    &
-                  &              + psi_uw(ji,jj,jk) - psi_uw(ji-1,jj  ,jk)  ) / e1e2t(ji,jj)
-            END DO
-         END DO
-      END DO
-      CALL lbc_lnk( 'ldftra', zw3d, 'T', 1. )      ! lateral boundary condition
-      CALL iom_put( "woce_eiv", zw3d )
+      IF(iom_use("uoce_eiv")) THEN
+         DO jk = 1, jpkm1                                         ! e2u e3u u_eiv = -dk[psi_uw]
+            zw3d(:,:,jk) = ( psi_uw(:,:,jk+1) - psi_uw(:,:,jk) ) / ( e2u(:,:) * e3u_n(:,:,jk) )
+         END DO
+         CALL iom_put( "uoce_eiv", zw3d )
+      ENDIF
+      !
+      IF(iom_use("voce_eiv")) THEN
+         DO jk = 1, jpkm1                                         ! e1v e3v v_eiv = -dk[psi_vw]
+            zw3d(:,:,jk) = ( psi_vw(:,:,jk+1) - psi_vw(:,:,jk) ) / ( e1v(:,:) * e3v_n(:,:,jk) )
+         END DO
+         CALL iom_put( "voce_eiv", zw3d )
+      ENDIF
+      !
+      IF(iom_use("woce_eiv")) THEN
+         DO jk = 1, jpkm1                                         ! e1 e2 w_eiv = dk[psix] + dk[psix]
+            DO jj = 2, jpjm1
+               DO ji = fs_2, fs_jpim1  ! vector opt.
+                  zw3d(ji,jj,jk) = (  psi_vw(ji,jj,jk) - psi_vw(ji  ,jj-1,jk)    &
+                     &              + psi_uw(ji,jj,jk) - psi_uw(ji-1,jj  ,jk)  ) / e1e2t(ji,jj)
+               END DO
+            END DO
+         END DO
+         CALL lbc_lnk( 'ldftra', zw3d, 'T', 1. )      ! lateral boundary condition
+         CALL iom_put( "woce_eiv", zw3d )
+      ENDIF
       !
       !
@@ -870,18 +876,20 @@
         CALL iom_put( "ueiv_heattr3d", zztmp * zw3d )                  ! heat transport in i-direction
       ENDIF
-      zw2d(:,:)   = 0._wp 
-      zw3d(:,:,:) = 0._wp 
-      DO jk = 1, jpkm1
-         DO jj = 2, jpjm1
-            DO ji = fs_2, fs_jpim1   ! vector opt.
-               zw3d(ji,jj,jk) = zw3d(ji,jj,jk) + ( psi_vw(ji,jj,jk+1)      - psi_vw(ji,jj,jk)          )   &
-                  &                            * ( tsn   (ji,jj,jk,jp_tem) + tsn   (ji,jj+1,jk,jp_tem) ) 
-               zw2d(ji,jj) = zw2d(ji,jj) + zw3d(ji,jj,jk)
-            END DO
-         END DO
-      END DO
-      CALL lbc_lnk( 'ldftra', zw2d, 'V', -1. )
-      CALL iom_put( "veiv_heattr", zztmp * zw2d )                  !  heat transport in j-direction
-      CALL iom_put( "veiv_heattr", zztmp * zw3d )                  !  heat transport in j-direction
+      IF( iom_use('veiv_heattr') ) THEN
+         zw2d(:,:)   = 0._wp 
+         zw3d(:,:,:) = 0._wp 
+         DO jk = 1, jpkm1
+            DO jj = 2, jpjm1
+               DO ji = fs_2, fs_jpim1   ! vector opt.
+                  zw3d(ji,jj,jk) = zw3d(ji,jj,jk) + ( psi_vw(ji,jj,jk+1)      - psi_vw(ji,jj,jk)          )   &
+                     &                            * ( tsn   (ji,jj,jk,jp_tem) + tsn   (ji,jj+1,jk,jp_tem) ) 
+                  zw2d(ji,jj) = zw2d(ji,jj) + zw3d(ji,jj,jk)
+               END DO
+            END DO
+         END DO
+         CALL lbc_lnk( 'ldftra', zw2d, 'V', -1. )
+         CALL iom_put( "veiv_heattr", zztmp * zw2d )                  !  heat transport in j-direction
+         CALL iom_put( "veiv_heattr", zztmp * zw3d )                  !  heat transport in j-direction
+      ENDIF
       !
       IF( ln_diaptr )  CALL dia_ptr_hst( jp_tem, 'eiv', 0.5 * zw3d )
@@ -905,18 +913,20 @@
         CALL iom_put( "ueiv_salttr3d", zztmp * zw3d )                  ! salt transport in i-direction
       ENDIF
-      zw2d(:,:) = 0._wp 
-      zw3d(:,:,:) = 0._wp 
-      DO jk = 1, jpkm1
-         DO jj = 2, jpjm1
-            DO ji = fs_2, fs_jpim1   ! vector opt.
-               zw3d(ji,jj,jk) = zw3d(ji,jj,jk) + ( psi_vw(ji,jj,jk+1)      - psi_vw(ji,jj,jk)          )   &
-                  &                            * ( tsn   (ji,jj,jk,jp_sal) + tsn   (ji,jj+1,jk,jp_sal) ) 
-               zw2d(ji,jj) = zw2d(ji,jj) + zw3d(ji,jj,jk)
-            END DO
-         END DO
-      END DO
-      CALL lbc_lnk( 'ldftra', zw2d, 'V', -1. )
-      CALL iom_put( "veiv_salttr", zztmp * zw2d )                  !  salt transport in j-direction
-      CALL iom_put( "veiv_salttr", zztmp * zw3d )                  !  salt transport in j-direction
+      IF( iom_use('veiv_salttr') ) THEN
+         zw2d(:,:) = 0._wp 
+         zw3d(:,:,:) = 0._wp 
+         DO jk = 1, jpkm1
+            DO jj = 2, jpjm1
+               DO ji = fs_2, fs_jpim1   ! vector opt.
+                  zw3d(ji,jj,jk) = zw3d(ji,jj,jk) + ( psi_vw(ji,jj,jk+1)      - psi_vw(ji,jj,jk)          )   &
+                     &                            * ( tsn   (ji,jj,jk,jp_sal) + tsn   (ji,jj+1,jk,jp_sal) ) 
+                  zw2d(ji,jj) = zw2d(ji,jj) + zw3d(ji,jj,jk)
+               END DO
+            END DO
+         END DO
+         CALL lbc_lnk( 'ldftra', zw2d, 'V', -1. )
+         CALL iom_put( "veiv_salttr", zztmp * zw2d )                  !  salt transport in j-direction
+         CALL iom_put( "veiv_salttr", zztmp * zw3d )                  !  salt transport in j-direction
+      ENDIF
       !
       IF( ln_diaptr ) CALL dia_ptr_hst( jp_sal, 'eiv', 0.5 * zw3d )
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_SI3_GPU/src/OCE/TRA/traadv_fct.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_SI3_GPU/src/OCE/TRA/traadv_fct.F90	(revision 13148)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_SI3_GPU/src/OCE/TRA/traadv_fct.F90	(revision 13149)
@@ -42,4 +42,6 @@
    INTEGER, PARAMETER ::   np_NH   = 0   ! Neumann homogeneous boundary condition
    INTEGER, PARAMETER ::   np_CEN2 = 1   ! 2nd order centered  boundary condition
+   REAL(wp), DIMENSION(:, :, :), ALLOCATABLE :: zbetup, zbetdo, zbup, zbdo
+   REAL(wp), DIMENSION(:, :, :), ALLOCATABLE :: zwi, zwx, zwy, zwz, ztu, ztv, zltu, zltv, ztw
 
    !! * Substitutions
@@ -84,5 +86,5 @@
       REAL(wp) ::   zfp_ui, zfp_vj, zfp_wk, zC2t_u, zC4t_u   !   -      -
       REAL(wp) ::   zfm_ui, zfm_vj, zfm_wk, zC2t_v, zC4t_v   !   -      -
-      REAL(wp), DIMENSION(jpi,jpj,jpk)        ::   zwi, zwx, zwy, zwz, ztu, ztv, zltu, zltv, ztw
+!     REAL(wp), DIMENSION(jpi,jpj,jpk)        ::   zwi, zwx, zwy, zwz, ztu, ztv, zltu, zltv, ztw
       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   ztrdx, ztrdy, ztrdz, zptry
       !!----------------------------------------------------------------------
@@ -92,4 +94,8 @@
          IF(lwp) WRITE(numout,*) 'tra_adv_fct : FCT advection scheme on ', cdtype
          IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
+         ALLOCATE (zbetup(jpi,jpj,jpk), zbetdo(jpi,jpj,jpk), zbup(jpi,jpj,jpk), zbdo(jpi,jpj,jpk) )
+         ALLOCATE (zwi(jpi,jpj,jpk), zwx(jpi,jpj,jpk), zwy(jpi,jpj,jpk), zwz(jpi,jpj,jpk), &
+                   ztu(jpi,jpj,jpk), ztv(jpi,jpj,jpk), zltu(jpi,jpj,jpk), zltv(jpi,jpj,jpk), &
+                                                                          ztw(jpi,jpj,jpk))
       ENDIF
       !
@@ -349,5 +355,5 @@
       REAL(wp) ::   zpos, zneg, zbt, za, zb, zc, zbig, zrtrn    ! local scalars
       REAL(wp) ::   zau, zbu, zcu, zav, zbv, zcv, zup, zdo            !   -      -
-      REAL(wp), DIMENSION(jpi,jpj,jpk) :: zbetup, zbetdo, zbup, zbdo
+!     REAL(wp), DIMENSION(jpi,jpj,jpk) :: zbetup, zbetdo, zbup, zbdo
       !!----------------------------------------------------------------------
       !
Index: NEMO/branches/UKMO/NEMO_4.0_mirror_SI3_GPU/src/OCE/TRA/traldf_iso.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0_mirror_SI3_GPU/src/OCE/TRA/traldf_iso.F90	(revision 13148)
+++ NEMO/branches/UKMO/NEMO_4.0_mirror_SI3_GPU/src/OCE/TRA/traldf_iso.F90	(revision 13149)
@@ -38,4 +38,6 @@
    LOGICAL  ::   l_ptr   ! flag to compute poleward transport
    LOGICAL  ::   l_hst   ! flag to compute heat transport
+   REAL(wp), DIMENSION(:, :)   , ALLOCATABLE ::   zdkt, zdk1t, z2d
+   REAL(wp), DIMENSION(:, :, :), ALLOCATABLE ::   zdit, zdjt, zftu, zftv, ztfw
 
    !! * Substitutions
@@ -109,6 +111,6 @@
       REAL(wp) ::  zmskv, zahv_w, zabe2, zcof2, zcoef4   !   -      -
       REAL(wp) ::  zcoef0, ze3w_2, zsign, z2dt, z1_2dt   !   -      -
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zdkt, zdk1t, z2d
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zdit, zdjt, zftu, zftv, ztfw 
+!      REAL(wp), DIMENSION(jpi,jpj)     ::   zdkt, zdk1t, z2d
+!      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zdit, zdjt, zftu, zftv, ztfw 
       !!----------------------------------------------------------------------
       !
@@ -120,4 +122,6 @@
          akz     (:,:,:) = 0._wp      
          ah_wslp2(:,:,:) = 0._wp
+         ALLOCATE(zdit(jpi,jpj,jpk), zdjt(jpi,jpj,jpk), zftu(jpi,jpj,jpk), zftv(jpi,jpj,jpk), ztfw(jpi,jpj,jpk))
+         ALLOCATE(zdkt(jpi,jpj), zdk1t(jpi,jpj), z2d(jpi,jpj))
       ENDIF
       !   
