Index: palm/trunk/SOURCE/boundary_conds.f90
===================================================================
--- palm/trunk/SOURCE/boundary_conds.f90	(revision 1407)
+++ palm/trunk/SOURCE/boundary_conds.f90	(revision 1409)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! -----------------
-! 
+! Bugfix: set inflow boundary conditions also if no humidity or passive_scalar
+! is used.
 ! 
 ! Former revisions:
@@ -301,69 +302,68 @@
            
        ENDIF
-!
-!--    In case of inflow at the south boundary the boundary for v is at nys
-!--    and in case of inflow at the left boundary the boundary for u is at nxl.
-!--    Since in prognostic_equations (cache optimized version) these levels are
-!--    handled as a prognostic level, boundary values have to be restored here.
-!--    For the SGS-TKE, Neumann boundary conditions are used at the inflow.
-       IF ( inflow_s )  THEN
-          v_p(:,nys,:) = v_p(:,nys-1,:)
-          IF ( .NOT. constant_diffusion ) e_p(:,nys-1,:) = e_p(:,nys,:)
-       ELSEIF ( inflow_n )  THEN
-          IF ( .NOT. constant_diffusion ) e_p(:,nyn+1,:) = e_p(:,nyn,:)
-       ELSEIF ( inflow_l ) THEN
-          u_p(:,:,nxl) = u_p(:,:,nxl-1)
-          IF ( .NOT. constant_diffusion ) e_p(:,:,nxl-1) = e_p(:,:,nxl)
-       ELSEIF ( inflow_r )  THEN
-          IF ( .NOT. constant_diffusion ) e_p(:,:,nxr+1) = e_p(:,:,nxr)
-       ENDIF
-
-!
-!--    Lateral boundary conditions for scalar quantities at the outflow
-       IF ( outflow_s )  THEN
-          pt_p(:,nys-1,:)     = pt_p(:,nys,:)
-          IF ( .NOT. constant_diffusion     )  e_p(:,nys-1,:) = e_p(:,nys,:)
-          IF ( humidity  .OR.  passive_scalar )  THEN
-             q_p(:,nys-1,:) = q_p(:,nys,:)
-             IF ( cloud_physics  .AND.  icloud_scheme == 0  .AND.              &
-                  precipitation)  THEN
-                qr_p(:,nys-1,:) = qr_p(:,nys,:)
-                nr_p(:,nys-1,:) = nr_p(:,nys,:)
-             ENDIF
-          ENDIF
-       ELSEIF ( outflow_n )  THEN
-          pt_p(:,nyn+1,:)     = pt_p(:,nyn,:)
-          IF ( .NOT. constant_diffusion     )  e_p(:,nyn+1,:) = e_p(:,nyn,:)
-          IF ( humidity  .OR.  passive_scalar )  THEN
-             q_p(:,nyn+1,:) = q_p(:,nyn,:)
-             IF ( cloud_physics  .AND.  icloud_scheme == 0  .AND.              &
-                  precipitation )  THEN
-                qr_p(:,nyn+1,:) = qr_p(:,nyn,:)
-                nr_p(:,nyn+1,:) = nr_p(:,nyn,:)
-             ENDIF
-          ENDIF
-       ELSEIF ( outflow_l )  THEN
-          pt_p(:,:,nxl-1)     = pt_p(:,:,nxl)
-          IF ( .NOT. constant_diffusion     )  e_p(:,:,nxl-1) = e_p(:,:,nxl)
-          IF ( humidity  .OR.  passive_scalar )  THEN
-             q_p(:,:,nxl-1) = q_p(:,:,nxl)
-             IF ( cloud_physics  .AND.  icloud_scheme == 0  .AND.              &
-                  precipitation )  THEN
-                qr_p(:,:,nxl-1) = qr_p(:,:,nxl)
-                nr_p(:,:,nxl-1) = nr_p(:,:,nxl)
-             ENDIF
-          ENDIF
-       ELSEIF ( outflow_r )  THEN
-          pt_p(:,:,nxr+1)     = pt_p(:,:,nxr)
-          IF ( .NOT. constant_diffusion     )  e_p(:,:,nxr+1) = e_p(:,:,nxr)
-          IF ( humidity .OR. passive_scalar )  THEN
-             q_p(:,:,nxr+1) = q_p(:,:,nxr)
-             IF ( cloud_physics  .AND.  icloud_scheme == 0  .AND.  precipitation )  THEN
-                qr_p(:,:,nxr+1) = qr_p(:,:,nxr)
-                nr_p(:,:,nxr+1) = nr_p(:,:,nxr)
-             ENDIF
-          ENDIF
-       ENDIF
-
+    ENDIF
+!
+!-- In case of inflow at the south boundary the boundary for v is at nys
+!-- and in case of inflow at the left boundary the boundary for u is at nxl.
+!-- Since in prognostic_equations (cache optimized version) these levels are
+!-- handled as a prognostic level, boundary values have to be restored here.
+!-- For the SGS-TKE, Neumann boundary conditions are used at the inflow.
+    IF ( inflow_s )  THEN
+       v_p(:,nys,:) = v_p(:,nys-1,:)
+       IF ( .NOT. constant_diffusion ) e_p(:,nys-1,:) = e_p(:,nys,:)
+    ELSEIF ( inflow_n )  THEN
+       IF ( .NOT. constant_diffusion ) e_p(:,nyn+1,:) = e_p(:,nyn,:)
+    ELSEIF ( inflow_l ) THEN
+       u_p(:,:,nxl) = u_p(:,:,nxl-1)
+       IF ( .NOT. constant_diffusion ) e_p(:,:,nxl-1) = e_p(:,:,nxl)
+    ELSEIF ( inflow_r )  THEN
+       IF ( .NOT. constant_diffusion ) e_p(:,:,nxr+1) = e_p(:,:,nxr)
+    ENDIF
+
+!
+!-- Lateral boundary conditions for scalar quantities at the outflow
+    IF ( outflow_s )  THEN
+       pt_p(:,nys-1,:)     = pt_p(:,nys,:)
+       IF ( .NOT. constant_diffusion     )  e_p(:,nys-1,:) = e_p(:,nys,:)
+       IF ( humidity  .OR.  passive_scalar )  THEN
+          q_p(:,nys-1,:) = q_p(:,nys,:)
+          IF ( cloud_physics  .AND.  icloud_scheme == 0  .AND.              &
+               precipitation)  THEN
+             qr_p(:,nys-1,:) = qr_p(:,nys,:)
+             nr_p(:,nys-1,:) = nr_p(:,nys,:)
+          ENDIF
+       ENDIF
+    ELSEIF ( outflow_n )  THEN
+       pt_p(:,nyn+1,:)     = pt_p(:,nyn,:)
+       IF ( .NOT. constant_diffusion     )  e_p(:,nyn+1,:) = e_p(:,nyn,:)
+       IF ( humidity  .OR.  passive_scalar )  THEN
+          q_p(:,nyn+1,:) = q_p(:,nyn,:)
+          IF ( cloud_physics  .AND.  icloud_scheme == 0  .AND.              &
+               precipitation )  THEN
+             qr_p(:,nyn+1,:) = qr_p(:,nyn,:)
+             nr_p(:,nyn+1,:) = nr_p(:,nyn,:)
+          ENDIF
+       ENDIF
+    ELSEIF ( outflow_l )  THEN
+       pt_p(:,:,nxl-1)     = pt_p(:,:,nxl)
+       IF ( .NOT. constant_diffusion     )  e_p(:,:,nxl-1) = e_p(:,:,nxl)
+       IF ( humidity  .OR.  passive_scalar )  THEN
+          q_p(:,:,nxl-1) = q_p(:,:,nxl)
+          IF ( cloud_physics  .AND.  icloud_scheme == 0  .AND.              &
+               precipitation )  THEN
+             qr_p(:,:,nxl-1) = qr_p(:,:,nxl)
+             nr_p(:,:,nxl-1) = nr_p(:,:,nxl)
+          ENDIF
+       ENDIF
+    ELSEIF ( outflow_r )  THEN
+       pt_p(:,:,nxr+1)     = pt_p(:,:,nxr)
+       IF ( .NOT. constant_diffusion     )  e_p(:,:,nxr+1) = e_p(:,:,nxr)
+       IF ( humidity .OR. passive_scalar )  THEN
+          q_p(:,:,nxr+1) = q_p(:,:,nxr)
+          IF ( cloud_physics  .AND.  icloud_scheme == 0  .AND.  precipitation )  THEN
+             qr_p(:,:,nxr+1) = qr_p(:,:,nxr)
+             nr_p(:,:,nxr+1) = nr_p(:,:,nxr)
+          ENDIF
+       ENDIF
     ENDIF
 
