Changeset 4329 for palm/trunk/SOURCE/surface_mod.f90
- Timestamp:
- Dec 10, 2019 3:46:36 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/surface_mod.f90
r4245 r4329 21 21 ! Current revisions: 22 22 ! ------------------ 23 ! 23 ! 24 24 ! 25 25 ! Former revisions: 26 26 ! ----------------- 27 27 ! $Id$ 28 ! Renamed wall_flags_0 to wall_flags_static_0 29 ! 30 ! 4245 2019-09-30 08:40:37Z pavelkrc 28 31 ! Corrected "Former revisions" section 29 32 ! … … 108 111 109 112 USE indices, & 110 ONLY: nxl, nxlg, nxr, nxrg, nys, nysg, nyn, nyng, nzb, nzt, wall_flags_ 0113 ONLY: nxl, nxlg, nxr, nxrg, nys, nysg, nyn, nyng, nzb, nzt, wall_flags_static_0 111 114 112 115 USE grid_variables, & … … 585 588 ! 586 589 !-- Check if current gridpoint belongs to the atmosphere 587 IF ( BTEST( wall_flags_ 0(k,j,i), 0 ) ) THEN588 IF ( .NOT. BTEST( wall_flags_ 0(k+bc_h(l)%koff, &590 IF ( BTEST( wall_flags_static_0(k,j,i), 0 ) ) THEN 591 IF ( .NOT. BTEST( wall_flags_static_0(k+bc_h(l)%koff, & 589 592 j+bc_h(l)%joff, & 590 593 i+bc_h(l)%ioff), 0 ) ) & … … 616 619 ! 617 620 !-- Check if current gridpoint belongs to the atmosphere 618 IF ( BTEST( wall_flags_ 0(k,j,i), 0 ) ) THEN621 IF ( BTEST( wall_flags_static_0(k,j,i), 0 ) ) THEN 619 622 ! 620 623 !-- Upward-facing 621 IF ( .NOT. BTEST( wall_flags_ 0(k+bc_h(l)%koff, &624 IF ( .NOT. BTEST( wall_flags_static_0(k+bc_h(l)%koff, & 622 625 j+bc_h(l)%joff, & 623 626 i+bc_h(l)%ioff), 0 ) & … … 652 655 ! 653 656 !-- Check if current gridpoint belongs to the atmosphere 654 IF ( BTEST( wall_flags_ 0(k,j,i), 0 ) ) THEN655 IF ( .NOT. BTEST( wall_flags_ 0(k+bc_v(l)%koff, &657 IF ( BTEST( wall_flags_static_0(k,j,i), 0 ) ) THEN 658 IF ( .NOT. BTEST( wall_flags_static_0(k+bc_v(l)%koff, & 656 659 j+bc_v(l)%joff, & 657 660 i+bc_v(l)%ioff), 0 ) ) & … … 685 688 ! 686 689 !-- Check if current gridpoint belongs to the atmosphere 687 IF ( BTEST( wall_flags_ 0(k,j,i), 0 ) ) THEN690 IF ( BTEST( wall_flags_static_0(k,j,i), 0 ) ) THEN 688 691 ! 689 692 !-- Upward-facing 690 IF ( .NOT. BTEST( wall_flags_ 0(k+bc_v(l)%koff, &693 IF ( .NOT. BTEST( wall_flags_static_0(k+bc_v(l)%koff, & 691 694 j+bc_v(l)%joff, & 692 695 i+bc_v(l)%ioff), 0 ) & … … 765 768 ! 766 769 !-- Check if current gridpoint belongs to the atmosphere 767 IF ( BTEST( wall_flags_ 0(k,j,i), 0 ) ) THEN770 IF ( BTEST( wall_flags_static_0(k,j,i), 0 ) ) THEN 768 771 ! 769 772 !-- Check if grid point adjoins to any upward-facing horizontal 770 773 !-- surface, e.g. the Earth surface, plane roofs, or ceilings. 771 774 772 IF ( .NOT. BTEST( wall_flags_ 0(k-1,j,i), 0 ) ) THEN775 IF ( .NOT. BTEST( wall_flags_static_0(k-1,j,i), 0 ) ) THEN 773 776 ! 774 777 !-- Determine flags indicating a terrain surface, a building 775 778 !-- surface, 776 terrain = BTEST( wall_flags_ 0(k-1,j,i), 5 ) .OR. &779 terrain = BTEST( wall_flags_static_0(k-1,j,i), 5 ) .OR. & 777 780 topo_no_distinct 778 building = BTEST( wall_flags_ 0(k-1,j,i), 6 ) .OR. &781 building = BTEST( wall_flags_static_0(k-1,j,i), 6 ) .OR. & 779 782 topo_no_distinct 780 783 ! … … 782 785 !-- as terrain but with a non-grid resolved building on top. 783 786 !-- These surfaces will be flagged as urban surfaces. 784 unresolved_building = BTEST( wall_flags_ 0(k-1,j,i), 5 ) &785 .AND. BTEST( wall_flags_ 0(k-1,j,i), 6 )787 unresolved_building = BTEST( wall_flags_static_0(k-1,j,i), 5 ) & 788 .AND. BTEST( wall_flags_static_0(k-1,j,i), 6 ) 786 789 ! 787 790 !-- Land-surface type … … 817 820 !-- Check for any other downward-facing surface. So far only for 818 821 !-- default surface type. 819 ELSEIF ( .NOT. BTEST( wall_flags_ 0(k+1,j,i), 0 ) ) THEN822 ELSEIF ( .NOT. BTEST( wall_flags_static_0(k+1,j,i), 0 ) ) THEN 820 823 num_def_h(1) = num_def_h(1) + 1 821 824 ENDIF … … 830 833 DO j = nys, nyn 831 834 DO k = nzb+1, nzt 832 IF ( BTEST( wall_flags_ 0(k,j,i), 0 ) ) THEN835 IF ( BTEST( wall_flags_static_0(k,j,i), 0 ) ) THEN 833 836 ! 834 837 !-- Northward-facing 835 IF ( .NOT. BTEST( wall_flags_ 0(k,j-1,i), 0 ) ) THEN838 IF ( .NOT. BTEST( wall_flags_static_0(k,j-1,i), 0 ) ) THEN 836 839 ! 837 840 !-- Determine flags indicating terrain or building 838 841 839 terrain = BTEST( wall_flags_ 0(k,j-1,i), 5 ) .OR. &842 terrain = BTEST( wall_flags_static_0(k,j-1,i), 5 ) .OR. & 840 843 topo_no_distinct 841 building = BTEST( wall_flags_ 0(k,j-1,i), 6 ) .OR. &844 building = BTEST( wall_flags_static_0(k,j-1,i), 6 ) .OR. & 842 845 topo_no_distinct 843 846 844 unresolved_building = BTEST( wall_flags_ 0(k,j-1,i), 5 ) &845 .AND. BTEST( wall_flags_ 0(k,j-1,i), 6 )847 unresolved_building = BTEST( wall_flags_static_0(k,j-1,i), 5 ) & 848 .AND. BTEST( wall_flags_static_0(k,j-1,i), 6 ) 846 849 847 850 IF ( land_surface .AND. terrain .AND. & … … 868 871 ! 869 872 !-- Southward-facing 870 IF ( .NOT. BTEST( wall_flags_ 0(k,j+1,i), 0 ) ) THEN873 IF ( .NOT. BTEST( wall_flags_static_0(k,j+1,i), 0 ) ) THEN 871 874 ! 872 875 !-- Determine flags indicating terrain or building 873 terrain = BTEST( wall_flags_ 0(k,j+1,i), 5 ) .OR. &876 terrain = BTEST( wall_flags_static_0(k,j+1,i), 5 ) .OR. & 874 877 topo_no_distinct 875 building = BTEST( wall_flags_ 0(k,j+1,i), 6 ) .OR. &878 building = BTEST( wall_flags_static_0(k,j+1,i), 6 ) .OR. & 876 879 topo_no_distinct 877 880 878 unresolved_building = BTEST( wall_flags_ 0(k,j+1,i), 5 ) &879 .AND. BTEST( wall_flags_ 0(k,j+1,i), 6 )881 unresolved_building = BTEST( wall_flags_static_0(k,j+1,i), 5 ) & 882 .AND. BTEST( wall_flags_static_0(k,j+1,i), 6 ) 880 883 881 884 IF ( land_surface .AND. terrain .AND. & … … 902 905 ! 903 906 !-- Eastward-facing 904 IF ( .NOT. BTEST( wall_flags_ 0(k,j,i-1), 0 ) ) THEN907 IF ( .NOT. BTEST( wall_flags_static_0(k,j,i-1), 0 ) ) THEN 905 908 ! 906 909 !-- Determine flags indicating terrain or building 907 terrain = BTEST( wall_flags_ 0(k,j,i-1), 5 ) .OR. &910 terrain = BTEST( wall_flags_static_0(k,j,i-1), 5 ) .OR. & 908 911 topo_no_distinct 909 building = BTEST( wall_flags_ 0(k,j,i-1), 6 ) .OR. &912 building = BTEST( wall_flags_static_0(k,j,i-1), 6 ) .OR. & 910 913 topo_no_distinct 911 914 912 unresolved_building = BTEST( wall_flags_ 0(k,j,i-1), 5 ) &913 .AND. BTEST( wall_flags_ 0(k,j,i-1), 6 )915 unresolved_building = BTEST( wall_flags_static_0(k,j,i-1), 5 ) & 916 .AND. BTEST( wall_flags_static_0(k,j,i-1), 6 ) 914 917 915 918 IF ( land_surface .AND. terrain .AND. & … … 936 939 ! 937 940 !-- Westward-facing 938 IF ( .NOT. BTEST( wall_flags_ 0(k,j,i+1), 0 ) ) THEN941 IF ( .NOT. BTEST( wall_flags_static_0(k,j,i+1), 0 ) ) THEN 939 942 ! 940 943 !-- Determine flags indicating terrain or building 941 terrain = BTEST( wall_flags_ 0(k,j,i+1), 5 ) .OR. &944 terrain = BTEST( wall_flags_static_0(k,j,i+1), 5 ) .OR. & 942 945 topo_no_distinct 943 building = BTEST( wall_flags_ 0(k,j,i+1), 6 ) .OR. &946 building = BTEST( wall_flags_static_0(k,j,i+1), 6 ) .OR. & 944 947 topo_no_distinct 945 948 946 unresolved_building = BTEST( wall_flags_ 0(k,j,i+1), 5 ) &947 .AND. BTEST( wall_flags_ 0(k,j,i+1), 6 )949 unresolved_building = BTEST( wall_flags_static_0(k,j,i+1), 5 ) & 950 .AND. BTEST( wall_flags_static_0(k,j,i+1), 6 ) 948 951 949 952 IF ( land_surface .AND. terrain .AND. & … … 2144 2147 ! 2145 2148 !-- Check if current gridpoint belongs to the atmosphere 2146 IF ( BTEST( wall_flags_ 0(k,j,i), 0 ) ) THEN2149 IF ( BTEST( wall_flags_static_0(k,j,i), 0 ) ) THEN 2147 2150 ! 2148 2151 !-- Upward-facing surface. Distinguish between differet surface types. 2149 2152 !-- To do, think about method to flag natural and non-natural 2150 2153 !-- surfaces. 2151 IF ( .NOT. BTEST( wall_flags_ 0(k-1,j,i), 0 ) ) THEN2154 IF ( .NOT. BTEST( wall_flags_static_0(k-1,j,i), 0 ) ) THEN 2152 2155 ! 2153 2156 !-- Determine flags indicating terrain or building 2154 terrain = BTEST( wall_flags_ 0(k-1,j,i), 5 ) .OR. &2157 terrain = BTEST( wall_flags_static_0(k-1,j,i), 5 ) .OR. & 2155 2158 topo_no_distinct 2156 building = BTEST( wall_flags_ 0(k-1,j,i), 6 ) .OR. &2159 building = BTEST( wall_flags_static_0(k-1,j,i), 6 ) .OR. & 2157 2160 topo_no_distinct 2158 2161 … … 2161 2164 !-- as terrain but with a non-grid resolved building on top. 2162 2165 !-- These surfaces will be flagged as urban surfaces. 2163 unresolved_building = BTEST( wall_flags_ 0(k-1,j,i), 5 ) &2164 .AND. BTEST( wall_flags_ 0(k-1,j,i), 6 )2166 unresolved_building = BTEST( wall_flags_static_0(k-1,j,i), 5 ) & 2167 .AND. BTEST( wall_flags_static_0(k-1,j,i), 6 ) 2165 2168 ! 2166 2169 !-- Natural surface type … … 2200 2203 !-- Check for any other downward-facing surface. So far only for 2201 2204 !-- default surface type. 2202 ELSEIF ( .NOT. BTEST( wall_flags_ 0(k+1,j,i), 0 ) ) THEN2205 ELSEIF ( .NOT. BTEST( wall_flags_static_0(k+1,j,i), 0 ) ) THEN 2203 2206 CALL initialize_horizontal_surfaces( k, j, i, & 2204 2207 surf_def_h(1), & … … 2210 2213 !-- Check for vertical walls and, if required, initialize it. 2211 2214 ! Start with northward-facing surface. 2212 IF ( .NOT. BTEST( wall_flags_ 0(k,j-1,i), 0 ) ) THEN2215 IF ( .NOT. BTEST( wall_flags_static_0(k,j-1,i), 0 ) ) THEN 2213 2216 ! 2214 2217 !-- Determine flags indicating terrain or building 2215 terrain = BTEST( wall_flags_ 0(k,j-1,i), 5 ) .OR. &2218 terrain = BTEST( wall_flags_static_0(k,j-1,i), 5 ) .OR. & 2216 2219 topo_no_distinct 2217 building = BTEST( wall_flags_ 0(k,j-1,i), 6 ) .OR. &2220 building = BTEST( wall_flags_static_0(k,j-1,i), 6 ) .OR. & 2218 2221 topo_no_distinct 2219 2222 2220 unresolved_building = BTEST( wall_flags_ 0(k,j-1,i), 5 ) &2221 .AND. BTEST( wall_flags_ 0(k,j-1,i), 6 )2223 unresolved_building = BTEST( wall_flags_static_0(k,j-1,i), 5 ) & 2224 .AND. BTEST( wall_flags_static_0(k,j-1,i), 6 ) 2222 2225 2223 2226 IF ( land_surface .AND. terrain .AND. & … … 2247 2250 ! 2248 2251 !-- southward-facing surface 2249 IF ( .NOT. BTEST( wall_flags_ 0(k,j+1,i), 0 ) ) THEN2252 IF ( .NOT. BTEST( wall_flags_static_0(k,j+1,i), 0 ) ) THEN 2250 2253 ! 2251 2254 !-- Determine flags indicating terrain or building 2252 terrain = BTEST( wall_flags_ 0(k,j+1,i), 5 ) .OR. &2255 terrain = BTEST( wall_flags_static_0(k,j+1,i), 5 ) .OR. & 2253 2256 topo_no_distinct 2254 building = BTEST( wall_flags_ 0(k,j+1,i), 6 ) .OR. &2257 building = BTEST( wall_flags_static_0(k,j+1,i), 6 ) .OR. & 2255 2258 topo_no_distinct 2256 2259 2257 unresolved_building = BTEST( wall_flags_ 0(k,j+1,i), 5 ) &2258 .AND. BTEST( wall_flags_ 0(k,j+1,i), 6 )2260 unresolved_building = BTEST( wall_flags_static_0(k,j+1,i), 5 ) & 2261 .AND. BTEST( wall_flags_static_0(k,j+1,i), 6 ) 2259 2262 2260 2263 IF ( land_surface .AND. terrain .AND. & … … 2284 2287 ! 2285 2288 !-- eastward-facing surface 2286 IF ( .NOT. BTEST( wall_flags_ 0(k,j,i-1), 0 ) ) THEN2289 IF ( .NOT. BTEST( wall_flags_static_0(k,j,i-1), 0 ) ) THEN 2287 2290 ! 2288 2291 !-- Determine flags indicating terrain or building 2289 terrain = BTEST( wall_flags_ 0(k,j,i-1), 5 ) .OR. &2292 terrain = BTEST( wall_flags_static_0(k,j,i-1), 5 ) .OR. & 2290 2293 topo_no_distinct 2291 building = BTEST( wall_flags_ 0(k,j,i-1), 6 ) .OR. &2294 building = BTEST( wall_flags_static_0(k,j,i-1), 6 ) .OR. & 2292 2295 topo_no_distinct 2293 2296 2294 unresolved_building = BTEST( wall_flags_ 0(k,j,i-1), 5 ) &2295 .AND. BTEST( wall_flags_ 0(k,j,i-1), 6 )2297 unresolved_building = BTEST( wall_flags_static_0(k,j,i-1), 5 ) & 2298 .AND. BTEST( wall_flags_static_0(k,j,i-1), 6 ) 2296 2299 2297 2300 IF ( land_surface .AND. terrain .AND. & … … 2321 2324 ! 2322 2325 !-- westward-facing surface 2323 IF ( .NOT. BTEST( wall_flags_ 0(k,j,i+1), 0 ) ) THEN2326 IF ( .NOT. BTEST( wall_flags_static_0(k,j,i+1), 0 ) ) THEN 2324 2327 ! 2325 2328 !-- Determine flags indicating terrain or building 2326 terrain = BTEST( wall_flags_ 0(k,j,i+1), 5 ) .OR. &2329 terrain = BTEST( wall_flags_static_0(k,j,i+1), 5 ) .OR. & 2327 2330 topo_no_distinct 2328 building = BTEST( wall_flags_ 0(k,j,i+1), 6 ) .OR. &2331 building = BTEST( wall_flags_static_0(k,j,i+1), 6 ) .OR. & 2329 2332 topo_no_distinct 2330 2333 2331 unresolved_building = BTEST( wall_flags_ 0(k,j,i+1), 5 ) &2332 .AND. BTEST( wall_flags_ 0(k,j,i+1), 6 )2334 unresolved_building = BTEST( wall_flags_static_0(k,j,i+1), 5 ) & 2335 .AND. BTEST( wall_flags_static_0(k,j,i+1), 6 ) 2333 2336 2334 2337 IF ( land_surface .AND. terrain .AND. &
Note: See TracChangeset
for help on using the changeset viewer.