Changeset 4335 for palm/trunk/SOURCE


Ignore:
Timestamp:
Dec 12, 2019 4:39:05 PM (5 years ago)
Author:
suehring
Message:

Plant canopy: implement fix for LAD on building edges also for the vectorl-optimized branch

Location:
palm/trunk/SOURCE
Files:
2 edited

Legend:

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

    r4331 r4335  
    2727! -----------------
    2828! $Id$
     29! Fix for LAD at building edges also implemented in vector branch.
     30!
     31! 4331 2019-12-10 18:25:02Z suehring
    2932! Typo corrected
    3033!
     
    15661569       INTEGER(iwp) ::  kk        !< running index for flat lad arrays
    15671570
     1571       LOGICAL ::  building_edge_e !< control flag indicating an eastward-facing building edge
     1572       LOGICAL ::  building_edge_n !< control flag indicating a north-facing building edge
     1573       LOGICAL ::  building_edge_s !< control flag indicating a south-facing building edge
     1574       LOGICAL ::  building_edge_w !< control flag indicating a westward-facing building edge
     1575
    15681576       REAL(wp) ::  ddt_3d    !< inverse of the LES timestep (dt_3d)
    15691577       REAL(wp) ::  lad_local !< local lad value
     
    15861594                DO  j = nys, nyn
    15871595!
     1596!--                Set control flags indicating east- and westward-orientated
     1597!--                building edges. Note, building_egde_w is set from the perspective
     1598!--                of the potential rooftop grid point, while building_edge_e is
     1599!--                is set from the perspective of the non-building grid point.
     1600                   building_edge_w = ANY( BTEST( wall_flags_static_0(:,j,i),   6 ) )&
     1601                        .AND.  .NOT. ANY( BTEST( wall_flags_static_0(:,j,i-1), 6 ) )
     1602                   building_edge_e = ANY( BTEST( wall_flags_static_0(:,j,i-1), 6 ) )&
     1603                        .AND.  .NOT. ANY( BTEST( wall_flags_static_0(:,j,i),   6 ) )
     1604!
    15881605!--                Determine topography-top index on u-grid
    15891606                   k_wall = topo_top_ind(j,i,1)
     
    15931610!
    15941611!--                   In order to create sharp boundaries of the plant canopy,
    1595 !--                   the lad on the u-grid at index (k,j,i) is equal to
    1596 !--                   lad_s(k,j,i), rather than being interpolated from the
    1597 !--                   surrounding lad_s, because this would yield smaller lad
    1598 !--                   at the canopy boundaries than inside of the canopy.
     1612!--                   the lad on the u-grid at index (k,j,i) is equal to lad_s(k,j,i),
     1613!--                   rather than being interpolated from the surrounding lad_s,
     1614!--                   because this would yield smaller lad at the canopy boundaries
     1615!--                   than inside of the canopy.
    15991616!--                   For the same reason, the lad at the rightmost(i+1)canopy
    1600 !--                   boundary on the u-grid equals lad_s(k,j,i).
     1617!--                   boundary on the u-grid equals lad_s(k,j,i), which is considered
     1618!--                   in the next if-statement. Note, at left-sided building edges
     1619!--                   this is not applied, here the LAD is equals the LAD at grid
     1620!--                   point (k,j,i), in order to avoid that LAD is mistakenly mapped
     1621!--                   on top of a roof where (usually) is no LAD is defined.
    16011622                      lad_local = lad_s(kk,j,i)
    1602                       IF ( lad_local == 0.0_wp .AND. lad_s(kk,j,i-1) > 0.0_wp )&
    1603                       THEN
    1604                          lad_local = lad_s(kk,j,i-1)
    1605                       ENDIF
     1623                      IF ( lad_local == 0.0_wp .AND. lad_s(kk,j,i-1) > 0.0_wp  &
     1624                           .AND.  .NOT. building_edge_w )  lad_local = lad_s(kk,j,i-1)
     1625!
     1626!--                   In order to avoid that LAD is mistakenly considered at right-
     1627!--                   sided building edges (here the topography-top index for the
     1628!--                   u-component at index j,i is still on the building while the
     1629!--                   topography top for the scalar isn't), LAD is taken from grid
     1630!--                   point (j,i-1).
     1631                      IF ( lad_local > 0.0_wp .AND. lad_s(kk,j,i-1) == 0.0_wp  &
     1632                           .AND.  building_edge_e )  lad_local = lad_s(kk,j,i-1)
    16061633
    16071634                      pre_tend = 0.0_wp
     
    16501677                DO  j = nysv, nyn
    16511678!
     1679!--                Set control flags indicating north- and southward-orientated
     1680!--                building edges. Note, building_egde_s is set from the perspective
     1681!--                of the potential rooftop grid point, while building_edge_n is
     1682!--                is set from the perspective of the non-building grid point.
     1683                   building_edge_s = ANY( BTEST( wall_flags_static_0(:,j,i),   6 ) )&
     1684                        .AND.  .NOT. ANY( BTEST( wall_flags_static_0(:,j-1,i), 6 ) )
     1685                   building_edge_n = ANY( BTEST( wall_flags_static_0(:,j-1,i), 6 ) )&
     1686                        .AND.  .NOT. ANY( BTEST( wall_flags_static_0(:,j,i),   6 ) )
     1687!
    16521688!--                Determine topography-top index on v-grid
    16531689                   k_wall = topo_top_ind(j,i,2)
     
    16581694!
    16591695!--                   In order to create sharp boundaries of the plant canopy,
    1660 !--                   the lad on the v-grid at index (k,j,i) is equal to
    1661 !--                   lad_s(k,j,i), rather than being interpolated from the
    1662 !--                   surrounding lad_s, because this would yield smaller lad
    1663 !--                   at the canopy boundaries than inside of the canopy.
    1664 !--                   For the same reason, the lad at the northmost(j+1) canopy
    1665 !--                   boundary on the v-grid equals lad_s(k,j,i).
     1696!--                   the lad on the v-grid at index (k,j,i) is equal to lad_s(k,j,i),
     1697!--                   rather than being interpolated from the surrounding lad_s,
     1698!--                   because this would yield smaller lad at the canopy boundaries
     1699!--                   than inside of the canopy.
     1700!--                   For the same reason, the lad at the northmost(j+1)canopy
     1701!--                   boundary on the v-grid equals lad_s(k,j,i), which is considered
     1702!--                   in the next if-statement. Note, at left-sided building edges
     1703!--                   this is not applied, here the LAD is equals the LAD at grid
     1704!--                   point (k,j,i), in order to avoid that LAD is mistakenly mapped
     1705!--                   on top of a roof where (usually) is no LAD is defined.
    16661706                      lad_local = lad_s(kk,j,i)
    1667                       IF ( lad_local == 0.0_wp .AND. lad_s(kk,j-1,i) > 0.0_wp )&
    1668                       THEN
    1669                          lad_local = lad_s(kk,j-1,i)
    1670                       ENDIF
     1707                      IF ( lad_local == 0.0_wp .AND. lad_s(kk,j-1,i) > 0.0_wp &
     1708                       .AND.  .NOT. building_edge_s )  lad_local = lad_s(kk,j-1,i)
     1709!
     1710!--                   In order to avoid that LAD is mistakenly considered at right-
     1711!--                   sided building edges (here the topography-top index for the
     1712!--                   u-component at index j,i is still on the building while the
     1713!--                   topography top for the scalar isn't), LAD is taken from grid
     1714!--                   point (j,i-1).
     1715                      IF ( lad_local > 0.0_wp .AND. lad_s(kk,j-1,i) == 0.0_wp  &
     1716                       .AND.  building_edge_n )  lad_local = lad_s(kk,j-1,i)
    16711717
    16721718                      pre_tend = 0.0_wp
  • palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90

    r4332 r4335  
    2525! -----------------
    2626! $Id$
     27! Commentation of last commit
     28!
     29! 4332 2019-12-10 19:44:12Z suehring
    2730! Limit initial velocity seeds in restart runs, if not the seed calculation
    2831! may become unstable. Further, minor bugfix in initial velocity seed
     
    939942          DO  i = nxlg, nxrg
    940943             DO  k = nzb, nzt+1
    941 
     944!
     945!--             In case the correlation coefficients are very small, the
     946!--             velocity seeds may become very large finally creating
     947!--             numerical instabilities in the synthetic turbulence generator.
     948!--             Empirically, a value of 10E-8 seems to be sufficient.
    942949                IF  ( a11(k) > 10E-8_wp )  THEN
    943950                   fu_xz(k,i) = ( u(k,j,i) - u_init(k) ) / a11(k)
Note: See TracChangeset for help on using the changeset viewer.