Index: palm/trunk/SOURCE/biometeorology_mod.f90
===================================================================
--- palm/trunk/SOURCE/biometeorology_mod.f90	(revision 3611)
+++ palm/trunk/SOURCE/biometeorology_mod.f90	(revision 3614)
@@ -27,4 +27,7 @@
 ! -----------------
 ! $Id$
+! unused variables removed
+! 
+! 3593 2018-12-03 13:51:13Z kanani
 ! Bugfix: additional tmrt_grid allocation in case bio_mrt not selected as ouput,
 ! replace degree symbol by degree_C
@@ -157,5 +160,4 @@
     LOGICAL ::  aver_v     = .FALSE.  !< switch: do v  averaging in this module?
     LOGICAL ::  aver_w     = .FALSE.  !< switch: do w  averaging in this module?
-    LOGICAL ::  aver_mrt   = .FALSE.  !< switch: do mrt averaging in this module?
     LOGICAL ::  average_trigger_perct = .FALSE.  !< update averaged input on call to bio_perct?
     LOGICAL ::  average_trigger_utci  = .FALSE.  !< update averaged input on call to bio_utci?
@@ -1076,7 +1078,6 @@
         ONLY: message_string
 
-    USE netcdf_data_input_mod,                                                &
-        ONLY:  netcdf_data_input_uvem, uvem_projarea_f, uvem_radiance_f,      &
-               uvem_irradiance_f, uvem_integration_f, building_obstruction_f
+    USE netcdf_data_input_mod,                                                 &
+        ONLY:  netcdf_data_input_uvem
 
     IMPLICIT NONE
@@ -3930,5 +3931,5 @@
 
     USE indices,                                                                                                      &
-        ONLY:  nxlg, nxrg, nyng, nysg, nys, nyn, nxl, nxr 
+        ONLY:  nys, nyn, nxl, nxr
     
     
@@ -4034,6 +4035,6 @@
 !                                                
 !                                                
-       DO  i = nxl, nxr    !nxlg, nxrg
-          DO  j = nys, nyn    !nysg, nyng 
+       DO  i = nxl, nxr
+          DO  j = nys, nyn
 !                   
 ! !--        extract obstruction from IBSET-Integer_Array ------------------'
Index: palm/trunk/SOURCE/chem_photolysis_mod.f90
===================================================================
--- palm/trunk/SOURCE/chem_photolysis_mod.f90	(revision 3611)
+++ palm/trunk/SOURCE/chem_photolysis_mod.f90	(revision 3614)
@@ -26,4 +26,7 @@
 ! -----------------
 ! $Id$
+! unused variables removed
+! 
+! 3298 2018-10-02 12:21:11Z kanani
 ! Moved USE radiation_model_mod from MODULE section into Subroutine
 ! in order to use constant photolysis without radiation module (forkel)
@@ -136,8 +139,4 @@
 
 
-    REAL(wp) :: time_photolysis = 0.0_wp,         & !< time since last call of photolysis code
-                dt_photolysis = 0.0_wp,           & !< hotolysis model timestep
-                skip_time_do_photolysis = 0.0_wp    !< Radiation model is not called before this time
-
     REAL(wp)     :: cosz = 0.7_wp                   !< cosine of Zenith angle (45 deg, if not specified otherwise)
 
Index: palm/trunk/SOURCE/date_and_time_mod.f90
===================================================================
--- palm/trunk/SOURCE/date_and_time_mod.f90	(revision 3611)
+++ palm/trunk/SOURCE/date_and_time_mod.f90	(revision 3614)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! further tabs removed
+! 
+! 3467 2018-10-30 19:05:21Z suehring
 ! Tabs removed
 ! 
@@ -509,15 +512,16 @@
     SELECT CASE(TRIM(daytype_mdh))
 
-		   CASE ("workday")
-	       
-	           index_hh = nmonth+ nday + hh 
-
-		   CASE ("weekend")
-	       
-	           index_hh = nmonth+ nday + nhour + hh 
-
-		   CASE ("holiday")
-	       
-	           index_hh = nmonth+ nday + 2*nhour + hh 
+       CASE ("workday")
+       
+          index_hh = nmonth+ nday + hh 
+
+       CASE ("weekend")
+       
+          index_hh = nmonth+ nday + nhour + hh 
+
+       CASE ("holiday")
+       
+          index_hh = nmonth+ nday + 2*nhour + hh 
+
     END SELECT
 
@@ -566,11 +570,11 @@
     ELSE 
 
