Index: /palm/trunk/SOURCE/land_surface_model_mod.f90
===================================================================
--- /palm/trunk/SOURCE/land_surface_model_mod.f90	(revision 3221)
+++ /palm/trunk/SOURCE/land_surface_model_mod.f90	(revision 3222)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! - Introduction of surface array for type and its names
+! - Bugfix in intialization of pavement surfaces
+! 
+! 3215 2018-08-29 09:58:59Z suehring
 ! Enable optional initialization of soil properties directly from dynamic 
 ! input file.
@@ -2600,5 +2604,5 @@
 
              surf_lsm_v(l)%lambda_w = 0.0_wp 
-          ENDIF      
+          ENDIF     
        ENDDO
 !
@@ -2631,4 +2635,41 @@
           ALLOCATE( surf_lsm_v(l)%building_covered(1:surf_lsm_v(l)%ns) )
        ENDDO
+!
+!--    Allocate arrays for the respective types and their names on the surface
+!--    elements. This will be required to treat deposition of chemical species.
+       ALLOCATE( surf_lsm_h%pavement_type(1:surf_lsm_h%ns)   )
+       ALLOCATE( surf_lsm_h%vegetation_type(1:surf_lsm_h%ns) )
+       ALLOCATE( surf_lsm_h%water_type(1:surf_lsm_h%ns)      )
+       
+       surf_lsm_h%pavement_type   = 0
+       surf_lsm_h%vegetation_type = 0
+       surf_lsm_h%water_type      = 0
+       
+       ALLOCATE( surf_lsm_h%pavement_type_name(1:surf_lsm_h%ns)   )
+       ALLOCATE( surf_lsm_h%vegetation_type_name(1:surf_lsm_h%ns) )
+       ALLOCATE( surf_lsm_h%water_type_name(1:surf_lsm_h%ns)      )
+       
+       surf_lsm_h%pavement_type_name   = 'none'
+       surf_lsm_h%vegetation_type_name = 'none'
+       surf_lsm_h%water_type_name      = 'none'
+       
+       DO  l = 0, 3
+          ALLOCATE( surf_lsm_v(l)%pavement_type(1:surf_lsm_v(l)%ns)   )
+          ALLOCATE( surf_lsm_v(l)%vegetation_type(1:surf_lsm_v(l)%ns) )
+          ALLOCATE( surf_lsm_v(l)%water_type(1:surf_lsm_v(l)%ns)      )
+          
+          surf_lsm_v(l)%pavement_type   = 0
+          surf_lsm_v(l)%vegetation_type = 0
+          surf_lsm_v(l)%water_type      = 0
+       
+          ALLOCATE( surf_lsm_v(l)%pavement_type_name(1:surf_lsm_v(l)%ns)   )
+          ALLOCATE( surf_lsm_v(l)%vegetation_type_name(1:surf_lsm_v(l)%ns) )
+          ALLOCATE( surf_lsm_v(l)%water_type_name(1:surf_lsm_v(l)%ns)      )
+       
+          surf_lsm_v(l)%pavement_type_name   = 'none'
+          surf_lsm_v(l)%vegetation_type_name = 'none'
+          surf_lsm_v(l)%water_type_name      = 'none'       
+       ENDDO
+       
 !
 !--    Set flag parameter for the prescribed surface type depending on user 
@@ -3134,4 +3175,7 @@
              surf_lsm_h%albedo_type(ind_veg_wall,m) = albedo_type
              surf_lsm_h%emissivity(ind_veg_wall,m)  = emissivity
+             
+             surf_lsm_h%vegetation_type(m)      = vegetation_type
+             surf_lsm_h%vegetation_type_name(m) = vegetation_type_name(vegetation_type)
           ELSE
              surf_lsm_h%lai(m)   = 0.0_wp
@@ -3160,4 +3204,7 @@
                 surf_lsm_v(l)%albedo_type(ind_veg_wall,m) = albedo_type
                 surf_lsm_v(l)%emissivity(ind_veg_wall,m)  = emissivity
