Index: palm/trunk/SOURCE/Makefile
===================================================================
--- palm/trunk/SOURCE/Makefile	(revision 4242)
+++ palm/trunk/SOURCE/Makefile	(revision 4245)
@@ -25,4 +25,7 @@
 # -----------------
 # $Id$
+# Remove no longer needed dependencies on surface_mod
+# 
+# 4227 2019-09-10 18:04:34Z gronemeier
 # Add palm_date_time_mod, remove date_and_time_mod
 #
Index: palm/trunk/SOURCE/indoor_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/indoor_model_mod.f90	(revision 4242)
+++ palm/trunk/SOURCE/indoor_model_mod.f90	(revision 4245)
@@ -26,4 +26,7 @@
 ! -----------------
 ! $Id$
+! 
+! 
+! 4242 2019-09-27 12:59:10Z suehring
 ! Bugfix in array index
 ! 
Index: palm/trunk/SOURCE/init_grid.f90
===================================================================
--- palm/trunk/SOURCE/init_grid.f90	(revision 4242)
+++ palm/trunk/SOURCE/init_grid.f90	(revision 4245)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Store oro_max (building z-offset) in 2D for building surfaces
+! 
+! 4189 2019-08-26 16:19:38Z suehring
 ! - Add check for proper setting of namelist parameter topography
 ! - Set flag to indicate land surfaces in case no topography is provided
@@ -1312,4 +1315,10 @@
        ENDIF
 !
+!--    Allocate array for storing terrain height under buildings
+       IF ( buildings_f%from_file )  THEN
+          ALLOCATE( buildings_f%oro_max(nysg:nyng,nxlg:nxrg) )
+          buildings_f%oro_max = buildings_f%fill1
+       END IF
+!
 !--    Map orography as well as buildings onto grid. 
        DO  i = nxl, nxr
@@ -1325,4 +1334,7 @@
                    nr = MINLOC( ABS( build_ids_final -                         &
                                      building_id_f%var(j,i) ), DIM = 1 )
+!
+!--                Save grid-indexed oro_max
+                   buildings_f%oro_max(j,i) = oro_max(nr)
                 ENDIF
              ENDIF
@@ -1433,4 +1445,7 @@
           ENDDO
        ENDDO
+!
+!--    Horizontal exchange the oro_max array
+       CALL exchange_horiz_2d( buildings_f%oro_max(:,:), nbgp )
 !
 !--    Deallocate temporary arrays required for processing and reading data
Index: palm/trunk/SOURCE/netcdf_data_input_mod.f90
===================================================================
--- palm/trunk/SOURCE/netcdf_data_input_mod.f90	(revision 4242)
+++ palm/trunk/SOURCE/netcdf_data_input_mod.f90	(revision 4245)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Add reading and processing of building_surface_pars
+! 
+! 4226 2019-09-10 17:03:24Z suehring
 ! - Netcdf input routine for dimension length renamed
 ! - Move offline-nesting-specific checks to nesting_offl_mod
@@ -376,4 +379,5 @@
        REAL(wp)                              ::  fill1 = -9999.9_wp !< fill values for lod = 1
        REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  var_2d             !< 2d variable (lod = 1)
+       REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  oro_max            !< terraing height under particular buildings
     END TYPE build_in
 
@@ -416,4 +420,19 @@
        REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::  pars_xyz          !< respective parameters, level of detail = 2
     END TYPE pars
+!
+!-- Data type for surface parameter lists
+    TYPE pars_surf
+       INTEGER(iwp)                                ::  np          !< total number of parameters
+       INTEGER(iwp)                                ::  nsurf       !< number of local surfaces
+       INTEGER(iwp), DIMENSION(:,:,:), ALLOCATABLE ::  index_ji    !< index for beginning and end of surfaces at (j,i)
+       INTEGER(iwp), DIMENSION(:,:), ALLOCATABLE   ::  coords      !< (k,j,i,norm_z,norm_y,norm_x)
+                                                                   !< k,j,i:                surface position
+                                                                   !< norm_z,norm_y,norm_x: surface normal vector
+
+       LOGICAL ::  from_file = .FALSE.  !< flag indicating whether an input variable is available and read from file or default values are used
+
+       REAL(wp)                              ::  fill = -9999.9_wp !< fill value
+       REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  pars              !< respective parameters per surface
+    END TYPE pars_surf
 !
 !-- Define type for global file attributes
@@ -551,4 +570,6 @@
     TYPE(pars)  ::  water_pars_f               !< input variable for water parameters
 
+    TYPE(pars_surf)  ::  building_surface_pars_f  !< input variable for building surface parameters
+
     TYPE(chem_emis_att_type)                             ::  chem_emis_att    !< Input Information of Chemistry Emission Data from netcdf  
     TYPE(chem_emis_val_type), ALLOCATABLE, DIMENSION(:)  ::  chem_emis        !< Input Chemistry Emission Data from netcdf  
@@ -683,5 +704,6 @@
 !-- Public variables
     PUBLIC albedo_pars_f, albedo_type_f, basal_area_density_f, buildings_f,    &
-           building_id_f, building_pars_f, building_type_f,                    &
+           building_id_f, building_pars_f, building_surface_pars_f,            &
+           building_type_f,                                                    &
            char_fill,                                                          &
            char_lod,                                                           &
@@ -1958,4 +1980,18 @@
           building_pars_f%from_file = .FALSE.
        ENDIF
+!
+!--    Read building surface parameters
+       IF ( check_existence( var_names, 'building_surface_pars' ) )  THEN
+          building_surface_pars_f%from_file = .TRUE.
+          CALL get_attribute( id_surf, char_fill,                              &
+                              building_surface_pars_f%fill,                    &
+                              .FALSE., 'building_surface_pars' )
+!
+!--       Read building_surface_pars
+          CALL get_variable_surf( id_surf, 'building_surface_pars', &
+                                  building_surface_pars_f )
+       ELSE
+          building_surface_pars_f%from_file = .FALSE.
+       ENDIF
 
 !
@@ -4302,10 +4338,7 @@
              ENDIF
 !
-!--       Extrapolate if actual height is above the highest Inifor level
+!--       Extrapolate if actual height is above the highest Inifor level by the last value
           ELSE
-             var(k) = var_file(ku) + ( var_file(ku) - var_file(ku-1) ) /       &
-                                     ( z_file(ku)   - z_file(ku-1)   ) *       &
-                                     ( z_grid(k)    - z_file(ku)     )
-
+             var(k) = var_file(ku)
           ENDIF
 
@@ -4965,4 +4998,225 @@
 #endif
     END SUBROUTINE get_variable_pr
