Index: palm/trunk/SOURCE/indoor_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/indoor_model_mod.f90	(revision 4157)
+++ palm/trunk/SOURCE/indoor_model_mod.f90	(revision 4159)
@@ -26,4 +26,8 @@
 ! -----------------
 ! $Id: indoor_model_mod.f90 
+! Bugfix in case of non grid-resolved buildings. Further, vertical grid spacing
+! is now considered at the correct level.  
+! 
+! 
 ! - change calculation of a_m and c_m
 ! - change calculation of u-values (use h_es in building array)
@@ -449,4 +453,5 @@
     REAL(wp) ::  du_tmp                                    !< 1/u_tmp
     REAL(wp) ::  du_win_tmp                                !< 1/building(nb)%u_value_win
+    REAL(wp) ::  facade_area_v                             !< dummy to compute the total facade area from vertical walls
 
     REAL(wp), DIMENSION(:), ALLOCATABLE ::  volume         !< total building volume at each discrete height level
@@ -588,5 +593,5 @@
              nb = MINLOC( ABS( buildings(:)%id - building_id_f%var(j,i) ),    &
                          DIM = 1 )
-             DO  k = nzb+1, nzt+1
+             DO  k = nzb, nzt+1
 !
 !--             Check if grid point belongs to a building. 
@@ -622,5 +627,5 @@
        DO  k = buildings(nb)%kb_min, buildings(nb)%kb_max
           buildings(nb)%building_height = buildings(nb)%building_height        &
-                                        + dzw(k)
+                                        + dzw(k+1)
        ENDDO
     ENDDO
@@ -650,5 +655,5 @@
                    DO  k = buildings(nb)%kb_min, buildings(nb)%kb_max
                       IF ( building_id_f%var(j,i) /= building_id_f%fill )      &
-                         volume_l(k) = volume_l(k) + dx * dy * dzw(k)
+                         volume_l(k) = volume_l(k) + dx * dy * dzw(k+1)
                    ENDDO
                 ENDDO
@@ -720,4 +725,5 @@
 !--    Determine building index and check whether building is on PE
        nb = MINLOC( ABS( buildings(:)%id - building_id_f%var(j,i) ), DIM = 1 )
+
        IF ( buildings(nb)%on_pe )  THEN
 !
@@ -846,9 +852,13 @@
        IF ( buildings(nb)%on_pe )  THEN
          
+          facade_area_v = 0.0_wp          
+          DO  k = buildings(nb)%kb_min, buildings(nb)%kb_max
+             facade_area_v = facade_area_v + buildings(nb)%num_facade_v(k)     &
+                             * dzw(k+1) * dx
+          ENDDO
+         
           buildings(nb)%vpf = buildings(nb)%vol_tot /                          &
-               ( buildings(nb)%num_facades_per_building_h * dx * dy +          &
-                 SUM( buildings(nb)%num_facade_v(buildings(nb)%kb_min:         &
-                                                 buildings(nb)%kb_max)         &
-                    * dzw(buildings(nb)%kb_min:buildings(nb)%kb_max) ) * dx )
+                        ( buildings(nb)%num_facades_per_building_h * dx * dy + &
+                          facade_area_v )
        ENDIF
     ENDDO
@@ -1130,5 +1140,5 @@
 !--          Building geometries --> not time-dependent
              facade_element_area          = dx * dy                                                   !< [m2] surface area per facade element    
-             floor_area_per_facade        = buildings(nb)%vpf(kk) * ddzw(kk)                          !< [m2/m2] floor area per facade area
+             floor_area_per_facade        = buildings(nb)%vpf(kk) * ddzw(kk+1)                        !< [m2/m2] floor area per facade area
              indoor_volume_per_facade     = buildings(nb)%vpf(kk)                                     !< [m3/m2] indoor air volume per facade area 
              buildings(nb)%area_facade    = facade_element_area *                                   &
@@ -1337,7 +1347,7 @@
 !--          EXCEPT facade_element_area, EVERYTHING IS CALCULATED EQUALLY)
 !--          Building geometries  --> not time-dependent
