Index: /branches/UKMO/dev_r5518_medusa_fix_restart/NEMOGCM/NEMO/OFF_SRC/dtadyn.F90
===================================================================
--- /branches/UKMO/dev_r5518_medusa_fix_restart/NEMOGCM/NEMO/OFF_SRC/dtadyn.F90	(revision 7868)
+++ /branches/UKMO/dev_r5518_medusa_fix_restart/NEMOGCM/NEMO/OFF_SRC/dtadyn.F90	(revision 7869)
@@ -546,12 +546,8 @@
       ! Partial steps: before Horizontal DErivative
       IF( ln_zps  .AND. .NOT. ln_isfcav)                            &
-         &            CALL zps_hde    ( kt, jpts, pts,              &
-         &                                        fse3w_n, gdept_n, &
-         &                                        gtsu, gtsv,       &  ! Partial steps: before horizontal gradient
+         &            CALL zps_hde    ( kt, jpts, pts, gtsu, gtsv,  &  ! Partial steps: before horizontal gradient
          &                                        rhd, gru , grv    )  ! of t, s, rd at the last ocean level
       IF( ln_zps .AND.        ln_isfcav)                            &
-         &            CALL zps_hde_isf( kt, jpts, pts,              &
-         &                              fse3w_n, gdept_n, gdep3w_n, &
-         &                                        gtsu, gtsv,  &    ! Partial steps for top cell (ISF)
+         &            CALL zps_hde_isf( kt, jpts, pts, gtsu, gtsv,  &    ! Partial steps for top cell (ISF)
          &                                        rhd, gru , grv , aru , arv , gzu , gzv , ge3ru , ge3rv ,   &
          &                                 gtui, gtvi, grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi    ) ! of t, s, rd at the first ocean level
Index: /branches/UKMO/dev_r5518_medusa_fix_restart/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90
===================================================================
--- /branches/UKMO/dev_r5518_medusa_fix_restart/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90	(revision 7868)
+++ /branches/UKMO/dev_r5518_medusa_fix_restart/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90	(revision 7869)
@@ -646,6 +646,4 @@
       !! ** Action  : 
       !!----------------------------------------------------------------------
-      USE dom_oce, ONLY: e3w_n
-
       INTEGER, INTENT(IN) :: kt               ! Current time step
       !
@@ -749,11 +747,8 @@
 
             IF( ln_zps .AND. .NOT. lk_c1d .AND. .NOT. ln_isfcav)      &
-               &  CALL zps_hde    ( kt, jpts, tsb, e3w_n, gdept_n,    &
-               &                              gtsu, gtsv,             &  ! Partial steps: before horizontal gradient
+               &  CALL zps_hde    ( kt, jpts, tsb, gtsu, gtsv,        &  ! Partial steps: before horizontal gradient
                &                              rhd, gru , grv          )  ! of t, s, rd at the last ocean level
             IF( ln_zps .AND. .NOT. lk_c1d .AND.       ln_isfcav)      &
-               &  CALL zps_hde_isf( nit000, jpts, tsb,                &
-               &                    e3w_n, gdept_n, gdep3w_n,         &
-               &                    gtsu, gtsv,                       &    ! Partial steps for top cell (ISF)
+               &  CALL zps_hde_isf( nit000, jpts, tsb, gtsu, gtsv,    &    ! Partial steps for top cell (ISF)
                &                                  rhd, gru , grv , aru , arv , gzu , gzv , ge3ru , ge3rv ,   &
                &                           gtui, gtvi, grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi    ) ! of t, s, rd at the last ocean level
Index: /branches/UKMO/dev_r5518_medusa_fix_restart/NEMOGCM/NEMO/OPA_SRC/DOM/istate.F90
===================================================================
--- /branches/UKMO/dev_r5518_medusa_fix_restart/NEMOGCM/NEMO/OPA_SRC/DOM/istate.F90	(revision 7868)
+++ /branches/UKMO/dev_r5518_medusa_fix_restart/NEMOGCM/NEMO/OPA_SRC/DOM/istate.F90	(revision 7869)
@@ -130,11 +130,8 @@
 #if ! defined key_c1d
          IF( ln_zps .AND. .NOT. ln_isfcav)                                 &
-            &            CALL zps_hde    ( nit000, jpts, tsb,              &
-            &                              e3w_n, gdept_n, gtsu, gtsv,     &    ! Partial steps: before horizontal gradient
+            &            CALL zps_hde    ( nit000, jpts, tsb, gtsu, gtsv,  &    ! Partial steps: before horizontal gradient
             &                                            rhd, gru , grv    )  ! of t, s, rd at the last ocean level
          IF( ln_zps .AND.       ln_isfcav)                                 &
-            &            CALL zps_hde_isf( nit000, jpts, tsb,              &
-            &                              e3w_n, gdept_n, gdep3w_n,       &
-            &                              gtsu, gtsv,                     &    ! Partial steps for top cell (ISF)
+            &            CALL zps_hde_isf( nit000, jpts, tsb, gtsu, gtsv,  &    ! Partial steps for top cell (ISF)
             &                                            rhd, gru , grv , aru , arv , gzu , gzv , ge3ru , ge3rv ,   &
             &                                     gtui, gtvi, grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi    ) ! of t, s, rd at the last ocean level
Index: /branches/UKMO/dev_r5518_medusa_fix_restart/NEMOGCM/NEMO/OPA_SRC/TRA/zpshde.F90
===================================================================
--- /branches/UKMO/dev_r5518_medusa_fix_restart/NEMOGCM/NEMO/OPA_SRC/TRA/zpshde.F90	(revision 7868)
+++ /branches/UKMO/dev_r5518_medusa_fix_restart/NEMOGCM/NEMO/OPA_SRC/TRA/zpshde.F90	(revision 7869)
@@ -32,4 +32,5 @@
 
    !! * Substitutions
+#  include "domzgr_substitute.h90"
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
@@ -40,5 +41,5 @@
 CONTAINS
 
-   SUBROUTINE zps_hde( kt, kjpt, pta, fse3w, fsdept, pgtu, pgtv,   &
+   SUBROUTINE zps_hde( kt, kjpt, pta, pgtu, pgtv,   &
       &                          prd, pgru, pgrv    )
       !!----------------------------------------------------------------------
@@ -88,6 +89,4 @@
       INTEGER                              , INTENT(in   )           ::  kjpt        ! number of tracers
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   )           ::  pta         ! 4D tracers fields
-      REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(in   )           ::  fse3w       ! Vertical scale factor on w pts
-      REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(in   )           ::  fsdept      !  Depth now at t pts
       REAL(wp), DIMENSION(jpi,jpj,    kjpt), INTENT(  out)           ::  pgtu, pgtv  ! hor. grad. of ptra at u- & v-pts 
       REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(in   ), OPTIONAL ::  prd         ! 3D density anomaly fields
@@ -197,5 +196,5 @@
    END SUBROUTINE zps_hde
    !
-   SUBROUTINE zps_hde_isf( kt, kjpt, pta, fse3w, fsdept, fsde3w, pgtu, pgtv,  &
+   SUBROUTINE zps_hde_isf( kt, kjpt, pta, pgtu, pgtv,   &
       &                          prd, pgru, pgrv, pmru, pmrv, pgzu, pgzv, pge3ru, pge3rv,  &
       &                   pgtui, pgtvi, pgrui, pgrvi, pmrui, pmrvi, pgzui, pgzvi, pge3rui, pge3rvi )
@@ -249,7 +248,4 @@
       INTEGER                              , INTENT(in   )           ::  kjpt        ! number of tracers
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   )           ::  pta         ! 4D tracers fields
-      REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(in   )           ::  fse3w       ! Vertical scale factor on w pts
-      REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(in   )           ::  fsdept      !  Depth now at t pts
-      REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(in   )           ::  fsde3w      ! Now depth of t pts (sum of e3w) (m)
       REAL(wp), DIMENSION(jpi,jpj,    kjpt), INTENT(  out)           ::  pgtu, pgtv  ! hor. grad. of ptra at u- & v-pts 
       REAL(wp), DIMENSION(jpi,jpj,    kjpt), INTENT(  out)           ::  pgtui, pgtvi  ! hor. grad. of stra at u- & v-pts (ISF)
Index: /branches/UKMO/dev_r5518_medusa_fix_restart/NEMOGCM/NEMO/OPA_SRC/step.F90
===================================================================
--- /branches/UKMO/dev_r5518_medusa_fix_restart/NEMOGCM/NEMO/OPA_SRC/step.F90	(revision 7868)
+++ /branches/UKMO/dev_r5518_medusa_fix_restart/NEMOGCM/NEMO/OPA_SRC/step.F90	(revision 7869)
@@ -31,5 +31,4 @@
    !!   stp             : OPA system time-stepping
    !!----------------------------------------------------------------------
-   USE dom_oce, ONLY: e3w_n, gdep3w_n, gdept_n
    USE step_oce         ! time stepping definition modules
    USE iom
@@ -156,11 +155,8 @@
                          CALL eos( tsb, rhd, gdept_0(:,:,:) )               ! before in situ density
          IF( ln_zps .AND. .NOT. ln_isfcav)                               &
-            &            CALL zps_hde    ( kstp, jpts, tsb,              &
-            &                              e3w_n, gdept_n, gtsu, gtsv,   &  ! Partial steps: before horizontal gradient
+            &            CALL zps_hde    ( kstp, jpts, tsb, gtsu, gtsv,  &  ! Partial steps: before horizontal gradient
             &                                          rhd, gru , grv    )  ! of t, s, rd at the last ocean level
          IF( ln_zps .AND.       ln_isfcav)                               &
-            &            CALL zps_hde_isf( kstp, jpts, tsb,              &
-            &                              e3w_n, gdept_n, gdep3w_n,     &
-            &                              gtsu, gtsv,                   &    ! Partial steps for top cell (ISF)
+            &            CALL zps_hde_isf( kstp, jpts, tsb, gtsu, gtsv,  &    ! Partial steps for top cell (ISF)
             &                                          rhd, gru , grv , aru , arv , gzu , gzv , ge3ru , ge3rv ,   &
             &                                   gtui, gtvi, grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi    ) ! of t, s, rd at the first ocean level
@@ -195,11 +191,8 @@
                             CALL eos    ( tsn, rhd, rhop, fsdept_n(:,:,:) ) ! now in situ density for hpg computation
             IF( ln_zps .AND. .NOT. ln_isfcav)                               &
-               &            CALL zps_hde    ( kstp, jpts, tsn,              &
-               &                              e3w_n, gdept_n, gtsu, gtsv,   &    ! Partial steps: before horizontal gradient
+               &            CALL zps_hde    ( kstp, jpts, tsn, gtsu, gtsv,  &    ! Partial steps: before horizontal gradient
                &                                          rhd, gru , grv    )  ! of t, s, rd at the last ocean level
             IF( ln_zps .AND.       ln_isfcav)                               &
-               &            CALL zps_hde_isf( kstp, jpts, tsn,              &
-               &                              e3w_n, gdept_n, gdep3w_n,     &
-               &                              gtsu, gtsv,                   &    ! Partial steps for top cell (ISF)
+               &            CALL zps_hde_isf( kstp, jpts, tsn, gtsu, gtsv,  &    ! Partial steps for top cell (ISF)
                &                                          rhd, gru , grv , aru , arv , gzu , gzv , ge3ru , ge3rv ,   &
                &                                   gtui, gtvi, grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi    ) ! of t, s, rd at the last ocean level
@@ -280,11 +273,8 @@
                              CALL eos    ( tsa, rhd, rhop, fsdept_n(:,:,:) )  ! Time-filtered in situ density for hpg computation
             IF( ln_zps .AND. .NOT. ln_isfcav)                                &
-               &             CALL zps_hde    ( kstp, jpts, tsa,              &
-               &                               e3w_n, gdept_n, gtsu, gtsv,   &    ! Partial steps: before horizontal gradient
+               &             CALL zps_hde    ( kstp, jpts, tsa, gtsu, gtsv,  &    ! Partial steps: before horizontal gradient
                &                                           rhd, gru , grv    )  ! of t, s, rd at the last ocean level
             IF( ln_zps .AND.       ln_isfcav)                                &
-               &             CALL zps_hde_isf( kstp, jpts, tsa,              &
-               &                               e3w_n, gdept_n, gdep3w_n,     &
-               &                               gtsu, gtsv,                   &    ! Partial steps for top cell (ISF)
+               &             CALL zps_hde_isf( kstp, jpts, tsa, gtsu, gtsv,  &    ! Partial steps for top cell (ISF)
                &                                           rhd, gru , grv , aru , arv , gzu , gzv , ge3ru , ge3rv ,   &
                &                                    gtui, gtvi, grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi    ) ! of t, s, rd at the last ocean level
@@ -294,11 +284,8 @@
                              CALL eos    ( tsn, rhd, rhop, fsdept_n(:,:,:) )  ! now in situ density for hpg computation
          IF( ln_zps .AND. .NOT. ln_isfcav)                                   &
-               &             CALL zps_hde    ( kstp, jpts, tsn,              &
-               &                               e3w_n, gdept_n, gtsu, gtsv,   &    ! Partial steps: before horizontal gradient
+               &             CALL zps_hde    ( kstp, jpts, tsn, gtsu, gtsv,  &    ! Partial steps: before horizontal gradient
                &                                           rhd, gru , grv    )  ! of t, s, rd at the last ocean level
          IF( ln_zps .AND.       ln_isfcav)                                   & 
-               &             CALL zps_hde_isf( kstp, jpts, tsn,              &
-               &                               e3w_n, gdept_n, gdep3w_n,     &
-               &                               gtsu, gtsv,                   &    ! Partial steps for top cell (ISF)
+               &             CALL zps_hde_isf( kstp, jpts, tsn, gtsu, gtsv,  &    ! Partial steps for top cell (ISF)
                &                                           rhd, gru , grv , aru , arv , gzu , gzv , ge3ru , ge3rv ,   &
                &                                    gtui, gtvi, grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi    ) ! of t, s, rd at the last ocean level
Index: /branches/UKMO/dev_r5518_medusa_fix_restart/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90
===================================================================
--- /branches/UKMO/dev_r5518_medusa_fix_restart/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90	(revision 7868)
+++ /branches/UKMO/dev_r5518_medusa_fix_restart/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90	(revision 7869)
@@ -14,5 +14,4 @@
    !!----------------------------------------------------------------------
    USE oce_trc         ! ocean dynamics and active tracers variables
-   USE dom_oce, ONLY: e3w_n, gdep3w_n, gdept_n
    USE trc             ! ocean passive tracers variables 
    USE trcnam_trp      ! passive tracers transport namelist variables
@@ -85,10 +84,7 @@
 
          IF( ln_zps  .AND. .NOT. ln_isfcav)        &
-            &            CALL zps_hde    ( kstp, jptra, trn, e3w_n, gdept_n, &
-            &                              gtru, gtrv )   ! Partial steps: now horizontal gradient of passive
+            &            CALL zps_hde    ( kstp, jptra, trn, gtru, gtrv )   ! Partial steps: now horizontal gradient of passive
          IF( ln_zps .AND.        ln_isfcav)        &
-            &            CALL zps_hde_isf( kstp, jptra, trn,                 &
-            &                              e3w_n, gdept_n, gdep3w_n,         &
-            &                              pgtu=gtru, pgtv=gtrv, pgtui=gtrui, pgtvi=gtrvi )  ! Partial steps: now horizontal gradient of passive
+            &            CALL zps_hde_isf( kstp, jptra, trn, pgtu=gtru, pgtv=gtrv, pgtui=gtrui, pgtvi=gtrvi )  ! Partial steps: now horizontal gradient of passive
                                                                 ! tracers at the bottom ocean level
          !
Index: /branches/UKMO/dev_r5518_medusa_fix_restart/NEMOGCM/NEMO/TOP_SRC/trcini.F90
===================================================================
--- /branches/UKMO/dev_r5518_medusa_fix_restart/NEMOGCM/NEMO/TOP_SRC/trcini.F90	(revision 7868)
+++ /branches/UKMO/dev_r5518_medusa_fix_restart/NEMOGCM/NEMO/TOP_SRC/trcini.F90	(revision 7869)
@@ -17,5 +17,4 @@
    !!----------------------------------------------------------------------
    USE oce_trc         ! shared variables between ocean and passive tracers
-   USE dom_oce, ONLY: e3w_n, gdep3w_n, gdept_n
    USE trc             ! passive tracers common variables
    USE trcrst          ! passive tracers restart
@@ -143,14 +142,19 @@
         !
         trb(:,:,:,:) = trn(:,:,:,:)
+
+        ! This code has been moved here from below - marc 4/417
+        ! Partial steps: before horizontal gradient of passive
+        IF ( ln_zps .AND. .NOT. lk_c1d .AND. .NOT. ln_isfcav ) THEN
+           CALL zps_hde(nit000, jptra, trn, gtru, gtrv)
+        END IF
         ! 
       ENDIF
  
       tra(:,:,:,:) = 0._wp
-      IF( ln_zps .AND. .NOT. lk_c1d .AND. .NOT. ln_isfcav )   &              ! Partial steps: before horizontal gradient of passive
-        &    CALL zps_hde    ( nit000, jptra, trn, e3w_n, gdept_n,    &
-        &                      gtru, gtrv  )  ! Partial steps: before horizontal gradient
+! GTRU and GTRV have now been put into dump - marc 4/4/17
+!      IF( ln_zps .AND. .NOT. lk_c1d .AND. .NOT. ln_isfcav )   &              ! Partial steps: before horizontal gradient of passive
+!        &    CALL zps_hde    ( nit000, jptra, trn, gtru, gtrv  )  ! Partial steps: before horizontal gradient
       IF( ln_zps .AND. .NOT. lk_c1d .AND.       ln_isfcav )   &
-        &    CALL zps_hde_isf( nit000, jptra, trn, e3w_n, gdept_n, gdep3w_n,  &
-        &                      pgtu=gtru, pgtv=gtrv, pgtui=gtrui, pgtvi=gtrvi )       ! tracers at the bottom ocean level
+        &    CALL zps_hde_isf( nit000, jptra, trn, pgtu=gtru, pgtv=gtrv, pgtui=gtrui, pgtvi=gtrvi )       ! tracers at the bottom ocean level
 
 
Index: /branches/UKMO/dev_r5518_medusa_fix_restart/NEMOGCM/NEMO/TOP_SRC/trcrst.F90
===================================================================
--- /branches/UKMO/dev_r5518_medusa_fix_restart/NEMOGCM/NEMO/TOP_SRC/trcrst.F90	(revision 7868)
+++ /branches/UKMO/dev_r5518_medusa_fix_restart/NEMOGCM/NEMO/TOP_SRC/trcrst.F90	(revision 7869)
@@ -109,4 +109,15 @@
       IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~'
 
+      ! GTRU/PGU & GTRV/PGV are needed in TRALDF_ISO for calculation of tracers
+      DO jn = 1, jptra
+         CALL iom_get( numrtr, jpdom_autoglo, 'gtru_'//ctrcnm(jn),   &
+                       gtru(:,:,jn) )
+         CALL iom_get( numrtr, jpdom_autoglo, 'gtrv_'//ctrcnm(jn),   &
+                       gtrv(:,:,jn) )
+      END DO
+! tmp - marc
+      write(numout,*) 'bbb222. gtrv(6,13,7)=',gtrv(6,13,7)
+!
+
       ! READ prognostic variables and computes diagnostic variable
       DO jn = 1, jptra
@@ -133,4 +144,13 @@
       !
       CALL iom_rstput( kt, nitrst, numrtw, 'rdttrc1', rdttrc(1) )   ! surface passive tracer time step
+
+      ! GTRU/PGU & GTRV/PGV are needed in TRALDF_ISO for calculation of tracers
+      DO jn = 1, jptra
+         CALL iom_rstput( kt, nitrst, numrtw, 'gtru_'//ctrcnm(jn), &
+                          gtru(:,:,jn) )
+         CALL iom_rstput( kt, nitrst, numrtw, 'gtrv_'//ctrcnm(jn), &
+                          gtrv(:,:,jn) )
+      END DO
+
       ! prognostic variables 
       ! -------------------- 