+                
+                surf_lsm_v(l)%vegetation_type(m)      = vegetation_type
+                surf_lsm_v(l)%vegetation_type_name(m) = vegetation_type_name(vegetation_type)
              ELSE
                 surf_lsm_v(l)%lai(m)   = 0.0_wp
@@ -3195,4 +3242,7 @@
                 surf_lsm_h%albedo_type(ind_veg_wall,m) = INT( vegetation_pars(ind_v_at,st) )
                 surf_lsm_h%emissivity(ind_veg_wall,m)  = vegetation_pars(ind_v_emis,st)
+                
+                surf_lsm_h%vegetation_type(m)      = st
+                surf_lsm_h%vegetation_type_name(m) = vegetation_type_name(st)
              ENDIF
           ENDDO
@@ -3221,4 +3271,7 @@
                    surf_lsm_v(l)%albedo_type(ind_veg_wall,m) = INT( vegetation_pars(ind_v_at,st) )
                    surf_lsm_v(l)%emissivity(ind_veg_wall,m)  = vegetation_pars(ind_v_emis,st)
+                   
+                   surf_lsm_v(l)%vegetation_type(m)      = st
+                   surf_lsm_v(l)%vegetation_type_name(m) = vegetation_type_name(st)
                 ENDIF
              ENDDO
@@ -3423,4 +3476,7 @@
              surf_lsm_h%albedo_type(ind_wat_win,m) = albedo_type
              surf_lsm_h%emissivity(ind_wat_win,m)  = emissivity
+             
+             surf_lsm_h%water_type(m)      = water_type
+             surf_lsm_h%water_type_name(m) = water_type_name(water_type)
           ENDIF
        ENDDO
@@ -3441,4 +3497,7 @@
                 surf_lsm_v(l)%albedo_type(ind_wat_win,m) = albedo_type
                 surf_lsm_v(l)%emissivity(ind_wat_win,m)  = emissivity
+                
+                surf_lsm_v(l)%water_type(m)      = water_type
+                surf_lsm_v(l)%water_type_name(m) = water_type_name(water_type)
              ENDIF 
           ENDDO
@@ -3471,4 +3530,7 @@
                 surf_lsm_h%albedo_type(ind_wat_win,m) = INT( water_pars(ind_w_at,st) )
                 surf_lsm_h%emissivity(ind_wat_win,m)  = water_pars(ind_w_emis,st)
+                
+                surf_lsm_h%water_type(m)      = st
+                surf_lsm_h%water_type_name(m) = water_type_name(st)
              ENDIF
           ENDDO
@@ -3498,4 +3560,7 @@
                    surf_lsm_v(l)%emissivity(ind_wat_win,m)  =                  &
                                                   water_pars(ind_w_emis,st)
+                                                  
+                   surf_lsm_v(l)%water_type(m)      = st
+                   surf_lsm_v(l)%water_type_name(m) = water_type_name(st)
                 ENDIF
              ENDDO
@@ -3694,4 +3759,7 @@
              surf_lsm_h%albedo_type(ind_pav_green,m) = albedo_type
              surf_lsm_h%emissivity(ind_pav_green,m)  = emissivity      
+             
+             surf_lsm_h%pavement_type(m)      = pavement_type
+             surf_lsm_h%pavement_type_name(m) = pavement_type_name(pavement_type)
       
              IF ( pavement_type /= 0 )  THEN
@@ -3703,6 +3771,6 @@
                 ENDDO
              ELSE
-                surf_lsm_v(l)%lambda_h_def(:,m)     = pavement_heat_conduct
-                surf_lsm_v(l)%rho_c_total_def(:,m)  = pavement_heat_capacity
+                surf_lsm_h%lambda_h_def(:,m)     = pavement_heat_conduct
+                surf_lsm_h%rho_c_total_def(:,m)  = pavement_heat_capacity
              ENDIF        
           ENDIF