-    DO i_mon=1,index_mm
-       
-       sum_dd=sum_dd+days(i_mon)
-
-    ENDDO
+       DO i_mon=1,index_mm
+
+         sum_dd=sum_dd+days(i_mon)
+
+       ENDDO
       
-    index_hh=(sum_dd*nhour)+(index_dd*nhour)+(hh)
+       index_hh=(sum_dd*nhour)+(index_dd*nhour)+(hh)
 
     ENDIF
Index: palm/trunk/SOURCE/large_scale_forcing_nudging_mod.f90
===================================================================
--- palm/trunk/SOURCE/large_scale_forcing_nudging_mod.f90	(revision 3611)
+++ palm/trunk/SOURCE/large_scale_forcing_nudging_mod.f90	(revision 3614)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! unused variables removed
+! 
+! 3428 2018-10-25 12:32:05Z gronemeier
 ! Rename td_XXX_lpt to td_XXX_thetal
 ! 
@@ -456,7 +459,4 @@
     SUBROUTINE lsf_init
 
-       USE control_parameters,                                                 &
-           ONLY:  bc_lr_cyc, bc_ns_cyc
-
        IMPLICIT NONE
 
Index: palm/trunk/SOURCE/netcdf_data_input_mod.f90
===================================================================
--- palm/trunk/SOURCE/netcdf_data_input_mod.f90	(revision 3611)
+++ palm/trunk/SOURCE/netcdf_data_input_mod.f90	(revision 3614)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! unused variables removed
+! 
+! 3560 2018-11-23 09:20:21Z raasch
 ! Some formatting adjustment
 ! 
@@ -1267,6 +1270,5 @@
 
        USE chem_modules,                                       &
-           ONLY:  do_emis, mode_emis, time_fac_type,           & 
-                  surface_csflux_name 
+           ONLY:  mode_emis, time_fac_type, surface_csflux_name
 
        USE control_parameters,                                 &
@@ -1274,5 +1276,5 @@
 
        USE indices,                                            &
-           ONLY:  nz, nx, ny, nxl, nxr, nys, nyn, nzb, nzt
+           ONLY:  nx, ny, nxl, nxr, nys, nyn
 
        IMPLICIT NONE
@@ -1281,18 +1283,8 @@
        TYPE(chem_emis_val_type), ALLOCATABLE, DIMENSION(:), INTENT(INOUT)             :: emt
     
-       CHARACTER (LEN=80)                               :: units=''              !< units of chemistry inputs
- 
        INTEGER(iwp)                                     :: ispec                 !< index for number of emission species in input
 
-       INTEGER(iwp), ALLOCATABLE, DIMENSION(:)          :: dum_var               !< value of variable read from netcdf input
-       INTEGER(iwp)                                     :: errno                 !< error number NF90_???? function
-       INTEGER(iwp)                                     :: id_var                !< variable id
-!       INTEGER(iwp)                                     :: id_emis               !< NetCDF id of input file
        INTEGER(iwp)                                     :: num_vars              !< number of variables in netcdf input file
-       INTEGER(iwp)                                     :: len_dims,len_dims_2   !< Length of dimensions
-
-       INTEGER(iwp)                                     :: max_string_length=25  !< Variable for the maximum length of a string
- 
-       CHARACTER(LEN=100), DIMENSION(:), ALLOCATABLE    :: var_names             !< Name of Variables
+       INTEGER(iwp)                                     :: len_dims              !< Length of dimension
 
        REAL(wp), ALLOCATABLE, DIMENSION(:,:,:)          :: dum_var_3d            !< variable for storing temporary data of 3-dimensional 
@@ -1562,9 +1554,8 @@
 
        USE control_parameters,                                                 &
-           ONLY:  bc_lr_cyc, bc_ns_cyc, land_surface, plant_canopy,            &
-                  urban_surface
+           ONLY:  land_surface, plant_canopy, urban_surface
 
        USE indices,                                                            &
-           ONLY:  nbgp, nx, nxl, nxr,ny, nyn, nys
+           ONLY:  nbgp, nxl, nxr, nyn, nys
 
 
@@ -2406,8 +2397,8 @@
 
        USE control_parameters,                                                 &
-           ONLY:  bc_lr_cyc, bc_ns_cyc, message_string, topography
+           ONLY:  message_string, topography
 
        USE indices,                                                            &
-           ONLY:  nbgp, nx, nxl, nxr, ny, nyn, nys, nzb
+           ONLY:  nbgp, nxl, nxr, ny, nyn, nys, nzb
 
 
Index: palm/trunk/SOURCE/ocean_mod.f90
===================================================================
--- palm/trunk/SOURCE/ocean_mod.f90	(revision 3611)
+++ palm/trunk/SOURCE/ocean_mod.f90	(revision 3614)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! unused variables removed
+! 
+! 3568 2018-11-27 16:07:59Z raasch
 ! bugifx: calculate equation of state for seawater even if salinity is switched
 !         off
