- Timestamp:
- Dec 12, 2019 4:39:05 PM (5 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/plant_canopy_model_mod.f90
r4331 r4335 27 27 ! ----------------- 28 28 ! $Id$ 29 ! Fix for LAD at building edges also implemented in vector branch. 30 ! 31 ! 4331 2019-12-10 18:25:02Z suehring 29 32 ! Typo corrected 30 33 ! … … 1566 1569 INTEGER(iwp) :: kk !< running index for flat lad arrays 1567 1570 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 1568 1576 REAL(wp) :: ddt_3d !< inverse of the LES timestep (dt_3d) 1569 1577 REAL(wp) :: lad_local !< local lad value … … 1586 1594 DO j = nys, nyn 1587 1595 ! 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 ! 1588 1605 !-- Determine topography-top index on u-grid 1589 1606 k_wall = topo_top_ind(j,i,1) … … 1593 1610 ! 1594 1611 !-- 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 the1597 !-- surrounding lad_s, because this would yield smaller lad1598 !-- at the canopy boundariesthan 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. 1599 1616 !-- 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. 1601 1622 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) 1606 1633 1607 1634 pre_tend = 0.0_wp … … 1650 1677 DO j = nysv, nyn 1651 1678 ! 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 ! 1652 1688 !-- Determine topography-top index on v-grid 1653 1689 k_wall = topo_top_ind(j,i,2) … … 1658 1694 ! 1659 1695 !-- 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. 1666 1706 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) 1671 1717 1672 1718 pre_tend = 0.0_wp -
palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90
r4332 r4335 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Commentation of last commit 28 ! 29 ! 4332 2019-12-10 19:44:12Z suehring 27 30 ! Limit initial velocity seeds in restart runs, if not the seed calculation 28 31 ! may become unstable. Further, minor bugfix in initial velocity seed … … 939 942 DO i = nxlg, nxrg 940 943 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. 942 949 IF ( a11(k) > 10E-8_wp ) THEN 943 950 fu_xz(k,i) = ( u(k,j,i) - u_init(k) ) / a11(k)
Note: See TracChangeset
for help on using the changeset viewer.