Index: /NEMO/trunk/src/OCE/stpctl.F90
===================================================================
--- /NEMO/trunk/src/OCE/stpctl.F90	(revision 13135)
+++ /NEMO/trunk/src/OCE/stpctl.F90	(revision 13136)
@@ -119,27 +119,37 @@
       !                                   !==            test of local extrema           ==!
       !                                   !==  done by all processes at every time step  ==!
+      !
+      ! define zmax default value. needed for land processors
+      IF( ll_colruns ) THEN    ! default value: must not be kept when calling mpp_max -> must be as small as possible
+         zmax(:) = -HUGE(1._wp)
+      ELSE                     ! default value: must not give true for any of the tests bellow (-> avoid manipulating HUGE...)
+         zmax(:) =  0._wp
+         zmax(3) = -1._wp      ! avoid salinity minimum at 0.
+      ENDIF
+      !
       llmsk(:,:,1) = ssmask(:,:) == 1._wp
-      IF( ll_wd ) THEN
-         zmax(1) = MAXVAL( ABS( ssh(:,:,Kmm) + ssh_ref ), mask = llmsk(:,:,1) )   ! ssh max
-      ELSE
-         zmax(1) = MAXVAL( ABS( ssh(:,:,Kmm)           ), mask = llmsk(:,:,1) )   ! ssh max
-      ENDIF
-      llmsk(:,:,:) = umask(:,:,:) == 1._wp
-      zmax(2) = MAXVAL(  ABS( uu(:,:,:,Kmm) ), mask = llmsk )                     ! velocity max (zonal only)
+      IF( COUNT( llmsk(:,:,1) ) > 0 ) THEN   ! avoid huge values sent back for land processors...
+         IF( ll_wd ) THEN
+            zmax(1) = MAXVAL( ABS( ssh(:,:,Kmm) + ssh_ref ), mask = llmsk(:,:,1) )   ! ssh max
+         ELSE
+            zmax(1) = MAXVAL( ABS( ssh(:,:,Kmm)           ), mask = llmsk(:,:,1) )   ! ssh max
+         ENDIF
+      ENDIF
+      zmax(2) = MAXVAL( ABS( uu(:,:,:,Kmm) ) )                                       ! velocity max (zonal only)
       llmsk(:,:,:) = tmask(:,:,:) == 1._wp
-      zmax(3) = MAXVAL( -ts(:,:,:,jp_sal,Kmm), mask = llmsk )                     ! minus salinity max
-      zmax(4) = MAXVAL(  ts(:,:,:,jp_sal,Kmm), mask = llmsk )                     !       salinity max
-      IF( ll_colruns .OR. jpnij == 1 ) THEN     ! following variables are used only in the netcdf file
-         zmax(5) = MAXVAL( -ts(:,:,:,jp_tem,Kmm), mask = llmsk )                  ! minus temperature max
-         zmax(6) = MAXVAL(  ts(:,:,:,jp_tem,Kmm), mask = llmsk )                  !       temperature max
-         IF( ln_zad_Aimp ) THEN
-            zmax(7) = MAXVAL(   Cu_adv(:,:,:)   , mask = llmsk )                  ! partitioning coeff. max
-            llmsk(:,:,:) = wmask(:,:,:) == 1._wp
-            zmax(8) = MAXVAL(  ABS( wi(:,:,:) ) , mask = llmsk )                  ! implicit vertical vel. max
-         ELSE
-            zmax(7:8) = 0._wp
-         ENDIF
-      ELSE
-         zmax(5:8) = 0._wp
+      IF( COUNT( llmsk(:,:,:) ) > 0 ) THEN   ! avoid huge values sent back for land processors...
+         zmax(3) = MAXVAL( -ts(:,:,:,jp_sal,Kmm), mask = llmsk )                     ! minus salinity max
+         zmax(4) = MAXVAL(  ts(:,:,:,jp_sal,Kmm), mask = llmsk )                     !       salinity max
+         IF( ll_colruns .OR. jpnij == 1 ) THEN     ! following variables are used only in the netcdf file
+            zmax(5) = MAXVAL( -ts(:,:,:,jp_tem,Kmm), mask = llmsk )                  ! minus temperature max
+            zmax(6) = MAXVAL(  ts(:,:,:,jp_tem,Kmm), mask = llmsk )                  !       temperature max
+            IF( ln_zad_Aimp ) THEN
+               zmax(7) = MAXVAL(   Cu_adv(:,:,:)   , mask = llmsk )                  ! partitioning coeff. max
+               llmsk(:,:,:) = wmask(:,:,:) == 1._wp
+               IF( COUNT( llmsk(:,:,:) ) > 0 ) THEN   ! avoid huge values sent back for land processors...
+                  zmax(8) = MAXVAL(ABS( wi(:,:,:) ), mask = llmsk )                  ! implicit vertical vel. max
+               ENDIF
+            ENDIF
+         ENDIF
       ENDIF
       zmax(9) = REAL( nstop, wp )                                              ! stop indicator
