Index: palm/trunk/UTIL/nav_mesh/nav_mesh.f90
===================================================================
--- palm/trunk/UTIL/nav_mesh/nav_mesh.f90	(revision 3159)
+++ palm/trunk/UTIL/nav_mesh/nav_mesh.f90	(revision 3168)
@@ -24,7 +24,8 @@
 ! Former revisions:
 ! -----------------!
-!
+! $Id$
+! Updated NetCDF ororgraphy and building input
+! 
 ! Initial revision
-! 
 ! 
 !
@@ -67,6 +68,7 @@
     CHARACTER(LEN=10) ::  char_fill = '_FillValue'  !< name of fill value attribute in NetCDF file
     CHARACTER(LEN=128) ::  runname                  !< Run name
-    
+
     LOGICAL ::  internal_buildings = .FALSE.  !< Flag that indicates whether buildings within closed courtyards should be deleted
+    LOGICAL ::  flag_2d            = .FALSE.  !< Flag that indicates that 2d buildings will be used in all cases
 
     INTEGER(iwp) ::  i                          !< Index along x
@@ -291,14 +293,14 @@
 !
 !--       Terrain height. First, get variable-related _FillValue attribute
-          IF ( check_existence( var_names, 'orography_2D' ) )  THEN
+          IF ( check_existence( var_names, 'zt' ) )  THEN
              terrain_height_f%from_file = .TRUE. 
              CALL get_attribute( id_topo, char_fill,                           &
                                  terrain_height_f%fill,                        &
-                                 .FALSE., 'orography_2D' ) 
+                                 .FALSE., 'zt' ) 
 !
 !--          PE-wise reading of 2D terrain height.
              ALLOCATE ( terrain_height_f%var(0:ny,0:nx)  )
              DO  i = 0, nx
-                CALL get_variable( id_topo, 'orography_2D',                    &
+                CALL get_variable( id_topo, 'zt',                    &
                                    i, terrain_height_f%var(:,i) )  
              ENDDO
@@ -310,13 +312,13 @@
 !--       Read building height. First, read its _FillValue attribute, 
 !--       as well as lod attribute
-          buildings_f%from_file = .FALSE. 
-          IF ( check_existence( var_names, 'buildings_2D' ) )  THEN
+          buildings_f%from_file = .FALSE.
+          IF ( check_existence( var_names, 'buildings_2d' ) )  THEN
              buildings_f%from_file = .TRUE. 
              CALL get_attribute( id_topo, char_lod, buildings_f%lod,           &
-                                 .FALSE., 'buildings_2D' )
+                                 .FALSE., 'buildings_2d' )
 
              CALL get_attribute( id_topo, char_fill,                           &
                                  buildings_f%fill1,                            &
-                                 .FALSE., 'buildings_2D' )
+                                 .FALSE., 'buildings_2d' )
 
 !
@@ -325,5 +327,5 @@
                 ALLOCATE ( buildings_f%var_2d(0:ny,0:nx) )
                 DO  i = 0, nx
-                   CALL get_variable( id_topo, 'buildings_2D',                 &
+                   CALL get_variable( id_topo, 'buildings_2d',                 &
                                       i, buildings_f%var_2d(:,i) ) 
                 ENDDO
@@ -335,14 +337,17 @@
 !
 !--       If available, also read 3D building information. If both are
-!--       available, use 3D information.
-          IF ( check_existence( var_names, 'buildings_3D' ) )  THEN
+!--       available, use 3D information. Do this only if the flag that indicates
+!--       that 2d buildings shall be used no matter what is false.
+          IF ( check_existence( var_names, 'buildings_3d' )                    &
+               .AND. .NOT. flag_2d )                                           &
+          THEN
              lod_flag = .TRUE.
              buildings_f%from_file = .TRUE. 
              CALL get_attribute( id_topo, char_lod, buildings_f%lod,           &
-                                 .FALSE., 'buildings_3D' )     
+                                 .FALSE., 'buildings_3d' )     
 
              CALL get_attribute( id_topo, char_fill,                           &
                                  buildings_f%fill2,                            &
-                                 .FALSE., 'buildings_3D' )
+                                 .FALSE., 'buildings_3d' )
 
              CALL get_dimension_length( id_topo, buildings_f%nz, 'z' )
@@ -359,5 +364,5 @@
                 DO  i = 0, nx
                    DO  j = 0, ny
-                      CALL get_variable( id_topo, 'buildings_3D',              &
+                      CALL get_variable( id_topo, 'buildings_3d',              &
                                          i, j,                                 &
                                          buildings_f%var_3d(:,j,i) )
@@ -1240,5 +1245,5 @@
        LOGICAL ::  p3d_flag = .FALSE.  !< indicates whether p3d file was found
 
-       NAMELIST /prepro_par/  tolerance_dp, internal_buildings
+       NAMELIST /prepro_par/  flag_2d, internal_buildings, tolerance_dp
 
        WRITE(*,'(X,A)')                                                        &
