Index: palm/trunk/SOURCE/modules.f90
===================================================================
--- palm/trunk/SOURCE/modules.f90	(revision 3156)
+++ palm/trunk/SOURCE/modules.f90	(revision 3157)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! added use_free_convection_scaling
+! 
+! 3129 2018-07-16 07:45:13Z gronemeier
 ! add target attribute to km and kh, necessary for output in tcm_data_output_3d
 ! 
@@ -1359,4 +1362,5 @@
     LOGICAL ::  urban_surface = .FALSE.                          !< use urban surface model?
     LOGICAL ::  use_cmax = .TRUE.                                !< namelist parameter
+    LOGICAL ::  use_free_convection_scaling = .FALSE.            !< namelist parameter to switch on free convection velocity scale in calculation of horizontal wind speed (surface_layer_fluxes)
     LOGICAL ::  use_initial_profile_as_reference = .FALSE.       !< use of initial profiles as reference state?
     LOGICAL ::  use_prescribed_profile_data = .FALSE.            !< use of prescribed wind profiles?
Index: palm/trunk/SOURCE/parin.f90
===================================================================
--- palm/trunk/SOURCE/parin.f90	(revision 3156)
+++ palm/trunk/SOURCE/parin.f90	(revision 3157)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! added use_free_convection_scaling
+! 
+! 3083 2018-06-19 14:03:12Z gronemeier
 ! Added rans_const_c and rans_const_sigma as input parameters (TG)
 ! 
@@ -558,4 +561,5 @@
              turbulent_inflow, turbulent_outflow,                              &
              use_subsidence_tendencies, ug_surface, ug_vertical_gradient,      &
+             use_free_convection_scaling,                                      &
              ug_vertical_gradient_level, use_surface_fluxes, use_cmax,         &
              use_top_fluxes, use_ug_for_galilei_tr, use_upstream_for_tke,      &
@@ -631,4 +635,5 @@
              ug_vertical_gradient_level, use_surface_fluxes, use_cmax,         &
              use_top_fluxes, use_ug_for_galilei_tr, use_upstream_for_tke,      &
+             use_free_convection_scaling,                                      &
              uv_heights, u_bulk, u_profile, vg_surface, vg_vertical_gradient,  &
              vg_vertical_gradient_level, v_bulk, v_profile, ventilation_effect,&
Index: palm/trunk/SOURCE/surface_layer_fluxes_mod.f90
===================================================================
--- palm/trunk/SOURCE/surface_layer_fluxes_mod.f90	(revision 3156)
+++ palm/trunk/SOURCE/surface_layer_fluxes_mod.f90	(revision 3157)
@@ -26,4 +26,9 @@
 ! -----------------
 ! $Id$
+! Added local free convection velocity scale w_lfc in calculation of uvw_abs.
+! This can be switche on/off by the user via the flag namelist parameter 
+! use_free_convection_scaling
+! 
+! 3152 2018-07-19 13:26:52Z suehring
 ! q_surface is now part of surface structure
 ! 
@@ -246,5 +251,6 @@
                most_method, neutral, passive_scalar, pt_surface, q_surface,    &
                run_coupled, surface_pressure, simulated_time, terminate_run,   &
-               time_since_reference_point, urban_surface, zeta_max, zeta_min
+               time_since_reference_point, urban_surface,                      &
+               use_free_convection_scaling, zeta_max, zeta_min
 
     USE grid_variables,                                                        &
@@ -952,5 +958,5 @@
 !------------------------------------------------------------------------------!
     SUBROUTINE calc_uvw_abs
-
+    
        IMPLICIT NONE
 
@@ -961,4 +967,5 @@
        INTEGER(iwp) ::  m             !< running index surface elements
 
+       REAL(wp)     :: w_lfc          !< local free convection velocity scale
 !
 !--    ibit is 1 for upward-facing surfaces, zero for downward-facing surfaces.
@@ -970,4 +977,17 @@
           j   = surf%j(m)
           k   = surf%k(m)
+       
+!
+!--       Calculate free convection velocity scale w_lfc is 
+!--       use_free_convection_scaling = .T.. This will maintain a horizontal
+!--       velocity even for very weak wind convective conditions. SIGN is used
+!--       to set w_lfc to zero under stable conditions.
+          IF ( use_free_convection_scaling )  THEN 
+             w_lfc = ABS(g / surf%pt1(m) * surf%z_mo(m) * surf%shf(m))
+             w_lfc = ( 0.5_wp * ( w_lfc + SIGN(w_lfc,surf%shf(m)) ) )**(0.33333_wp)
+          ELSE
+             w_lfc = 0.0_wp
+          ENDIF
+
 !
 !--       Compute the absolute value of the horizontal velocity.
@@ -991,5 +1011,5 @@
                                            ) * ibit                            &
                                          )                                     &
-                              )**2                                             &
+                              )**2  + w_lfc**2                                 &
                                 )
 
