Index: /palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90
===================================================================
--- /palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90	(revision 3774)
+++ /palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90	(revision 3775)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! removed unused variables
+! 
+! 3719 2019-02-06 13:10:18Z kanani
 ! Removed log_point measurement from stg_init, since this part is counted to
 ! log_point(2) 'initialisation' already. Moved other log_points to calls of
@@ -520,5 +523,5 @@
 
     USE arrays_3d,                                                             &
-        ONLY:  dzw, ddzw, u_init, v_init, zu
+        ONLY:  ddzw, u_init, v_init
 
     USE control_parameters,                                                    &
@@ -526,5 +529,5 @@
 
     USE grid_variables,                                                        &
-        ONLY:  ddx, ddy, dx, dy
+        ONLY:  ddy
 
     USE indices,                                                               &
@@ -558,7 +561,4 @@
     REAL(wp) :: d3      !< w profile
     REAL(wp) :: d5      !< e profile
-    REAL(wp) :: d11     !< vertical interpolation for a11
-    REAL(wp) :: d21     !< vertical interpolation for a21
-    REAL(wp) :: d22     !< vertical interpolation for a22
     REAL(wp) :: luy     !< length scale for u in y direction
     REAL(wp) :: luz     !< length scale for u in z direction
@@ -1055,5 +1055,5 @@
 
     USE control_parameters,                                                    &
-        ONLY:  child_domain, dt_3d, intermediate_timestep_count,               &
+        ONLY:  child_domain, dt_3d,                                            &
                nesting_offline, rans_mode, time_since_reference_point,         &
                volume_flow_initial
@@ -1064,7 +1064,4 @@
     USE indices,                                                               &
         ONLY:  wall_flags_0
-
-    USE statistics,                                                            &
-        ONLY:  weight_substep
 
     USE pmc_interface,                                                         &
@@ -1086,5 +1083,5 @@
 !
 !-- Calculate time step which is needed for filter functions
-    dt_stg = MAX( dt_3d, dt_stg_call ) !* weight_substep(intermediate_timestep_count)
+    dt_stg = MAX( dt_3d, dt_stg_call )
 !
 !-- Initial value of fu, fv, fw
@@ -1826,7 +1823,4 @@
 
     IMPLICIT NONE
-    
-    INTEGER(iwp) ::  k
-
 
 !
@@ -1876,11 +1870,8 @@
 
     USE arrays_3d,                                                             &
-        ONLY:  dzw, ddzw, u_init, v_init, zu, zw
+        ONLY:  dzw, ddzw, u_init, v_init
 
     USE grid_variables,                                                        &
         ONLY:  ddx, ddy, dx, dy
-        
-    USE statistics,                                                            &
-        ONLY:  hom
 
     IMPLICIT NONE
@@ -1985,5 +1976,5 @@
     USE control_parameters,                                                    &
         ONLY:  bc_dirichlet_l, bc_dirichlet_n, bc_dirichlet_r, bc_dirichlet_s, &
-               humidity, pt_surface
+               pt_surface
              
     USE indices,                                                               &
@@ -2007,5 +1998,4 @@
     REAL(wp) ::  u_int                  !< u-component
     REAL(wp) ::  v_int                  !< v-component
-    REAL(wp) ::  vpt_surface            !< near-surface virtual potential temperature
     REAL(wp) ::  w_convective           !< convective velocity scale
     REAL(wp) ::  z0_mean                !< mean roughness length
Index: /palm/trunk/SOURCE/turbulence_closure_mod.f90
===================================================================
--- /palm/trunk/SOURCE/turbulence_closure_mod.f90	(revision 3774)
+++ /palm/trunk/SOURCE/turbulence_closure_mod.f90	(revision 3775)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! removed unused variables
+! 
+! 3724 2019-02-06 16:28:23Z kanani
 ! Correct double-used log_point_s units
 ! 
@@ -1228,5 +1231,5 @@
 
     USE control_parameters,                                                    &
-        ONLY:  bc_lr_cyc, bc_ns_cyc, f, message_string, wall_adjustment_factor
+        ONLY:  f, message_string, wall_adjustment_factor
 
     USE grid_variables,                                                        &
@@ -1262,6 +1265,4 @@
 
     INTEGER(KIND=1), DIMENSION(:,:,:), ALLOCATABLE :: vicinity !< contains topography information of the vicinity of (i/j/k)
-
-    INTEGER(iwp), DIMENSION(:,:,:), ALLOCATABLE :: wall_flags_dummy    !< dummy array required for MPI_ALLREDUCE command
 
     REAL(wp) :: radius           !< search radius in meter
@@ -1927,12 +1928,6 @@
  SUBROUTINE tcm_prognostic_equations
 
-    USE arrays_3d,                                                             &
-        ONLY:  ddzu
-
     USE control_parameters,                                                    &
-        ONLY:  f, scalar_advec, tsc
-
-    USE surface_mod,                                                           &
-        ONLY :  surf_def_h
+        ONLY:  scalar_advec, tsc
 
     IMPLICIT NONE
@@ -1941,7 +1936,4 @@
     INTEGER(iwp) ::  j       !< loop index
     INTEGER(iwp) ::  k       !< loop index
-    INTEGER(iwp) ::  m       !< loop index
-    INTEGER(iwp) ::  surf_e  !< end index of surface elements at given i-j position
-    INTEGER(iwp) ::  surf_s  !< start index of surface elements at given i-j position
 
     REAL(wp)     ::  sbt     !< wheighting factor for sub-time step
@@ -3677,4 +3669,5 @@
  SUBROUTINE diffusion_e( var, var_reference )
 
+#ifdef _OPENACC
     USE arrays_3d,                                                             &
         ONLY:  ddzu, dd2zu, ddzw, drho_air, rho_air_zw
@@ -3683,5 +3676,8 @@
         ONLY:  atmos_ocean_sign, use_single_reference_value,                   &
                wall_adjustment, wall_adjustment_factor
-
+#else
+    USE arrays_3d,                                                             &
+        ONLY:  ddzu, ddzw, drho_air, rho_air_zw
+#endif
     USE grid_variables,                                                        &
         ONLY:  ddx2, ddy2
@@ -4433,4 +4429,5 @@
  SUBROUTINE tcm_diffusivities_default( var, var_reference )
  
+#ifdef _OPENACC
     USE arrays_3d,                                                             &
         ONLY:  dd2zu
@@ -4439,4 +4436,5 @@
         ONLY:  atmos_ocean_sign, use_single_reference_value,                   &
                wall_adjustment, wall_adjustment_factor
+#endif
 
     USE statistics,                                                            &
