Changeset 4189 for palm/trunk


Ignore:
Timestamp:
Aug 26, 2019 4:19:38 PM (5 years ago)
Author:
suehring
Message:

init_grid: Add check for proper setting of namelist parameter topography; Set bit flag to indicate land surfaces in case no topography is provided

File:
1 edited

Legend:

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

    r4182 r4189  
    2525! -----------------
    2626! $Id$
     27! - Add check for proper setting of namelist parameter topography
     28! - Set flag to indicate land surfaces in case no topography is provided
     29!
     30! 4182 2019-08-22 15:20:23Z scharf
    2731! Corrected "Former revisions" section
    2832!
     
    13331337!--             Hence, in this case, also a building flag.
    13341338                IF ( zu(k) - ocean_offset <= terrain_height_f%var(j,i) )  THEN
    1335                     topo_3d(k,j,i) = IBCLR( topo_3d(k,j,i), 0 )
    1336                     topo_3d(k,j,i) = IBSET( topo_3d(k,j,i), 1 )
    1337                     topo_top_index = k ! topo_top_index + 1
     1339                   topo_3d(k,j,i) = IBCLR( topo_3d(k,j,i), 0 )
     1340                   topo_3d(k,j,i) = IBSET( topo_3d(k,j,i), 1 )
     1341                   topo_top_index = k ! topo_top_index + 1
    13381342                ENDIF
    13391343!
     
    14561460!--             Note, each topography is flagged as building.
    14571461                IF ( zu(k) - ocean_offset <= buildings_f%var_2d(j,i) )  THEN
    1458                     topo_3d(k,j,i) = IBCLR( topo_3d(k,j,i), 0 )
    1459                     topo_3d(k,j,i) = IBSET( topo_3d(k,j,i), 2 ) !indicates building
     1462                   topo_3d(k,j,i) = IBCLR( topo_3d(k,j,i), 0 )
     1463                   topo_3d(k,j,i) = IBSET( topo_3d(k,j,i), 2 ) !indicates building
    14601464                ENDIF
    14611465             ENDDO
     
    17121716   
    17131717    USE kinds
     1718   
     1719    USE netcdf_data_input_mod,                                                 &
     1720        ONLY:  buildings_f, terrain_height_f
    17141721
    17151722    USE pegrid
     
    17491756    INTEGER(iwp), DIMENSION(:,:), ALLOCATABLE ::  nzb_local         !< index for topography top at cell-center
    17501757    INTEGER(iwp), DIMENSION(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ::  topo !< input array for 3D topography and dummy array for setting "outer"-flags
    1751 
    1752 
     1758!
     1759!-- Check for correct setting of the namelist parameter topography. If
     1760!-- topography information is read from file but topography = 'flat',
     1761!-- initialization does not properly.
     1762    IF ( ( buildings_f%from_file  .OR.  terrain_height_f%from_file )  .AND.    &
     1763           TRIM( topography ) /= 'read_from_file' )  THEN
     1764       message_string =  'If topography information is provided (via ' //      &
     1765                         'Netcdf or ASCII input) topography = '        //      &
     1766                         '"read_from_file" is required.'
     1767       CALL message( 'init_grid', 'PA0437', 1, 2, 0, 6, 0 )     
     1768    ENDIF
    17531769!
    17541770!-- Set outer and inner index arrays for non-flat topography.
     
    22632279    USE control_parameters,                                                    &
    22642280        ONLY:  bc_lr_cyc, bc_ns_cyc, constant_flux_layer, land_surface,        &
    2265                scalar_advec, use_surface_fluxes, use_top_fluxes, urban_surface
     2281               scalar_advec, topography, use_surface_fluxes, use_top_fluxes,   &
     2282               urban_surface
    22662283
    22672284    USE indices,                                                               &
     
    25262543!
    25272544!-- Finally, set identification flags indicating natural terrain or buildings.
    2528 !-- Natural terrain grid points.
     2545!-- Natural terrain grid points. Information on the type of the surface is
     2546!-- stored in bit 1 of 3D Integer array topo. However, this bit is only set
     2547!-- when topography is read from file. In order to run the land-surface model
     2548!-- also without topography information, set bit 1 explicitely in this case.
    25292549    IF ( land_surface )  THEN
    2530        DO i = nxl, nxr
    2531           DO j = nys, nyn
    2532              DO k = nzb, nzt+1
    2533 !
    2534 !--             Natural terrain grid point
    2535                 IF ( BTEST( topo(k,j,i), 1 ) )                                 &
    2536                    wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 5 )
     2550!
     2551!--    If no topography is initialized, the land-surface is at k = nzb.
     2552       IF ( TRIM( topography ) /= 'read_from_file' )  THEN
     2553          wall_flags_0(nzb,:,:) = IBSET( wall_flags_0(nzb,:,:), 5 )
     2554       ELSE
     2555          DO i = nxl, nxr
     2556             DO j = nys, nyn
     2557                DO k = nzb, nzt+1
     2558!         
     2559!--                Natural terrain grid point
     2560                   IF ( BTEST( topo(k,j,i), 1 ) )                              &
     2561                      wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 5 )
     2562                ENDDO
    25372563             ENDDO
    25382564          ENDDO
    2539        ENDDO
     2565       ENDIF
    25402566    ENDIF
    25412567!
Note: See TracChangeset for help on using the changeset viewer.