@@ -3729,4 +3797,7 @@
                 surf_lsm_v(l)%albedo_type(ind_pav_green,m) = albedo_type
                 surf_lsm_v(l)%emissivity(ind_pav_green,m)  = emissivity
+                
+                surf_lsm_v(l)%pavement_type(m)      = pavement_type
+                surf_lsm_v(l)%pavement_type_name(m) = pavement_type_name(pavement_type)
 
                 IF ( pavement_type /= 0 )  THEN
@@ -3786,4 +3857,7 @@
                 surf_lsm_h%albedo_type(ind_pav_green,m) = INT( pavement_pars(ind_p_at,st) )
                 surf_lsm_h%emissivity(ind_pav_green,m)  = pavement_pars(ind_p_emis,st)  
+                
+                surf_lsm_h%pavement_type(m)      = st
+                surf_lsm_h%pavement_type_name(m) = pavement_type_name(st)
 
                 DO  k = nzb_soil, surf_lsm_h%nzt_pavement(m)
@@ -3837,5 +3911,8 @@
                                               INT( pavement_pars(ind_p_at,st) )
                    surf_lsm_v(l)%emissivity(ind_pav_green,m)  =                &
-                                              pavement_pars(ind_p_emis,st)    
+                                              pavement_pars(ind_p_emis,st)  
+                                              
+                   surf_lsm_v(l)%pavement_type(m)      = st
+                   surf_lsm_v(l)%pavement_type_name(m) = pavement_type_name(st)
                                               
                    DO  k = nzb_soil, surf_lsm_v(l)%nzt_pavement(m)
Index: /palm/trunk/SOURCE/surface_mod.f90
===================================================================
--- /palm/trunk/SOURCE/surface_mod.f90	(revision 3221)
+++ /palm/trunk/SOURCE/surface_mod.f90	(revision 3222)
@@ -26,4 +26,8 @@
 ! -----------------
 ! $Id$
+! +building_type, pavement_type, vegetation_type, water_type
+! +building_type_name, pavement_type_name, vegetation_type_name, water_type_name 
+! 
+! 3176 2018-07-26 17:12:48Z suehring
 ! Bugfix in restarts for surface elements.
 ! 
@@ -290,5 +294,15 @@
 !
 !--    Variables required for LSM as well as for USM
-       INTEGER(iwp), DIMENSION(:), ALLOCATABLE   ::  nzt_pavement  !< top index for pavement in soil
+       CHARACTER(LEN=40), DIMENSION(:), ALLOCATABLE ::  building_type_name    !< building type name at surface element
+       CHARACTER(LEN=40), DIMENSION(:), ALLOCATABLE ::  pavement_type_name    !< pavement type name at surface element
+       CHARACTER(LEN=40), DIMENSION(:), ALLOCATABLE ::  vegetation_type_name  !< water type at name surface element
+       CHARACTER(LEN=40), DIMENSION(:), ALLOCATABLE ::  water_type_name       !< water type at name surface element
+       
+       INTEGER(iwp), DIMENSION(:), ALLOCATABLE ::  nzt_pavement     !< top index for pavement in soil
+       INTEGER(iwp), DIMENSION(:), ALLOCATABLE ::  building_type    !< building type at surface element
+       INTEGER(iwp), DIMENSION(:), ALLOCATABLE ::  pavement_type    !< pavement type at surface element
+       INTEGER(iwp), DIMENSION(:), ALLOCATABLE ::  vegetation_type  !< vegetation type at surface element
+       INTEGER(iwp), DIMENSION(:), ALLOCATABLE ::  water_type       !< water type at surface element
+       
        INTEGER(iwp), DIMENSION(:,:), ALLOCATABLE ::  albedo_type   !< albedo type, for each fraction (wall,green,window or vegetation,pavement water)
 
@@ -298,5 +312,5 @@
        LOGICAL, DIMENSION(:), ALLOCATABLE  ::  water_surface       !< flag parameter for water surfaces
        LOGICAL, DIMENSION(:), ALLOCATABLE  ::  vegetation_surface  !< flag parameter for natural land surfaces