+
+
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Reads a per-surface pars variable from file. Because all surfaces are stored
+!> as flat 1-D array, each PE has to scan the data and find the surface indices
+!> belonging to its subdomain. During this scan, it also builds a necessary
+!> (j,i) index.
+!------------------------------------------------------------------------------!
+    SUBROUTINE get_variable_surf( id, variable_name, surf )
+#if defined( __netcdf )
+
+       USE pegrid
+
+       USE indices,                                            &
+           ONLY:  nxl, nxr, nys, nyn, nzb, nzt
+
+       USE control_parameters,                                 &
+           ONLY: dz, message_string
+
+       USE grid_variables,                                     &
+           ONLY: dx, dy
+       
+       USE basic_constants_and_equations_mod,                  &
+           ONLY: pi
+
+       USE arrays_3d,                                          &
+           ONLY:  zu, zw
+
+       IMPLICIT NONE
+
+       INTEGER, PARAMETER ::  nsurf_pars_read = 1024**2 !< read buffer size
+
+       CHARACTER(LEN=*)                          ::  variable_name !< variable name
+
+       INTEGER(iwp), DIMENSION(6)                ::  coords        !< integer coordinates of surface
+       INTEGER(iwp)                              ::  i, j
+       INTEGER(iwp)                              ::  isurf         !< netcdf surface index
+       INTEGER(iwp)                              ::  is            !< local surface index
+       INTEGER(iwp), INTENT(IN)                  ::  id            !< file id
+       INTEGER(iwp), DIMENSION(2)                ::  id_dim        !< dimension ids
+       INTEGER(iwp)                              ::  id_var        !< variable id
+       INTEGER(iwp)                              ::  id_zs         !< zs variable id
+       INTEGER(iwp)                              ::  id_ys         !< ys variable id
+       INTEGER(iwp)                              ::  id_xs         !< xs variable id
+       INTEGER(iwp)                              ::  id_zenith     !< zeith variable id
+       INTEGER(iwp)                              ::  id_azimuth    !< azimuth variable id
+       INTEGER(iwp)                              ::  is0, isc      !< read surface start and count
+       INTEGER(iwp)                              ::  nsurf         !< total number of surfaces in file
+       INTEGER(iwp), DIMENSION(:,:), ALLOCATABLE ::  nsurf_ji      !< numbers of surfaces by coords
+
+       TYPE(pars_surf)                           ::  surf          !< parameters variable to be loaded
+       REAL(wp), DIMENSION(:,:), ALLOCATABLE     ::  pars_read     !< read buffer
+       REAL(wp), DIMENSION(:), ALLOCATABLE       ::  zs, ys, xs    !< read buffer for zs(s), ys, xs
+       REAL(wp), DIMENSION(:), ALLOCATABLE       ::  zenith        !< read buffer for zenith(s)
+       REAL(wp), DIMENSION(:), ALLOCATABLE       ::  azimuth       !< read buffer for azimuth(s)
+       REAL(wp)                                  ::  oro_max_l     !< maximum terrain height under building
+
+!
+!--    First, inquire variable ID
+       nc_stat = NF90_INQ_VARID( id, TRIM( variable_name ), id_var )
+       nc_stat = NF90_INQ_VARID( id, 'zs',                  id_zs )
+       nc_stat = NF90_INQ_VARID( id, 'ys',                  id_ys )
+       nc_stat = NF90_INQ_VARID( id, 'xs',                  id_xs )
+       nc_stat = NF90_INQ_VARID( id, 'zenith',              id_zenith )
+       nc_stat = NF90_INQ_VARID( id, 'azimuth',             id_azimuth )
+!
+!--    Inquire dimension sizes
+       nc_stat = NF90_INQUIRE_VARIABLE( id, id_var, DIMIDS = id_dim )
+       nc_stat = NF90_INQUIRE_DIMENSION( id, id_dim(1), LEN = nsurf )
+       nc_stat = NF90_INQUIRE_DIMENSION( id, id_dim(2), LEN = surf%np )
+
+       ALLOCATE ( pars_read( nsurf_pars_read, surf%np ),        &
+                  zs(nsurf_pars_read), ys(nsurf_pars_read),     &
+                  xs(nsurf_pars_read), zenith(nsurf_pars_read), &
+                  azimuth(nsurf_pars_read),                     &
+                  nsurf_ji(nys:nyn, nxl:nxr) )
+
+       nsurf_ji(:,:) = 0
+!
+!--    Scan surface coordinates, count local
+       is0 = 1
+       DO
+          isc = MIN(nsurf_pars_read, nsurf - is0 + 1)
+          IF ( isc <= 0 )  EXIT
+
+          nc_stat = NF90_GET_VAR( id, id_ys, ys,     &
+                                  start = (/ is0 /), &
+                                  count = (/ isc /) )
+          nc_stat = NF90_GET_VAR( id, id_xs, xs,     &
+                                  start = (/ is0 /), &
+                                  count = (/ isc /) )
+          nc_stat = NF90_GET_VAR( id, id_zenith, zenith,      &
+                                  start = (/ is0 /), &
+                                  count = (/ isc /) )
+          nc_stat = NF90_GET_VAR( id, id_azimuth, azimuth,    &
+                                  start = (/ is0 /), &
+                                  count = (/ isc /) )
+          CALL handle_error( 'get_variable_surf', 682, 'azimuth' )
+          
+          DO  isurf = 1, isc
+!
+!--          Parse coordinates, detect if belongs to subdomain
+             coords = transform_coords( xs(isurf), ys(isurf),         &
+                                        zenith(isurf), azimuth(isurf) )
+             IF ( coords(2) < nys  .OR.  coords(2) > nyn  .OR.  &
+                  coords(3) < nxl  .OR.  coords(3) > nxr )  CYCLE
+
+             nsurf_ji(coords(2), coords(3)) = nsurf_ji(coords(2), coords(3)) + 1
+          ENDDO
+
+          is0 = is0 + isc
+       ENDDO
+!
+!--    Populate reverse index from surface counts
+       ALLOCATE ( surf%index_ji( 2, nys:nyn, nxl:nxr ) )
+
+       isurf = 1
+       DO  j = nys, nyn
+          DO  i = nxl, nxr
+             surf%index_ji(:,j,i) = (/ isurf, isurf + nsurf_ji(j,i) - 1 /)
+             isurf = isurf + nsurf_ji(j,i)
+          ENDDO
+       ENDDO
+
+       surf%nsurf = isurf - 1
+       ALLOCATE( surf%pars( 0:surf%np-1, surf%nsurf ), &
+                 surf%coords( 6, surf%nsurf ) )
+!
+!--    Scan surfaces again, saving pars into allocated structures
+       nsurf_ji(:,:) = 0
+       is0 = 1
+       DO
+          isc = MIN(nsurf_pars_read, nsurf - is0 + 1)
+          IF ( isc <= 0 )  EXIT
+
+          nc_stat = NF90_GET_VAR( id, id_var, pars_read(1:isc, 1:surf%np), &
+                                  start = (/ is0, 1       /),              &
+                                  count = (/ isc, surf%np /) )
+          CALL handle_error( 'get_variable_surf', 683, variable_name )
+
+          nc_stat = NF90_GET_VAR( id, id_zs, zs,                           &
+                                  start = (/ is0 /),                       &
+                                  count = (/ isc /) )
+          nc_stat = NF90_GET_VAR( id, id_ys, ys,                           &
+                                  start = (/ is0 /),                       &
+                                  count = (/ isc /) )
+          nc_stat = NF90_GET_VAR( id, id_xs, xs,                           &
+                                  start = (/ is0 /),                       &
+                                  count = (/ isc /) )
+          nc_stat = NF90_GET_VAR( id, id_zenith, zenith,                   &
+                                  start = (/ is0 /),                       &
+                                  count = (/ isc /) )
+          nc_stat = NF90_GET_VAR( id, id_azimuth, azimuth,                 &
+                                  start = (/ is0 /),                       &
+                                  count = (/ isc /) )
+          
+          DO  isurf = 1, isc
+!
+!--          Parse coordinates, detect if belongs to subdomain
+             coords = transform_coords( xs(isurf), ys(isurf),         &
+                                        zenith(isurf), azimuth(isurf) )
+             IF ( coords(2) < nys  .OR.  coords(2) > nyn  .OR.  &
+                  coords(3) < nxl  .OR.  coords(3) > nxr )  CYCLE
+!
+!--          Determine maximum terrain under building (base z-coordinate). Using
+!--          normal vector to locate building inner coordinates.
+             oro_max_l = buildings_f%oro_max(coords(2)-coords(5), coords(3)-coords(6))
+             IF  ( oro_max_l == buildings_f%fill1 )  THEN
+                WRITE( message_string, * ) 'Found building surface on '   // &
+                   'non-building coordinates (xs, ys, zenith, azimuth): ',   &
+                   xs(isurf), ys(isurf), zenith(isurf), azimuth(isurf)
+                CALL message( 'get_variable_surf', 'PA0684', 2, 2, 0, 6, 0 ) 
+             ENDIF
+!
+!--          Urban layer has no stretching, therefore using dz(1) instead of linear
+!--          searching through zu/zw
+             coords(1) = NINT((zs(isurf) + oro_max_l) / dz(1) +     &
+                              0.5_wp + 0.5_wp * coords(4), KIND=iwp)
+!
+!--          Save surface entry
+             is = surf%index_ji(1, coords(2), coords(3)) + nsurf_ji(coords(2), coords(3))
+             surf%pars(:,is) = pars_read(isurf,:)
+             surf%coords(:,is) = coords(:)
+
+             nsurf_ji(coords(2), coords(3)) = nsurf_ji(coords(2), coords(3)) + 1
+          ENDDO
+
+          is0 = is0 + isc
+       ENDDO
+
+       DEALLOCATE( pars_read, zs, ys, xs, zenith, azimuth, nsurf_ji )
+
+    CONTAINS
+
+       PURE FUNCTION transform_coords( x, y, zenith, azimuth )
+
+          REAL(wp), INTENT(in)       ::  x, y    !< surface centre coordinates in metres from origin
+          REAL(wp), INTENT(in)       ::  zenith  !< surface normal zenith angle in degrees
+          REAL(wp), INTENT(in)       ::  azimuth !< surface normal azimuth angle in degrees
+
+          INTEGER(iwp), DIMENSION(6) ::  transform_coords !< (k,j,i,norm_z,norm_y,norm_x)
+
+          transform_coords(4) = NINT(COS(zenith*pi/180._wp), KIND=iwp)
+          IF ( transform_coords(4) == 0 )  THEN
+             transform_coords(5) = NINT(COS(azimuth*pi/180._wp), KIND=iwp)
+             transform_coords(6) = NINT(SIN(azimuth*pi/180._wp), KIND=iwp)
+          ELSE
+             transform_coords(5) = 0._wp
+             transform_coords(6) = 0._wp
+          ENDIF
+
+          transform_coords(1) = -999._wp ! not calculated here
+          transform_coords(2) = NINT(y/dy - 0.5_wp + 0.5_wp*transform_coords(5), KIND=iwp)
+          transform_coords(3) = NINT(x/dx - 0.5_wp + 0.5_wp*transform_coords(6), KIND=iwp)
+
+       END FUNCTION transform_coords
+
+#endif
+    END SUBROUTINE get_variable_surf
 
 
Index: palm/trunk/SOURCE/pmc_child_mod.f90
===================================================================
--- palm/trunk/SOURCE/pmc_child_mod.f90	(revision 4242)
+++ palm/trunk/SOURCE/pmc_child_mod.f90	(revision 4245)
@@ -26,4 +26,7 @@
 ! -----------------
 ! $Id$
