Index: palm/trunk/SOURCE/netcdf_data_input_mod.f90
===================================================================
--- palm/trunk/SOURCE/netcdf_data_input_mod.f90	(revision 3184)
+++ palm/trunk/SOURCE/netcdf_data_input_mod.f90	(revision 3186)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Read zsoil dimension lenght only if soil variables are provided
+! 
+! 3183 2018-07-27 14:25:55Z suehring
 ! Adjust input of dynamic driver according to revised Inifor version. 
 ! Replace simulated_time by time_since_reference_point.
@@ -2122,5 +2125,6 @@
        CALL get_dimension_length( id_dynamic, init_3d%nzu, 'z'     )
        CALL get_dimension_length( id_dynamic, init_3d%nzw, 'zw'    )
-       CALL get_dimension_length( id_dynamic, init_3d%nzs, 'zsoil' )
+       IF ( check_existence( var_names, 'zsoil' ) )                            &
+          CALL get_dimension_length( id_dynamic, init_3d%nzs, 'zsoil' )
 !
 !--    Read also the horizontal dimensions. These are used just used fo
Index: palm/trunk/SOURCE/radiation_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/radiation_model_mod.f90	(revision 3184)
+++ palm/trunk/SOURCE/radiation_model_mod.f90	(revision 3186)
@@ -28,4 +28,7 @@
 ! -----------------
 ! $Id$
+! Remove print statement
+! 
+! 3180 2018-07-27 11:00:56Z suehring
 ! Revise concept for calculation of effective radiative temperature and mapping
 ! of radiative heating
@@ -4984,6 +4987,4 @@
       t_rad_urb = ( (pemitlw - pabslw + emissivity_urb*pinlw) / &
            (emissivity_urb*sigma_sb * area_hor) )**0.25_wp
-write(9,*) t_rad_urb
-flush(9)
 !
 !--  It has been turned out that the effective radiative temperature is far 
Index: palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90
===================================================================
--- palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90	(revision 3184)
+++ palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90	(revision 3186)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Mask topography while imposing inflow perturbations at the boundaries; do not
+! impose perturbations at top boundary as well as ghost points
+! 
+! 3183 2018-07-27 14:25:55Z suehring
 ! Rename variables and extend error message
 ! Enable geneartor also for stretched grids
@@ -1270,12 +1274,15 @@
           IF ( myidx == id_stg_left  )  THEN
 
-             DO  j = nysg, nyng
-                DO  k = nzb, nzt+1
-                   u(k,j,-nbgp+1:0) = ( u(k,j,-nbgp+1:0) + dist_yz(k,j,1) )    &
-                                        * mc_factor
-                   v(k,j,-nbgp:-1)  = ( v(k,j,-nbgp:-1)  + dist_yz(k,j,2)  )   &
-                                        * mc_factor
-                   w(k,j,-nbgp:-1)  = ( w(k,j,-nbgp:-1)  + dist_yz(k,j,3)  )   &
-                                        * mc_factor
+             DO  j = nys, nyn
+                DO  k = nzb, nzt
+                   u(k,j,0) = ( u(k,j,0) + dist_yz(k,j,1) )                    &
+                       * mc_factor * MERGE( 1.0_wp, 0.0_wp,                    &
+                                            BTEST( wall_flags_0(k,j,0), 1 ) )
+                   v(k,j,-1)  = ( v(k,j,-1)  + dist_yz(k,j,2)  )               &
+                       * mc_factor * MERGE( 1.0_wp, 0.0_wp,                    &
+                                            BTEST( wall_flags_0(k,j,-1), 2 ) )
+                   w(k,j,-1)  = ( w(k,j,-1)  + dist_yz(k,j,3)  )               &
+                       * mc_factor * MERGE( 1.0_wp, 0.0_wp,                    &
+                                            BTEST( wall_flags_0(k,j,-1), 3 ) )
                 ENDDO
              ENDDO
@@ -1283,12 +1290,15 @@
           IF ( myidx == id_stg_right  )  THEN
 