@@ -512,7 +515,4 @@
  SUBROUTINE ocean_parin
 
-    USE control_parameters,                                                    &
-        ONLY:  message_string
-
     IMPLICIT NONE
 
@@ -706,5 +706,5 @@
 
     USE control_parameters,                                                    &
-        ONLY:  data_output_pr, message_string
+        ONLY:  data_output_pr
 
     USE indices
@@ -1172,7 +1172,4 @@
     USE indices,                                                               &
         ONLY:  nxlg, nxrg, nyng, nysg, nzb, nzt
-
-    USE pmc_interface,                                                         &
-        ONLY:  nested_run
 
     IMPLICIT NONE
@@ -2160,5 +2157,5 @@
 
     USE indices,                                                               &
-        ONLY:  nxl, nxr, nys, nysv, nyn, nzb, nzt
+        ONLY:  nzb, nzt
 
     IMPLICIT NONE
Index: palm/trunk/SOURCE/plant_canopy_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/plant_canopy_model_mod.f90	(revision 3611)
+++ palm/trunk/SOURCE/plant_canopy_model_mod.f90	(revision 3614)
@@ -27,4 +27,7 @@
 ! -----------------
 ! $Id$
+! unused variables removed
+! 
+! 3589 2018-11-30 15:09:51Z suehring
 ! Formatting adjustments
 ! 
@@ -879,5 +882,5 @@
 
        USE control_parameters,                                                 &
-           ONLY: message_string, ocean_mode, urban_surface
+           ONLY: message_string, ocean_mode
 
        USE netcdf_data_input_mod,                                              &
Index: palm/trunk/SOURCE/surface_output_mod.f90
===================================================================
--- palm/trunk/SOURCE/surface_output_mod.f90	(revision 3611)
+++ palm/trunk/SOURCE/surface_output_mod.f90	(revision 3614)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! unused variables removed
+! 
+! 3572 2018-11-28 11:40:28Z suehring
 ! Added short- and longwave radiation flux arrays (e.g. diffuse, direct,
 ! reflected, resedual) for all surfaces (M. Salim)
@@ -166,10 +169,8 @@
 
       INTEGER(iwp) ::  i                 !< grid index in x-direction, also running variable for counting non-average data output
-      INTEGER(iwp) ::  ilen              !< string length
       INTEGER(iwp) ::  j                 !< grid index in y-direction, also running variable for counting average data output
       INTEGER(iwp) ::  k                 !< grid index in z-direction
       INTEGER(iwp) ::  l                 !< running index for surface-element orientation
       INTEGER(iwp) ::  m                 !< running index for surface elements
-      INTEGER(iwp) ::  n_out             !< running index for number of output variables   
       INTEGER(iwp) ::  npg               !< counter variable for all surface elements ( or polygons )
       INTEGER(iwp) ::  point_index_count !< local counter variable for point index
@@ -875,6 +876,4 @@
       INTEGER(iwp) ::  av     !< id indicating average or non-average data output
       INTEGER(iwp) ::  i      !< loop index
-      INTEGER(iwp) ::  l      !< running index for surface-element orientation
-      INTEGER(iwp) ::  m      !< running index for surface elements
       INTEGER(iwp) ::  n_out  !< counter variables for surface output
 
@@ -2264,6 +2263,4 @@
       CHARACTER(LEN=100) ::  trimvar !< dummy variable for current output variable
        
-      INTEGER(iwp) ::  l      !< running index for surface-element orientation
-      INTEGER(iwp) ::  m      !< running index for surface elements
       INTEGER(iwp) ::  n_out  !< counter variables for surface output
       
@@ -3513,7 +3510,4 @@
     SUBROUTINE surface_output_parin
 
-       USE control_parameters,                                                 &
-           ONLY:  message_string
-
        IMPLICIT NONE
 
@@ -3565,7 +3559,5 @@
 
        USE control_parameters,                                                 &
-           ONLY:  averaging_interval, dt_data_output, dt_data_output_av,       &
-                  message_string, skip_time_data_output,                       &
-                  skip_time_data_output_av
+           ONLY:  averaging_interval, dt_data_output, message_string
 
        IMPLICIT NONE
Index: palm/trunk/SOURCE/urban_surface_mod.f90
===================================================================
--- palm/trunk/SOURCE/urban_surface_mod.f90	(revision 3611)
+++ palm/trunk/SOURCE/urban_surface_mod.f90	(revision 3614)
@@ -28,4 +28,7 @@
 ! -----------------
 ! $Id$
