Index: /branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/NEMO/OPA_SRC/stpctl.F90
===================================================================
--- /branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/NEMO/OPA_SRC/stpctl.F90	(revision 8783)
+++ /branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/NEMO/OPA_SRC/stpctl.F90	(revision 8784)
@@ -57,8 +57,8 @@
       INTEGER  ::   iih, ijh               ! local integers
       INTEGER  ::   iiu, iju, iku          !   -       -
-      INTEGER  ::   iis, ijs               !   -       -
+      INTEGER  ::   iis, ijs, iks          !   -       -
       REAL(wp) ::   zzz                    ! local real 
-      INTEGER , DIMENSION(3) ::   ilocu
-      INTEGER , DIMENSION(2) ::   ilocs, iloch
+      INTEGER , DIMENSION(3) ::   ilocu, ilocs
+      INTEGER , DIMENSION(2) ::   iloch
       REAL(wp), DIMENSION(3) ::   zmax
       !!----------------------------------------------------------------------
@@ -82,5 +82,5 @@
       zmax(1) = MAXVAL(  ABS( sshn(:,:) )  )                                  ! ssh max
       zmax(2) = MAXVAL(  ABS( un(:,:,:) )  )                                  ! velocity max (zonal only)
-      zmax(3) = MAXVAL( -tsn(:,:,1,jp_sal) , mask = tmask(:,:,1) == 1._wp )   ! minus surface salinity max
+      zmax(3) = MAXVAL( -tsn(:,:,:,jp_sal) , mask = tmask(:,:,:) == 1._wp )   ! minus salinity max
       !
       IF( lk_mpp )   CALL mpp_max_multiple( zmax(:), 3 ) ! max over the global domain
@@ -88,5 +88,5 @@
       IF( MOD( kt, nwrite ) == 1 .AND. lwp ) THEN
          WRITE(numout,*) ' ==>> time-step= ', kt, ' |ssh| max: ',   zmax(1), ' |U| max: ', zmax(2),   &
-            &                                     ' SSS min: '  , - zmax(3)
+            &                                     ' S min: '    , - zmax(3)
       ENDIF
       !
@@ -96,22 +96,22 @@
          &  ISNAN( zmax(1) + zmax(2) + zmax(3) )  ) THEN   ! NaN encounter in the tests
          IF( lk_mpp ) THEN
-            CALL mpp_maxloc( ABS(sshn)        , tmask(:,:,1), zzz, iih, ijh )
-            CALL mpp_maxloc( ABS(un)          , umask(:,:,:), zzz, iiu, iju, iku )
-            CALL mpp_minloc( tsn(:,:,1,jp_sal), tmask(:,:,1), zzz, iis, ijs )
+            CALL mpp_maxloc( ABS(sshn)        , ssmask(:,:)  , zzz, iih, ijh )
+            CALL mpp_maxloc( ABS(un)          , umask (:,:,:), zzz, iiu, iju, iku )
+            CALL mpp_minloc( tsn(:,:,:,jp_sal), tmask (:,:,:), zzz, iis, ijs, iks )
          ELSE
-            iloch = MINLOC( ABS( sshn(:,:) ) )
-            ilocu = MAXLOC( ABS( un(:,:,:) ) )
-            ilocs = MINLOC( tsn(:,:,1,jp_sal), mask = tmask(:,:,1) == 1._wp )
+            iloch = MINLOC( ABS( sshn(:,:)   )                               )
+            ilocu = MAXLOC( ABS( un  (:,:,:) )                               )
+            ilocs = MINLOC( tsn(:,:,:,jp_sal) , mask = tmask(:,:,:) == 1._wp )
             iih = iloch(1) + nimpp - 1   ;   ijh = iloch(2) + njmpp - 1
             iiu = ilocu(1) + nimpp - 1   ;   iju = ilocu(2) + njmpp - 1   ;   iku = ilocu(3)
-            iis = ilocs(1) + nimpp - 1   ;   ijs = ilocs(2) + njmpp - 1
+            iis = ilocs(1) + nimpp - 1   ;   ijs = ilocs(2) + njmpp - 1   ;   iks = ilocu(3)
          ENDIF
          IF(lwp) THEN
             WRITE(numout,cform_err)
-            WRITE(numout,*) ' stpctl: |ssh| > 10 m   or   |U| > 10 m/s   or   SSS < 0   or   NaN encounter in the tests'
+            WRITE(numout,*) ' stpctl: |ssh| > 10 m   or   |U| > 10 m/s   or   S < 0   or   NaN encounter in the tests'
             WRITE(numout,*) ' ====== '
             WRITE(numout,9100) kt,   zmax(1), iih, ijh
             WRITE(numout,9200) kt,   zmax(2), iiu, iju, iku
-            WRITE(numout,9300) kt, - zmax(3), iis, ijs
+            WRITE(numout,9300) kt, - zmax(3), iis, ijs, iks
             WRITE(numout,*)
             WRITE(numout,*) '          output of last computed fields in output.abort.nc file'
@@ -121,10 +121,10 @@
 9100  FORMAT (' kt=',i8,'   |ssh| max: ',1pg11.4,', at  i j  : ',2i5)
 9200  FORMAT (' kt=',i8,'   |U|   max: ',1pg11.4,', at  i j k: ',3i5)
-9300  FORMAT (' kt=',i8,'   SSS   min: ',1pg11.4,', at  i j  : ',2i5)
+9300  FORMAT (' kt=',i8,'   S     min: ',1pg11.4,', at  i j  : ',2i5)
       !
       !                                            !==  run statistics  ==!   ("run.stat" file)
       IF(lwp) WRITE(numrun,9400) kt, zmax(1), zmax(2), - zmax(3)
       !
-9400  FORMAT(' it :', i8, '    |ssh|_max: ', e16.10, ' |U|_max: ',e16.10,' SSS_min: ',e16.10)
+9400  FORMAT(' it :', i8, '    |ssh|_max: ', e16.10, ' |U|_max: ',e16.10,' S_min: ',e16.10)
       !
    END SUBROUTINE stp_ctl