-             IF ( l == 0  .OR. l == 1 ) facade_element_area = dx * dzw(kk)                            !< [m2] surface area per facade element
-             IF ( l == 2  .OR. l == 3 ) facade_element_area = dy * dzw(kk)                            !< [m2] surface area per facade element
-             floor_area_per_facade        = buildings(nb)%vpf(kk) * ddzw(kk)                          !< [m2/m2] floor area per facade area
+             IF ( l == 0  .OR. l == 1 ) facade_element_area = dx * dzw(kk+1)                          !< [m2] surface area per facade element
+             IF ( l == 2  .OR. l == 3 ) facade_element_area = dy * dzw(kk+1)                          !< [m2] surface area per facade element
+             floor_area_per_facade        = buildings(nb)%vpf(kk) * ddzw(kk+1)                        !< [m2/m2] floor area per facade area
              indoor_volume_per_facade     = buildings(nb)%vpf(kk)                                     !< [m3/m2] indoor air volume per facade area 
              buildings(nb)%area_facade    = facade_element_area *                                   &
Index: palm/trunk/SOURCE/init_grid.f90
===================================================================
--- palm/trunk/SOURCE/init_grid.f90	(revision 4157)
+++ palm/trunk/SOURCE/init_grid.f90	(revision 4159)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Revision of topography processing. This was not consistent between 2D and 3D
+! buildings. 
+! 
+! 4144 2019-08-06 09:11:47Z raasch
 ! relational operators .EQ., .NE., etc. replaced by ==, /=, etc.
 ! 
@@ -1408,4 +1412,5 @@
 !-- need to be remove to avoid steep edges at the child-domain boundaries.
     IF ( input_pids_static )  THEN
