Ignore:
Timestamp:
May 30, 2018 5:43:55 PM (6 years ago)
Author:
suehring
Message:

Speed-up NetCDF input; Revise NetCDF-input routines and remove input via io-blocks; Temporarily revoke renaming of input variables in dynamic driver; More detailed error messages created; Bugfix in mapping 3D buildings; Bugfix in land-surface model at pavement surfaces; Bugfix in initialization with inifor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/init_grid.f90

    r3049 r3051  
    2525! -----------------
    2626! $Id$
     27! Minor bugfix concerning mapping 3D buildings on top of terrain
     28!
     29! 3045 2018-05-28 07:55:41Z Giersch
    2730! Error messages revised
    2831!
     
    926929    topo_3d(nzb,:,:) = IBCLR( topo_3d(nzb,:,:), 0 )
    927930!
     931!-- In order to map topography on PALM grid also in case of ocean simulations,
     932!-- pre-calculate an offset value.
     933    ocean_offset = MERGE( zw(0), 0.0_wp, ocean )
     934!
    928935!-- Reference buildings on top of orography. This is not necessary
    929936!-- if topography is read from ASCII file as no distinction between buildings
     
    10381045
    10391046!
    1040 !--       Finally, determine maximumum terrain height occupied by the
    1041 !--       respective building.
     1047!--       Determine maximumum terrain height occupied by the respective
     1048!--       building and temporalily store on oro_max
    10421049          ALLOCATE( oro_max_l(1:SIZE(build_ids_final)) )
    10431050          ALLOCATE( oro_max(1:SIZE(build_ids_final))   )
     
    10591066          oro_max = oro_max_l
    10601067#endif
     1068!
     1069!--       Finally, determine discrete grid height of maximum orography occupied
     1070!--       by a building. Use all-or-nothing approach, i.e. a grid box is either
     1071          oro_max_l = 0.0
     1072          DO  nr = 1, SIZE(build_ids_final)
     1073             DO  k = nzb, nzt
     1074                IF ( zu(k) - ocean_offset <= oro_max(nr) )                     &
     1075                   oro_max_l = zw(k) - ocean_offset
     1076             ENDDO
     1077             oro_max = oro_max_l
     1078          ENDDO
    10611079       ENDIF
    10621080!
    10631081!--    Map orography as well as buildings onto grid.
    1064 !--    In case of ocean simulations, add an offset. 
    1065        ocean_offset = MERGE( zw(0), 0.0_wp, ocean )
    10661082       DO  i = nxl, nxr
    10671083          DO  j = nys, nyn
     
    10801096                    topo_3d(k,j,i) = IBCLR( topo_3d(k,j,i), 0 )
    10811097                    topo_3d(k,j,i) = IBSET( topo_3d(k,j,i), 1 )
    1082                     topo_top_index = topo_top_index + 1
     1098                    topo_top_index = k ! topo_top_index + 1
    10831099                ENDIF
    10841100!
     
    11161132                                     building_id_f%var(j,i) ), DIM = 1 )
    11171133!
    1118 !--                Extend building down to the terrain surface.
    1119                    k2 = topo_top_index
     1134!--                Extend building down to the terrain surface, i.e. fill-up
     1135!--                surface irregularities below a building. Note, oro_max
     1136!--                is already a discrete height according to the all-or-nothing
     1137!--                approach, i.e. grid box is either topography or atmosphere,
     1138!--                terrain top is defined at upper bound of the grid box.
     1139!--                Hence, check for zw in this case.
    11201140                   DO k = topo_top_index + 1, nzt + 1     
    1121                       IF ( zu(k) - ocean_offset <= oro_max(nr) )  THEN
     1141                      IF ( zw(k) - ocean_offset <= oro_max(nr) )  THEN
    11221142                         topo_3d(k,j,i) = IBCLR( topo_3d(k,j,i), 0 )
    11231143                         topo_3d(k,j,i) = IBSET( topo_3d(k,j,i), 2 )
    1124                          k2             = k2 + 1
    11251144                      ENDIF
    1126                    ENDDO   
    1127                    topo_top_index = k2       
    1128 !
    1129 !--                Now, map building on top.
     1145                   ENDDO       
     1146!
     1147!--                After surface irregularities are smoothen, determine lower
     1148!--                start index where building starts.
     1149                   DO  k = nzb, nzt
     1150                      IF ( zw(k) - ocean_offset <= oro_max(nr) )               &
     1151                         topo_top_index = k
     1152                   ENDDO
     1153!
     1154!--                Finally, map building on top.
    11301155                   k2 = 0
    11311156                   DO k = topo_top_index, nzt + 1
Note: See TracChangeset for help on using the changeset viewer.