+! unused variables removed
+! 
+! 3607 2018-12-07 11:56:58Z suehring
 ! Output of radiation-related quantities migrated to radiation_model_mod.
 ! 
@@ -960,19 +963,4 @@
 
 
-!-- arrays for time averages
-!-- Attention: the variable rad_net_av is also used in the 3d field variable in radiation_model_mod.f90. It may be better to rename it 
-    REAL(wp), DIMENSION(:), ALLOCATABLE            ::  wghf_eb_av       !< average of wghf_eb
-    REAL(wp), DIMENSION(:), ALLOCATABLE            ::  wshf_eb_av       !< average of wshf_eb
-    REAL(wp), DIMENSION(:,:), ALLOCATABLE          ::  t_wall_av        !< Average of t_wall
-    REAL(wp), DIMENSION(:), ALLOCATABLE            ::  wghf_eb_green_av !< average of wghf_eb_green
-    REAL(wp), DIMENSION(:,:), ALLOCATABLE          ::  t_green_av       !< Average of t_green
-    REAL(wp), DIMENSION(:), ALLOCATABLE            ::  wghf_eb_window_av !< average of wghf_eb_window
-    REAL(wp), DIMENSION(:,:), ALLOCATABLE          ::  t_window_av      !< Average of t_window
-    REAL(wp), DIMENSION(:), ALLOCATABLE            ::  qsws_eb_av       !< average of qsws_eb
-    REAL(wp), DIMENSION(:), ALLOCATABLE            ::  qsws_veg_av   !< average of qsws_veg
-    REAL(wp), DIMENSION(:), ALLOCATABLE            ::  qsws_liq_av   !< average of qsws_liq
-    REAL(wp), DIMENSION(:,:), ALLOCATABLE          ::  swc_av        !< Average of swc
-    
-
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !-- anthropogenic heat sources
@@ -1061,12 +1049,4 @@
     
 #endif
-    REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_wall_av          !< average of wall surface temperature (K)
-    REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_window_av   !< average of window surface temperature (K)
-    REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_green_av    !< average of green wall surface temperature (K)
-
-!-- Temporal tendencies for time stepping            
-    REAL(wp), DIMENSION(:), ALLOCATABLE            :: tt_surface_wall_m       !< surface temperature tendency of wall (K)
-    REAL(wp), DIMENSION(:), ALLOCATABLE            :: tt_surface_window_m !< surface temperature tendency of window (K)
-    REAL(wp), DIMENSION(:), ALLOCATABLE            :: tt_surface_green_m !< surface temperature tendency of green wall (K)
 
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -1077,11 +1057,8 @@
 #if defined( __nopointer )
     REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: t_wall_h             !< Wall temperature (K)
-    REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: t_wall_h_av          !< Average of t_wall
     REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: t_wall_h_p           !< Prog. wall temperature (K)
     REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: t_window_h           !< Window temperature (K)
-    REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: t_window_h_av        !< Average of t_window
     REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: t_window_h_p         !< Prog. window temperature (K)
     REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: t_green_h            !< Green temperature (K)
-    REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: t_green_h_av         !< Average of t_green
     REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: t_green_h_p          !< Prog. green temperature (K)
     REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: swc_h              !< soil water content green building layer
@@ -1096,23 +1073,19 @@
 
     TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: t_wall_v             !< Wall temperature (K)
-    TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: t_wall_v_av          !< Average of t_wall
     TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: t_wall_v_p           !< Prog. wall temperature (K)
     TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: t_window_v           !< Window temperature (K)
-    TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: t_window_v_av        !< Average of t_window
     TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: t_window_v_p         !< Prog. window temperature (K)
     TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: t_green_v            !< Green temperature (K)
-    TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: t_green_v_av         !< Average of t_green
     TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: t_green_v_p          !< Prog. green temperature (K)
     TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: swc_v             !< Wall swc
-    TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: swc_v_av          !< Average of swc
     TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: swc_v_p           !< Prog. swc
     
 #else
     REAL(wp), DIMENSION(:,:), POINTER                :: t_wall_h, t_wall_h_p
-    REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: t_wall_h_av, t_wall_h_1, t_wall_h_2
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: t_wall_h_1, t_wall_h_2
     REAL(wp), DIMENSION(:,:), POINTER                :: t_window_h, t_window_h_p
-    REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: t_window_h_av, t_window_h_1, t_window_h_2
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: t_window_h_1, t_window_h_2
     REAL(wp), DIMENSION(:,:), POINTER                :: t_green_h, t_green_h_p
