Index: palm/trunk/SOURCE/check_parameters.f90
===================================================================
--- palm/trunk/SOURCE/check_parameters.f90	(revision 3543)
+++ palm/trunk/SOURCE/check_parameters.f90	(revision 3545)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Call tcm_check_parameters before other modules
+! 
+! 3529 2018-11-15 21:03:15Z gronemeier
 ! Save time zone in variable run_zone, change date format into YYYY-MM-DD
 ! 
@@ -1513,4 +1516,5 @@
 
 !-- Check the module settings
+    CALL tcm_check_parameters
     IF ( biometeorology )       CALL bio_check_parameters
     IF ( bulk_cloud_model )     CALL bcm_check_parameters
@@ -1524,5 +1528,4 @@
     IF ( calculate_spectra )    CALL spectra_check_parameters
     CALL stg_check_parameters
-    CALL tcm_check_parameters
     IF ( urban_surface )        CALL usm_check_parameters
     IF ( wind_turbine )         CALL wtm_check_parameters
Index: palm/trunk/SOURCE/parin.f90
===================================================================
--- palm/trunk/SOURCE/parin.f90	(revision 3543)
+++ palm/trunk/SOURCE/parin.f90	(revision 3545)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! remove rans_mode from initialization_parameters
+! 
+! 3525 2018-11-14 16:06:14Z kanani
 ! Changes related to clean-up of biometeorology (dom_dwd_user)
 ! 
@@ -623,5 +626,4 @@
              q_vertical_gradient, q_vertical_gradient_level,                   &
              random_generator, random_heatflux, rans_const_c, rans_const_sigma,&
-             rans_mode,                                                        &
              rayleigh_damping_factor, rayleigh_damping_height,                 &
              recycling_width, recycling_yshift,                                &
@@ -695,5 +697,4 @@
              q_vertical_gradient, q_vertical_gradient_level,                   &
              random_generator, random_heatflux, rans_const_c, rans_const_sigma,&
-             rans_mode,                                                        &
              rayleigh_damping_factor, rayleigh_damping_height,                 &
              recycling_width, recycling_yshift,                                &
Index: palm/trunk/SOURCE/turbulence_closure_mod.f90
===================================================================
--- palm/trunk/SOURCE/turbulence_closure_mod.f90	(revision 3543)
+++ palm/trunk/SOURCE/turbulence_closure_mod.f90	(revision 3545)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! - Set rans_mode according to value of turbulence_closure
+! - removed debug output
+! 
+! 3430 2018-10-25 13:36:23Z maronga
 ! Added support for buildings in the dynamic SGS model
 ! 
@@ -160,5 +164,4 @@
 !> @todo test initialization for all possibilities
 !>       add OpenMP directives whereever possible
-!>       remove debug output variables (dummy1, dummy2, dummy3)
 !> @todo Check for random disturbances
 !> @note <Enter notes on the module>
@@ -251,11 +254,4 @@
     REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  l_wall !< near-wall mixing length
 
-    !> @todo remove debug variables
-    REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, TARGET :: &
-       diss_prod1, diss_adve1, diss_diff1, &
-       diss_prod2, diss_adve2, diss_diff2, &
-       diss_prod3, diss_adve3, diss_diff3, &
-       dummy1, dummy2, dummy3
-
 
     PUBLIC c_0, rans_const_c, rans_const_sigma
@@ -404,9 +400,4 @@
 ! ------------
 !> Check parameters routine for turbulence closure module.
-!> @todo remove rans_mode from initialization namelist and rework checks
-!>   The way it is implemented at the moment, the user has to set two variables
-!>   so that the RANS mode is working. It would be better if only one parameter
-!>   has to be set.
-!>   2018-06-18, gronemeier
 !------------------------------------------------------------------------------!
  SUBROUTINE tcm_check_parameters
@@ -419,6 +410,29 @@
 !
 !-- Define which turbulence closure is going to be used
+    SELECT CASE ( TRIM( turbulence_closure ) )
+
+       CASE ( 'dynamic' )
+          les_dynamic = .TRUE.
+
+       CASE ( 'Moeng_Wyngaard' )
+          les_mw = .TRUE.
+
+       CASE ( 'TKE-l' )
+          rans_tke_l = .TRUE.
+          rans_mode = .TRUE.
+
+       CASE ( 'TKE-e' )
+          rans_tke_e = .TRUE.
+          rans_mode = .TRUE.
+
+       CASE DEFAULT
+          message_string = 'Unknown turbulence closure: ' //                &
+                           TRIM( turbulence_closure )
+          CALL message( 'tcm_check_parameters', 'PA0500', 1, 2, 0, 6, 0 )
+
+    END SELECT
+!
+!-- Set variables for RANS mode or LES mode
     IF ( rans_mode )  THEN