+! 
+! 
+! 4182 2019-08-22 15:20:23Z scharf
 ! Corrected "Former revisions" section
 ! 
Index: palm/trunk/SOURCE/pmc_parent_mod.f90
===================================================================
--- palm/trunk/SOURCE/pmc_parent_mod.f90	(revision 4242)
+++ palm/trunk/SOURCE/pmc_parent_mod.f90	(revision 4245)
@@ -26,4 +26,7 @@
 ! -----------------
 ! $Id$
+! 
+! 
+! 4213 2019-09-02 14:25:56Z suehring
 ! Allocate array for index_list_2d also for zero-size arrays, in order to  
 ! avoid errors when array bound checks are enabled 
Index: palm/trunk/SOURCE/radiation_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/radiation_model_mod.f90	(revision 4242)
+++ palm/trunk/SOURCE/radiation_model_mod.f90	(revision 4245)
@@ -28,4 +28,7 @@
 ! -----------------
 ! $Id$
+! Initialize explicit per-surface albedos from building_surface_pars
+! 
+! 4238 2019-09-25 16:06:01Z suehring
 ! Modify check in order to avoid equality comparisons of floating points
 ! 
@@ -257,4 +260,5 @@
                albedo_pars_f,                                                  &
                building_type_f,                                                &
+               building_surface_pars_f,                                        &
                pavement_type_f,                                                &
                vegetation_type_f,                                              &
@@ -356,4 +360,16 @@
                                    'building (dummy)                     '  & ! 33
                                                          /)
+!
+!-- Indices of radiation-related input attributes in building_surface_pars
+!-- (other are in urban_surface_mod)
+    INTEGER(iwp) ::  ind_s_alb_b_wall                = 19 !< index for Broadband albedo of wall fraction
+    INTEGER(iwp) ::  ind_s_alb_l_wall                = 20 !< index for Longwave albedo of wall fraction
+    INTEGER(iwp) ::  ind_s_alb_s_wall                = 21 !< index for Shortwave albedo of wall fraction
+    INTEGER(iwp) ::  ind_s_alb_b_win                 = 22 !< index for Broadband albedo of window fraction
+    INTEGER(iwp) ::  ind_s_alb_l_win                 = 23 !< index for Longwave albedo of window fraction
+    INTEGER(iwp) ::  ind_s_alb_s_win                 = 24 !< index for Shortwave albedo of window fraction
+    INTEGER(iwp) ::  ind_s_alb_b_green               = 24 !< index for Broadband albedo of green fraction
+    INTEGER(iwp) ::  ind_s_alb_l_green               = 25 !< index for Longwave albedo of green fraction
+    INTEGER(iwp) ::  ind_s_alb_s_green               = 26 !< index for Shortwave albedo of green fraction
 
     INTEGER(iwp) :: albedo_type  = 9999999_iwp, &     !< Albedo surface type
@@ -1497,7 +1513,9 @@
 
        INTEGER(iwp) ::  i         !< running index x-direction 
+       INTEGER(iwp) ::  is        !< running index for input surface elements
        INTEGER(iwp) ::  ioff      !< offset in x between surface element reference grid point in atmosphere and actual surface 
        INTEGER(iwp) ::  j         !< running index y-direction 
        INTEGER(iwp) ::  joff      !< offset in y between surface element reference grid point in atmosphere and actual surface 
+       INTEGER(iwp) ::  k         !< running index z-direction
        INTEGER(iwp) ::  l         !< running index for orientation of vertical surfaces 
        INTEGER(iwp) ::  m         !< running index for surface elements
@@ -1887,4 +1905,86 @@
           ENDIF  
 !
