Index: palm/trunk/SOURCE/salsa_mod.f90
===================================================================
--- palm/trunk/SOURCE/salsa_mod.f90	(revision 3786)
+++ palm/trunk/SOURCE/salsa_mod.f90	(revision 3787)
@@ -26,4 +26,7 @@
 ! -----------------
 ! $Id$
+! unused variables removed
+! 
+! 3780 2019-03-05 11:19:45Z forkel
 ! unused variable for file index removed from rrd-subroutines parameter list
 ! 
@@ -297,5 +300,4 @@
                                 !< if particle water is advected)
     REAL(wp) ::  act_coeff = 1.0E-7_wp     !< Activation coefficient
-    REAL(wp) ::  aerosol_source = 0.0_wp   !< Constant aerosol flux (#/(m3*s))
     REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::  emission_mass_fracs  !< array for 
                                     !< aerosol composition per emission category
@@ -2042,5 +2044,4 @@
     IMPLICIT NONE
     
-    CHARACTER (LEN=20) :: field_char   !< 
     INTEGER(iwp) ::  b  !<    
     INTEGER(iwp) ::  c  !<
@@ -3111,5 +3112,4 @@
     
     INTEGER(iwp) ::  b      !< loop index
-    INTEGER(iwp) ::  c      !< loop index
     REAL(wp) ::  avis       !< molecular viscocity of air (kg/(m*s))
     REAL(wp), PARAMETER ::  c_A = 1.249_wp !< Constants A, B and C for 
@@ -3197,9 +3197,5 @@
     
     INTEGER(iwp) ::  c      !< loop index
-    REAL(wp), PARAMETER ::  c_A = 1.249_wp !< Constants A, B and C for 
-    REAL(wp), PARAMETER ::  c_B = 0.42_wp  !< calculating  the Cunningham  
-    REAL(wp), PARAMETER ::  c_C = 0.87_wp  !< slip-flow correction (Cc)  
-                                           !< according to Jacobson (2005), 
-                                           !< Eq. 15.30
+
     REAL(wp) ::  alpha       !< parameter, Table 3 in Zhang et al. (2001)  
     REAL(wp) ::  depo        !< deposition efficiency
@@ -3450,5 +3446,4 @@
     REAL(wp), INTENT(in) ::  visc    !< molecular viscosity of air (kg/(m*s))
     
-    REAL(wp), PARAMETER ::  rhoa_ref = 1.225_wp ! reference air density (kg/m3)
 !
 !-- Stokes law with Cunningham slip correction factor
@@ -5571,5 +5566,4 @@
     REAL(wp) ::  zcgnh3eqae(nbins)  !< Equilibrium gas concentration: NH3
     REAL(wp) ::  zcgno3eqae(nbins)  !< Equilibrium gas concentration: HNO3
-    REAL(wp) ::  zcgwaeqae(nbins)   !< Equilibrium gas concentration: H2O
     REAL(wp) ::  zcnh3c             !< Current NH3 gas concentration
     REAL(wp) ::  zcnh3int           !< Intermediate NH3 gas concentration
@@ -5670,7 +5664,6 @@
 !
 !-- NH4/HNO3 saturation ratios for aerosols
-    CALL SVsat( ptemp, paero, zacno3ae, zacnh3ae, zacnh4hso2ae, zachhso4ae,    &
-                zcgno3eqae, zcno3cae, zcnh3cae, zkelno3ae, zkelnh3ae,          &
-                zsathno3ae, zsatnh3ae, zmolsae ) 
+    CALL SVsat( ptemp, paero, zacno3ae, zacnh4hso2ae, zachhso4ae, zcgno3eqae,  &
+                zcno3cae, zcnh3cae, zkelno3ae, zkelnh3ae, zsathno3ae, zsatnh3ae )
 !    
 !-- Intermediate concentrations    
@@ -5808,7 +5801,6 @@
 !> Calculate saturation ratios of NH4 and HNO3 for aerosols
 !------------------------------------------------------------------------------!
- SUBROUTINE SVsat( ptemp, ppart, pachno3, pacnh3, pacnh4hso2, pachhso4,        &
-                   pchno3eq, pchno3, pcnh3, pkelhno3, pkelnh3, psathno3,       &
-                   psatnh3, pmols )
+ SUBROUTINE SVsat( ptemp, ppart, pachno3, pacnh4hso2, pachhso4, pchno3eq,      &
+                   pchno3, pcnh3, pkelhno3, pkelnh3, psathno3, psatnh3 )
 
     IMPLICIT NONE
@@ -5819,5 +5811,4 @@
 !-- Activity coefficients
     REAL(wp), INTENT(in) ::  pachhso4(nbins)   !<
-    REAL(wp), INTENT(in) ::  pacnh3(nbins)     !< 
     REAL(wp), INTENT(in) ::  pacnh4hso2(nbins) !<
     REAL(wp), INTENT(in) ::  pachno3(nbins)    !<
@@ -5830,5 +5821,4 @@
     REAL(wp), INTENT(in) ::  pkelhno3(nbins) !< Kelvin effect for HNO3
     REAL(wp), INTENT(in) ::  pkelnh3(nbins)  !< Kelvin effect for NH3
-    REAL(wp), INTENT(in) ::  pmols(nbins,7)
 !-- Saturation ratios
     REAL(wp), INTENT(out) ::  psathno3(nbins) !<
@@ -7035,13 +7025,4 @@
  SUBROUTINE salsa_diagnostics( i, j )
  
-    USE arrays_3d,                                                             &
-        ONLY:  p, pt, zu
-        
-    USE basic_constants_and_equations_mod,                                     &
-        ONLY: g
-    
-    USE control_parameters,                                                    &
-        ONLY:  pt_surface, surface_pressure
-        
     USE cpulog,                                                                &
         ONLY:  cpu_log, log_point_s
@@ -7228,5 +7209,5 @@
         ONLY:  advec_s_up
     USE arrays_3d,                                                             &
-        ONLY:  ddzu, hyp, pt, rdf_sc, tend
+        ONLY:  ddzu, rdf_sc, tend
     USE diffusion_s_mod,                                                       &
         ONLY:  diffusion_s
@@ -7234,5 +7215,5 @@
         ONLY:  wall_flags_0
     USE pegrid,                                                                &
-        ONLY:  threads_per_task, myid     
+        ONLY:  threads_per_task
     USE surface_mod,                                                           &
         ONLY :  surf_def_h, surf_def_v, surf_lsm_h, surf_lsm_v, surf_usm_h,    &
@@ -7912,5 +7893,4 @@
     INTEGER(iwp) ::  j           !< loop index: y-direction
     INTEGER(iwp) ::  k           !< loop index: z-direction
-    INTEGER(iwp) ::  kg          !< loop index: z-direction (gases)
     INTEGER(iwp) ::  n_dt        !< number of time steps in the emission file
     INTEGER(iwp) ::  nc_stat     !< local variable for storing the result of 
@@ -7919,5 +7899,4 @@
     INTEGER(iwp) ::  ncat        !< Number of emission categories 
     INTEGER(iwp) ::  ng_file     !< Number of grid-points in file (gases)  
-    INTEGER(iwp) ::  num_vars    !< number of variables in input file
     INTEGER(iwp) ::  nz_file     !< number of grid-points in file     
     INTEGER(iwp) ::  n           !< loop index
@@ -7938,7 +7917,7 @@
 !-- 1 = traffic, 2 = road dust, 3 = wood combustion, 4 = other 
 !-- Mass fractions: H2SO4, OC, BC, DU, SS, HNO3, NH3
-    CHARACTER(LEN=15), DIMENSION(ndc) ::  cat_name_table = &!< emission category
-                                         (/'road traffic   ','road dust      ',&
-                                           'wood combustion','other          '/)
+!    CHARACTER(LEN=15), DIMENSION(ndc) ::  cat_name_table = &!< emission category
+!                                         (/'road traffic   ','road dust      ',&
+!                                           'wood combustion','other          '/)
     REAL(wp), DIMENSION(ndc) ::  avg_density        !< average density
     REAL(wp), DIMENSION(ndc) ::  conversion_factor  !< unit conversion factor  
@@ -8445,5 +8424,5 @@
  
     USE arrays_3d,                                                             &
-        ONLY: hyp, pt, rho_air_zw
+        ONLY:  rho_air_zw
  
     USE surface_mod,                                                           &
@@ -8455,6 +8434,4 @@
     TYPE(surf_type), INTENT(inout) :: surface  !< respective surface type
     INTEGER(iwp) ::  b  !< loop index
-    INTEGER(iwp) ::  ee  !< loop index
-    INTEGER(iwp) ::  g   !< loop index
     INTEGER(iwp) ::  i   !< loop index
     INTEGER(iwp) ::  j   !< loop index
@@ -8463,5 +8440,4 @@
     INTEGER(iwp) ::  n   !< loop index for emission categories
     INTEGER(iwp) ::  c   !< loop index
-    INTEGER(iwp) ::  ss  !< loop index
     
     DO  m = 1, surface%ns
@@ -8619,10 +8595,8 @@
     TYPE(surf_type), INTENT(inout) ::  surface  !< respective surface type
      
-    INTEGER(iwp) ::  ee !< index: end 
     INTEGER(iwp) ::  i  !< loop index 
     INTEGER(iwp) ::  j  !< loop index
     INTEGER(iwp) ::  k  !< loop index
     INTEGER(iwp) ::  c  !< loop index
-    INTEGER(iwp) ::  ss !<index: start 
     
 !
@@ -9242,4 +9216,7 @@
     REAL(wp), DIMENSION(:,:,:), POINTER ::  to_be_resorted           !< pointer
     
+!
+!-- Next statement is to avoid compiler warning about unused variable. May be removed in future.
+    IF ( two_d )  CONTINUE
     
     found = .TRUE.
Index: palm/trunk/SOURCE/surface_layer_fluxes_mod.f90
===================================================================
--- palm/trunk/SOURCE/surface_layer_fluxes_mod.f90	(revision 3786)
+++ palm/trunk/SOURCE/surface_layer_fluxes_mod.f90	(revision 3787)
@@ -26,4 +26,7 @@
 ! -----------------
 ! $Id$
+! unused variables removed
+! 
+! 3745 2019-02-15 18:57:56Z suehring
 ! Bugfix, missing calculation of 10cm temperature at vertical building walls, 
 ! required for indoor model
@@ -297,5 +300,4 @@
     INTEGER(iwp) ::  k              !< loop index z direction
     INTEGER(iwp) ::  l              !< loop index for surf type
-    INTEGER(iwp) ::  li_bnd  = 7500 !< Lookup table index of the last time step
 
     INTEGER(iwp), PARAMETER ::  num_steps = 15000  !< number of steps in the lookup table
@@ -308,11 +310,6 @@
     LOGICAL      ::  surf_vertical     !< Flag indicating vertical surfaces
 
-    REAL(wp), DIMENSION(0:num_steps-1) :: rib_tab,  & !< Lookup table bulk Richardson number
-                                          ol_tab      !< Lookup table values of L
-
     REAL(wp)     ::  e_s,               & !< Saturation water vapor pressure
                      ol_max = 1.0E6_wp, & !< Maximum Obukhov length
-                     rib_max,           & !< Maximum Richardson number in lookup table
-                     rib_min,           & !< Minimum Richardson number in lookup table
                      z_mo                 !< Height of the constant flux layer where MOST is assumed
 
@@ -726,23 +723,6 @@
        IMPLICIT NONE
 
-       INTEGER(iwp) :: li,         & !< Index for loop to create lookup table
-                       num_steps_n   !< Number of non-stretched zeta steps
-
-       LOGICAL :: terminate_run_l = .FALSE.    !< Flag to terminate run (global)
-
-       REAL(wp), PARAMETER ::  zeta_stretch = -10.0_wp !< Start of stretching in the free convection limit
-                               
-       REAL(wp), DIMENSION(:), ALLOCATABLE :: zeta_tmp
-
-
-       REAL(wp) :: zeta_step,            & !< Increment of zeta
-                   regr      = 1.01_wp,  & !< Stretching factor of zeta_step in the free convection limit
-                   regr_old  = 1.0E9_wp, & !< Stretching factor of last iteration step
-                   z0h_min   = 0.0_wp,   & !< Minimum value of z0h to create table
-                   z0_min    = 0.0_wp      !< Minimum value of z0 to create table
-
 
        CALL location_message( 'initializing surface layer', .FALSE. )
-
 
 !
@@ -1015,5 +995,4 @@
 
        INTEGER(iwp) ::  iter    !< Newton iteration step
-       INTEGER(iwp) ::  li      !< look index
        INTEGER(iwp) ::  m       !< loop variable over all horizontal wall elements 
 
@@ -2016,6 +1995,6 @@
        IMPLICIT NONE
 
-       CHARACTER (LEN = *), INTENT(IN)       :: z_char          !< string identifier to identify z level
-       INTEGER(iwp)                          :: i, j, k, l, m   !< running indices
+       CHARACTER (LEN = *), INTENT(IN)       :: z_char       !< string identifier to identify z level
+       INTEGER(iwp)                          :: i, j, k, m   !< running indices
 
        
