Index: /palm/trunk/SOURCE/init_grid.f90
===================================================================
--- /palm/trunk/SOURCE/init_grid.f90	(revision 3114)
+++ /palm/trunk/SOURCE/init_grid.f90	(revision 3115)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Referencing of buildings onto top of terrain - special treatment for bridges. 
+! 
+! 3103 2018-07-04 17:30:52Z suehring
 ! Reference lowest terrain height to zero level
 ! 
@@ -1287,5 +1290,5 @@
 
     USE netcdf_data_input_mod,                                                 &
-        ONLY:  buildings_f, building_id_f, input_pids_static,                  &
+        ONLY:  buildings_f, building_id_f, building_type_f, input_pids_static, &
                terrain_height_f
 
@@ -1577,17 +1580,23 @@
 !--                terrain top is defined at upper bound of the grid box.
 !--                Hence, check for zw in this case. 
-                   DO k = topo_top_index + 1, nzt + 1      
-                      IF ( zw(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 )
-                      ENDIF
-                   ENDDO        
-!
-!--                After surface irregularities are smoothen, determine lower
-!--                start index where building starts. 
-                   DO  k = nzb, nzt
-                      IF ( zw(k) - ocean_offset <= oro_max(nr) )               &
-                         topo_top_index = k
-                   ENDDO
+!--                Note, do this only for buildings which are surface mounted, 
+!--                i.e. building types 1-6. Below bridges, which are represented
+!--                exclusively by building type 7, terrain shape should be
+!--                maintained. 
+                   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
+                            topo_3d(k,j,i) = IBCLR( topo_3d(k,j,i), 0 )
+                            topo_3d(k,j,i) = IBSET( topo_3d(k,j,i), 2 )
+                         ENDIF
+                      ENDDO        
+!
+!--                   After surface irregularities are smoothen, determine lower
+!--                   start index where building starts. 
+                      DO  k = nzb, nzt
+                         IF ( zw(k) - ocean_offset <= oro_max(nr) )            &
+                            topo_top_index = k
+                      ENDDO
+                   ENDIF
 !
 !--                Finally, map building on top.
Index: /palm/trunk/SOURCE/urban_surface_mod.f90
===================================================================
--- /palm/trunk/SOURCE/urban_surface_mod.f90	(revision 3114)
+++ /palm/trunk/SOURCE/urban_surface_mod.f90	(revision 3115)
@@ -28,4 +28,7 @@
 ! -----------------
 ! $Id$
+! Additional building type to represent bridges 
+! 
+! 3091 2018-06-28 16:20:35Z suehring
 ! - Limit aerodynamic resistance at vertical walls.
 ! - Add check for local roughness length not exceeding surface-layer height and
@@ -428,5 +431,5 @@
 
 
-    CHARACTER(37), DIMENSION(0:6), PARAMETER :: building_type_name = (/     &
+    CHARACTER(37), DIMENSION(0:7), PARAMETER :: building_type_name = (/     &
                                    'user-defined                         ', & !  0 
                                    'residential - 1950                   ', & !  1 
@@ -435,5 +438,6 @@
                                    'office - 1950                        ', & !  4 
                                    'office 1951 - 2000                   ', & !  5
-                                   'office 2001 -                        '  & !  6
+                                   'office 2001 -                        ', & !  6
+                                   'bridges                              '  & !  7
                                                                      /)
 !
@@ -460,9 +464,9 @@
 !-- 45 - heat capacity of the wall surface, 46 - heat conductivity
 !-- Please note, only preleminary dummy values so far!
-    REAL(wp), DIMENSION(0:46,1:6), PARAMETER :: building_pars = RESHAPE( (/    &
+    REAL(wp), DIMENSION(0:46,1:7), PARAMETER :: building_pars = RESHAPE( (/    &
         1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 1.0_wp, 1.0_wp,                        & !parameter 0-5
         1000000.0_wp, 1000000.0_wp, 1000000.0_wp, 0.3_wp, 0.3_wp, 0.3_wp,      & !parameter 6-11
         296.15_wp, 293.15_wp, 0.9_wp, 0.9_wp, 0.01_wp, 0.99_wp,                & !parameter 12-17
-        0.001_wp, 0.0001_wp, 4.0_wp,                                             & !parameter 18-20
+        0.001_wp, 0.0001_wp, 4.0_wp,                                           & !parameter 18-20
         1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 3.0_wp,                                & !parameter 21-25
         1000000.0_wp, 1000000.0_wp, 1000000.0_wp,                              & !parameter 26-28                     
@@ -475,5 +479,5 @@
         1000000.0_wp, 1000000.0_wp, 1000000.0_wp, 0.3_wp, 0.3_wp, 0.3_wp,      & !parameter 6-11
         296.15_wp, 293.15_wp, 0.9_wp, 0.9_wp, 0.01_wp, 0.99_wp,                & !parameter 12-17
-        0.001_wp, 0.0001_wp, 4.0_wp,                                             & !parameter 18-20
+        0.001_wp, 0.0001_wp, 4.0_wp,                                           & !parameter 18-20
         1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 3.0_wp,                                & !parameter 21-25
         1000000.0_wp, 1000000.0_wp, 1000000.0_wp,                              & !parameter 26-28                     
@@ -486,5 +490,5 @@
         1000000.0_wp, 1000000.0_wp, 1000000.0_wp, 0.3_wp, 0.3_wp, 0.3_wp,      & !parameter 6-11
         296.15_wp, 293.15_wp, 0.9_wp, 0.9_wp, 0.01_wp, 0.99_wp,                & !parameter 12-17
-        0.001_wp, 0.0001_wp, 4.0_wp,                                             & !parameter 18-20
+        0.001_wp, 0.0001_wp, 4.0_wp,                                           & !parameter 18-20
         1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 3.0_wp,                                & !parameter 21-25
         1000000.0_wp, 1000000.0_wp, 1000000.0_wp,                              & !parameter 26-28                     
@@ -508,5 +512,5 @@
         1000000.0_wp, 1000000.0_wp, 1000000.0_wp, 0.3_wp, 0.3_wp, 0.3_wp,      & !parameter 6-11
         296.15_wp, 293.15_wp, 0.9_wp, 0.9_wp, 0.01_wp, 0.99_wp,                & !parameter 12-17
-        0.001_wp, 0.0001_wp, 4.0_wp,                                             & !parameter 18-20
+        0.001_wp, 0.0001_wp, 4.0_wp,                                           & !parameter 18-20
         1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 3.0_wp,                                & !parameter 21-25
         1000000.0_wp, 1000000.0_wp, 1000000.0_wp,                              & !parameter 26-28                     
@@ -519,5 +523,5 @@
         1000000.0_wp, 1000000.0_wp, 1000000.0_wp, 0.3_wp, 0.3_wp, 0.3_wp,      & !parameter 6-11
         296.15_wp, 293.15_wp, 0.9_wp, 0.9_wp, 0.01_wp, 0.99_wp,                & !parameter 12-17
-        0.001_wp, 0.0001_wp, 4.0_wp,                                             & !parameter 18-20
+        0.001_wp, 0.0001_wp, 4.0_wp,                                           & !parameter 18-20
         1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 3.0_wp,                                & !parameter 21-25
         1000000.0_wp, 1000000.0_wp, 1000000.0_wp,                              & !parameter 26-28                     
@@ -526,7 +530,18 @@
         24.0_wp, 24.0_wp, 24.0_wp,                                             & !parameter 38-40
         0.0242_wp, 0.0969_wp, 0.346_wp, 1.0_wp,                                & !parameter 41-44
-        20000.0_wp, 10.0_wp                                                    & !parameter 45-46 - end of type 6
+        20000.0_wp, 10.0_wp,                                                   & !parameter 45-46 - end of type 6
+        1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 1.0_wp, 1.0_wp,                        & !parameter 0-5
+        1000000.0_wp, 1000000.0_wp, 1000000.0_wp, 0.3_wp, 0.3_wp, 0.3_wp,      & !parameter 6-11
+        296.15_wp, 293.15_wp, 0.9_wp, 0.9_wp, 0.01_wp, 0.99_wp,                & !parameter 12-17
+        0.001_wp, 0.0001_wp, 0.0_wp,                                           & !parameter 18-20
+        1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 3.0_wp,                                & !parameter 21-25
+        1000000.0_wp, 1000000.0_wp, 1000000.0_wp,                              & !parameter 26-28                     
+        0.3_wp, 0.3_wp, 0.3_wp,                                                & !parameter 29-31       
+        0.4_wp, 0.4_wp, 0.4_wp, 0.4_wp, 0.01_wp, 0.001_wp,                     & !parameter 32-37
+        24.0_wp, 24.0_wp, 24.0_wp,                                             & !parameter 38-40
+        0.0242_wp, 0.0969_wp, 0.346_wp, 1.0_wp,                                & !parameter 41-44
+        20000.0_wp, 10.0_wp                                                    & !parameter 45-46 - end of type 7 (bridges)
                                                                           /),  &
-                                                               (/47, 6/) )
+                                                               (/47, 7/) )
 
 !