+!--       Read explicit albedo values from building surface pars. If present,
+!--       they override all less specific albedo values and force a albedo_type
+!--       to zero in order to take effect.
+          IF ( building_surface_pars_f%from_file )  THEN
+             DO  m = 1, surf_usm_h%ns
+                i = surf_usm_h%i(m)
+                j = surf_usm_h%j(m)
+                k = surf_usm_h%k(m)
+!
+!--             Iterate over surfaces in column, check height and orientation
+                DO  is = building_surface_pars_f%index_ji(1,j,i), &
+                         building_surface_pars_f%index_ji(2,j,i)
+                   IF ( building_surface_pars_f%coords(4,is) == -surf_usm_h%koff .AND. &
+                        building_surface_pars_f%coords(1,is) == k )  THEN
+
+                      IF ( building_surface_pars_f%pars(ind_s_alb_b_wall,is) /=      &
+                           building_surface_pars_f%fill )  THEN
+                         surf_usm_h%albedo(ind_veg_wall,m) =                         &
+                                  building_surface_pars_f%pars(ind_s_alb_b_wall,is)
+                         surf_usm_h%albedo_type(ind_veg_wall,m) = 0
+                      ENDIF
+
+                      IF ( building_surface_pars_f%pars(ind_s_alb_b_win,is) /=       &
+                           building_surface_pars_f%fill )  THEN
+                         surf_usm_h%albedo(ind_wat_win,m) =                          &
+                                  building_surface_pars_f%pars(ind_s_alb_b_win,is)
+                         surf_usm_h%albedo_type(ind_wat_win,m) = 0
+                      ENDIF
+
+                      IF ( building_surface_pars_f%pars(ind_s_alb_b_green,is) /=     &
+                           building_surface_pars_f%fill )  THEN
+                         surf_usm_h%albedo(ind_pav_green,m) =                        &
+                                  building_surface_pars_f%pars(ind_s_alb_b_green,is)
+                         surf_usm_h%albedo_type(ind_pav_green,m) = 0
+                      ENDIF
+
+                      EXIT ! surface was found and processed
+                   ENDIF
+                ENDDO
+             ENDDO
+
+             DO  l = 0, 3
+                DO  m = 1, surf_usm_v(l)%ns
+                   i = surf_usm_v(l)%i(m)
+                   j = surf_usm_v(l)%j(m)
+                   k = surf_usm_v(l)%k(m)
+!
+!--                Iterate over surfaces in column, check height and orientation
+                   DO  is = building_surface_pars_f%index_ji(1,j,i), &
+                            building_surface_pars_f%index_ji(2,j,i)
+                      IF ( building_surface_pars_f%coords(5,is) == -surf_usm_v(l)%joff .AND. &
+                           building_surface_pars_f%coords(6,is) == -surf_usm_v(l)%ioff .AND. &
+                           building_surface_pars_f%coords(1,is) == k )  THEN
+
+                         IF ( building_surface_pars_f%pars(ind_s_alb_b_wall,is) /=      &
+                              building_surface_pars_f%fill )  THEN
+                            surf_usm_v(l)%albedo(ind_veg_wall,m) =                      &
+                                     building_surface_pars_f%pars(ind_s_alb_b_wall,is)
+                            surf_usm_v(l)%albedo_type(ind_veg_wall,m) = 0
+                         ENDIF
+
+                         IF ( building_surface_pars_f%pars(ind_s_alb_b_win,is) /=       &
+                              building_surface_pars_f%fill )  THEN
+                            surf_usm_v(l)%albedo(ind_wat_win,m) =                       &
+                                     building_surface_pars_f%pars(ind_s_alb_b_win,is)
+                            surf_usm_v(l)%albedo_type(ind_wat_win,m) = 0
+                         ENDIF
+
+                         IF ( building_surface_pars_f%pars(ind_s_alb_b_green,is) /=     &
+                              building_surface_pars_f%fill )  THEN
+                            surf_usm_v(l)%albedo(ind_pav_green,m) =                     &
+                                     building_surface_pars_f%pars(ind_s_alb_b_green,is)
+                            surf_usm_v(l)%albedo_type(ind_pav_green,m) = 0
+                         ENDIF
+
+                         EXIT ! surface was found and processed
+                      ENDIF
+                   ENDDO
+                ENDDO
+             ENDDO
+          ENDIF
+!
 !--    Initialization actions for RRTMG
        ELSEIF ( radiation_scheme == 'rrtmg' )  THEN
@@ -2289,4 +2389,194 @@
              ENDDO
 