+    
 #if defined( __parallel ) 
        CALL MPI_ALLREDUCE( MINVAL( terrain_height_f%var ), oro_min, 1,         &
@@ -1414,5 +1419,4 @@
        oro_min = MINVAL( terrain_height_f%var )
 #endif
-
        terrain_height_f%var = terrain_height_f%var - oro_min
 !                           
@@ -1575,7 +1579,8 @@
 
           DO  nr = 1, SIZE(build_ids_final)
-             oro_max_l(nr) = MAXVAL(                                              &
-                              MERGE( terrain_height_f%var, 0.0_wp,                &
-                                     building_id_f%var(nys:nyn,nxl:nxr) ==      &
+             oro_max_l(nr) = MAXVAL(                                           &
+                              MERGE( terrain_height_f%var(nys:nyn,nxl:nxr),    &
+                                     0.0_wp,                                   &
+                                     building_id_f%var(nys:nyn,nxl:nxr) ==     &
                                      build_ids_final(nr) ) )
           ENDDO
@@ -1583,5 +1588,5 @@
 #if defined( __parallel )    
           IF ( SIZE(build_ids_final) >= 1 ) THEN
-             CALL MPI_ALLREDUCE( oro_max_l, oro_max, SIZE( oro_max ), MPI_REAL,   &
+             CALL MPI_ALLREDUCE( oro_max_l, oro_max, SIZE( oro_max ), MPI_REAL,&
                                  MPI_MAX, comm2d, ierr ) 
           ENDIF
@@ -1591,5 +1596,8 @@
 !
 !--       Finally, determine discrete grid height of maximum orography occupied
-!--       by a building. Use all-or-nothing approach, i.e. a grid box is either
+!--       by a building. Use all-or-nothing approach, i.e. if terrain
+!--       exceeds the scalar level the grid box is fully terrain and the 
+!--       maximum terrain is set to the zw level. 
+!--       terrain or 
           oro_max_l = 0.0
           DO  nr = 1, SIZE(build_ids_final)
@@ -1625,6 +1633,5 @@
 !--             attributes will not be correct as given surface information
 !--             will not be in accordance to the classified grid points. 
-!--             Hence, in this case, de-flag the grid point and give it 
-!--             urban type instead. 
+!--             Hence, in this case, also a building flag.
                 IF ( zu(k) - ocean_offset <= terrain_height_f%var(j,i) )  THEN
                     topo_3d(k,j,i) = IBCLR( topo_3d(k,j,i), 0 )
@@ -1636,16 +1643,41 @@
 !--             3D buildings require separate treatment. 
                 IF ( buildings_f%from_file  .AND.  buildings_f%lod == 1 )  THEN
-                   IF ( building_id_f%var(j,i) /= building_id_f%fill )  THEN       
-                      IF ( zu(k) - ocean_offset <=                             &
-                           oro_max(nr) + buildings_f%var_2d(j,i) )  THEN
+!
+!--                Fill-up the terrain to the level of maximum orography
+!--                within the building-covered area.
+                   IF ( building_id_f%var(j,i) /= building_id_f%fill )  THEN
+!
+!--                   Note, oro_max is always on zw level                   
+                      IF ( zu(k) - ocean_offset < oro_max(nr) )  THEN
+                         topo_3d(k,j,i) = IBCLR( topo_3d(k,j,i), 0 )
+                         topo_3d(k,j,i) = IBSET( topo_3d(k,j,i), 1 )
+                      ELSEIF ( zu(k) - ocean_offset <=                         &
+                               oro_max(nr) + buildings_f%var_2d(j,i) )  THEN
                          topo_3d(k,j,i) = IBCLR( topo_3d(k,j,i), 0 )
                          topo_3d(k,j,i) = IBSET( topo_3d(k,j,i), 2 )
-!
-!--                      De-flag grid point of type natural. See comment above.
-                         topo_3d(k,j,i) = IBCLR( topo_3d(k,j,i), 1 ) 
                       ENDIF
                    ENDIF
                 ENDIF
              ENDDO
+!
+!--          Special treatment for non grid-resolved buildings. This case,
+!--          the uppermost terrain grid point is flagged as building as well
+!--          well, even though no building exists at all. However, the 
+!--          surface element will be identified as urban-surface and the 
+!--          input data provided by the drivers is consistent to the surface
+!--          classification. Else, all non grid-resolved buildings would vanish
+!--          and identified as terrain grid points, which, however, won't be
+!--          consistent with the input data. 
+             IF ( buildings_f%from_file  .AND.  buildings_f%lod == 1 )  THEN
+                IF ( building_id_f%var(j,i) /= building_id_f%fill )  THEN
+                   DO  k = nzb, nzt
+                      IF( zw(k) - ocean_offset == oro_max(nr) )  THEN
+                         IF ( buildings_f%var_2d(j,i) <= zu(k+1) - zw(k) )  THEN
+                            topo_3d(k,j,i) = IBSET( topo_3d(k,j,i), 2 )
+                         ENDIF
+                      ENDIF
+                   ENDDO
+                ENDIF
+             ENDIF
 !
 !--          Map 3D buildings onto terrain height.  
@@ -1669,7 +1701,7 @@
                       IF ( building_type_f%var(j,i) /= 7 )  THEN
                          DO k = topo_top_index + 1, nzt + 1      
-                            IF ( zw(k) - ocean_offset <= oro_max(nr) )  THEN
+                            IF ( zu(k) - ocean_offset <= oro_max(nr) )  THEN
                                topo_3d(k,j,i) = IBCLR( topo_3d(k,j,i), 0 )
-                               topo_3d(k,j,i) = IBSET( topo_3d(k,j,i), 2 )
+                               topo_3d(k,j,i) = IBSET( topo_3d(k,j,i), 1 )
                             ENDIF
                          ENDDO        
@@ -1678,5 +1710,5 @@
 !--                      lower start index where building starts. 
                          DO  k = nzb, nzt
-                            IF ( zw(k) - ocean_offset <= oro_max(nr) )         &
+                            IF ( zu(k) - ocean_offset <= oro_max(nr) )         &
                                topo_top_index = k
                          ENDDO
@@ -1690,5 +1722,4 @@
                          IF ( buildings_f%var_3d(k2,j,i) == 1 )  THEN
                             topo_3d(k,j,i) = IBCLR( topo_3d(k,j,i), 0 )
-                            topo_3d(k,j,i) = IBCLR( topo_3d(k,j,i), 1 )
                             topo_3d(k,j,i) = IBSET( topo_3d(k,j,i), 2 )
                          ENDIF
@@ -1709,6 +1740,14 @@
     ELSE
        ocean_offset     = MERGE( zw(0), 0.0_wp, ocean_mode )
+!
+!--    Initialize topography bit 0 (indicates obstacle) everywhere to zero
+!--    and clear all grid points at nzb, where alway a surface is defined.
+!--    Further, set also bit 1 (indicates terrain) at nzb, which is further
+!--    used for masked data output and further processing. Note, in the 
+!--    ASCII case no distinction is made between buildings and terrain, 
+!--    so that setting of bit 1 and 2 at the same time has no effect. 
        topo_3d          = IBSET( topo_3d, 0 )
        topo_3d(nzb,:,:) = IBCLR( topo_3d(nzb,:,:), 0 )
+       topo_3d(nzb,:,:) = IBSET( topo_3d(nzb,:,:), 1 )
        DO  i = nxl, nxr
           DO  j = nys, nyn
Index: palm/trunk/SOURCE/surface_mod.f90
===================================================================
--- palm/trunk/SOURCE/surface_mod.f90	(revision 4157)
+++ palm/trunk/SOURCE/surface_mod.f90	(revision 4159)
@@ -26,4 +26,7 @@
 ! -----------------
 ! $Id$
+! Surface classification revised and adjusted to changes in init_grid
+! 
+! 4156 2019-08-14 09:18:14Z schwenkel
 ! Bugfix in case of cloud microphysics morrison
 ! 
@@ -939,4 +942,6 @@
        LOGICAL ::  building                       !< flag indicating building grid point
        LOGICAL ::  terrain                        !< flag indicating natural terrain grid point
+       LOGICAL ::  unresolved_building            !< flag indicating a grid point where actually a building is 
+                                                  !< defined but not resolved by the vertical grid 
 
        num_def_h = 0
@@ -966,5 +971,6 @@
                    IF ( .NOT. BTEST( wall_flags_0(k-1,j,i), 0 ) )  THEN
 !
-!--                   Determine flags indicating terrain or building. 
+!--                   Determine flags indicating a terrain surface, a building
+!--                   surface, 
                       terrain  = BTEST( wall_flags_0(k-1,j,i), 5 )  .OR.       &
                                  topo_no_distinct
@@ -972,6 +978,13 @@
                                  topo_no_distinct
 !
+!--                   unresolved_building indicates a surface with equal height 
+!--                   as terrain but with a non-grid resolved building on top.
+!--                   These surfaces will be flagged as urban surfaces.
+                      unresolved_building = BTEST( wall_flags_0(k-1,j,i), 5 )  &
+                                     .AND.  BTEST( wall_flags_0(k-1,j,i), 6 )
+!
 !--                   Land-surface type
-                      IF ( land_surface  .AND.  terrain )  THEN
+                      IF ( land_surface  .AND.  terrain  .AND.                 &
+                           .NOT. unresolved_building )  THEN
                          num_lsm_h    = num_lsm_h    + 1 
 !
@@ -1027,5 +1040,10 @@
                       building = BTEST( wall_flags_0(k,j-1,i), 6 )   .OR.      &
                                  topo_no_distinct
-                      IF (  land_surface  .AND.  terrain )  THEN
+
+                      unresolved_building = BTEST( wall_flags_0(k,j-1,i), 5 )  &
+                                     .AND.  BTEST( wall_flags_0(k,j-1,i), 6 )
+                                     
+                      IF (  land_surface  .AND.  terrain  .AND.                &
+                           .NOT. unresolved_building )  THEN
                          num_lsm_v(0) = num_lsm_v(0) + 1 
                       ELSEIF ( urban_surface  .AND.  building )  THEN
@@ -1056,5 +1074,10 @@
                       building = BTEST( wall_flags_0(k,j+1,i), 6 )  .OR.       &
                                  topo_no_distinct
-                      IF (  land_surface  .AND.  terrain )  THEN
+                                 
+                      unresolved_building = BTEST( wall_flags_0(k,j+1,i), 5 )  &
+                                     .AND.  BTEST( wall_flags_0(k,j+1,i), 6 ) 
+                                
+                      IF (  land_surface  .AND.  terrain  .AND.                &
+                           .NOT. unresolved_building )  THEN
                          num_lsm_v(1) = num_lsm_v(1) + 1 
                       ELSEIF ( urban_surface  .AND.  building )  THEN
@@ -1085,5 +1108,10 @@
                       building = BTEST( wall_flags_0(k,j,i-1), 6 )  .OR.       &
                                  topo_no_distinct
-                      IF (  land_surface  .AND.  terrain )  THEN
+                                 
+                      unresolved_building = BTEST( wall_flags_0(k,j,i-1), 5 )  &
+                                     .AND.  BTEST( wall_flags_0(k,j,i-1), 6 )
+                                     
+                      IF (  land_surface  .AND.  terrain  .AND.                &
+                           .NOT. unresolved_building )  THEN
                          num_lsm_v(2) = num_lsm_v(2) + 1 
                       ELSEIF ( urban_surface  .AND.  building )  THEN
@@ -1114,5 +1142,10 @@
                       building = BTEST( wall_flags_0(k,j,i+1), 6 )  .OR.       &
                                  topo_no_distinct
-                      IF (  land_surface  .AND.  terrain )  THEN
+                                 
+                      unresolved_building = BTEST( wall_flags_0(k,j,i+1), 5 )  &
+                                     .AND.  BTEST( wall_flags_0(k,j,i+1), 6 )
+                                 
+                      IF (  land_surface  .AND.  terrain  .AND.                &
+                           .NOT. unresolved_building )  THEN
                          num_lsm_v(3) = num_lsm_v(3) + 1 
                       ELSEIF ( urban_surface  .AND.  building )  THEN
@@ -2217,7 +2250,7 @@
        INTEGER(iwp), DIMENSION(0:3) ::  start_index_usm_v !< dummy to determing local start index in surface type for given (j,i), for vertical urban surfaces
 
-       LOGICAL ::  building     !< flag indicating building grid point
-       LOGICAL ::  terrain      !< flag indicating natural terrain grid point
-
+       LOGICAL ::  building            !< flag indicating building grid point
+       LOGICAL ::  terrain             !< flag indicating natural terrain grid point
+       LOGICAL ::  unresolved_building !< flag indicating a grid point where actually a building is defined but not resolved by the vertical grid 
 !
 !--    Set offset indices, i.e. index difference between surface element and 
@@ -2322,7 +2355,15 @@
                       building = BTEST( wall_flags_0(k-1,j,i), 6 )  .OR.       &
                                  topo_no_distinct
+                                 
+!
+!--                   unresolved_building indicates a surface with equal height 
+!--                   as terrain but with a non-grid resolved building on top.
+!--                   These surfaces will be flagged as urban surfaces.
+                      unresolved_building = BTEST( wall_flags_0(k-1,j,i), 5 )  &
+                                     .AND.  BTEST( wall_flags_0(k-1,j,i), 6 )
 !
 !--                   Natural surface type          
-                      IF ( land_surface  .AND.  terrain )  THEN
+                      IF ( land_surface  .AND.  terrain  .AND.                 &
+                           .NOT. unresolved_building )  THEN
                          CALL initialize_horizontal_surfaces( k, j, i,         &
                                                               surf_lsm_h,      &
@@ -2375,5 +2416,17 @@
                       building = BTEST( wall_flags_0(k,j-1,i), 6 )  .OR.       &
                                  topo_no_distinct
-                      IF ( urban_surface  .AND.  building )  THEN
+
+                      unresolved_building = BTEST( wall_flags_0(k,j-1,i), 5 )  &
+                                     .AND.  BTEST( wall_flags_0(k,j-1,i), 6 )
+                                     
+                      IF ( land_surface  .AND.  terrain  .AND.                 &
+                           .NOT. unresolved_building )  THEN
+                         CALL initialize_vertical_surfaces( k, j, i,           &
+                                                            surf_lsm_v(0),     &
+                                                            num_lsm_v(0),      &
+                                                            num_lsm_v_kji(0),  &
+                                                            .FALSE., .FALSE.,  &             
+                                                            .FALSE., .TRUE. )
+                      ELSEIF ( urban_surface  .AND.  building )  THEN
                          CALL initialize_vertical_surfaces( k, j, i,           &
                                                             surf_usm_v(0),     &
@@ -2381,12 +2434,5 @@
                                                             num_usm_v_kji(0),  &
                                                             .FALSE., .FALSE.,  &             
-                                                            .FALSE., .TRUE. ) 
-                      ELSEIF ( land_surface  .AND.  terrain )  THEN
-                         CALL initialize_vertical_surfaces( k, j, i,           &
-                                                            surf_lsm_v(0),     &
-                                                            num_lsm_v(0),      &
-                                                            num_lsm_v_kji(0),  &
-                                                            .FALSE., .FALSE.,  &             
-                                                            .FALSE., .TRUE. ) 
+                                                            .FALSE., .TRUE. )
                       ELSE
                          CALL initialize_vertical_surfaces( k, j, i,           &
@@ -2407,5 +2453,17 @@
                       building = BTEST( wall_flags_0(k,j+1,i), 6 )  .OR.       &
                                  topo_no_distinct
-                      IF ( urban_surface  .AND.  building )  THEN
+                                 
+                      unresolved_building = BTEST( wall_flags_0(k,j+1,i), 5 )  &
+                                     .AND.  BTEST( wall_flags_0(k,j+1,i), 6 )
+                                     
+                      IF ( land_surface  .AND.  terrain  .AND.                 &
+                           .NOT. unresolved_building )  THEN
+                         CALL initialize_vertical_surfaces( k, j, i,           &
+                                                            surf_lsm_v(1),     &
+                                                            num_lsm_v(1),      &
+                                                            num_lsm_v_kji(1),  &
+                                                            .FALSE., .FALSE.,  &
+                                                            .TRUE., .FALSE. )
+                      ELSEIF ( urban_surface  .AND.  building )  THEN
                          CALL initialize_vertical_surfaces( k, j, i,           &
                                                             surf_usm_v(1),     &
@@ -2414,11 +2472,4 @@
                                                             .FALSE., .FALSE.,  &
                                                             .TRUE., .FALSE. )
-                      ELSEIF ( land_surface  .AND.  terrain )  THEN
-                         CALL initialize_vertical_surfaces( k, j, i,           &
-                                                            surf_lsm_v(1),     &
-                                                            num_lsm_v(1),      &
-                                                            num_lsm_v_kji(1),  &
-                                                            .FALSE., .FALSE.,  &
-                                                            .TRUE., .FALSE. )  
                       ELSE
                          CALL initialize_vertical_surfaces( k, j, i,           &
@@ -2439,5 +2490,17 @@
                       building = BTEST( wall_flags_0(k,j,i-1), 6 )  .OR.       &
                                  topo_no_distinct
-                      IF ( urban_surface  .AND.  building )  THEN
+                                 
+                      unresolved_building = BTEST( wall_flags_0(k,j,i-1), 5 )  &
+                                     .AND.  BTEST( wall_flags_0(k,j,i-1), 6 )
+                                 
+                      IF ( land_surface  .AND.  terrain  .AND.                 &
+                           .NOT. unresolved_building )  THEN
+                         CALL initialize_vertical_surfaces( k, j, i,           &
+                                                            surf_lsm_v(2),     &
+                                                            num_lsm_v(2),      &
+                                                            num_lsm_v_kji(2),  &
+                                                            .TRUE., .FALSE.,   &
+                                                            .FALSE., .FALSE. )
+                      ELSEIF ( urban_surface  .AND.  building )  THEN
                          CALL initialize_vertical_surfaces( k, j, i,           &
                                                             surf_usm_v(2),     &
@@ -2445,12 +2508,5 @@
                                                             num_usm_v_kji(2),  &
                                                             .TRUE., .FALSE.,   &
-                                                            .FALSE., .FALSE. ) 
-                      ELSEIF ( land_surface  .AND.  terrain )  THEN
-                         CALL initialize_vertical_surfaces( k, j, i,           &
-                                                            surf_lsm_v(2),     &
-                                                            num_lsm_v(2),      &
-                                                            num_lsm_v_kji(2),  &
-                                                            .TRUE., .FALSE.,   &
-                                                            .FALSE., .FALSE. ) 
+                                                            .FALSE., .FALSE. )
                       ELSE
                          CALL initialize_vertical_surfaces( k, j, i,           &
@@ -2471,5 +2527,17 @@
                       building = BTEST( wall_flags_0(k,j,i+1), 6 )  .OR.       &
                                  topo_no_distinct
-                      IF ( urban_surface  .AND.  building )  THEN
+                                 
+                      unresolved_building = BTEST( wall_flags_0(k,j,i+1), 5 )  &
+                                     .AND.  BTEST( wall_flags_0(k,j,i+1), 6 )
+                                  
+                      IF ( land_surface  .AND.  terrain  .AND.                 &
+                           .NOT. unresolved_building )  THEN
+                         CALL initialize_vertical_surfaces( k, j, i,           &
+                                                            surf_lsm_v(3),     &
+                                                            num_lsm_v(3),      &
+                                                            num_lsm_v_kji(3),  &
+                                                           .FALSE., .TRUE.,    &
+                                                           .FALSE., .FALSE. )
+                      ELSEIF ( urban_surface  .AND.  building )  THEN
                          CALL initialize_vertical_surfaces( k, j, i,           &
                                                             surf_usm_v(3),     &
@@ -2477,12 +2545,5 @@
                                                             num_usm_v_kji(3),  &
                                                            .FALSE., .TRUE.,    &
-                                                           .FALSE., .FALSE. ) 
-                      ELSEIF ( land_surface  .AND.  terrain )  THEN
-                         CALL initialize_vertical_surfaces( k, j, i,           &
-                                                            surf_lsm_v(3),     &
-                                                            num_lsm_v(3),      &
-                                                            num_lsm_v_kji(3),  &
-                                                           .FALSE., .TRUE.,    &
-                                                           .FALSE., .FALSE. ) 
+                                                           .FALSE., .FALSE. )
                       ELSE
                          CALL initialize_vertical_surfaces( k, j, i,           &
