Index: /palm/trunk/SOURCE/boundary_conds.f90
===================================================================
--- /palm/trunk/SOURCE/boundary_conds.f90	(revision 1158)
+++ /palm/trunk/SOURCE/boundary_conds.f90	(revision 1159)
@@ -20,4 +20,10 @@
 ! Current revisions:
 ! -----------------
+! Bugfix: Neumann boundary conditions for the velocity components at the
+! outflow are in fact radiation boundary conditions using the maximum phase
+! velocity that ensures numerical stability (CFL-condition).
+! Hence, logical operator use_cmax is now used instead of bc_lr_dirneu/_neudir.
+! Bugfix: In case of use_cmax at the outflow, u, v, w are replaced by
+! u_p, v_p, w_p  
 !
 !  
@@ -96,8 +102,5 @@
 ! Description:
 ! ------------
-! Boundary conditions for the prognostic quantities (range='main').
-! In case of non-cyclic lateral boundaries the conditions for velocities at
-! the outflow are set after the pressure solver has been called (range=
-! 'outflow_uvw').
+! Boundary conditions for the prognostic quantities.
 ! One additional bottom boundary condition is applied for the TKE (=(u*)**2)
 ! in prandtl_fluxes. The cyclic lateral boundary conditions are implicitly
@@ -334,13 +337,15 @@
 
 !
-!-- Neumann or Radiation boundary condition for the velocities at the 
-!-- respective outflow
+!-- Radiation boundary conditions for the velocities at the respective outflow.
+!-- The phase velocity is either assumed to the maximum phase velocity that
+!-- ensures numerical stability (CFL-condition) or calculated after
+!-- Orlanski(1976) and averaged along the outflow boundary.
     IF ( outflow_s )  THEN
 
-       IF ( bc_ns_dirneu )  THEN
-          u(:,-1,:) = u(:,0,:)
-          v(:,0,:)  = v(:,1,:)
-          w(:,-1,:) = w(:,0,:)          
-       ELSEIF ( bc_ns_dirrad )  THEN
+       IF ( use_cmax )  THEN
+          u_p(:,-1,:) = u(:,0,:)
+          v_p(:,0,:)  = v(:,1,:)
+          w_p(:,-1,:) = w(:,0,:)          
+       ELSEIF ( .NOT. use_cmax )  THEN
 
           c_max = dy / dt_3d
@@ -477,9 +482,9 @@
     IF ( outflow_n )  THEN
 
-       IF ( bc_ns_neudir )  THEN
-          u(:,ny+1,:) = u(:,ny,:)
-          v(:,ny+1,:) = v(:,ny,:)
-          w(:,ny+1,:) = w(:,ny,:)          
-       ELSEIF ( bc_ns_dirrad )  THEN
+       IF ( use_cmax )  THEN
+          u_p(:,ny+1,:) = u(:,ny,:)
+          v_p(:,ny+1,:) = v(:,ny,:)
+          w_p(:,ny+1,:) = w(:,ny,:)          
+       ELSEIF ( .NOT. use_cmax )  THEN
 
           c_max = dy / dt_3d
@@ -616,9 +621,9 @@
     IF ( outflow_l )  THEN
 
-       IF ( bc_lr_neudir )  THEN
-          u(:,:,-1) = u(:,:,0)
-          v(:,:,0)  = v(:,:,1)
-          w(:,:,-1) = w(:,:,0)          
-       ELSEIF ( bc_ns_dirrad )  THEN
+       IF ( use_cmax )  THEN
+          u_p(:,:,-1) = u(:,:,0)
+          v_p(:,:,0)  = v(:,:,1)
+          w_p(:,:,-1) = w(:,:,0)          
+       ELSEIF ( .NOT. use_cmax )  THEN
 
           c_max = dx / dt_3d
@@ -755,9 +760,9 @@
     IF ( outflow_r )  THEN
 
-       IF ( bc_lr_dirneu )  THEN
-          u(:,:,nx+1) = u(:,:,nx)
-          v(:,:,nx+1) = v(:,:,nx)
-          w(:,:,nx+1) = w(:,:,nx)          
-       ELSEIF ( bc_ns_dirrad )  THEN
+       IF ( use_cmax )  THEN
+          u_p(:,:,nx+1) = u(:,:,nx)
+          v_p(:,:,nx+1) = v(:,:,nx)
+          w_p(:,:,nx+1) = w(:,:,nx)          
+       ELSEIF ( .NOT. use_cmax )  THEN
 
           c_max = dx / dt_3d