Index: /NEMO/trunk/src/SAS/stpctl.F90
===================================================================
--- /NEMO/trunk/src/SAS/stpctl.F90	(revision 13135)
+++ /NEMO/trunk/src/SAS/stpctl.F90	(revision 13136)
@@ -112,7 +112,15 @@
       !                                   !==  done by all processes at every time step  ==!
       llmsk(:,:) = tmask(:,:,1) == 1._wp
-      zmax(1) = MAXVAL(      vt_i (:,:)            , mask = llmsk )   ! max ice thickness
-      zmax(2) = MAXVAL( ABS( u_ice(:,:) )          , mask = llmsk )   ! max ice velocity (zonal only)
-      zmax(3) = MAXVAL(     -tm_i (:,:) + 273.15_wp, mask = llmsk )   ! min ice temperature
+      IF( COUNT( llmsk(:,:) ) > 0 ) THEN   ! avoid huge values sent back for land processors...
+         zmax(1) = MAXVAL(      vt_i (:,:)            , mask = llmsk )   ! max ice thickness
+         zmax(2) = MAXVAL( ABS( u_ice(:,:) )          , mask = llmsk )   ! max ice velocity (zonal only)
+         zmax(3) = MAXVAL(     -tm_i (:,:) + 273.15_wp, mask = llmsk )   ! min ice temperature
+      ELSE
+         IF( ll_colruns ) THEN    ! default value: must not be kept when calling mpp_max -> must be as small as possible
+            zmax(1:3) = -HUGE(1._wp)
+         ELSE                     ! default value: must not give true for any of the tests bellow (-> avoid manipulating HUGE...)
+            zmax(1:3) = 0._wp
+         ENDIF
+      ENDIF
       zmax(4) = REAL( nstop, wp )                                     ! stop indicator
       !                                   !==               get global extrema             ==!
Index: /NEMO/trunk/tests/CANAL/MY_SRC/stpctl.F90
===================================================================
--- /NEMO/trunk/tests/CANAL/MY_SRC/stpctl.F90	(revision 13135)
+++ /NEMO/trunk/tests/CANAL/MY_SRC/stpctl.F90	(revision 13136)
@@ -119,27 +119,37 @@
       !                                   !==            test of local extrema           ==!
       !                                   !==  done by all processes at every time step  ==!
+      !
+      ! define zmax default value. needed for land processors
+      IF( ll_colruns ) THEN    ! default value: must not be kept when calling mpp_max -> must be as small as possible
+         zmax(:) = -HUGE(1._wp)
+      ELSE                     ! default value: must not give true for any of the tests bellow (-> avoid manipulating HUGE...)
+         zmax(:) =  0._wp
+         zmax(3) = -1._wp      ! avoid salinity minimum at 0.
+      ENDIF
+      !
       llmsk(:,:,1) = ssmask(:,:) == 1._wp
-      IF( ll_wd ) THEN
-         zmax(1) = MAXVAL( ABS( ssh(:,:,Kmm) + ssh_ref ), mask = llmsk(:,:,1) )   ! ssh max
-      ELSE
-         zmax(1) = MAXVAL( ABS( ssh(:,:,Kmm)           ), mask = llmsk(:,:,1) )   ! ssh max
-      ENDIF
-      llmsk(:,:,:) = umask(:,:,:) == 1._wp
-      zmax(2) = MAXVAL(  ABS( uu(:,:,:,Kmm) ), mask = llmsk )                     ! velocity max (zonal only)
+      IF( COUNT( llmsk(:,:,1) ) > 0 ) THEN   ! avoid huge values sent back for land processors...
+         IF( ll_wd ) THEN
+            zmax(1) = MAXVAL( ABS( ssh(:,:,Kmm) + ssh_ref ), mask = llmsk(:,:,1) )   ! ssh max
+         ELSE
+            zmax(1) = MAXVAL( ABS( ssh(:,:,Kmm)           ), mask = llmsk(:,:,1) )   ! ssh max
+         ENDIF
+      ENDIF
+      zmax(2) = MAXVAL( ABS( uu(:,:,:,Kmm) ) )                                       ! velocity max (zonal only)
       llmsk(:,:,:) = tmask(:,:,:) == 1._wp