-
 !
 !--    Assign values to constants for RANS mode
@@ -432,19 +446,4 @@
        c_4 = rans_const_c(4)
 
-       SELECT CASE ( TRIM( turbulence_closure ) )
-
-          CASE ( 'TKE-l' )
-             rans_tke_l = .TRUE.
-
-          CASE ( 'TKE-e' )
-             rans_tke_e = .TRUE.
-
-          CASE DEFAULT
-             message_string = 'Unknown turbulence closure: ' //                &
-                              TRIM( turbulence_closure )
-             CALL message( 'tcm_check_parameters', 'PA0500', 1, 2, 0, 6, 0 )
-
-       END SELECT
-
        IF ( turbulent_inflow .OR. turbulent_outflow )  THEN
           message_string = 'turbulent inflow/outflow is not yet '//            &
@@ -459,25 +458,10 @@
 
     ELSE
-
-       c_0 = 0.1_wp !according to Lilly (1967) and Deardorff (1980)
+!
+!--    LES mode
+       c_0 = 0.1_wp    !according to Lilly (1967) and Deardorff (1980)
 
        dsig_e = 1.0_wp !assure to use K_m to calculate TKE instead 
                        !of K_e which is used in RANS mode
-
-       SELECT CASE ( TRIM( turbulence_closure ) )
-
-          CASE ( 'Moeng_Wyngaard' )
-             les_mw = .TRUE.
-
-          CASE ( 'dynamic' )
-             les_dynamic = .TRUE.
-
-          CASE DEFAULT
-             !> @todo rework this part so that only one call of this error exists
-             message_string = 'Unknown turbulence closure: ' //                &
-                              TRIM( turbulence_closure )
-             CALL message( 'tcm_check_parameters', 'PA0500', 1, 2, 0, 6, 0 )
-
-       END SELECT
 
     ENDIF
@@ -502,10 +486,4 @@
        CASE ( 'diss' )
           unit = 'm2/s3'
-
-       CASE ( 'diss1', 'diss2',                         &                      !> @todo remove later
-              'diss_prod1', 'diss_adve1', 'diss_diff1', &
-              'diss_prod2', 'diss_adve2', 'diss_diff2', &
-              'diss_prod3', 'diss_adve3', 'diss_diff3', 'dummy3'  )
-          unit = 'debug output'
 
        CASE ( 'kh', 'km' )
@@ -544,12 +522,4 @@
 
        CASE ( 'diss', 'diss_xy', 'diss_xz', 'diss_yz' )
-          grid_x = 'x'
-          grid_y = 'y'
-          grid_z = 'zu'
-
-       CASE ( 'diss1', 'diss2',                         &                       !> @todo remove later
-              'diss_prod1', 'diss_adve1', 'diss_diff1', &
-              'diss_prod2', 'diss_adve2', 'diss_diff2', &
-              'diss_prod3', 'diss_adve3', 'diss_diff3', 'dummy3' )
           grid_x = 'x'
           grid_y = 'y'
@@ -741,8 +711,8 @@
     INTEGER(iwp) ::  nzt_do    !< vertical output index (top)
 
-    LOGICAL ::  found   !< flag if output variable is found
+    LOGICAL ::  found     !< flag if output variable is found
     LOGICAL ::  resorted  !< flag if output is already resorted
 
-    REAL(wp) ::  fill_value = -999.0_wp  !< value for the _FillValue attribute
+    REAL(wp) ::  fill_value = -9999.0_wp  !< value for the _FillValue attribute
 
     REAL(wp), DIMENSION(nxl:nxr,nys:nyn,nzb_do:nzt_do) ::  local_pf !< local
@@ -842,5 +812,5 @@
     LOGICAL ::  resorted  !< flag if output is already resorted
 
-    REAL(wp) ::  fill_value = -999.0_wp  !< value for the _FillValue attribute
+    REAL(wp) ::  fill_value = -9999.0_wp  !< value for the _FillValue attribute
 
     REAL(sp), DIMENSION(nxl:nxr,nys:nyn,nzb_do:nzt_do) ::  local_pf   !< local