+          ENDIF
+!
+!--       Read explicit albedo values from building surface pars. If present,
+!--       they override all less specific albedo values and force a albedo_type
+!--       to zero in order to take effect.
+          IF ( building_surface_pars_f%from_file )  THEN
+             DO  m = 1, surf_usm_h%ns
+                i = surf_usm_h%i(m)
+                j = surf_usm_h%j(m)
+                k = surf_usm_h%k(m)
+!
+!--             Iterate over surfaces in column, check height and orientation
+                DO  is = building_surface_pars_f%index_ji(1,j,i), &
+                         building_surface_pars_f%index_ji(2,j,i)
+                   IF ( building_surface_pars_f%coords(4,is) == -surf_usm_h%koff .AND. &
+                        building_surface_pars_f%coords(1,is) == k )  THEN
+
+                      IF ( building_surface_pars_f%pars(ind_s_alb_b_wall,is) /=      &
+                           building_surface_pars_f%fill )  THEN
+                         surf_usm_h%albedo(ind_veg_wall,m) =                         &
+                                  building_surface_pars_f%pars(ind_s_alb_b_wall,is)
+                         surf_usm_h%albedo_type(ind_veg_wall,m) = 0
+                      ENDIF
+
+                      IF ( building_surface_pars_f%pars(ind_s_alb_l_wall,is) /=      &
+                           building_surface_pars_f%fill )  THEN
+                         surf_usm_h%aldir(ind_veg_wall,m) =                          &
+                                  building_surface_pars_f%pars(ind_s_alb_l_wall,is)
+                         surf_usm_h%aldif(ind_veg_wall,m) =                          &
+                                  building_surface_pars_f%pars(ind_s_alb_l_wall,is)
+                         surf_usm_h%albedo_type(ind_veg_wall,m) = 0
+                      ENDIF
+
+                      IF ( building_surface_pars_f%pars(ind_s_alb_s_wall,is) /=      &
+                           building_surface_pars_f%fill )  THEN
+                         surf_usm_h%asdir(ind_veg_wall,m) =                          &
+                                  building_surface_pars_f%pars(ind_s_alb_s_wall,is)
+                         surf_usm_h%asdif(ind_veg_wall,m) =                          &
+                                  building_surface_pars_f%pars(ind_s_alb_s_wall,is)
+                         surf_usm_h%albedo_type(ind_veg_wall,m) = 0
+                      ENDIF
+
+                      IF ( building_surface_pars_f%pars(ind_s_alb_b_win,is) /=       &
+                           building_surface_pars_f%fill )  THEN
+                         surf_usm_h%albedo(ind_wat_win,m) =                          &
+                                  building_surface_pars_f%pars(ind_s_alb_b_win,is)
+                         surf_usm_h%albedo_type(ind_wat_win,m) = 0
+                      ENDIF
+
+                      IF ( building_surface_pars_f%pars(ind_s_alb_l_win,is) /=       &
+                           building_surface_pars_f%fill )  THEN
+                         surf_usm_h%aldir(ind_wat_win,m) =                           &
+                                  building_surface_pars_f%pars(ind_s_alb_l_win,is)
+                         surf_usm_h%aldif(ind_wat_win,m) =                           &
+                                  building_surface_pars_f%pars(ind_s_alb_l_win,is)
+                         surf_usm_h%albedo_type(ind_wat_win,m) = 0
+                      ENDIF
+
+                      IF ( building_surface_pars_f%pars(ind_s_alb_s_win,is) /=       &
+                           building_surface_pars_f%fill )  THEN
+                         surf_usm_h%asdir(ind_wat_win,m) =                           &
+                                  building_surface_pars_f%pars(ind_s_alb_s_win,is)
+                         surf_usm_h%asdif(ind_wat_win,m) =                           &
+                                  building_surface_pars_f%pars(ind_s_alb_s_win,is)
+                         surf_usm_h%albedo_type(ind_wat_win,m) = 0
+                      ENDIF
+
+                      IF ( building_surface_pars_f%pars(ind_s_alb_b_green,is) /=     &
+                           building_surface_pars_f%fill )  THEN
+                         surf_usm_h%albedo(ind_pav_green,m) =                        &
+                                  building_surface_pars_f%pars(ind_s_alb_b_green,is)
+                         surf_usm_h%albedo_type(ind_pav_green,m) = 0
+                      ENDIF
+
+                      IF ( building_surface_pars_f%pars(ind_s_alb_l_green,is) /=     &
+                           building_surface_pars_f%fill )  THEN
+                         surf_usm_h%aldir(ind_pav_green,m) =                         &
+                                  building_surface_pars_f%pars(ind_s_alb_l_green,is)
+                         surf_usm_h%aldif(ind_pav_green,m) =                         &
+                                  building_surface_pars_f%pars(ind_s_alb_l_green,is)
+                         surf_usm_h%albedo_type(ind_pav_green,m) = 0
+                      ENDIF
+
+                      IF ( building_surface_pars_f%pars(ind_s_alb_s_green,is) /=     &
+                           building_surface_pars_f%fill )  THEN
+                         surf_usm_h%asdir(ind_pav_green,m) =                         &
+                                  building_surface_pars_f%pars(ind_s_alb_s_green,is)
+                         surf_usm_h%asdif(ind_pav_green,m) =                         &
+                                  building_surface_pars_f%pars(ind_s_alb_s_green,is)
+                         surf_usm_h%albedo_type(ind_pav_green,m) = 0
+                      ENDIF
+
+                      EXIT ! surface was found and processed
+                   ENDIF
+                ENDDO
+             ENDDO
+
+             DO  l = 0, 3
+                DO  m = 1, surf_usm_v(l)%ns
+                   i = surf_usm_v(l)%i(m)
+                   j = surf_usm_v(l)%j(m)
+                   k = surf_usm_v(l)%k(m)
+!
+!--                Iterate over surfaces in column, check height and orientation
+                   DO  is = building_surface_pars_f%index_ji(1,j,i), &
+                            building_surface_pars_f%index_ji(2,j,i)
+                      IF ( building_surface_pars_f%coords(5,is) == -surf_usm_v(l)%joff .AND. &
+                           building_surface_pars_f%coords(6,is) == -surf_usm_v(l)%ioff .AND. &
+                           building_surface_pars_f%coords(1,is) == k )  THEN
+
+                         IF ( building_surface_pars_f%pars(ind_s_alb_b_wall,is) /=      &
+                              building_surface_pars_f%fill )  THEN
+                            surf_usm_v(l)%albedo(ind_veg_wall,m) =                      &
+                                     building_surface_pars_f%pars(ind_s_alb_b_wall,is)
+                            surf_usm_v(l)%albedo_type(ind_veg_wall,m) = 0
+                         ENDIF
+
+                         IF ( building_surface_pars_f%pars(ind_s_alb_l_wall,is) /=      &
+                              building_surface_pars_f%fill )  THEN
+                            surf_usm_v(l)%aldir(ind_veg_wall,m) =                       &
+                                     building_surface_pars_f%pars(ind_s_alb_l_wall,is)
+                            surf_usm_v(l)%aldif(ind_veg_wall,m) =                       &
+                                     building_surface_pars_f%pars(ind_s_alb_l_wall,is)
+                            surf_usm_v(l)%albedo_type(ind_veg_wall,m) = 0
+                         ENDIF
+
+                         IF ( building_surface_pars_f%pars(ind_s_alb_s_wall,is) /=      &
+                              building_surface_pars_f%fill )  THEN
+                            surf_usm_v(l)%asdir(ind_veg_wall,m) =                       &
+                                     building_surface_pars_f%pars(ind_s_alb_s_wall,is)
+                            surf_usm_v(l)%asdif(ind_veg_wall,m) =                       &
+                                     building_surface_pars_f%pars(ind_s_alb_s_wall,is)
+                            surf_usm_v(l)%albedo_type(ind_veg_wall,m) = 0
+                         ENDIF
+
+                         IF ( building_surface_pars_f%pars(ind_s_alb_b_win,is) /=       &
+                              building_surface_pars_f%fill )  THEN
+                            surf_usm_v(l)%albedo(ind_wat_win,m) =                       &
+                                     building_surface_pars_f%pars(ind_s_alb_b_win,is)
+                            surf_usm_v(l)%albedo_type(ind_wat_win,m) = 0
+                         ENDIF
+
+                         IF ( building_surface_pars_f%pars(ind_s_alb_l_win,is) /=       &
+                              building_surface_pars_f%fill )  THEN
+                            surf_usm_v(l)%aldir(ind_wat_win,m) =                        &
+                                     building_surface_pars_f%pars(ind_s_alb_l_win,is)
+                            surf_usm_v(l)%aldif(ind_wat_win,m) =                        &
+                                     building_surface_pars_f%pars(ind_s_alb_l_win,is)
+                            surf_usm_v(l)%albedo_type(ind_wat_win,m) = 0
+                         ENDIF
+
+                         IF ( building_surface_pars_f%pars(ind_s_alb_s_win,is) /=       &
+                              building_surface_pars_f%fill )  THEN
+                            surf_usm_v(l)%asdir(ind_wat_win,m) =                        &
+                                     building_surface_pars_f%pars(ind_s_alb_s_win,is)
+                            surf_usm_v(l)%asdif(ind_wat_win,m) =                        &
+                                     building_surface_pars_f%pars(ind_s_alb_s_win,is)
+                            surf_usm_v(l)%albedo_type(ind_wat_win,m) = 0
+                         ENDIF
+
+                         IF ( building_surface_pars_f%pars(ind_s_alb_b_green,is) /=     &
+                              building_surface_pars_f%fill )  THEN
+                            surf_usm_v(l)%albedo(ind_pav_green,m) =                     &
+                                     building_surface_pars_f%pars(ind_s_alb_b_green,is)
+                            surf_usm_v(l)%albedo_type(ind_pav_green,m) = 0
+                         ENDIF
+
+                         IF ( building_surface_pars_f%pars(ind_s_alb_l_green,is) /=     &
+                              building_surface_pars_f%fill )  THEN
+                            surf_usm_v(l)%aldir(ind_pav_green,m) =                      &
+                                     building_surface_pars_f%pars(ind_s_alb_l_green,is)
+                            surf_usm_v(l)%aldif(ind_pav_green,m) =                      &
+                                     building_surface_pars_f%pars(ind_s_alb_l_green,is)
+                            surf_usm_v(l)%albedo_type(ind_pav_green,m) = 0
+                         ENDIF
+
+                         IF ( building_surface_pars_f%pars(ind_s_alb_s_green,is) /=     &
+                              building_surface_pars_f%fill )  THEN
+                            surf_usm_v(l)%asdir(ind_pav_green,m) =                      &
+                                     building_surface_pars_f%pars(ind_s_alb_s_green,is)
+                            surf_usm_v(l)%asdif(ind_pav_green,m) =                      &
+                                     building_surface_pars_f%pars(ind_s_alb_s_green,is)
+                            surf_usm_v(l)%albedo_type(ind_pav_green,m) = 0
+                         ENDIF
+
+                         EXIT ! surface was found and processed
+                      ENDIF
+                   ENDDO
+                ENDDO
+             ENDDO
           ENDIF
 