Index: palm/trunk/SOURCE/init_grid.f90
===================================================================
--- palm/trunk/SOURCE/init_grid.f90	(revision 1407)
+++ palm/trunk/SOURCE/init_grid.f90	(revision 1409)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! -----------------
-! 
+! Bugfix: set wall_flags_0 at inflow and outflow boundary also for i <= nxlu 
+! j <= nysv
 ! 
 ! Former revisions:
@@ -1229,5 +1230,5 @@
 !--             WS1 (9), WS3 (10), WS5 (11)
                 IF ( k <= nzb_u_inner(j,i+1)                                  &
-                     .OR. ( ( inflow_l .OR. outflow_l ) .AND. i == nxlu )     &
+                     .OR. ( ( inflow_l .OR. outflow_l ) .AND. i <= nxlu )     &
                      .OR. ( ( inflow_r .OR. outflow_r ) .AND. i == nxr  )     &
                    )  THEN
@@ -1298,5 +1299,5 @@
 !--             WS1 (21), WS3 (22), WS5 (23)
                 IF ( k <= nzb_v_inner(j+1,i)                                   &
-                     .OR. ( ( inflow_s .OR. outflow_s ) .AND. i == nysv )      &
+                     .OR. ( ( inflow_s .OR. outflow_s ) .AND. j <= nysv )      &
                      .OR. ( ( inflow_n .OR. outflow_n ) .AND. j == nyn  )      &
                    )  THEN
Index: palm/trunk/SOURCE/prognostic_equations.f90
===================================================================
--- palm/trunk/SOURCE/prognostic_equations.f90	(revision 1407)
+++ palm/trunk/SOURCE/prognostic_equations.f90	(revision 1409)
@@ -20,5 +20,7 @@
 ! Current revisions:
 ! ------------------
-! 
+! Bugfix: i_omp_start changed for advec_u_ws at left inflow and outflow boundary. 
+! This ensures that left-hand side fluxes are also calculated for nxl in that
+! case, even though the solution at nxl is overwritten in boundary_conds() 
 ! 
 ! Former revisions:
@@ -349,9 +351,5 @@
              IF ( timestep_scheme(1:5) == 'runge' )  THEN
                 IF ( ws_scheme_mom )  THEN
-                   IF ( ( inflow_l .OR. outflow_l ) .AND. i_omp_start == nxl )  THEN 
-                      CALL advec_u_ws( i, j, i_omp_start + 1, tn )
-                   ELSE
-                      CALL advec_u_ws( i, j, i_omp_start, tn )
-                   ENDIF
+                   CALL advec_u_ws( i, j, i_omp_start, tn )
                 ELSE 
                    CALL advec_u_pw( i, j )
