Index: palm/trunk/SOURCE/diffusion_v.f90
===================================================================
--- palm/trunk/SOURCE/diffusion_v.f90	(revision 1321)
+++ palm/trunk/SOURCE/diffusion_v.f90	(revision 1340)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! REAL constants defined as wp-kind
 !
 ! Former revisions:
@@ -129,7 +129,7 @@
 !
 !--             Interpolate eddy diffusivities on staggered gridpoints
-                kmxp = 0.25 * &
+                kmxp = 0.25_wp * &
                        ( km(k,j,i)+km(k,j,i+1)+km(k,j-1,i)+km(k,j-1,i+1) )
-                kmxm = 0.25 * &
+                kmxm = 0.25_wp * &
                        ( km(k,j,i)+km(k,j,i-1)+km(k,j-1,i)+km(k,j-1,i-1) )
 
@@ -140,25 +140,25 @@
                       &   - kmxm * ( u(k,j,i) - u(k,j-1,i) ) * ddy             &
                       &   ) * ddx                                              &
-                      & + 2.0 * (                                              &
+                      & + 2.0_wp * (                                           &
                       &           km(k,j,i)   * ( v(k,j+1,i) - v(k,j,i) )      &
                       &         - km(k,j-1,i) * ( v(k,j,i) - v(k,j-1,i) )      &
-                      &         ) * ddy2
+                      &            ) * ddy2
              ENDDO
 
 !
 !--          Wall functions at the left and right walls, respectively
-             IF ( wall_v(j,i) /= 0.0 )  THEN
+             IF ( wall_v(j,i) /= 0.0_wp )  THEN
 
                 DO  k = nzb_v_inner(j,i)+1, nzb_v_outer(j,i)
-                   kmxp = 0.25 *                                               &
+                   kmxp = 0.25_wp *                                            &
                           ( km(k,j,i)+km(k,j,i+1)+km(k,j-1,i)+km(k,j-1,i+1) )
-                   kmxm = 0.25 *                                               &
+                   kmxm = 0.25_wp *                                            &
                           ( km(k,j,i)+km(k,j,i-1)+km(k,j-1,i)+km(k,j-1,i-1) )
                    
                    tend(k,j,i) = tend(k,j,i)                                   &
-                                 + 2.0 * (                                     &
+                                 + 2.0_wp * (                                  &
                                        km(k,j,i)   * ( v(k,j+1,i) - v(k,j,i) ) &
                                      - km(k,j-1,i) * ( v(k,j,i) - v(k,j-1,i) ) &
-                                         ) * ddy2                              &
+                                            ) * ddy2                           &
                                  + (   fxp(j,i) * (                            &
                                   kmxp * ( v(k,j,i+1) - v(k,j,i)     ) * ddx   &
@@ -180,7 +180,7 @@
 !
 !--             Interpolate eddy diffusivities on staggered gridpoints
-                kmzp = 0.25 * &
+                kmzp = 0.25_wp * &
                        ( km(k,j,i)+km(k+1,j,i)+km(k,j-1,i)+km(k+1,j-1,i) )
-                kmzm = 0.25 * &
+                kmzm = 0.25_wp * &
                        ( km(k,j,i)+km(k-1,j,i)+km(k,j-1,i)+km(k-1,j-1,i) )
 
@@ -209,7 +209,7 @@
 !
 !--             Interpolate eddy diffusivities on staggered gridpoints
-                kmzp = 0.25 *                                                  &
+                kmzp = 0.25_wp *                                               &
                        ( km(k,j,i)+km(k+1,j,i)+km(k,j-1,i)+km(k+1,j-1,i) )
-                kmzm = 0.25 *                                                  &
+                kmzm = 0.25_wp *                                               &
                        ( km(k,j,i)+km(k-1,j,i)+km(k,j-1,i)+km(k-1,j-1,i) )
 
@@ -229,7 +229,7 @@
 !
 !--             Interpolate eddy diffusivities on staggered gridpoints
-                kmzp = 0.25 *                                                  &
+                kmzp = 0.25_wp *                                               &
                        ( km(k,j,i)+km(k+1,j,i)+km(k,j-1,i)+km(k+1,j-1,i) )
-                kmzm = 0.25 *                                                  &
+                kmzm = 0.25_wp *                                               &
                        ( km(k,j,i)+km(k-1,j,i)+km(k,j-1,i)+km(k-1,j-1,i) )
 
@@ -301,7 +301,7 @@
 !
 !--                Interpolate eddy diffusivities on staggered gridpoints
-                   kmxp = 0.25 *                                               &
+                   kmxp = 0.25_wp *                                            &
                           ( km(k,j,i)+km(k,j,i+1)+km(k,j-1,i)+km(k,j-1,i+1) )
-                   kmxm = 0.25 *                                               &
+                   kmxm = 0.25_wp *                                            &
                           ( km(k,j,i)+km(k,j,i-1)+km(k,j-1,i)+km(k,j-1,i-1) )
 
@@ -312,8 +312,8 @@
                          &   - kmxm * ( u(k,j,i) - u(k,j-1,i) ) * ddy          &
                          &   ) * ddx                                           &
-                         & + 2.0 * (                                           &
+                         & + 2.0_wp * (                                        &
                          &           km(k,j,i)   * ( v(k,j+1,i) - v(k,j,i) )   &
                          &         - km(k,j-1,i) * ( v(k,j,i) - v(k,j-1,i) )   &
-                         &         ) * ddy2
+                         &            ) * ddy2
                 ENDIF
              ENDDO
@@ -323,16 +323,16 @@
              DO  k = 1, nzt
                 IF( k > nzb_v_inner(j,i)  .AND.  k <= nzb_v_outer(j,i)  .AND.  &
-                    wall_v(j,i) /= 0.0 )  THEN
-
-                   kmxp = 0.25 *                                               &
+                    wall_v(j,i) /= 0.0_wp )  THEN
+
+                   kmxp = 0.25_wp *                                            &
                           ( km(k,j,i)+km(k,j,i+1)+km(k,j-1,i)+km(k,j-1,i+1) )