-
+       
        REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  albedo            !< broadband albedo for each surface fraction (LSM: vegetation, water, pavement; USM: wall, green, window)
        REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  emissivity        !< emissivity of the surface, for each fraction  (LSM: vegetation, water, pavement; USM: wall, green, window)
Index: /palm/trunk/SOURCE/urban_surface_mod.f90
===================================================================
--- /palm/trunk/SOURCE/urban_surface_mod.f90	(revision 3221)
+++ /palm/trunk/SOURCE/urban_surface_mod.f90	(revision 3222)
@@ -28,4 +28,7 @@
 ! -----------------
 ! $Id$
+! Introduction of surface array for type and its name
+! 
+! 3203 2018-08-23 10:48:36Z suehring
 ! Revise bulk parameter for emissivity at ground-floor level
 ! 
@@ -886,7 +889,15 @@
        
 !--     allocate array of wall types and wall parameters
-        ALLOCATE ( surf_usm_h%surface_types(1:surf_usm_h%ns) )
+        ALLOCATE ( surf_usm_h%surface_types(1:surf_usm_h%ns)      )
+        ALLOCATE ( surf_usm_h%building_type(1:surf_usm_h%ns)      )
+        ALLOCATE ( surf_usm_h%building_type_name(1:surf_usm_h%ns) )
+        surf_usm_h%building_type = 0
+        surf_usm_h%building_type = 'none'
         DO  l = 0, 3
            ALLOCATE( surf_usm_v(l)%surface_types(1:surf_usm_v(l)%ns) )
+           ALLOCATE ( surf_usm_v(l)%building_type(1:surf_usm_v(l)%ns)      )
+           ALLOCATE ( surf_usm_v(l)%building_type_name(1:surf_usm_v(l)%ns) )
+           surf_usm_v(l)%building_type = 0
+           surf_usm_v(l)%building_type = 'none'
         ENDDO
 !
@@ -3752,4 +3763,8 @@
                                      surf_usm_h%ground_level(m) )
 !
+!--        Store building type and its name on each surface element
+           surf_usm_h%building_type(m)      = building_type
+           surf_usm_h%building_type_name(m) = building_type_name(building_type)
+!
 !--        Initialize relatvie wall- (0), green- (1) and window (2) fractions
            surf_usm_h%frac(ind_veg_wall,m)  = building_pars(ind_wall_frac,building_type)   
@@ -3869,5 +3884,8 @@
               ind_z0qh         = MERGE( ind_z0qh_gfl,         ind_z0qh_agfl,         &
                                         surf_usm_v(l)%ground_level(m) )
-
+!
+!--           Store building type and its name on each surface element
+              surf_usm_v(l)%building_type(m)      = building_type
+              surf_usm_v(l)%building_type_name(m) = building_type_name(building_type)
 !
 !--           Initialize relatvie wall- (0), green- (1) and window (2) fractions
@@ -3999,5 +4017,8 @@
                  ind_z0qh         = MERGE( ind_z0qh_gfl,         ind_z0qh_agfl,         &
                                            surf_usm_h%ground_level(m) )
-
+!
+!--              Store building type and its name on each surface element
+                 surf_usm_h%building_type(m)      = st
+                 surf_usm_h%building_type_name(m) = building_type_name(st)
 !
 !--              Initialize relatvie wall- (0), green- (1) and window (2) fractions
@@ -4127,5 +4148,8 @@
                     ind_z0qh         = MERGE( ind_z0qh_gfl,         ind_z0qh_agfl,         &
                                               surf_usm_v(l)%ground_level(m) )
-
+!
+!--                 Store building type and its name on each surface element
+                    surf_usm_v(l)%building_type(m)      = st
+                    surf_usm_v(l)%building_type_name(m) = building_type_name(st)
 !
 !--                 Initialize relatvie wall- (0), green- (1) and window (2) fractions
@@ -4210,5 +4234,5 @@
            ENDDO
         ENDIF 
-
+        
 !
 !--     Level 3 - initialization via building_pars read from file