Index: /palm/trunk/SOURCE/check_parameters.f90
===================================================================
--- /palm/trunk/SOURCE/check_parameters.f90	(revision 1158)
+++ /palm/trunk/SOURCE/check_parameters.f90	(revision 1159)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-!
+! bc_lr/ns_dirneu/neudir removed
 !
 ! Former revisions:
@@ -1440,6 +1440,5 @@
 !-- Lateral boundary conditions
     IF ( bc_lr /= 'cyclic'  .AND.  bc_lr /= 'dirichlet/radiation'  .AND. &
-         bc_lr /= 'radiation/dirichlet' .AND. bc_lr /= 'dirichlet/neumann' &
-         .AND. bc_lr /= 'neumann/dirichlet' )  THEN
+         bc_lr /= 'radiation/dirichlet' )  THEN
        message_string = 'unknown boundary condition: bc_lr = "' // &
                         TRIM( bc_lr ) // '"'
@@ -1447,6 +1446,5 @@
     ENDIF
     IF ( bc_ns /= 'cyclic'  .AND.  bc_ns /= 'dirichlet/radiation'  .AND. &
-         bc_ns /= 'radiation/dirichlet' .AND. bc_ns /= 'dirichlet/neumann' &
-         .AND. bc_ns /= 'neumann/dirichlet' )  THEN
+         bc_ns /= 'radiation/dirichlet' )  THEN
        message_string = 'unknown boundary condition: bc_ns = "' // &
                         TRIM( bc_ns ) // '"'
@@ -1459,11 +1457,7 @@
     IF ( bc_lr == 'dirichlet/radiation' )  bc_lr_dirrad = .TRUE.
     IF ( bc_lr == 'radiation/dirichlet' )  bc_lr_raddir = .TRUE.
-    IF ( bc_lr == 'dirichlet/neumann' )    bc_lr_dirneu = .TRUE.
-    IF ( bc_lr == 'neumann/dirichlet' )    bc_lr_neudir = .TRUE.
     IF ( bc_ns /= 'cyclic' )               bc_ns_cyc    = .FALSE.
     IF ( bc_ns == 'dirichlet/radiation' )  bc_ns_dirrad = .TRUE.
     IF ( bc_ns == 'radiation/dirichlet' )  bc_ns_raddir = .TRUE.
-    IF ( bc_ns == 'dirichlet/neumann' )    bc_ns_dirneu = .TRUE.
-    IF ( bc_ns == 'neumann/dirichlet' )    bc_ns_neudir = .TRUE.
 
 !
@@ -3306,15 +3300,15 @@
     ENDIF
 
-    IF ( bc_lr == 'radiation/dirichlet' .OR. bc_lr == 'neumann/dirichlet' )  THEN
+    IF ( bc_lr == 'radiation/dirichlet' )  THEN
        dist_nxr    = nx - inflow_disturbance_begin
        dist_nxl(1) = nx - inflow_disturbance_end
-    ELSEIF ( bc_lr == 'dirichlet/radiation' .OR. bc_lr == 'dirichlet/neumann' )  THEN
+    ELSEIF ( bc_lr == 'dirichlet/radiation' )  THEN
        dist_nxl    = inflow_disturbance_begin
        dist_nxr(1) = inflow_disturbance_end
     ENDIF
-    IF ( bc_ns == 'dirichlet/radiation' .OR. bc_ns == 'dirichlet/neumann' )  THEN
+    IF ( bc_ns == 'dirichlet/radiation' )  THEN
        dist_nyn    = ny - inflow_disturbance_begin
        dist_nys(1) = ny - inflow_disturbance_end
-    ELSEIF ( bc_ns == 'radiation/dirichlet' .OR. bc_ns == 'neumann/dirichlet' )  THEN
+    ELSEIF ( bc_ns == 'radiation/dirichlet' )  THEN
        dist_nys    = inflow_disturbance_begin
        dist_nyn(1) = inflow_disturbance_end
@@ -3324,5 +3318,5 @@
 !-- A turbulent inflow requires Dirichlet conditions at the respective inflow
 !-- boundary (so far, a turbulent inflow is realized from the left side only)
-    IF ( turbulent_inflow  .AND.  bc_lr /= 'dirichlet/radiation' .AND.  bc_lr /= 'dirichlet/neumann' )  THEN
+    IF ( turbulent_inflow  .AND.  bc_lr /= 'dirichlet/radiation' )  THEN
        message_string = 'turbulent_inflow = .T. requires a Dirichlet ' // &
                         'condition at the inflow boundary'
Index: /palm/trunk/SOURCE/header.f90
===================================================================
--- /palm/trunk/SOURCE/header.f90	(revision 1158)
+++ /palm/trunk/SOURCE/header.f90	(revision 1159)
@@ -20,4 +20,5 @@
 ! Current revisions:
 ! -----------------