-                   kmxm = 0.25 *                                               &
+                   kmxm = 0.25_wp *                                            &
                           ( km(k,j,i)+km(k,j,i-1)+km(k,j-1,i)+km(k,j-1,i-1) )
                    
                    tend(k,j,i) = tend(k,j,i)                                   &
-                                 + 2.0 * (                                     &
+                                 + 2.0_wp * (                                  &
                                        km(k,j,i)   * ( v(k,j+1,i) - v(k,j,i) ) &
                                      - km(k,j-1,i) * ( v(k,j,i) - v(k,j-1,i) ) &
-                                         ) * ddy2                              &
+                                            ) * ddy2                           &
                                  + (   fxp(j,i) * (                            &
                                   kmxp * ( v(k,j,i+1) - v(k,j,i)     ) * ddx   &
@@ -355,7 +355,7 @@
 !
 !--                Interpolate eddy diffusivities on staggered gridpoints
-                   kmzp = 0.25 *                                               &
+                   kmzp = 0.25_wp *                                            &
                           ( km(k,j,i)+km(k+1,j,i)+km(k,j-1,i)+km(k+1,j-1,i) )
-                   kmzm = 0.25 *                                               &
+                   kmzm = 0.25_wp *                                            &
                           ( km(k,j,i)+km(k-1,j,i)+km(k,j-1,i)+km(k-1,j-1,i) )
 
@@ -392,7 +392,7 @@
 !
 !--             Interpolate eddy diffusivities on staggered gridpoints
-                kmzp = 0.25 *                                                  &
+                kmzp = 0.25_wp *                                               &
                        ( km(k,j,i)+km(k+1,j,i)+km(k,j-1,i)+km(k+1,j-1,i) )
-                kmzm = 0.25 *                                                  &
+                kmzm = 0.25_wp *                                               &
                        ( km(k,j,i)+km(k-1,j,i)+km(k,j-1,i)+km(k-1,j-1,i) )
 
@@ -420,7 +420,7 @@
 !
 !--             Interpolate eddy diffusivities on staggered gridpoints
-                kmzp = 0.25 *                                                  &
+                kmzp = 0.25_wp *                                               &
                        ( km(k,j,i)+km(k+1,j,i)+km(k,j-1,i)+km(k+1,j-1,i) )
-                kmzm = 0.25 *                                                  &
+                kmzm = 0.25_wp *                                               &
                        ( km(k,j,i)+km(k-1,j,i)+km(k,j-1,i)+km(k-1,j-1,i) )
 
@@ -476,6 +476,6 @@
 !
 !--       Interpolate eddy diffusivities on staggered gridpoints
-          kmxp = 0.25 * ( km(k,j,i)+km(k,j,i+1)+km(k,j-1,i)+km(k,j-1,i+1) )
-          kmxm = 0.25 * ( km(k,j,i)+km(k,j,i-1)+km(k,j-1,i)+km(k,j-1,i-1) )
+          kmxp = 0.25_wp * ( km(k,j,i)+km(k,j,i+1)+km(k,j-1,i)+km(k,j-1,i+1) )
+          kmxm = 0.25_wp * ( km(k,j,i)+km(k,j,i-1)+km(k,j-1,i)+km(k,j-1,i-1) )
 
           tend(k,j,i) = tend(k,j,i)                                            &
@@ -485,13 +485,13 @@
                       &   - kmxm * ( u(k,j,i) - u(k,j-1,i) ) * ddy             &
                       &   ) * ddx                                              &
-                      & + 2.0 * (                                              &
+                      & + 2.0_wp * (                                           &
                       &           km(k,j,i)   * ( v(k,j+1,i) - v(k,j,i) )      &
                       &         - km(k,j-1,i) * ( v(k,j,i) - v(k,j-1,i) )      &
-                      &         ) * ddy2
+                      &            ) * ddy2
        ENDDO
 
 !
 !--    Wall functions at the left and right walls, respectively
-       IF ( wall_v(j,i) /= 0.0 )  THEN
+       IF ( wall_v(j,i) /= 0.0_wp )  THEN
 
 !
@@ -501,14 +501,14 @@
 
           DO  k = nzb_v_inner(j,i)+1, nzb_v_outer(j,i)
-             kmxp = 0.25 *                                                     &
+             kmxp = 0.25_wp *                                                  &
                     ( km(k,j,i)+km(k,j,i+1)+km(k,j-1,i)+km(k,j-1,i+1) )
-             kmxm = 0.25 *                                                     &
+             kmxm = 0.25_wp *                                                  &
                     ( km(k,j,i)+km(k,j,i-1)+km(k,j-1,i)+km(k,j-1,i-1) )
 
              tend(k,j,i) = tend(k,j,i)                                         &
-                                 + 2.0 * (                                     &
+                                 + 2.0_wp * (                                  &
                                        km(k,j,i)   * ( v(k,j+1,i) - v(k,j,i) ) &
                                      - km(k,j-1,i) * ( v(k,j,i) - v(k,j-1,i) ) &
-                                         ) * ddy2                              &
+                                            ) * ddy2                           &
                                  + (   fxp(j,i) * (                            &
                                   kmxp * ( v(k,j,i+1) - v(k,j,i)     ) * ddx   &
@@ -530,6 +530,6 @@
 !
 !--       Interpolate eddy diffusivities on staggered gridpoints
-          kmzp = 0.25 * ( km(k,j,i)+km(k+1,j,i)+km(k,j-1,i)+km(k+1,j-1,i) )
-          kmzm = 0.25 * ( km(k,j,i)+km(k-1,j,i)+km(k,j-1,i)+km(k-1,j-1,i) )
+          kmzp = 0.25_wp * ( km(k,j,i)+km(k+1,j,i)+km(k,j-1,i)+km(k+1,j-1,i) )
+          kmzm = 0.25_wp * ( km(k,j,i)+km(k-1,j,i)+km(k,j-1,i)+km(k-1,j-1,i) )
 
           tend(k,j,i) = tend(k,j,i)                                            &
@@ -557,6 +557,6 @@
 !
 !--       Interpolate eddy diffusivities on staggered gridpoints
-          kmzp = 0.25 * ( km(k,j,i)+km(k+1,j,i)+km(k,j-1,i)+km(k+1,j-1,i) )
-          kmzm = 0.25 * ( km(k,j,i)+km(k-1,j,i)+km(k,j-1,i)+km(k-1,j-1,i) )
+          kmzp = 0.25_wp * ( km(k,j,i)+km(k+1,j,i)+km(k,j-1,i)+km(k+1,j-1,i) )
+          kmzm = 0.25_wp * ( km(k,j,i)+km(k-1,j,i)+km(k,j-1,i)+km(k-1,j-1,i) )
 
           tend(k,j,i) = tend(k,j,i)                                            &
@@ -575,7 +575,7 @@
 !
 !--       Interpolate eddy diffusivities on staggered gridpoints
-          kmzp = 0.25 * &
+          kmzp = 0.25_wp * &
                  ( km(k,j,i)+km(k+1,j,i)+km(k,j-1,i)+km(k+1,j-1,i) )
-          kmzm = 0.25 * &
+          kmzm = 0.25_wp * &
                  ( km(k,j,i)+km(k-1,j,i)+km(k,j-1,i)+km(k-1,j-1,i) )
 
