Index: NEMO/branches/2021/dev_r14122_HPC-08_Mueller_OSMOSIS_streamlining/src/SWE/stprk3.F90
===================================================================
--- NEMO/branches/2021/dev_r14122_HPC-08_Mueller_OSMOSIS_streamlining/src/SWE/stprk3.F90	(revision 14529)
+++ NEMO/branches/2021/dev_r14122_HPC-08_Mueller_OSMOSIS_streamlining/src/SWE/stprk3.F90	(revision 14822)
@@ -129,22 +129,4 @@
       CALL dyn_ldf( kstp, Nbb, Nbb, uu, vv, Nrhs )  ! lateral mixing
 #endif
-!!st       !
-!!st       DO_3D( 0,0, 0,0, 1,jpkm1 )
-!!st          !                                          ! horizontal pressure gradient
-!!st          uu(ji,jj,jk,Nrhs) = uu(ji,jj,jk,Nrhs) - grav * ( ssh(ji+1,jj,Nbb) - ssh(ji,jj,Nbb) ) * r1_e1u(ji,jj)
-!!st          vv(ji,jj,jk,Nrhs) = vv(ji,jj,jk,Nrhs) - grav * ( ssh(ji,jj+1,Nbb) - ssh(ji,jj,Nbb) ) * r1_e2v(ji,jj)
-!!st       END_3D
-!!st       !
-!!st #if defined key_RK3all 
-!!st       !                                             ! wind stress and layer friction
-!!st       z5_6 = 5._wp/6._wp
-!!st       DO_3D( 0, 0, 0, 0,1,jpkm1)
-!!st          uu(ji,jj,jk,Nrhs) = uu(ji,jj,jk,Nrhs) + r1_rho0 * ( z5_6*utau_b(ji,jj) + (1._wp - z5_6)*utau(ji,jj) ) / e3u(ji,jj,jk,Nbb)   &
-!!st             &                                  - rn_rfr * uu(ji,jj,jk,Nbb)
-!!st          vv(ji,jj,jk,Nrhs) = vv(ji,jj,jk,Nrhs) + r1_rho0 * ( z5_6*vtau_b(ji,jj) + (1._wp - z5_6)*vtau(ji,jj) ) / e3v(ji,jj,jk,Nbb)   &
-!!st             &                                  - rn_rfr * vv(ji,jj,jk,Nbb)
-!!st       END_3D
-!!st #endif
-!!st why not ?
       z5_6 = 5._wp/6._wp
       DO_3D( 0, 0, 0, 0, 1, jpkm1 )
@@ -163,5 +145,4 @@
          vv(ji,jj,jk,Nrhs) = vv(ji,jj,jk,Nrhs) + zrhs_v
       END_3D
-!!st end
       !
       !                                 !==  Time stepping of ssh Eq.  ==!   (and update r3_Naa)
@@ -190,5 +171,5 @@
       ENDIF
       !
-      CALL lbc_lnk_multi( 'stp_RK3', uu(:,:,:,Naa), 'U', -1., vv(:,:,:,Naa), 'V', -1. )
+      CALL lbc_lnk( 'stp_RK3', uu(:,:,:,Naa), 'U', -1., vv(:,:,:,Naa), 'V', -1. )
       !
       !                                 !==  Swap time levels  ==!
@@ -229,21 +210,4 @@
          vv(ji,jj,jk,Nrhs) = vv(ji,jj,jk,Nrhs) + zrhs_v
       END_3D
-!!st       !
-!!st       DO_3D( 0, 0, 0, 0, 1, jpkm1 )
-!!st          !                                          ! horizontal pressure gradient
-!!st          uu(ji,jj,jk,Nrhs) = uu(ji,jj,jk,Nrhs) - grav * ( ssh(ji+1,jj,Nnn) - ssh(ji,jj,Nnn) ) * r1_e1u(ji,jj)
-!!st          vv(ji,jj,jk,Nrhs) = vv(ji,jj,jk,Nrhs) - grav * ( ssh(ji,jj+1,Nnn) - ssh(ji,jj,Nnn) ) * r1_e2v(ji,jj)
-!!st       END_3D
-!!st       !
-!!st #if defined key_RK3all
-!!st       !                                             ! wind stress and layer friction
-!!st       z3_4 = 3._wp/4._wp
-!!st       DO_3D( 0, 0, 0, 0,1,jpkm1)
-!!st          uu(ji,jj,jk,Nrhs) = uu(ji,jj,jk,Nrhs) + r1_rho0 * ( z3_4*utau_b(ji,jj) + (1._wp - z3_4)*utau(ji,jj) ) / e3u(ji,jj,jk,Nbb)   &
-!!st             &                                  - rn_rfr * uu(ji,jj,jk,Nbb)
-!!st          vv(ji,jj,jk,Nrhs) = vv(ji,jj,jk,Nrhs) + r1_rho0 * ( z3_4*vtau_b(ji,jj) + (1._wp - z3_4)*vtau(ji,jj) ) / e3v(ji,jj,jk,Nbb)   &
-!!st             &                                  - rn_rfr * vv(ji,jj,jk,Nbb)
-!!st       END_3D
-!!st #endif
       !
       !                                 !==  Time stepping of ssh Eq.  ==!   (and update r3_Naa)
@@ -272,5 +236,5 @@
       ENDIF
       !
-      CALL lbc_lnk_multi( 'stp_RK3', uu(:,:,:,Naa), 'U', -1., vv(:,:,:,Naa), 'V', -1. )
+      CALL lbc_lnk( 'stp_RK3', uu(:,:,:,Naa), 'U', -1., vv(:,:,:,Naa), 'V', -1. )
       !
       !                                 !==  Swap time levels  ==!
@@ -335,5 +299,5 @@
       ENDIF
       !
-      CALL lbc_lnk_multi( 'stp_RK3', uu(:,:,:,Naa), 'U', -1., vv(:,:,:,Naa), 'V', -1. )
+      CALL lbc_lnk( 'stp_RK3', uu(:,:,:,Naa), 'U', -1., vv(:,:,:,Naa), 'V', -1. )
       !
       !                                 !==  Swap time levels  ==!
@@ -344,16 +308,16 @@
 
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-      ! diagnostics and outputs
+      ! diagnostics and outputs at Nbb (i.e. the just computed time step)
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
       
-      IF( ln_diacfl  )   CALL dia_cfl   ( kstp,      Nnn )      ! Courant number diagnostics
-                         CALL dia_wri   ( kstp,      Nnn )      ! ocean model: outputs
-      !
-      IF( lrst_oce   )   CALL rst_write    ( kstp, Nbb, Nnn )   ! write output ocean restart file
+      IF( ln_diacfl  )   CALL dia_cfl      ( kstp,      Nbb )      ! Courant number diagnostics
+                         CALL dia_wri      ( kstp,      Nbb )      ! ocean model: outputs
+      !
+      IF( lrst_oce   )   CALL rst_write    ( kstp, Nbb, Nbb )   ! write output ocean restart file
 
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
       ! Control
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-                         CALL stp_ctl      ( kstp, Nnn )
+                         CALL stp_ctl      ( kstp     , Nbb )
 
       IF( kstp == nit000 ) THEN                          ! 1st time step only
@@ -364,5 +328,5 @@
 
       !
-#if defined key_iomput
+#if defined key_xios
       IF( kstp == nitend .OR. indic < 0 ) THEN 
          CALL iom_context_finalize( cxios_context )