-      zmax(3) = MAXVAL( -ts(:,:,:,jp_sal,Kmm), mask = llmsk )                     ! minus salinity max
-      zmax(4) = MAXVAL(  ts(:,:,:,jp_sal,Kmm), mask = llmsk )                     !       salinity max
-      IF( ll_colruns .OR. jpnij == 1 ) THEN     ! following variables are used only in the netcdf file
-         zmax(5) = MAXVAL( -ts(:,:,:,jp_tem,Kmm), mask = llmsk )                  ! minus temperature max
-         zmax(6) = MAXVAL(  ts(:,:,:,jp_tem,Kmm), mask = llmsk )                  !       temperature max
-         IF( ln_zad_Aimp ) THEN
-            zmax(7) = MAXVAL(   Cu_adv(:,:,:)   , mask = llmsk )                  ! partitioning coeff. max
-            llmsk(:,:,:) = wmask(:,:,:) == 1._wp
-            zmax(8) = MAXVAL(  ABS( wi(:,:,:) ) , mask = llmsk )                  ! implicit vertical vel. max
-         ELSE
-            zmax(7:8) = 0._wp
-         ENDIF
-      ELSE
-         zmax(5:8) = 0._wp
+      IF( COUNT( llmsk(:,:,:) ) > 0 ) THEN   ! avoid huge values sent back for land processors...
+         zmax(3) = MAXVAL( -ts(:,:,:,jp_sal,Kmm), mask = llmsk )                     ! minus salinity max
+         zmax(4) = MAXVAL(  ts(:,:,:,jp_sal,Kmm), mask = llmsk )                     !       salinity max
+         IF( ll_colruns .OR. jpnij == 1 ) THEN     ! following variables are used only in the netcdf file
+            zmax(5) = MAXVAL( -ts(:,:,:,jp_tem,Kmm), mask = llmsk )                  ! minus temperature max
+            zmax(6) = MAXVAL(  ts(:,:,:,jp_tem,Kmm), mask = llmsk )                  !       temperature max
+            IF( ln_zad_Aimp ) THEN
+               zmax(7) = MAXVAL(   Cu_adv(:,:,:)   , mask = llmsk )                  ! partitioning coeff. max
+               llmsk(:,:,:) = wmask(:,:,:) == 1._wp
+               IF( COUNT( llmsk(:,:,:) ) > 0 ) THEN   ! avoid huge values sent back for land processors...
+                  zmax(8) = MAXVAL(ABS( wi(:,:,:) ), mask = llmsk )                  ! implicit vertical vel. max
+               ENDIF
+            ENDIF
+         ENDIF
       ENDIF
       zmax(9) = REAL( nstop, wp )                                              ! stop indicator
Index: /NEMO/trunk/tests/STATION_ASF/MY_SRC/stpctl.F90
===================================================================
--- /NEMO/trunk/tests/STATION_ASF/MY_SRC/stpctl.F90	(revision 13135)
+++ /NEMO/trunk/tests/STATION_ASF/MY_SRC/stpctl.F90	(revision 13136)
@@ -111,7 +111,15 @@
       !                                   !==  done by all processes at every time step  ==!
       llmsk(:,:) = tmask(:,:,1) == 1._wp
-      zmax(1) = MAXVAL(     taum(:,:)   , mask = llmsk )   ! max wind stress module
-      zmax(2) = MAXVAL( ABS( qns(:,:) ) , mask = llmsk )   ! max non-solar heat flux
-      zmax(3) = MAXVAL( ABS( emp(:,:) ) , mask = llmsk )   ! max E-P
+      IF( COUNT( llmsk(:,:) ) > 0 ) THEN   ! avoid huge values sent back for land processors...
+         zmax(1) = MAXVAL(     taum(:,:)   , mask = llmsk )   ! max wind stress module
+         zmax(2) = MAXVAL( ABS( qns(:,:) ) , mask = llmsk )   ! max non-solar heat flux
+         zmax(3) = MAXVAL( ABS( emp(:,:) ) , mask = llmsk )   ! max E-P
+      ELSE
+         IF( ll_colruns ) THEN    ! default value: must not be kept when calling mpp_max -> must be as small as possible
+            zmax(1:3) = -HUGE(1._wp)
+         ELSE                     ! default value: must not give true for any of the tests bellow (-> avoid manipulating HUGE...)
+            zmax(1:3) = 0._wp
+         ENDIF
+      ENDIF
       zmax(4) = REAL( nstop, wp )                                     ! stop indicator
       !                                   !==               get global extrema             ==!