@@ -889,64 +859,4 @@
              to_be_resorted => km_av
           ENDIF
-
-       CASE ( 'dummy3' )                                                        !> @todo remove later
-          IF ( av == 0 )  THEN
-             to_be_resorted => dummy3
-          ENDIF
-
-       CASE ( 'diss1' )                                                         !> @todo remove later
-          IF ( av == 0 )  THEN
-             to_be_resorted => dummy1
-          ENDIF
-
-       CASE ( 'diss2' )                                                         !> @todo remove later
-          IF ( av == 0 )  THEN
-             to_be_resorted => dummy2
-          ENDIF
-
-       CASE ( 'diss_prod1' )                                                    !> @todo remove later
-          IF ( av == 0 )  THEN
-             to_be_resorted => diss_prod1
-          ENDIF
-
-       CASE ( 'diss_adve1' )                                                    !> @todo remove later
-          IF ( av == 0 )  THEN
-             to_be_resorted => diss_adve1
-          ENDIF
-
-       CASE ( 'diss_diff1' )                                                    !> @todo remove later
-          IF ( av == 0 )  THEN
-             to_be_resorted => diss_diff1
-          ENDIF
-
-       CASE ( 'diss_prod2' )                                                    !> @todo remove later
-          IF ( av == 0 )  THEN
-             to_be_resorted => diss_prod2
-          ENDIF
-
-       CASE ( 'diss_adve2' )                                                    !> @todo remove later
-          IF ( av == 0 )  THEN
-             to_be_resorted => diss_adve2
-          ENDIF
-
-       CASE ( 'diss_diff2' )                                                    !> @todo remove later
-          IF ( av == 0 )  THEN
-             to_be_resorted => diss_diff2
-          ENDIF
-
-       CASE ( 'diss_prod3' )                                                    !> @todo remove later
-          IF ( av == 0 )  THEN
-             to_be_resorted => diss_prod3
-          ENDIF
-
-       CASE ( 'diss_adve3' )                                                    !> @todo remove later
-          IF ( av == 0 )  THEN
-             to_be_resorted => diss_adve3
-          ENDIF
-
-       CASE ( 'diss_diff3' )                                                    !> @todo remove later
-          IF ( av == 0 )  THEN
-             to_be_resorted => diss_diff3
-          ENDIF
           
        CASE DEFAULT
