Index: palm/trunk/SOURCE/prognostic_equations.f90
===================================================================
--- palm/trunk/SOURCE/prognostic_equations.f90	(revision 110)
+++ palm/trunk/SOURCE/prognostic_equations.f90	(revision 129)
@@ -4,5 +4,5 @@
 ! Actual revisions:
 ! -----------------
-! 
+! add wall_*flux to parameter list of calls of diffusion_s
 !
 ! Former revisions:
@@ -369,5 +369,6 @@
 !--       Tendency terms
           IF ( scalar_advec == 'bc-scheme' )  THEN
-             CALL diffusion_s( i, j, ddzu, ddzw, kh, pt, shf, tswst, tend )
+             CALL diffusion_s( i, j, ddzu, ddzw, kh, pt, shf, tswst, &
+                               wall_heatflux, tend )
           ELSE
              IF ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' )  THEN
@@ -383,7 +384,8 @@
              THEN
                 CALL diffusion_s( i, j, ddzu, ddzw, kh_m, pt_m, shf_m, &
-                                  tswst_m, tend )
+                                  tswst_m, wall_heatflux, tend )
              ELSE
-                CALL diffusion_s( i, j, ddzu, ddzw, kh, pt, shf, tswst, tend )
+                CALL diffusion_s( i, j, ddzu, ddzw, kh, pt, shf, tswst, &
+                                  wall_heatflux, tend )
              ENDIF
           ENDIF
@@ -471,5 +473,5 @@
              IF ( scalar_advec == 'bc-scheme' )  THEN
                 CALL diffusion_s( i, j, ddzu, ddzw, kh, sa, saswsb, saswst, &
-                                  tend )
+                                  wall_salinityflux, tend )
              ELSE
                 IF ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' ) THEN
@@ -483,5 +485,5 @@
                 ENDIF
                 CALL diffusion_s( i, j, ddzu, ddzw, kh, sa, saswsb, saswst, &
-                                  tend )
+                                  wall_salinityflux, tend )
              ENDIF
        
@@ -563,5 +565,6 @@
 !--          Tendency-terms
              IF ( scalar_advec == 'bc-scheme' )  THEN
-                CALL diffusion_s( i, j, ddzu, ddzw, kh, q, qsws, qswst, tend )
+                CALL diffusion_s( i, j, ddzu, ddzw, kh, q, qsws, qswst, &
+                                  wall_qflux, tend )
              ELSE
                 IF ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' ) THEN
@@ -577,8 +580,8 @@
                 THEN
                    CALL diffusion_s( i, j, ddzu, ddzw, kh_m, q_m, qsws_m, &
-                                     qswst_m, tend )
+                                     qswst_m, wall_qflux, tend )
                 ELSE
                    CALL diffusion_s( i, j, ddzu, ddzw, kh, q, qsws, qswst, &
-                                     tend )
+                                     wall_qflux, tend )
                 ENDIF
              ENDIF
@@ -974,7 +977,8 @@
           THEN
              CALL diffusion_s( i, j, ddzu, ddzw, kh_m, pt_m, shf_m, &
-                               tswst_m, tend )
-          ELSE
-             CALL diffusion_s( i, j, ddzu, ddzw, kh, pt, shf, tswst, tend )
+                               tswst_m, wall_heatflux, tend )
+          ELSE
+             CALL diffusion_s( i, j, ddzu, ddzw, kh, pt, shf, tswst, &
+                               wall_heatflux, tend )
           ENDIF
 
@@ -1033,5 +1037,5 @@
              ENDIF
              CALL diffusion_s( i, j, ddzu, ddzw, kh, sa, saswsb, saswst, &
-                               tend )
+                               wall_salinityflux, tend )
 
              CALL user_actions( i, j, 'sa-tendency' )
@@ -1087,8 +1091,8 @@
              THEN
                 CALL diffusion_s( i, j, ddzu, ddzw, kh_m, q_m, qsws_m, &
-                                  qswst_m, tend )
+                                  qswst_m, wall_qflux, tend )
              ELSE
                 CALL diffusion_s( i, j, ddzu, ddzw, kh, q, qsws, qswst, &
-                                  tend )
+                                  wall_qflux, tend )
              ENDIF
        
@@ -1487,5 +1491,6 @@
 !-- pt-tendency terms with no communication
     IF ( scalar_advec == 'bc-scheme' )  THEN
-       CALL diffusion_s( ddzu, ddzw, kh, pt, shf, tswst, tend )
+       CALL diffusion_s( ddzu, ddzw, kh, pt, shf, tswst, wall_heatflux, &
+                         tend )
     ELSE
        IF ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' )  THEN
@@ -1499,7 +1504,9 @@
        ENDIF
        IF ( tsc(2) == 2.0  .AND.  timestep_scheme(1:8) == 'leapfrog' )  THEN
-          CALL diffusion_s( ddzu, ddzw, kh_m, pt_m, shf_m, tswst_m, tend )
+          CALL diffusion_s( ddzu, ddzw, kh_m, pt_m, shf_m, tswst_m, &
+                            wall_heatflux, tend )
        ELSE
-          CALL diffusion_s( ddzu, ddzw, kh, pt, shf, tswst, tend )
+          CALL diffusion_s( ddzu, ddzw, kh, pt, shf, tswst, wall_heatflux, &
+                            tend )
        ENDIF
     ENDIF
@@ -1589,7 +1596,8 @@
 
 !
-!--    Scalar/q-tendency terms with no communication
+!--    sa-tendency terms with no communication
        IF ( scalar_advec == 'bc-scheme' )  THEN
-          CALL diffusion_s( ddzu, ddzw, kh, sa, saswsb, saswst, tend )
+          CALL diffusion_s( ddzu, ddzw, kh, sa, saswsb, saswst, &
+                            wall_salinityflux, tend )
        ELSE
           IF ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' )  THEN
@@ -1602,5 +1610,6 @@
              ENDIF
           ENDIF
-          CALL diffusion_s( ddzu, ddzw, kh, sa, saswsb, saswst, tend )
+          CALL diffusion_s( ddzu, ddzw, kh, sa, saswsb, saswst, &
+                            wall_salinityflux, tend )
        ENDIF
        
@@ -1689,5 +1698,5 @@
 !--    Scalar/q-tendency terms with no communication
        IF ( scalar_advec == 'bc-scheme' )  THEN
-          CALL diffusion_s( ddzu, ddzw, kh, q, qsws, qswst, tend )
+          CALL diffusion_s( ddzu, ddzw, kh, q, qsws, qswst, wall_qflux, tend )
        ELSE
           IF ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' )  THEN
@@ -1701,7 +1710,9 @@
           ENDIF
           IF ( tsc(2) == 2.0  .AND.  timestep_scheme(1:8) == 'leapfrog' )  THEN
-             CALL diffusion_s( ddzu, ddzw, kh_m, q_m, qsws_m, qswst_m, tend )
-          ELSE
-             CALL diffusion_s( ddzu, ddzw, kh, q, qsws, qswst, tend )
+             CALL diffusion_s( ddzu, ddzw, kh_m, q_m, qsws_m, qswst_m, &
+                               wall_qflux, tend )
+          ELSE
+             CALL diffusion_s( ddzu, ddzw, kh, q, qsws, qswst, &
+                               wall_qflux, tend )
           ENDIF
        ENDIF