-    REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: t_green_h_av, t_green_h_1, t_green_h_2
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: t_green_h_1, t_green_h_2
     REAL(wp), DIMENSION(:,:), POINTER                :: swc_h, rootfr_h, wilt_h, fc_h, swc_sat_h, swc_h_p, swc_res_h
     REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET    :: swc_h_1, rootfr_h_1, &
@@ -1121,17 +1094,12 @@
 
     TYPE(t_wall_vertical), DIMENSION(:), POINTER   :: t_wall_v, t_wall_v_p
-    TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: t_wall_v_av, t_wall_v_1, t_wall_v_2
+    TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: t_wall_v_1, t_wall_v_2
     TYPE(t_wall_vertical), DIMENSION(:), POINTER   :: t_window_v, t_window_v_p
-    TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: t_window_v_av, t_window_v_1, t_window_v_2
+    TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: t_window_v_1, t_window_v_2
     TYPE(t_wall_vertical), DIMENSION(:), POINTER   :: t_green_v, t_green_v_p
-    TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: t_green_v_av, t_green_v_1, t_green_v_2
+    TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: t_green_v_1, t_green_v_2
     TYPE(t_wall_vertical), DIMENSION(:), POINTER   :: swc_v, swc_v_p
-    TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: swc_v_av, swc_v_1, swc_v_2
+    TYPE(t_wall_vertical), DIMENSION(0:3), TARGET  :: swc_v_1, swc_v_2
 #endif
-
-!-- Wall temporal tendencies for time stepping
-    REAL(wp), DIMENSION(:,:), ALLOCATABLE          :: tt_wall_m          !< t_wall prognostic array 
-    REAL(wp), DIMENSION(:,:), ALLOCATABLE          :: tt_window_m        !< t_window prognostic array 
-    REAL(wp), DIMENSION(:,:), ALLOCATABLE          :: tt_green_m         !< t_green prognostic array 
 
 !-- Surface and material parameters classes (surface_type)
@@ -2850,5 +2818,5 @@
         REAL(wp), DIMENSION(nzb:nzt+1,nys:nyn,nxl:nxr)     ::  temp_pf    !< temp array for urban surface output procedure
         
-        CHARACTER (len=varnamelength)                          :: var, surfid
+        CHARACTER (len=varnamelength)                          :: var
         INTEGER(iwp), PARAMETER                                :: nd = 5
         CHARACTER(len=6), DIMENSION(0:nd-1), PARAMETER         :: dirname = (/ '_roof ', '_south', '_north', '_west ', '_east ' /)
@@ -2856,6 +2824,6 @@
         INTEGER(iwp), DIMENSION(0:nd-1), PARAMETER             :: diridx =  (/       -1,        1,        0,        3,        2 /)
                                                                      !< index for surf_*_v: 0:3 = (North, South, East, West)
-        INTEGER(iwp)                                           :: ids,idsint,idsidx,isurf,isvf,isurfs,isurflt,ipcgb
-        INTEGER(iwp)                                           :: is,js,ks,i,j,k,iwl,istat, l, m
+        INTEGER(iwp)                                           :: ids,idsint,idsidx,isvf
+        INTEGER(iwp)                                           :: i,j,k,iwl,istat, l, m
 
         found = .TRUE.
@@ -7499,5 +7467,5 @@
         INTEGER(iwp), DIMENSION(0:17, nysg:nyng, nxlg:nxrg)   :: usm_par
         REAL(wp), DIMENSION(1:14, nysg:nyng, nxlg:nxrg)       :: usm_val
-        INTEGER(iwp)                                          :: k, l, d, iw, jw, kw, it, ip, ii, ij, m
+        INTEGER(iwp)                                          :: k, l, iw, jw, kw, it, ip, ii, ij, m
         INTEGER(iwp)                                          :: i, j
         INTEGER(iwp)                                          :: nz, roof, dirwe, dirsn
@@ -8145,5 +8113,5 @@
         IMPLICIT NONE
 
-        INTEGER(iwp)                          :: i, j, k, l, d, m   !< running indices
+        INTEGER(iwp)                          :: i, j, k, l, m   !< running indices
         
         INTEGER(iwp) ::  i_off     !< offset to determine index of surface element, seen from atmospheric grid point, for x
@@ -8153,5 +8121,4 @@
         LOGICAL                               :: spinup             !true during spinup
         
-        REAL(wp)                              :: u1,v1,w1           !< near wall u,v,w
         REAL(wp)                              :: stend_wall              !< surface tendency
         