@@ -993,29 +903,4 @@
     ALLOCATE( kh(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
     ALLOCATE( km(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
-
-    ALLOCATE( dummy1(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )                           !> @todo remove later
-    ALLOCATE( dummy2(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
-    ALLOCATE( dummy3(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
-    ALLOCATE( diss_adve1(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
-    ALLOCATE( diss_adve2(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
-    ALLOCATE( diss_adve3(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
-    ALLOCATE( diss_prod1(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
-    ALLOCATE( diss_prod2(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
-    ALLOCATE( diss_prod3(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
-    ALLOCATE( diss_diff1(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
-    ALLOCATE( diss_diff2(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
-    ALLOCATE( diss_diff3(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
-    dummy1 = 0.0_wp
-    dummy2 = 0.0_wp
-    dummy3 = 0.0_wp
-    diss_adve1 = 0.0_wp
-    diss_adve2 = 0.0_wp
-    diss_adve3 = 0.0_wp
-    diss_prod1 = 0.0_wp
-    diss_prod2 = 0.0_wp
-    diss_prod3 = 0.0_wp
-    diss_diff1 = 0.0_wp
-    diss_diff2 = 0.0_wp
-    diss_diff3 = 0.0_wp
 
 #if defined( __nopointer )
@@ -1095,5 +980,4 @@
 !-- Initialize mixing length
     CALL tcm_init_mixing_length
-    dummy3 = l_wall                 !> @todo remove later
 
 !
@@ -1143,6 +1027,6 @@
                    kh   = 0.01_wp   ! there must exist an initial diffusion, because 
                    km   = 0.01_wp   ! otherwise no TKE would be produced by the
-                                     ! production terms, as long as not yet
-                                     ! e = (u*/cm)**2 at k=nzb+1
+                                    ! production terms, as long as not yet
+                                    ! e = (u*/cm)**2 at k=nzb+1
                 ELSE
                    kh   = 0.00001_wp
@@ -2335,17 +2219,4 @@
     INTEGER(iwp) ::  tn      !< task number of openmp task
 
-!    INTEGER(iwp) :: pis = 32 !< debug variable, print from i=pis                !> @todo remove later
-!    INTEGER(iwp) :: pie = 32 !< debug variable, print until i=pie               !> @todo remove later
-!    INTEGER(iwp) :: pjs = 26 !< debug variable, print from j=pjs                !> @todo remove later
-!    INTEGER(iwp) :: pje = 26 !< debug variable, print until j=pje               !> @todo remove later
-!    INTEGER(iwp) :: pkb = 1  !< debug variable, print from k=pkb                !> @todo remove later
-!    INTEGER(iwp) :: pkt = 7  !< debug variable, print until k=pkt               !> @todo remove later
-
-    REAL(wp), DIMENSION(nzb:nzt+1) :: dum_adv   !< debug variable               !> @todo remove later
-    REAL(wp), DIMENSION(nzb:nzt+1) :: dum_pro   !< debug variable               !> @todo remove later
-    REAL(wp), DIMENSION(nzb:nzt+1) :: dum_dif   !< debug variable               !> @todo remove later
-
-!5555 FORMAT(A,7(1X,E12.5))   !> @todo remove later
-
 !
 !-- If required, compute prognostic equation for turbulent kinetic
@@ -2368,9 +2239,5 @@
        ENDIF
 
-       dum_adv = tend(:,j,i)                                                    !> @todo remove later
-
        CALL production_e( i, j, .FALSE. )
-
-       dum_pro = tend(:,j,i) - dum_adv                                          !> @todo remove later
 
        IF ( .NOT. humidity )  THEN
@@ -2383,6 +2250,4 @@
           CALL diffusion_e( i, j, vpt, pt_reference )
        ENDIF
-
-       dum_dif = tend(:,j,i) - dum_adv - dum_pro                                !> @todo remove later
 
 !
@@ -2423,21 +2288,4 @@
        ENDIF
 
-!        if ( i >= pis .and. i <= pie .and. j >= pjs .and. j <= pje ) then        !> @todo remove later
-!           WRITE(9, *) '------'
-!           WRITE(9, '(A,F8.3,1X,F8.3,1X,I2)') 't, dt, int_ts:', simulated_time, dt_3d, intermediate_timestep_count
-!           WRITE(9, *) 'i:', i
-!           WRITE(9, *) 'j:', j
-!           WRITE(9, *) 'k:', pkb, ' - ', pkt
-!           WRITE(9, *) '---'
-!           WRITE(9, *) 'e:'
-!           WRITE(9, 5555) 'adv :', dum_adv(pkb:pkt)
-!           WRITE(9, 5555) 'pro :', dum_pro(pkb:pkt)
-!           WRITE(9, 5555) 'dif :', dum_dif(pkb:pkt)
-!           WRITE(9, 5555) 'tend:', tend(pkb:pkt,j,i)
-!           WRITE(9, 5555) 'e_p :', e_p(pkb:pkt,j,i)
-!           WRITE(9, 5555) 'e   :', e(pkb:pkt,j,i)
-!           FLUSH(9)
-!        endif
-
     ENDIF   ! TKE equation
 
@@ -2445,5 +2293,4 @@
 !-- If required, compute prognostic equation for TKE dissipation rate
     IF ( rans_tke_e )  THEN
-
 !
 !--    Tendency-terms for dissipation
@@ -2460,30 +2307,10 @@
           CALL advec_s_up( i, j, diss )
        ENDIF
-
-       IF ( intermediate_timestep_count == 1 )  diss_adve1(:,j,i) = tend(:,j,i) !> @todo remove later
-       IF ( intermediate_timestep_count == 2 )  diss_adve2(:,j,i) = tend(:,j,i)
-       IF ( intermediate_timestep_count == 3 )  diss_adve3(:,j,i) = tend(:,j,i)
-
 !
 !--    Production of TKE dissipation rate
        CALL production_e( i, j, .TRUE. )
-
-       IF ( intermediate_timestep_count == 1 )  diss_prod1(:,j,i) = tend(:,j,i) - diss_adve1(:,j,i) !> @todo remove later
-       IF ( intermediate_timestep_count == 2 )  diss_prod2(:,j,i) = tend(:,j,i) - diss_adve2(:,j,i)
-       IF ( intermediate_timestep_count == 3 )  diss_prod3(:,j,i) = tend(:,j,i) - diss_adve3(:,j,i)
-
-       dum_pro = tend(:,j,i) - dum_adv                                          !> @todo remove later
-
 !
 !--    Diffusion term of TKE dissipation rate
        CALL diffusion_diss( i, j )
-
-       IF ( intermediate_timestep_count == 1 )  diss_diff1(:,j,i) = tend(:,j,i) - diss_adve1(:,j,i) - diss_prod1(:,j,i) !> @todo remove later
-       IF ( intermediate_timestep_count == 2 )  diss_diff2(:,j,i) = tend(:,j,i) - diss_adve2(:,j,i) - diss_prod2(:,j,i)
-       IF ( intermediate_timestep_count == 3 )  diss_diff3(:,j,i) = tend(:,j,i) - diss_adve3(:,j,i) - diss_prod3(:,j,i)
-!        IF ( intermediate_timestep_count == 3 )  dummy3(:,j,i) = km(:,j,i)
-
-       dum_dif = tend(:,j,i) - dum_adv - dum_pro                                !> @todo remove later
-
 !
 !--    Additional sink term for flows through plant canopies
@@ -2522,21 +2349,4 @@
        ENDIF
 
-       IF ( intermediate_timestep_count == 1 )  dummy1(:,j,i) = diss_p(:,j,i)   !> @todo remove later
-       IF ( intermediate_timestep_count == 2 )  dummy2(:,j,i) = diss_p(:,j,i)
-
-!        if ( i >= pis .and. i <= pie .and. j >= pjs .and. j <= pje ) then        !> @todo remove later
-!           WRITE(9, *) '---'
-!           WRITE(9, *) 'diss:'
-!           WRITE(9, 5555) 'adv   :', dum_adv(pkb:pkt)
-!           WRITE(9, 5555) 'pro   :', dum_pro(pkb:pkt)
-!           WRITE(9, 5555) 'dif   :', dum_dif(pkb:pkt)
-!           WRITE(9, 5555) 'tend  :', tend(pkb:pkt,j,i)
-!           WRITE(9, 5555) 'diss_p:', diss_p(pkb:pkt,j,i)
-!           WRITE(9, 5555) 'diss  :', diss(pkb:pkt,j,i)
-!           WRITE(9, *) '---'
-!           WRITE(9, 5555) 'km    :', km(pkb:pkt,j,i)
-!           flush(9)
-!        endif
-
     ENDIF   ! dissipation equation
 
@@ -2586,11 +2396,11 @@
     INTEGER(iwp) ::  flag_nr !< number of masking flag
 
-    REAL(wp)     ::  def         !< 
+    REAL(wp)     ::  def         !< ( du_i/dx_j + du_j/dx_i ) * du_i/dx_j
     REAL(wp)     ::  flag        !< flag to mask topography
-    REAL(wp)     ::  k1          !<
-    REAL(wp)     ::  k2          !<
+    REAL(wp)     ::  k1          !< temporary factor
+    REAL(wp)     ::  k2          !< temporary factor
     REAL(wp)     ::  km_neutral  !< diffusion coefficient assuming neutral conditions - used to compute shear production at surfaces
-    REAL(wp)     ::  theta       !<
-    REAL(wp)     ::  temp        !<
+    REAL(wp)     ::  theta       !< virtual potential temperature
+    REAL(wp)     ::  temp        !< theta * Exner-function
     REAL(wp)     ::  sign_dir    !< sign of wall-tke flux, depending on wall orientation 
     REAL(wp)     ::  usvs        !< momentum flux u"v"
@@ -3256,11 +3066,11 @@
     INTEGER(iwp) ::  flag_nr !< number of masking flag
 
-    REAL(wp)     ::  def         !<
+    REAL(wp)     ::  def         !< ( du_i/dx_j + du_j/dx_i ) * du_i/dx_j
     REAL(wp)     ::  flag        !< flag to mask topography
-    REAL(wp)     ::  k1          !<
-    REAL(wp)     ::  k2          !<
+    REAL(wp)     ::  k1          !< temporary factor
+    REAL(wp)     ::  k2          !< temporary factor
     REAL(wp)     ::  km_neutral  !< diffusion coefficient assuming neutral conditions - used to compute shear production at surfaces
-    REAL(wp)     ::  theta       !<
-    REAL(wp)     ::  temp        !<
+    REAL(wp)     ::  theta       !< virtual potential temperature
+    REAL(wp)     ::  temp        !< theta * Exner-function
     REAL(wp)     ::  sign_dir    !< sign of wall-tke flux, depending on wall orientation
     REAL(wp)     ::  usvs        !< momentum flux u"v"
@@ -3376,5 +3186,5 @@
        ENDDO
 !
-!--          Compute gradients at east- and west-facing walls
+!--    Compute gradients at east- and west-facing walls
        DO  l = 2, 3
           surf_s = surf_def_v(l)%start_index(j,i)
@@ -3395,5 +3205,5 @@
           ENDDO
 !
-!--             Natural surfaces
+!--       Natural surfaces
           surf_s = surf_lsm_v(l)%start_index(j,i)
           surf_e = surf_lsm_v(l)%end_index(j,i)
@@ -3413,5 +3223,5 @@
           ENDDO
 !
-!--             Urban surfaces
+!--       Urban surfaces
           surf_s = surf_usm_v(l)%start_index(j,i)
           surf_e = surf_usm_v(l)%end_index(j,i)
@@ -3432,5 +3242,5 @@
        ENDDO
 !
-!--          Compute gradients at upward-facing surfaces
+!--    Compute gradients at upward-facing surfaces
        surf_s = surf_def_h(0)%start_index(j,i)
        surf_e = surf_def_h(0)%end_index(j,i)
@@ -3498,5 +3308,5 @@
        IF ( .NOT. diss_production )  THEN
 
-!--       Compute temdency for TKE-production from shear
+!--       Compute tendency for TKE-production from shear
           tend(k,j,i) = tend(k,j,i) + km(k,j,i) * def * flag
 
@@ -3511,5 +3321,4 @@
     ENDDO
 
-
 !
 !-- If required, calculate TKE production by buoyancy
@@ -3522,5 +3331,4 @@
 !--          So far in the ocean no special treatment of density flux
 !--          in the bottom and top surface layer
-
              DO  k = nzb+1, nzt
                 tmp_flux(k) = kh(k,j,i) * ( prho(k+1,j,i) - prho(k-1,j,i) ) * dd2zu(k)
@@ -4266,5 +4074,5 @@
     REAL(wp), DIMENSION(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ::  var  !< temperature
 #else
-    REAL(wp), DIMENSION(:,:,:), POINTER ::  var     !< temperature
+    REAL(wp), DIMENSION(:,:,:), POINTER ::  var  !< temperature
 #endif
 
@@ -4323,5 +4131,5 @@
     REAL(wp), DIMENSION(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ::  var  !< temperature
 #else
-    REAL(wp), DIMENSION(:,:,:), POINTER ::  var     !< temperature
+    REAL(wp), DIMENSION(:,:,:), POINTER ::  var  !< temperature
 #endif
 
@@ -4376,11 +4184,11 @@
                 surf_usm_h, surf_usm_v
 
-    INTEGER(iwp) ::  i                   !< loop index
-    INTEGER(iwp) ::  j                   !< loop index
-    INTEGER(iwp) ::  k                   !< loop index
-    INTEGER(iwp) ::  m                   !< loop index
-    INTEGER(iwp) ::  n                   !< loop index
-
-    REAL(wp) ::  var_reference       !< reference temperature
+    INTEGER(iwp) ::  i          !< loop index
+    INTEGER(iwp) ::  j          !< loop index
+    INTEGER(iwp) ::  k          !< loop index
+    INTEGER(iwp) ::  m          !< loop index
+    INTEGER(iwp) ::  n          !< loop index
+
+    REAL(wp) ::  var_reference  !< reference temperature
 
 #if defined( __nopointer )
@@ -4718,5 +4526,5 @@
     REAL(wp)     ::  dwdz        !< Gradient of w-component in z-direction
 
-    REAL(wp)     ::  flag                !< topography flag
+    REAL(wp)     ::  flag        !< topography flag
     
     REAL(wp)     ::  uc(-1:1,-1:1)  !< u on grid center
Index: palm/trunk/TESTS/cases/rans_tkee/INPUT/rans_tkee_p3d
===================================================================
--- palm/trunk/TESTS/cases/rans_tkee/INPUT/rans_tkee_p3d	(revision 3543)
+++ palm/trunk/TESTS/cases/rans_tkee/INPUT/rans_tkee_p3d	(revision 3545)
@@ -27,5 +27,4 @@
          time_utc_init    = 0.0,
 
-         rans_mode = .T.,
          turbulence_closure = 'TKE-e',
 