Index: palm/trunk/SOURCE/surface_mod.f90
===================================================================
--- palm/trunk/SOURCE/surface_mod.f90	(revision 4242)
+++ palm/trunk/SOURCE/surface_mod.f90	(revision 4245)
@@ -21,5 +21,5 @@
 ! Current revisions:
 ! ------------------
-! 
+!
 ! 
 ! Former revisions:
Index: palm/trunk/SOURCE/urban_surface_mod.f90
===================================================================
--- palm/trunk/SOURCE/urban_surface_mod.f90	(revision 4242)
+++ palm/trunk/SOURCE/urban_surface_mod.f90	(revision 4245)
@@ -28,4 +28,7 @@
 ! -----------------
 ! $Id$
+! Initialize explicit per-surface parameters from building_surface_pars
+! 
+! 4238 2019-09-25 16:06:01Z suehring
 ! Indoor-model parameters for some building types adjusted in order to avoid
 ! unrealistically high indoor temperatures (S. Rissmann) 
@@ -465,5 +468,26 @@
     INTEGER(iwp) ::  ind_z0qh_gfl          = 37   !< index in input list for z0h / z0q, ground floor level
     INTEGER(iwp) ::  ind_green_type_roof   = 118  !< index in input list for type of green roof
-
+!
+!-- Indices of input attributes in building_surface_pars (except for
+!-- radiation-related, which are in radiation_model_mod)
+    INTEGER(iwp) ::  ind_s_wall_frac                 = 0  !< index for wall fraction (0-1)
+    INTEGER(iwp) ::  ind_s_win_frac                  = 1  !< index for window fraction (0-1)
+    INTEGER(iwp) ::  ind_s_green_frac_w              = 2  !< index for green fraction on wall (0-1)
+    INTEGER(iwp) ::  ind_s_green_frac_r              = 3  !< index for green fraction on roof (0-1)
+    INTEGER(iwp) ::  ind_s_lai_r                     = 4  !< index for leaf area index of green fraction
+    INTEGER(iwp) ::  ind_s_hc1                       = 5  !< index for heat capacity of wall layer 1
+    INTEGER(iwp) ::  ind_s_hc2                       = 6  !< index for heat capacity of wall layer 2
+    INTEGER(iwp) ::  ind_s_hc3                       = 7  !< index for heat capacity of wall layer 3
+    INTEGER(iwp) ::  ind_s_tc1                       = 8  !< index for thermal conducivity of wall layer 1
+    INTEGER(iwp) ::  ind_s_tc2                       = 9  !< index for thermal conducivity of wall layer 2
+    INTEGER(iwp) ::  ind_s_tc3                       = 10 !< index for thermal conducivity of wall layer 3
+    INTEGER(iwp) ::  ind_s_indoor_target_temp_summer = 11 !< index for indoor target summer temperature
+    INTEGER(iwp) ::  ind_s_indoor_target_temp_winter = 12 !< index for indoor target winter temperature
+    INTEGER(iwp) ::  ind_s_emis_wall                 = 13 !< index for emissivity of wall fraction (0-1)
+    INTEGER(iwp) ::  ind_s_emis_green                = 14 !< index for emissivity of green fraction (0-1)
+    INTEGER(iwp) ::  ind_s_emis_win                  = 15 !< index for emissivity o f window fraction (0-1)
+    INTEGER(iwp) ::  ind_s_trans                     = 16 !< index for transmissivity of window fraction (0-1)
+    INTEGER(iwp) ::  ind_s_z0                        = 17 !< index for roughness length for momentum (m)
+    INTEGER(iwp) ::  ind_s_z0qh                      = 18 !< index for roughness length for heat (m)
 
     REAL(wp)  ::  roof_height_limit = 4.0_wp         !< height for distinguish between land surfaces and roofs
@@ -3437,5 +3461,6 @@
 
         USE netcdf_data_input_mod,                                             &
-            ONLY:  building_pars_f, building_type_f, terrain_height_f
+            ONLY:  building_pars_f, building_surface_pars_f, building_type_f,  &
+                   terrain_height_f
     
         IMPLICIT NONE
@@ -3477,4 +3502,5 @@
         INTEGER(iwp) ::  ind_z0              !< index in input list for z0
         INTEGER(iwp) ::  ind_z0qh            !< index in input list for z0h / z0q
+        INTEGER(iwp) ::  is                  !< loop index input surface element
         INTEGER(iwp) ::  j                   !< loop index y-dirction
         INTEGER(iwp) ::  k                   !< loop index z-dirction
@@ -4705,4 +4731,301 @@
            ENDDO
         ENDIF 
