Changeset 2968 for palm/trunk/SOURCE/init_grid.f90
- Timestamp:
- Apr 13, 2018 11:52:24 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/init_grid.f90
r2955 r2968 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Bugfix in initialization in case of elevated model surface. Introduce 28 ! index for minimum topography-top. 29 ! 30 ! 2955 2018-04-09 15:14:01Z suehring 27 31 ! Improve topography filter routine and add ghost-point exchange for building 28 32 ! ID and building type. … … 332 336 nzb_max, nzb_s_inner, nzb_s_outer, nzb_u_inner, & 333 337 nzb_u_outer, nzb_v_inner, nzb_v_outer, nzb_w_inner, & 334 nzb_w_outer, nzt 338 nzb_w_outer, nzt, topo_min_level 335 339 336 340 USE kinds … … 348 352 IMPLICIT NONE 349 353 350 INTEGER(iwp) :: i !< index variable along x351 INTEGER(iwp) :: j !< index variable along y352 INTEGER(iwp) :: k !< index variable along z353 INTEGER(iwp) :: k_top !< topography top index on local PE354 INTEGER(iwp) :: l !< loop variable355 INTEGER(iwp) :: nzb_local_max !< vertical grid index of maximum topography height356 INTEGER(iwp) :: nzb_local_min !< vertical grid index of minimum topography height354 INTEGER(iwp) :: i !< index variable along x 355 INTEGER(iwp) :: j !< index variable along y 356 INTEGER(iwp) :: k !< index variable along z 357 INTEGER(iwp) :: k_top !< topography top index on local PE 358 INTEGER(iwp) :: l !< loop variable 359 INTEGER(iwp) :: nzb_local_max !< vertical grid index of maximum topography height 360 INTEGER(iwp) :: nzb_local_min !< vertical grid index of minimum topography height 357 361 358 362 INTEGER(iwp), DIMENSION(:,:), ALLOCATABLE :: nzb_local !< index for topography top at cell-center … … 553 557 ! 554 558 !-- Finally, if topography extents up to the model top, limit nzb_max to nzt. 555 nzb_max = MIN( nzb_max, nzt ) 556 559 nzb_max = MIN( nzb_max, nzt ) 560 ! 561 !-- Determine minimum index of topography. Usually, this will be nzb. In case 562 !-- there is elevated topography, however, the lowest topography will be higher. 563 !-- This index is e.g. used to calculate mean first-grid point atmosphere 564 !-- temperature, surface pressure and density, etc. . 565 topo_min_level = 0 566 #if defined( __parallel ) 567 CALL MPI_ALLREDUCE( MINVAL( get_topography_top_index( 's' ) ), & 568 topo_min_level, 1, MPI_INTEGER, MPI_MIN, comm2d, ierr ) 569 #else 570 topo_min_level = MINVAL( get_topography_top_index( 's' ) ) 571 #endif 557 572 ! 558 573 !-- Initialize boundary conditions via surface type 559 574 CALL init_bc 560 561 575 ! 562 576 !-- Allocate and set topography height arrays required for data output … … 621 635 nzb_local(nys:nyn,nxl:nxr) = get_topography_top_index( 's' ) 622 636 CALL exchange_horiz_2d_int( nzb_local, nys, nyn, nxl, nxr, nbgp ) 623 637 ! 638 !-- Check topography for consistency with model domain. Therefore, use 639 !-- maximum and minium topography-top indices. Note, minimum topography top 640 !-- index is already calculated. 624 641 IF ( TRIM( topography ) /= 'flat' ) THEN 625 642 #if defined( __parallel ) 626 643 CALL MPI_ALLREDUCE( MAXVAL( get_topography_top_index( 's' ) ), & 627 nzb_local_max, 1, MPI_INTEGER, MPI_MAX, comm2d, ierr ) 628 CALL MPI_ALLREDUCE( MINVAL( get_topography_top_index( 's' ) ), & 629 nzb_local_min, 1, MPI_INTEGER, MPI_MIN, comm2d, ierr ) 644 nzb_local_max, 1, MPI_INTEGER, MPI_MAX, comm2d, ierr ) 630 645 #else 631 646 nzb_local_max = MAXVAL( get_topography_top_index( 's' ) ) 632 nzb_local_min = MINVAL( get_topography_top_index( 's' ) )633 647 #endif 648 nzb_local_min = topo_min_level 634 649 ! 635 650 !-- Consistency checks
Note: See TracChangeset
for help on using the changeset viewer.