Ignore:
Timestamp:
Apr 13, 2018 11:52:24 AM (3 years ago)
Author:
suehring
Message:

Bugfixes in initalization of land-surface model as well as timeseries data output in case of elevated model surfaces.

File:
1 edited

Legend:

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

    r2955 r2968  
    2525! -----------------
    2626! $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
    2731! Improve topography filter routine and add ghost-point exchange for building
    2832! ID and building type.
     
    332336               nzb_max, nzb_s_inner, nzb_s_outer, nzb_u_inner,                 &
    333337               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
    335339   
    336340    USE kinds
     
    348352    IMPLICIT NONE
    349353
    350     INTEGER(iwp) ::  i             !< index variable along x
    351     INTEGER(iwp) ::  j             !< index variable along y
    352     INTEGER(iwp) ::  k             !< index variable along z
    353     INTEGER(iwp) ::  k_top         !< topography top index on local PE
    354     INTEGER(iwp) ::  l             !< loop variable
    355     INTEGER(iwp) ::  nzb_local_max !< vertical grid index of maximum topography height
    356     INTEGER(iwp) ::  nzb_local_min !< vertical grid index of minimum topography height
     354    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
    357361                                     
    358362    INTEGER(iwp), DIMENSION(:,:), ALLOCATABLE ::  nzb_local      !< index for topography top at cell-center
     
    553557!   
    554558!-- 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
    557572!
    558573!-- Initialize boundary conditions via surface type
    559574    CALL init_bc
    560 
    561575!
    562576!-- Allocate and set topography height arrays required for data output
     
    621635    nzb_local(nys:nyn,nxl:nxr) = get_topography_top_index( 's' )
    622636    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. 
    624641    IF ( TRIM( topography ) /= 'flat' )  THEN
    625642#if defined( __parallel )
    626643       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 )             
    630645#else
    631646       nzb_local_max = MAXVAL( get_topography_top_index( 's' ) )
    632        nzb_local_min = MINVAL( get_topography_top_index( 's' ) )
    633647#endif
     648       nzb_local_min = topo_min_level
    634649!
    635650!--    Consistency checks
Note: See TracChangeset for help on using the changeset viewer.