Index: NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OFF/dtadyn.F90
===================================================================
--- NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OFF/dtadyn.F90	(revision 11027)
+++ NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OFF/dtadyn.F90	(revision 11480)
@@ -46,9 +46,10 @@
    PRIVATE
 
-   PUBLIC   dta_dyn_init       ! called by opa.F90
-   PUBLIC   dta_dyn            ! called by step.F90
-   PUBLIC   dta_dyn_sed_init   ! called by opa.F90
-   PUBLIC   dta_dyn_sed        ! called by step.F90
-   PUBLIC   dta_dyn_swp        ! called by step.F90
+   PUBLIC   dta_dyn_init       ! called by nemo_init
+   PUBLIC   dta_dyn            ! called by nemo_gcm
+   PUBLIC   dta_dyn_sed_init   ! called by nemo_init
+   PUBLIC   dta_dyn_sed        ! called by nemo_gcm
+   PUBLIC   dta_dyn_atf        ! called by nemo_gcm
+   PUBLIC   dta_dyn_sf_interp  ! called by nemo_gcm
 
    CHARACTER(len=100) ::   cn_dir          !: Root directory for location of ssr files
@@ -535,31 +536,40 @@
    END SUBROUTINE dta_dyn_sed_init
 
-   SUBROUTINE dta_dyn_swp( kt, Kbb, Kmm, Kaa )
+   SUBROUTINE dta_dyn_atf( kt, Kbb, Kmm, Kaa )
      !!---------------------------------------------------------------------
       !!                    ***  ROUTINE dta_dyn_swp  ***
       !!
-      !! ** Purpose :   Swap and the data and compute the vertical scale factor 
-      !!              at U/V/W pointand the depht
+      !! ** Purpose :   Asselin time filter of now SSH
       !!---------------------------------------------------------------------
       INTEGER, INTENT(in) :: kt             ! time step
       INTEGER, INTENT(in) :: Kbb, Kmm, Kaa  ! ocean time level indices
       !
+      !!---------------------------------------------------------------------
+
+      IF( kt == nit000 ) THEN
+         IF(lwp) WRITE(numout,*)
+         IF(lwp) WRITE(numout,*) 'dta_dyn_atf : Asselin time filter of sea surface height'
+         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~ '
+      ENDIF
+
+      ssh(:,:,Kmm) = ssh(:,:,Kmm) + atfp * ( ssh(:,:,Kbb) - 2 * ssh(:,:,Kmm) + ssh(:,:,Kaa))  
+
+      !! Do we also need to time filter e3t??
+      !
+   END SUBROUTINE dta_dyn_atf
+   
+   SUBROUTINE dta_dyn_sf_interp( kt, Kmm )
+      !!---------------------------------------------------------------------
+      !!                    ***  ROUTINE dta_dyn_sf_interp  ***
+      !!
+      !! ** Purpose :   Calculate scale factors at U/V/W points and depths
+      !!                given the after e3t field
+      !!---------------------------------------------------------------------
+      INTEGER, INTENT(in) :: kt   ! time step
+      INTEGER, INTENT(in) :: Kmm  ! ocean time level indices
+      !
       INTEGER             :: ji, jj, jk
       REAL(wp)            :: zcoef
       !!---------------------------------------------------------------------
-
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'ssh_swp : Asselin time filter and swap of sea surface height'
-         IF(lwp) WRITE(numout,*) '~~~~~~~ '
-      ENDIF
-
-      ssh(:,:,Kbb) = ssh(:,:,Kmm) + atfp * ( ssh(:,:,Kbb) - 2 * ssh(:,:,Kmm) + ssh(:,:,Kaa))  ! before <-- now filtered
-      ssh(:,:,Kmm) = ssh(:,:,Kaa)
-
-      e3t(:,:,:,Kmm) = e3t(:,:,:,Kaa)
-
-      ! Reconstruction of all vertical scale factors at now and before time steps
-      ! =============================================================================
 
       ! Horizontal scale factor interpolations
@@ -571,8 +581,4 @@
       ! ------------------------------------
       CALL dom_vvl_interpol( e3t(:,:,:,Kmm), e3w (:,:,:,Kmm), 'W' )
-
-      e3t(:,:,:,Kbb)  = e3t(:,:,:,Kmm)
-      e3u(:,:,:,Kbb)  = e3u(:,:,:,Kmm)
-      e3v(:,:,:,Kbb)  = e3v(:,:,:,Kmm)
 
       ! t- and w- points depth
@@ -592,9 +598,5 @@
       END DO
       !
-      gdept(:,:,:,Kbb) = gdept(:,:,:,Kmm)
-      gdepw(:,:,:,Kbb) = gdepw(:,:,:,Kmm)
-      !
-   END SUBROUTINE dta_dyn_swp
-   
+   END SUBROUTINE dta_dyn_sf_interp
 
    SUBROUTINE dta_dyn_ssh( kt, phdivtr, psshb,  pemp, pssha, pe3ta )
Index: NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OFF/nemogcm.F90
===================================================================
--- NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OFF/nemogcm.F90	(revision 11027)
+++ NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OFF/nemogcm.F90	(revision 11480)
@@ -119,7 +119,18 @@
 #else
                                 CALL dta_dyn    ( istp, Nbb, Nnn, Naa )       ! Interpolation of the dynamical fields
-         IF( .NOT.ln_linssh )   CALL dta_dyn_swp( istp, Nbb, Nnn, Naa )       ! swap of sea  surface height and vertical scale factors
 #endif
                                 CALL trc_stp    ( istp, Nbb, Nnn, Nrhs, Naa ) ! time-stepping
+#if ! defined key_sed_off
+         IF( .NOT.ln_linssh )   CALL dta_dyn_atf( istp, Nbb, Nnn, Naa )       ! time filter of sea  surface height and vertical scale factors
+#endif
+         ! Swap time levels
+         Nrhs = Nbb
+         Nbb = Nnn
+         Nnn = Naa
+         Naa = Nrhs
+         !
+#if ! defined key_sed_off
+         IF( .NOT.ln_linssh )   CALL dta_dyn_sf_interp( istp, Nnn )  ! calculate now grid parameters
+#endif
                                 CALL stp_ctl    ( istp, indic )  ! Time loop: control and print
          istp = istp + 1
@@ -333,5 +344,5 @@
 #endif
 
-                           CALL     trc_init( Nbb, Nnn, Naa )   ! Passive tracers initialization
+                           CALL     trc_init                         ! Passive tracers initialization
                            CALL dia_ptr_init   ! Poleward TRansports initialization
                            