+! +use_cmax
 !
 !
@@ -742,5 +743,5 @@
     WRITE ( io, 317 )  bc_lr, bc_ns
     IF ( .NOT. bc_lr_cyc  .OR.  .NOT. bc_ns_cyc )  THEN
-       WRITE ( io, 318 )  pt_damping_width, pt_damping_factor       
+       WRITE ( io, 318 )  use_cmax, pt_damping_width, pt_damping_factor       
        IF ( turbulent_inflow )  THEN
           WRITE ( io, 319 )  recycling_width, recycling_plane, &
@@ -1781,5 +1782,6 @@
             '       left/right:  ',A/    &
             '       north/south: ',A)
-318 FORMAT (/'       pt damping layer width = ',F7.2,' m, pt ', &
+318 FORMAT (/'       use_cmax: ',L1 / &
+            '       pt damping layer width = ',F8.2,' m, pt ', &
                     'damping factor = ',F6.4)
 319 FORMAT ('       turbulence recycling at inflow switched on'/ &
Index: /palm/trunk/SOURCE/init_3d_model.f90
===================================================================
--- /palm/trunk/SOURCE/init_3d_model.f90	(revision 1158)
+++ /palm/trunk/SOURCE/init_3d_model.f90	(revision 1159)
@@ -23,4 +23,5 @@
 ! Current revisions:
 ! ------------------
+! -bc_lr_dirneu, bc_lr_neudir, bc_ns_dirneu, bc_ns_neudir
 !
 !
@@ -1695,5 +1696,5 @@
     ptdf_x = 0.0
     ptdf_y = 0.0
-    IF ( bc_lr_dirrad  .OR.  bc_lr_dirneu )  THEN
+    IF ( bc_lr_dirrad )  THEN
        DO  i = nxl, nxr
           IF ( ( i * dx ) < pt_damping_width )  THEN
@@ -1703,5 +1704,5 @@
           ENDIF
        ENDDO
-    ELSEIF ( bc_lr_raddir  .OR.  bc_lr_neudir )  THEN
+    ELSEIF ( bc_lr_raddir )  THEN
        DO  i = nxl, nxr
           IF ( ( i * dx ) > ( nx * dx - pt_damping_width ) )  THEN
@@ -1711,5 +1712,5 @@
           ENDIF
        ENDDO 
-    ELSEIF ( bc_ns_dirrad  .OR.  bc_ns_dirneu )  THEN
+    ELSEIF ( bc_ns_dirrad )  THEN
        DO  j = nys, nyn
           IF ( ( j * dy ) > ( ny * dy - pt_damping_width ) )  THEN
@@ -1719,5 +1720,5 @@
           ENDIF
        ENDDO 
-    ELSEIF ( bc_ns_raddir  .OR.  bc_ns_neudir )  THEN
+    ELSEIF ( bc_ns_raddir )  THEN
        DO  j = nys, nyn
           IF ( ( j * dy ) < pt_damping_width )  THEN
Index: /palm/trunk/SOURCE/init_pegrid.f90
===================================================================
--- /palm/trunk/SOURCE/init_pegrid.f90	(revision 1158)
+++ /palm/trunk/SOURCE/init_pegrid.f90	(revision 1159)
@@ -20,4 +20,5 @@
 ! Current revisions:
 ! -----------------
+! dirichlet/neumann and neumann/dirichlet removed
 !
 !
@@ -1051,7 +1052,7 @@
 !-- horizontal boundary conditions.
     IF ( pleft == MPI_PROC_NULL )  THEN
-       IF ( bc_lr == 'dirichlet/radiation' .OR. bc_lr == 'dirichlet/neumann' )  THEN
+       IF ( bc_lr == 'dirichlet/radiation' )  THEN
           inflow_l  = .TRUE.
-       ELSEIF ( bc_lr == 'radiation/dirichlet' .OR. bc_lr == 'neumann/dirichlet' )  THEN
+       ELSEIF ( bc_lr == 'radiation/dirichlet' )  THEN
           outflow_l = .TRUE.
        ENDIF
@@ -1059,7 +1060,7 @@
 
     IF ( pright == MPI_PROC_NULL )  THEN
-       IF ( bc_lr == 'dirichlet/radiation' .OR. bc_lr == 'dirichlet/neumann' )  THEN
+       IF ( bc_lr == 'dirichlet/radiation' )  THEN
           outflow_r = .TRUE.
-       ELSEIF ( bc_lr == 'radiation/dirichlet' .OR. bc_lr == 'neumann/dirichlet' )  THEN
+       ELSEIF ( bc_lr == 'radiation/dirichlet' )  THEN
           inflow_r  = .TRUE.
        ENDIF
@@ -1067,7 +1068,7 @@
 
     IF ( psouth == MPI_PROC_NULL )  THEN
-       IF ( bc_ns == 'dirichlet/radiation' .OR. bc_ns == 'dirichlet/neumann' )  THEN
+       IF ( bc_ns == 'dirichlet/radiation' )  THEN
           outflow_s = .TRUE.
-       ELSEIF ( bc_ns == 'radiation/dirichlet' .OR. bc_ns == 'neumann/dirichlet' )  THEN
+       ELSEIF ( bc_ns == 'radiation/dirichlet' )  THEN
           inflow_s  = .TRUE.
        ENDIF
@@ -1075,7 +1076,7 @@
 
     IF ( pnorth == MPI_PROC_NULL )  THEN
-       IF ( bc_ns == 'dirichlet/radiation' .OR. bc_ns == 'dirichlet/neumann' )  THEN
+       IF ( bc_ns == 'dirichlet/radiation' )  THEN
           inflow_n  = .TRUE.
-       ELSEIF ( bc_ns == 'radiation/dirichlet' .OR. bc_ns == 'neumann/dirichlet' )  THEN
+       ELSEIF ( bc_ns == 'radiation/dirichlet' )  THEN
           outflow_n = .TRUE.
        ENDIF
@@ -1107,16 +1108,16 @@
 
 #elif ! defined ( __parallel )
-    IF ( bc_lr == 'dirichlet/radiation' .OR. bc_lr == 'dirichlet/neumann' )  THEN
+    IF ( bc_lr == 'dirichlet/radiation' )  THEN
        inflow_l  = .TRUE.
        outflow_r = .TRUE.
-    ELSEIF ( bc_lr == 'radiation/dirichlet' .OR. bc_lr == 'neumann/dirichlet' )  THEN
+    ELSEIF ( bc_lr == 'radiation/dirichlet' )  THEN
        outflow_l = .TRUE.
        inflow_r  = .TRUE.
     ENDIF
 
-    IF ( bc_ns == 'dirichlet/radiation' .OR. bc_ns == 'dirichlet/neumann' )  THEN
+    IF ( bc_ns == 'dirichlet/radiation' )  THEN
        inflow_n  = .TRUE.
        outflow_s = .TRUE.
-    ELSEIF ( bc_ns == 'radiation/dirichlet' .OR. bc_ns == 'neumann/dirichlet' )  THEN
+    ELSEIF ( bc_ns == 'radiation/dirichlet' )  THEN
        outflow_n = .TRUE.
        inflow_s  = .TRUE.
Index: /palm/trunk/SOURCE/modules.f90
===================================================================
--- /palm/trunk/SOURCE/modules.f90	(revision 1158)
+++ /palm/trunk/SOURCE/modules.f90	(revision 1159)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! ------------------
-!
+! -bc_lr_dirneu, bc_lr_neudir, bc_ns_dirneu, bc_ns_neudir
+! +use_cmax
 !
 ! Former revisions:
@@ -730,9 +731,7 @@
 
     LOGICAL ::  avs_output = .FALSE., &
-                bc_lr_cyc =.TRUE., bc_lr_dirneu = .FALSE., &
-                bc_lr_dirrad = .FALSE., bc_lr_neudir = .FALSE., &
+                bc_lr_cyc =.TRUE., bc_lr_dirrad = .FALSE., &
                 bc_lr_raddir = .FALSE., bc_ns_cyc = .TRUE., &
-                bc_ns_dirneu = .FALSE., bc_ns_dirrad = .FALSE., &
-                bc_ns_neudir = .FALSE., bc_ns_raddir = .FALSE., &
+                bc_ns_dirrad = .FALSE., bc_ns_raddir = .FALSE.,&
                 call_psolver_at_all_substeps = .TRUE., &
                 cloud_droplets = .FALSE., cloud_physics = .FALSE., &
@@ -767,5 +766,5 @@
                 stop_dt = .FALSE., synchronous_exchange = .FALSE., &
                 terminate_run = .FALSE., turbulence = .FALSE., &
-                turbulent_inflow = .FALSE., &
+                turbulent_inflow = .FALSE., use_cmax = .TRUE., &
                 use_prescribed_profile_data = .FALSE., use_reference = .FALSE.,&
                 use_surface_fluxes = .FALSE., use_top_fluxes = .FALSE., &
Index: /palm/trunk/SOURCE/parin.f90
===================================================================
--- /palm/trunk/SOURCE/parin.f90	(revision 1158)
+++ /palm/trunk/SOURCE/parin.f90	(revision 1159)
@@ -20,4 +20,5 @@
 ! Current revisions:
 ! -----------------
+! +use_cmax
 !
 !
@@ -254,5 +255,5 @@
              top_momentumflux_u, top_momentumflux_v, top_salinityflux, &
              turbulence, turbulent_inflow, ug_surface, ug_vertical_gradient, &
-             ug_vertical_gradient_level, use_surface_fluxes, &
+             ug_vertical_gradient_level, use_surface_fluxes, use_cmax, &
              use_top_fluxes, use_ug_for_galilei_tr, use_upstream_for_tke, &
              uv_heights, u_bulk, u_profile, vg_surface, vg_vertical_gradient, &
Index: /palm/trunk/SOURCE/poismg.f90
===================================================================
--- /palm/trunk/SOURCE/poismg.f90	(revision 1158)
+++ /palm/trunk/SOURCE/poismg.f90	(revision 1159)
@@ -23,4 +23,5 @@
 ! Current revisions:
 ! -----------------
+! bc_lr/ns_dirneu/neudir removed
 ! 
 !
@@ -1251,10 +1252,10 @@
 !--       outflow conditions have to be used on all PEs after the switch,
 !--       because then they have the total domain.
-          IF ( bc_lr_dirrad  .OR.  bc_lr_dirneu )  THEN
+          IF ( bc_lr_dirrad )  THEN
              inflow_l  = .TRUE.
              inflow_r  = .FALSE.
              outflow_l = .FALSE.
              outflow_r = .TRUE.
-          ELSEIF ( bc_lr_raddir  .OR.  bc_lr_neudir )  THEN
+          ELSEIF ( bc_lr_raddir )  THEN
              inflow_l  = .FALSE.
              inflow_r  = .TRUE.
@@ -1263,10 +1264,10 @@
           ENDIF
 
-          IF ( bc_ns_dirrad  .OR.  bc_ns_dirneu )  THEN
+          IF ( bc_ns_dirrad )  THEN
              inflow_n  = .TRUE.
              inflow_s  = .FALSE.
              outflow_n = .FALSE.
              outflow_s = .TRUE.
-          ELSEIF ( bc_ns_raddir  .OR.  bc_ns_neudir )  THEN
+          ELSEIF ( bc_ns_raddir )  THEN
              inflow_n  = .FALSE.
              inflow_s  = .TRUE.
@@ -1339,7 +1340,7 @@
 
           IF ( pleft == MPI_PROC_NULL )  THEN
-             IF ( bc_lr_dirrad  .OR.  bc_lr_dirneu )  THEN
+             IF ( bc_lr_dirrad )  THEN
                 inflow_l  = .TRUE.
-             ELSEIF ( bc_lr_raddir  .OR.  bc_lr_neudir )  THEN
+             ELSEIF ( bc_lr_raddir )  THEN
                 outflow_l = .TRUE.
              ENDIF
@@ -1347,7 +1348,7 @@
 
           IF ( pright == MPI_PROC_NULL )  THEN
-             IF ( bc_lr_dirrad  .OR.  bc_lr_dirneu )  THEN
+             IF ( bc_lr_dirrad )  THEN
                 outflow_r = .TRUE.
-             ELSEIF ( bc_lr_raddir  .OR.  bc_lr_neudir )  THEN
+             ELSEIF ( bc_lr_raddir )  THEN
                 inflow_r  = .TRUE.
              ENDIF
@@ -1355,7 +1356,7 @@
 
           IF ( psouth == MPI_PROC_NULL )  THEN
-             IF ( bc_ns_dirrad  .OR.  bc_ns_dirneu )  THEN
+             IF ( bc_ns_dirrad )  THEN
                 outflow_s = .TRUE.
-             ELSEIF ( bc_ns_raddir  .OR.  bc_ns_neudir )  THEN
+             ELSEIF ( bc_ns_raddir )  THEN
                 inflow_s  = .TRUE.
              ENDIF
@@ -1363,7 +1364,7 @@
 
           IF ( pnorth == MPI_PROC_NULL )  THEN
-             IF ( bc_ns_dirrad  .OR.  bc_ns_dirneu )  THEN
+             IF ( bc_ns_dirrad )  THEN
                 inflow_n  = .TRUE.
-             ELSEIF ( bc_ns_raddir  .OR.  bc_ns_neudir )  THEN
+             ELSEIF ( bc_ns_raddir )  THEN
                 outflow_n = .TRUE.
              ENDIF