-             DO  j = nysg, nyng
-                DO  k = nzb, nzt+1
-                   u(k,j,nxr+1:nxr+nbgp) = ( u(k,j,nxr+1:nxr+nbgp) +           &
-                                             dist_yz(k,j,1) ) * mc_factor
-                   v(k,j,nxr+1:nxr+nbgp) = ( v(k,j,nxr+1:nxr+nbgp) +           &
-                                             dist_yz(k,j,2) ) * mc_factor
-                   w(k,j,nxr+1:nxr+nbgp) = ( w(k,j,nxr+1:nxr+nbgp) +           &
-                                             dist_yz(k,j,3) ) * mc_factor
+             DO  j = nys, nyn
+                DO  k = nzb, nzt
+                   u(k,j,nxr+1) = ( u(k,j,nxr+1) + dist_yz(k,j,1) )            &
+                     * mc_factor * MERGE( 1.0_wp, 0.0_wp,                      &
+                                          BTEST( wall_flags_0(k,j,nxr+1), 1 ) )
+                   v(k,j,nxr+1) = ( v(k,j,nxr+1) + dist_yz(k,j,2) )            &
+                     * mc_factor * MERGE( 1.0_wp, 0.0_wp,                      &
+                                          BTEST( wall_flags_0(k,j,nxr+1), 2 ) )
+                   w(k,j,nxr+1) = ( w(k,j,nxr+1) + dist_yz(k,j,3) )            &
+                     * mc_factor * MERGE( 1.0_wp, 0.0_wp,                      &
+                                          BTEST( wall_flags_0(k,j,nxr+1), 3 ) )
                 ENDDO
              ENDDO
@@ -1389,12 +1399,15 @@
        IF ( myidy == id_stg_south  )  THEN
 
-          DO  i = nxlg, nxrg
-             DO  k = nzb, nzt+1
-                u(k,-nbgp:-1,i) = ( u(k,-nbgp:-1,i) + dist_xz(k,i,1) )         &
-                                     * mc_factor
-                v(k,-nbgp:0,i)  = ( v(k,-nbgp:0,i)  + dist_xz(k,i,2)  )        &
-                                     * mc_factor
-                w(k,-nbgp:-1,i) = ( w(k,-nbgp:-1,i) + dist_xz(k,i,3)  )        &
-                                     * mc_factor
+          DO  i = nxl, nxr
+             DO  k = nzb, nzt
+                u(k,-1,i) = ( u(k,-1,i) + dist_xz(k,i,1) )                     &
+                      * mc_factor * MERGE( 1.0_wp, 0.0_wp,                     &
+                                           BTEST( wall_flags_0(k,-1,i), 1 ) )
+                v(k,0,i)  = ( v(k,0,i)  + dist_xz(k,i,2)  )                    &
+                      * mc_factor * MERGE( 1.0_wp, 0.0_wp,                     &
+                                           BTEST( wall_flags_0(k,0,i), 2 ) )
+                w(k,-1,i) = ( w(k,-1,i) + dist_xz(k,i,3)  )                    &
+                      * mc_factor * MERGE( 1.0_wp, 0.0_wp,                     &
+                                           BTEST( wall_flags_0(k,-1,i), 3 ) )
              ENDDO
           ENDDO
@@ -1402,12 +1415,15 @@
        IF ( myidy == id_stg_north  )  THEN
 
-          DO  i = nxlg, nxrg
-             DO  k = nzb, nzt+1
-                u(k,nyn+1:nyn+nbgp,i) = ( u(k,nyn+1:nyn+nbgp,i) +              &
-                                          dist_xz(k,i,1) ) * mc_factor
-                v(k,nyn+1:nyn+nbgp,i) = ( v(k,nyn+1:nyn+nbgp,i) +              &
-                                          dist_xz(k,i,2) ) * mc_factor
-                w(k,nyn+1:nyn+nbgp,i) = ( w(k,nyn+1:nyn+nbgp,i) +              &
-                                          dist_xz(k,i,3) ) * mc_factor
+          DO  i = nxl, nxr
+             DO  k = nzb, nzt
+                u(k,nyn+1,i) = ( u(k,nyn+1,i) + dist_xz(k,i,1) )                &
+                     * mc_factor * MERGE( 1.0_wp, 0.0_wp,                       &
+                                          BTEST( wall_flags_0(k,nyn+1,i), 1 ) )
+                v(k,nyn+1,i) = ( v(k,nyn+1,i) + dist_xz(k,i,1) )                &
+                     * mc_factor * MERGE( 1.0_wp, 0.0_wp,                       &
+                                          BTEST( wall_flags_0(k,nyn+1,i), 2 ) )
+                w(k,nyn+1,i) = ( w(k,nyn+1,i) + dist_xz(k,i,1) )                &
+                     * mc_factor * MERGE( 1.0_wp, 0.0_wp,                       &
+                                          BTEST( wall_flags_0(k,nyn+1,i), 3 ) )
              ENDDO
           ENDDO