+!
+!--     Read building surface pars. If present, they override LOD1-LOD3 building
+!--     pars where applicable
+        IF ( building_surface_pars_f%from_file )  THEN
+           DO  m = 1, surf_usm_h%ns
+              i = surf_usm_h%i(m)
+              j = surf_usm_h%j(m)
+              k = surf_usm_h%k(m)
+!
+!--           Iterate over surfaces in column, check height and orientation
+              DO  is = building_surface_pars_f%index_ji(1,j,i), &
+                       building_surface_pars_f%index_ji(2,j,i)
+                 IF ( building_surface_pars_f%coords(4,is) == -surf_usm_h%koff .AND.            &
+                      building_surface_pars_f%coords(1,is) == k )  THEN
+
+                    IF ( building_surface_pars_f%pars(ind_s_wall_frac,is) /=                     &
+                         building_surface_pars_f%fill )                                          &
+                       surf_usm_h%frac(ind_veg_wall,m) =                                         &
+                                building_surface_pars_f%pars(ind_s_wall_frac,is)
+
+                    IF ( building_surface_pars_f%pars(ind_s_green_frac_w,is) /=                  &
+                         building_surface_pars_f%fill )                                          &
+                       surf_usm_h%frac(ind_pav_green,m) =                                        &
+                                building_surface_pars_f%pars(ind_s_green_frac_w,is)
+
+                    IF ( building_surface_pars_f%pars(ind_s_green_frac_r,is) /=                  &
+                         building_surface_pars_f%fill )                                          &
+                       surf_usm_h%frac(ind_pav_green,m) =                                        &
+                                building_surface_pars_f%pars(ind_s_green_frac_r,is)
+                                !TODO clarify: why should _w and _r be on the same surface?
+
+                    IF ( building_surface_pars_f%pars(ind_s_win_frac,is) /=                      &
+                         building_surface_pars_f%fill )                                          &
+                       surf_usm_h%frac(ind_wat_win,m) =                                          &
+                                building_surface_pars_f%pars(ind_s_win_frac,is)
+
+                    IF ( building_surface_pars_f%pars(ind_s_lai_r,is) /=                         &
+                         building_surface_pars_f%fill )                                          &
+                       surf_usm_h%lai(m) =                                                       &
+                                building_surface_pars_f%pars(ind_s_lai_r,is)
+
+                    IF ( building_surface_pars_f%pars(ind_s_hc1,is) /=                           &
+                         building_surface_pars_f%fill )  THEN
+                       surf_usm_h%rho_c_wall(nzb_wall:nzb_wall+1,m) =                            &
+                                building_surface_pars_f%pars(ind_s_hc1,is)
+                       surf_usm_h%rho_c_green(nzb_wall:nzb_wall+1,m) =                           &
+                                building_surface_pars_f%pars(ind_s_hc1,is)
+                       surf_usm_h%rho_c_window(nzb_wall:nzb_wall+1,m) =                          &
+                                building_surface_pars_f%pars(ind_s_hc1,is)
+                    ENDIF
+
+                    IF ( building_surface_pars_f%pars(ind_s_hc2,is) /=                           &
+                         building_surface_pars_f%fill )  THEN
+                       surf_usm_h%rho_c_wall(nzb_wall+2,m) =                                     &
+                                building_surface_pars_f%pars(ind_s_hc2,is)
+                       surf_usm_h%rho_c_green(nzb_wall+2,m) =                                    &
+                                building_surface_pars_f%pars(ind_s_hc2,is)
+                       surf_usm_h%rho_c_window(nzb_wall+2,m) =                                   &
+                                building_surface_pars_f%pars(ind_s_hc2,is)
+                    ENDIF
+
+                    IF ( building_surface_pars_f%pars(ind_s_hc3,is) /=                           &
+                         building_surface_pars_f%fill )  THEN
+                       surf_usm_h%rho_c_wall(nzb_wall+3,m) =                                     &
+                                building_surface_pars_f%pars(ind_s_hc3,is)
+                       surf_usm_h%rho_c_green(nzb_wall+3,m) =                                    &
+                                building_surface_pars_f%pars(ind_s_hc3,is)
+                       surf_usm_h%rho_c_window(nzb_wall+3,m) =                                   &
+                                building_surface_pars_f%pars(ind_s_hc3,is)
+                    ENDIF
+
+                    IF ( building_surface_pars_f%pars(ind_s_tc1,is) /=                           &
+                         building_surface_pars_f%fill )  THEN
+                       surf_usm_h%lambda_h(nzb_wall:nzb_wall+1,m) =                              &
+                                building_surface_pars_f%pars(ind_s_tc1,is)
+                       surf_usm_h%lambda_h_green(nzb_wall:nzb_wall+1,m) =                        &
+                                building_surface_pars_f%pars(ind_s_tc1,is)
+                       surf_usm_h%lambda_h_window(nzb_wall:nzb_wall+1,m) =                       &
+                                building_surface_pars_f%pars(ind_s_tc1,is)
+                    ENDIF
+
+                    IF ( building_surface_pars_f%pars(ind_s_tc2,is) /=                           &
+                         building_surface_pars_f%fill )  THEN
+                       surf_usm_h%lambda_h(nzb_wall+2,m) =                                       &
+                                building_surface_pars_f%pars(ind_s_tc2,is)
+                       surf_usm_h%lambda_h_green(nzb_wall+2,m) =                                 &
+                                building_surface_pars_f%pars(ind_s_tc2,is)
+                       surf_usm_h%lambda_h_window(nzb_wall+2,m) =                                &
+                                building_surface_pars_f%pars(ind_s_tc2,is)
+                    ENDIF
+
+                    IF ( building_surface_pars_f%pars(ind_s_tc3,is) /=                           &
+                         building_surface_pars_f%fill )  THEN
+                       surf_usm_h%lambda_h(nzb_wall+3,m) =                                       &
+                                building_surface_pars_f%pars(ind_s_tc3,is)
+                       surf_usm_h%lambda_h_green(nzb_wall+3,m) =                                 &
+                                building_surface_pars_f%pars(ind_s_tc3,is)
+                       surf_usm_h%lambda_h_window(nzb_wall+3,m) =                                &
+                                building_surface_pars_f%pars(ind_s_tc3,is)
+                    ENDIF
+
+                    IF ( building_surface_pars_f%pars(ind_s_indoor_target_temp_summer,is) /=     &
+                         building_surface_pars_f%fill )                                          &
+                       surf_usm_h%target_temp_summer(m) =                                        &
+                                building_surface_pars_f%pars(ind_s_indoor_target_temp_summer,is)
+
+                    IF ( building_surface_pars_f%pars(ind_s_indoor_target_temp_winter,is) /=     &
+                         building_surface_pars_f%fill )                                          &
+                       surf_usm_h%target_temp_winter(m) =                                        &
+                                building_surface_pars_f%pars(ind_s_indoor_target_temp_winter,is)
+
+                    IF ( building_surface_pars_f%pars(ind_s_emis_wall,is) /=                     &
+                         building_surface_pars_f%fill )                                          &
+                       surf_usm_h%emissivity(ind_veg_wall,m) =                                   &
+                                building_surface_pars_f%pars(ind_s_emis_wall,is)
+
+                    IF ( building_surface_pars_f%pars(ind_s_emis_green,is) /=                    &
+                         building_surface_pars_f%fill )                                          &
+                       surf_usm_h%emissivity(ind_pav_green,m) =                                  &
+                                building_surface_pars_f%pars(ind_s_emis_green,is)
+
+                    IF ( building_surface_pars_f%pars(ind_s_emis_win,is) /=                      &
+                         building_surface_pars_f%fill )                                          &
+                       surf_usm_h%emissivity(ind_wat_win,m) =                                    &
+                                building_surface_pars_f%pars(ind_s_emis_win,is)
+
+                    IF ( building_surface_pars_f%pars(ind_s_trans,is) /=                         &
+                         building_surface_pars_f%fill )                                          &
+                       surf_usm_h%transmissivity(m) =                                            &
+                                building_surface_pars_f%pars(ind_s_trans,is)
+
+                    IF ( building_surface_pars_f%pars(ind_s_z0,is) /=                            &
+                         building_surface_pars_f%fill )                                          &
+                       surf_usm_h%z0(m) =                                                        &
+                                building_surface_pars_f%pars(ind_s_z0,is)
+
+                    IF ( building_surface_pars_f%pars(ind_s_z0qh,is) /=                          &
+                         building_surface_pars_f%fill )  THEN
+                       surf_usm_h%z0q(m) =                                                       &
+                                building_surface_pars_f%pars(ind_s_z0qh,is)
+                       surf_usm_h%z0h(m) =                                                       &
+                                building_surface_pars_f%pars(ind_s_z0qh,is)
+                    ENDIF
+
+                    EXIT ! surface was found and processed
+                 ENDIF
+              ENDDO
+           ENDDO
+
+           DO  l = 0, 3
+              DO  m = 1, surf_usm_v(l)%ns
+                 i = surf_usm_v(l)%i(m)
+                 j = surf_usm_v(l)%j(m)
+                 k = surf_usm_v(l)%k(m)
+!
+!--              Iterate over surfaces in column, check height and orientation
+                 DO  is = building_surface_pars_f%index_ji(1,j,i), &
+                          building_surface_pars_f%index_ji(2,j,i)
+                    IF ( building_surface_pars_f%coords(5,is) == -surf_usm_v(l)%joff .AND.    &
+                         building_surface_pars_f%coords(6,is) == -surf_usm_v(l)%ioff .AND.    &
+                         building_surface_pars_f%coords(1,is) == k )  THEN
+
+                       IF ( building_surface_pars_f%pars(ind_s_wall_frac,is) /=                &
+                            building_surface_pars_f%fill )                                     &
+                          surf_usm_v(l)%frac(ind_veg_wall,m) =                                 &
+                                   building_surface_pars_f%pars(ind_s_wall_frac,is)
+
+                       IF ( building_surface_pars_f%pars(ind_s_green_frac_w,is) /=             &
+                            building_surface_pars_f%fill )                                     &
+                          surf_usm_v(l)%frac(ind_pav_green,m) =                                &
+                                   building_surface_pars_f%pars(ind_s_green_frac_w,is)
+
+                       IF ( building_surface_pars_f%pars(ind_s_green_frac_r,is) /=             &
+                            building_surface_pars_f%fill )                                     &
+                          surf_usm_v(l)%frac(ind_pav_green,m) =                                &
+                                   building_surface_pars_f%pars(ind_s_green_frac_r,is)
+                                   !TODO clarify: why should _w and _r be on the same surface?
+
+                       IF ( building_surface_pars_f%pars(ind_s_win_frac,is) /=                 &
+                            building_surface_pars_f%fill )                                     &
+                          surf_usm_v(l)%frac(ind_wat_win,m) =                                  &
+                                   building_surface_pars_f%pars(ind_s_win_frac,is)
+
+                       IF ( building_surface_pars_f%pars(ind_s_lai_r,is) /=                    &
+                            building_surface_pars_f%fill )                                     &
+                          surf_usm_v(l)%lai(m) =                                               &
+                                   building_surface_pars_f%pars(ind_s_lai_r,is)
+
+                       IF ( building_surface_pars_f%pars(ind_s_hc1,is) /=                      &
+                            building_surface_pars_f%fill )  THEN
+                          surf_usm_v(l)%rho_c_wall(nzb_wall:nzb_wall+1,m) =                    &
+                                   building_surface_pars_f%pars(ind_s_hc1,is)
+                          surf_usm_v(l)%rho_c_green(nzb_wall:nzb_wall+1,m) =                   &
+                                   building_surface_pars_f%pars(ind_s_hc1,is)
+                          surf_usm_v(l)%rho_c_window(nzb_wall:nzb_wall+1,m) =                  &
+                                   building_surface_pars_f%pars(ind_s_hc1,is)
+                       ENDIF
+
+                       IF ( building_surface_pars_f%pars(ind_s_hc2,is) /=                      &
+                            building_surface_pars_f%fill )  THEN
+                          surf_usm_v(l)%rho_c_wall(nzb_wall+2,m) =                             &
+                                   building_surface_pars_f%pars(ind_s_hc2,is)
+                          surf_usm_v(l)%rho_c_green(nzb_wall+2,m) =                            &
+                                   building_surface_pars_f%pars(ind_s_hc2,is)
+                          surf_usm_v(l)%rho_c_window(nzb_wall+2,m) =                           &
+                                   building_surface_pars_f%pars(ind_s_hc2,is)
+                       ENDIF
+
+                       IF ( building_surface_pars_f%pars(ind_s_hc3,is) /=                      &
+                            building_surface_pars_f%fill )  THEN
+                          surf_usm_v(l)%rho_c_wall(nzb_wall+3,m) =                             &
+                                   building_surface_pars_f%pars(ind_s_hc3,is)
+                          surf_usm_v(l)%rho_c_green(nzb_wall+3,m) =                            &
+                                   building_surface_pars_f%pars(ind_s_hc3,is)
+                          surf_usm_v(l)%rho_c_window(nzb_wall+3,m) =                           &
+                                   building_surface_pars_f%pars(ind_s_hc3,is)
+                       ENDIF
+
+                       IF ( building_surface_pars_f%pars(ind_s_tc1,is) /=                      &
+                            building_surface_pars_f%fill )  THEN
+                          surf_usm_v(l)%lambda_h(nzb_wall:nzb_wall+1,m) =                      &
+                                   building_surface_pars_f%pars(ind_s_tc1,is)
+                          surf_usm_v(l)%lambda_h_green(nzb_wall:nzb_wall+1,m) =                &
+                                   building_surface_pars_f%pars(ind_s_tc1,is)
+                          surf_usm_v(l)%lambda_h_window(nzb_wall:nzb_wall+1,m) =               &
+                                   building_surface_pars_f%pars(ind_s_tc1,is)
+                       ENDIF
+
+                       IF ( building_surface_pars_f%pars(ind_s_tc2,is) /=                      &
+                            building_surface_pars_f%fill )  THEN
+                          surf_usm_v(l)%lambda_h(nzb_wall+2,m) =                               &
+                                   building_surface_pars_f%pars(ind_s_tc2,is)
+                          surf_usm_v(l)%lambda_h_green(nzb_wall+2,m) =                         &
+                                   building_surface_pars_f%pars(ind_s_tc2,is)
+                          surf_usm_v(l)%lambda_h_window(nzb_wall+2,m) =                        &
+                                   building_surface_pars_f%pars(ind_s_tc2,is)
+                       ENDIF
+
+                       IF ( building_surface_pars_f%pars(ind_s_tc3,is) /=                      &
+                            building_surface_pars_f%fill )  THEN
+                          surf_usm_v(l)%lambda_h(nzb_wall+3,m) =                               &
+                                   building_surface_pars_f%pars(ind_s_tc3,is)
+                          surf_usm_v(l)%lambda_h_green(nzb_wall+3,m) =                         &
+                                   building_surface_pars_f%pars(ind_s_tc3,is)
+                          surf_usm_v(l)%lambda_h_window(nzb_wall+3,m) =                        &
+                                   building_surface_pars_f%pars(ind_s_tc3,is)
+                       ENDIF
+
+                       IF ( building_surface_pars_f%pars(ind_s_indoor_target_temp_summer,is) /=    &
+                            building_surface_pars_f%fill )                                         &
+                          surf_usm_v(l)%target_temp_summer(m) =                                    &
+                                   building_surface_pars_f%pars(ind_s_indoor_target_temp_summer,is)
+
+                       IF ( building_surface_pars_f%pars(ind_s_indoor_target_temp_winter,is) /=    &
+                            building_surface_pars_f%fill )                                         &
+                          surf_usm_v(l)%target_temp_winter(m) =                                    &
+                                   building_surface_pars_f%pars(ind_s_indoor_target_temp_winter,is)
+
+                       IF ( building_surface_pars_f%pars(ind_s_emis_wall,is) /=      &
+                            building_surface_pars_f%fill )                           &
+                          surf_usm_v(l)%emissivity(ind_veg_wall,m) =                 &
+                                   building_surface_pars_f%pars(ind_s_emis_wall,is)
+
+                       IF ( building_surface_pars_f%pars(ind_s_emis_green,is) /=     &
+                            building_surface_pars_f%fill )                           &
+                          surf_usm_v(l)%emissivity(ind_pav_green,m) =                &
+                                   building_surface_pars_f%pars(ind_s_emis_green,is)
+
+                       IF ( building_surface_pars_f%pars(ind_s_emis_win,is) /=       &
+                            building_surface_pars_f%fill )                           &
+                          surf_usm_v(l)%emissivity(ind_wat_win,m) =                  &
+                                   building_surface_pars_f%pars(ind_s_emis_win,is)
+
+                       IF ( building_surface_pars_f%pars(ind_s_trans,is) /=          &
+                            building_surface_pars_f%fill )                           &
+                          surf_usm_v(l)%transmissivity(m) =                          &
+                                   building_surface_pars_f%pars(ind_s_trans,is)
+
+                       IF ( building_surface_pars_f%pars(ind_s_z0,is) /=             &
+                            building_surface_pars_f%fill )                           &
+                          surf_usm_v(l)%z0(m) =                                      &
+                                   building_surface_pars_f%pars(ind_s_z0,is)
+
+                       IF ( building_surface_pars_f%pars(ind_s_z0qh,is) /=           &
+                            building_surface_pars_f%fill )  THEN
+                          surf_usm_v(l)%z0q(m) =                                     &
+                                   building_surface_pars_f%pars(ind_s_z0qh,is)
+                          surf_usm_v(l)%z0h(m) =                                     &
+                                   building_surface_pars_f%pars(ind_s_z0qh,is)
+                       ENDIF
+
+                       EXIT ! surface was found and processed
+                    ENDIF
+                 ENDDO
+              ENDDO
+           ENDDO
+        ENDIF
 !       
 !--     Read the surface_types array.
