Index: palm/trunk/SOURCE/flow_statistics.f90
===================================================================
--- palm/trunk/SOURCE/flow_statistics.f90	(revision 1556)
+++ palm/trunk/SOURCE/flow_statistics.f90	(revision 1557)
@@ -21,5 +21,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! Adjustments for monotonic limiter
 ! 
 ! Former revisions:
@@ -143,5 +143,6 @@
         ONLY:   average_count_pr, cloud_droplets, cloud_physics, do_sum,       &
                 dt_3d, g, humidity, icloud_scheme, kappa, large_scale_forcing, &
-                large_scale_subsidence, max_pr_user, message_string, ocean,    &
+                large_scale_subsidence, max_pr_user, message_string,           &
+                monotonic_adjustment, ocean,                                   &
                 passive_scalar, precipitation, simulated_time,                 &
                 use_subsidence_tendencies, use_surface_fluxes, use_top_fluxes, &
@@ -281,5 +282,6 @@
        ENDIF
 
-       IF ( ws_scheme_sca .AND. sr == 0 )  THEN
+       IF ( ws_scheme_sca .AND. .NOT. monotonic_adjustment                    &
+           .AND. sr == 0 )  THEN
 
           DO  i = 0, threads_per_task-1
@@ -802,5 +804,6 @@
 !--             but so far there is no other suitable place to calculate)
                 IF ( ocean )  THEN
-                   IF( .NOT. ws_scheme_sca .OR. sr /= 0 )  THEN
+                   IF( .NOT. ws_scheme_sca .OR. monotonic_adjustment .OR.      &
+                             sr /= 0 )  THEN
                       pts = 0.5_wp * ( sa(k,j,i)   - hom(k,1,23,sr) +          &
                                        sa(k+1,j,i) - hom(k+1,1,23,sr) )
@@ -853,10 +856,12 @@
                       ENDIF
                    ELSE
-                      IF( .NOT. ws_scheme_sca .OR. sr /= 0 )  THEN
+                      IF( .NOT. ws_scheme_sca .OR. monotonic_adjustment .OR.   &
+                                sr /= 0 )  THEN
                          pts = 0.5_wp * ( vpt(k,j,i)   - hom(k,1,44,sr) +      &
                                           vpt(k+1,j,i) - hom(k+1,1,44,sr) )
                          sums_l(k,46,tn) = sums_l(k,46,tn) + pts * w(k,j,i) *  &
                                                              rmask(j,i,sr)
-                      ELSE IF ( ws_scheme_sca .AND. sr == 0 )  THEN
+                      ELSE IF ( ws_scheme_sca .AND. .NOT. monotonic_adjustment &
+                                .AND. sr == 0 )  THEN
                          sums_l(k,46,tn) = ( 1.0_wp + 0.61_wp *                & 
                                              hom(k,1,41,sr) ) *                &
@@ -870,5 +875,5 @@
 !--             Passive scalar flux
                 IF ( passive_scalar .AND. ( .NOT. ws_scheme_sca                &
-                     .OR. sr /= 0 ) )  THEN
+                     .OR. monotonic_adjustment .OR. sr /= 0 ) )  THEN
                    pts = 0.5_wp * ( q(k,j,i)   - hom(k,1,41,sr) +              &
                                     q(k+1,j,i) - hom(k+1,1,41,sr) )
@@ -914,5 +919,5 @@
 
        ENDIF
-       IF ( .NOT. ws_scheme_sca .OR. sr /= 0 )  THEN
+       IF ( .NOT. ws_scheme_sca .OR. monotonic_adjustment .OR. sr /= 0 )  THEN
          !$OMP DO
          DO  i = nxl, nxr
@@ -1525,5 +1530,6 @@
         ONLY :  average_count_pr, cloud_droplets, cloud_physics, do_sum,       &
                 dt_3d, g, humidity, icloud_scheme, kappa, large_scale_forcing, &
-                large_scale_subsidence, max_pr_user, message_string, ocean,    &
+                large_scale_subsidence, max_pr_user, message_string,           &
+                monotonic_adjustment, ocean,                                   &
                 passive_scalar, precipitation, simulated_time,                 &
                 use_subsidence_tendencies, use_surface_fluxes, use_top_fluxes, &
@@ -1663,5 +1669,5 @@
        ENDIF
 
-       IF ( ws_scheme_sca .AND. sr == 0 )  THEN
+       IF ( ws_scheme_sca .AND. .NOT. monotonic_adjustment .AND. sr == 0 )  THEN
 
           DO  i = 0, threads_per_task-1
@@ -2486,5 +2492,5 @@
        IF ( ocean )  THEN
 
-          IF( .NOT. ws_scheme_sca .OR. sr /= 0 )  THEN
+          IF( .NOT. ws_scheme_sca .OR. monotonic_adjustment .OR. sr /= 0 )  THEN
 
              !$acc parallel loop gang present( hom, rflags_invers, rmask, sa, sums_l, w ) create( s1 )
@@ -2628,5 +2634,5 @@
           ELSE
 
-             IF( .NOT. ws_scheme_sca  .OR.  sr /= 0 )  THEN
+             IF( .NOT. ws_scheme_sca .OR. monotonic_adjustment .OR.  sr /= 0 )  THEN
 
                 !$acc parallel loop gang present( hom, rflags_invers, rmask, sums_l, vpt, w ) create( s1 )
@@ -2660,5 +2666,6 @@
 !
 !--    Passive scalar flux
-       IF ( passive_scalar  .AND.  ( .NOT. ws_scheme_sca  .OR.  sr /= 0 ) )  THEN
+       IF ( passive_scalar  .AND.  ( .NOT. ws_scheme_sca .OR. monotonic_adjustment &
+                                     .OR.  sr /= 0 ) )  THEN
 
           !$acc parallel loop gang present( hom, q, rflags_invers, rmask, sums_l, w ) create( s1 )
@@ -2714,5 +2721,5 @@
        ENDIF
 
-       IF ( .NOT. ws_scheme_sca  .OR.  sr /= 0 )  THEN
+       IF ( .NOT. ws_scheme_sca .OR. monotonic_adjustment .OR.  sr /= 0 )  THEN
 
           !$OMP DO
