Changeset 4722 for palm/trunk


Ignore:
Timestamp:
Oct 5, 2020 11:03:14 AM (4 years ago)
Author:
suehring
Message:

Bugfix in building mapping when static driver is available but no actual building is present within the model domain

File:
1 edited

Legend:

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

    r4691 r4722  
    2424! -----------------
    2525! $Id$
     26! Bugfix in building mapping when static driver is available but no actual building is present
     27! within the model domain
     28!
     29! 4691 2020-09-22 14:38:38Z suehring
    2630! Reference model topography to the lowest grid point also in ASCII input case
    2731!
     
    903907    IMPLICIT NONE
    904908
     909    INTEGER(iwp) ::  dim_builds       !< total number of buildings within the model domain
    905910    INTEGER(iwp) ::  i                !< running index along x-direction
    906911    INTEGER(iwp) ::  j                !< running index along y-direction
     
    10991104!
    11001105!--       Determine maximumum terrain height occupied by the respective building and temporalily
    1101 !--       store on oro_max.
    1102           ALLOCATE( oro_max_l(1:SIZE(build_ids_final)) )
    1103           ALLOCATE( oro_max(1:SIZE(build_ids_final))   )
     1106!--       store on oro_max. Before, check whether any buildings are defined within the domain.
     1107          IF ( ALLOCATED( build_ids_final ) )  THEN
     1108             dim_builds = SIZE(build_ids_final)
     1109          ELSE
     1110             dim_builds = 0
     1111          ENDIF
     1112
     1113          ALLOCATE( oro_max_l(1:dim_builds) )
     1114          ALLOCATE( oro_max(1:dim_builds)   )
    11041115          oro_max_l = 0.0_wp
    11051116
    1106           DO  nr = 1, SIZE(build_ids_final)
     1117          DO  nr = 1, dim_builds
    11071118             oro_max_l(nr) = MAXVAL( MERGE( terrain_height_f%var(nys:nyn,nxl:nxr),                 &
    11081119                                              0.0_wp,                                              &
     
    11121123
    11131124#if defined( __parallel )
    1114           IF ( SIZE(build_ids_final) >= 1 )  THEN
     1125          IF ( dim_builds >= 1 )  THEN
    11151126             CALL MPI_ALLREDUCE( oro_max_l, oro_max, SIZE( oro_max ), MPI_REAL, MPI_MAX, comm2d,   &
    11161127                                 ierr )
     
    11251136!--       terrain or
    11261137          oro_max_l = 0.0
    1127           DO  nr = 1, SIZE(build_ids_final)
     1138          DO  nr = 1, dim_builds
    11281139             DO  k = nzb, nzt
    11291140                IF ( zu(k) - ocean_offset <= oro_max(nr) )  oro_max_l(nr) = zw(k) - ocean_offset
Note: See TracChangeset for help on using the changeset viewer.