Changeset 4346 for palm/trunk/SOURCE/surface_mod.f90
- Timestamp:
- Dec 18, 2019 11:55:56 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/surface_mod.f90
r4331 r4346 26 26 ! ----------------- 27 27 ! $Id$ 28 ! Introduction of wall_flags_total_0, which currently sets bits based on static 29 ! topography information used in wall_flags_static_0 30 ! 31 ! 4331 2019-12-10 18:25:02Z suehring 28 32 ! -pt_2m - array is moved to diagnostic_output_quantities 29 33 ! … … 114 118 115 119 USE indices, & 116 ONLY: nxl, nxlg, nxr, nxrg, nys, nysg, nyn, nyng, nzb, nzt, wall_flags_static_0 120 ONLY: nxl, nxlg, nxr, nxrg, nys, nysg, nyn, nyng, nzb, nzt, & 121 wall_flags_total_0 117 122 118 123 USE grid_variables, & … … 590 595 ! 591 596 !-- Check if current gridpoint belongs to the atmosphere 592 IF ( BTEST( wall_flags_ static_0(k,j,i), 0 ) ) THEN593 IF ( .NOT. BTEST( wall_flags_ static_0(k+bc_h(l)%koff,&597 IF ( BTEST( wall_flags_total_0(k,j,i), 0 ) ) THEN 598 IF ( .NOT. BTEST( wall_flags_total_0(k+bc_h(l)%koff, & 594 599 j+bc_h(l)%joff, & 595 600 i+bc_h(l)%ioff), 0 ) ) & … … 621 626 ! 622 627 !-- Check if current gridpoint belongs to the atmosphere 623 IF ( BTEST( wall_flags_ static_0(k,j,i), 0 ) ) THEN628 IF ( BTEST( wall_flags_total_0(k,j,i), 0 ) ) THEN 624 629 ! 625 630 !-- Upward-facing 626 IF ( .NOT. BTEST( wall_flags_ static_0(k+bc_h(l)%koff,&631 IF ( .NOT. BTEST( wall_flags_total_0(k+bc_h(l)%koff, & 627 632 j+bc_h(l)%joff, & 628 633 i+bc_h(l)%ioff), 0 ) & … … 657 662 ! 658 663 !-- Check if current gridpoint belongs to the atmosphere 659 IF ( BTEST( wall_flags_ static_0(k,j,i), 0 ) ) THEN660 IF ( .NOT. BTEST( wall_flags_ static_0(k+bc_v(l)%koff,&664 IF ( BTEST( wall_flags_total_0(k,j,i), 0 ) ) THEN 665 IF ( .NOT. BTEST( wall_flags_total_0(k+bc_v(l)%koff, & 661 666 j+bc_v(l)%joff, & 662 667 i+bc_v(l)%ioff), 0 ) ) & … … 690 695 ! 691 696 !-- Check if current gridpoint belongs to the atmosphere 692 IF ( BTEST( wall_flags_ static_0(k,j,i), 0 ) ) THEN697 IF ( BTEST( wall_flags_total_0(k,j,i), 0 ) ) THEN 693 698 ! 694 699 !-- Upward-facing 695 IF ( .NOT. BTEST( wall_flags_ static_0(k+bc_v(l)%koff,&700 IF ( .NOT. BTEST( wall_flags_total_0(k+bc_v(l)%koff, & 696 701 j+bc_v(l)%joff, & 697 702 i+bc_v(l)%ioff), 0 ) & … … 770 775 ! 771 776 !-- Check if current gridpoint belongs to the atmosphere 772 IF ( BTEST( wall_flags_ static_0(k,j,i), 0 ) ) THEN777 IF ( BTEST( wall_flags_total_0(k,j,i), 0 ) ) THEN 773 778 ! 774 779 !-- Check if grid point adjoins to any upward-facing horizontal 775 780 !-- surface, e.g. the Earth surface, plane roofs, or ceilings. 776 781 777 IF ( .NOT. BTEST( wall_flags_ static_0(k-1,j,i), 0 ) ) THEN782 IF ( .NOT. BTEST( wall_flags_total_0(k-1,j,i), 0 ) ) THEN 778 783 ! 779 784 !-- Determine flags indicating a terrain surface, a building 780 785 !-- surface, 781 terrain = BTEST( wall_flags_ static_0(k-1,j,i), 5 ) .OR. &786 terrain = BTEST( wall_flags_total_0(k-1,j,i), 5 ) .OR. & 782 787 topo_no_distinct 783 building = BTEST( wall_flags_ static_0(k-1,j,i), 6 ) .OR. &788 building = BTEST( wall_flags_total_0(k-1,j,i), 6 ) .OR. & 784 789 topo_no_distinct 785 790 ! … … 787 792 !-- as terrain but with a non-grid resolved building on top. 788 793 !-- These surfaces will be flagged as urban surfaces. 789 unresolved_building = BTEST( wall_flags_ static_0(k-1,j,i), 5 ) &790 .AND. BTEST( wall_flags_ static_0(k-1,j,i), 6 )794 unresolved_building = BTEST( wall_flags_total_0(k-1,j,i), 5 ) & 795 .AND. BTEST( wall_flags_total_0(k-1,j,i), 6 ) 791 796 ! 792 797 !-- Land-surface type … … 822 827 !-- Check for any other downward-facing surface. So far only for 823 828 !-- default surface type. 824 ELSEIF ( .NOT. BTEST( wall_flags_ static_0(k+1,j,i), 0 ) ) THEN829 ELSEIF ( .NOT. BTEST( wall_flags_total_0(k+1,j,i), 0 ) ) THEN 825 830 num_def_h(1) = num_def_h(1) + 1 826 831 ENDIF … … 835 840 DO j = nys, nyn 836 841 DO k = nzb+1, nzt 837 IF ( BTEST( wall_flags_ static_0(k,j,i), 0 ) ) THEN842 IF ( BTEST( wall_flags_total_0(k,j,i), 0 ) ) THEN 838 843 ! 839 844 !-- Northward-facing 840 IF ( .NOT. BTEST( wall_flags_ static_0(k,j-1,i), 0 ) ) THEN845 IF ( .NOT. BTEST( wall_flags_total_0(k,j-1,i), 0 ) ) THEN 841 846 ! 842 847 !-- Determine flags indicating terrain or building 843 848 844 terrain = BTEST( wall_flags_ static_0(k,j-1,i), 5 ) .OR. &849 terrain = BTEST( wall_flags_total_0(k,j-1,i), 5 ) .OR. & 845 850 topo_no_distinct 846 building = BTEST( wall_flags_ static_0(k,j-1,i), 6 ) .OR. &851 building = BTEST( wall_flags_total_0(k,j-1,i), 6 ) .OR. & 847 852 topo_no_distinct 848 853 849 unresolved_building = BTEST( wall_flags_ static_0(k,j-1,i), 5 ) &850 .AND. BTEST( wall_flags_ static_0(k,j-1,i), 6 )854 unresolved_building = BTEST( wall_flags_total_0(k,j-1,i), 5 ) & 855 .AND. BTEST( wall_flags_total_0(k,j-1,i), 6 ) 851 856 852 857 IF ( land_surface .AND. terrain .AND. & … … 873 878 ! 874 879 !-- Southward-facing 875 IF ( .NOT. BTEST( wall_flags_ static_0(k,j+1,i), 0 ) ) THEN880 IF ( .NOT. BTEST( wall_flags_total_0(k,j+1,i), 0 ) ) THEN 876 881 ! 877 882 !-- Determine flags indicating terrain or building 878 terrain = BTEST( wall_flags_ static_0(k,j+1,i), 5 ) .OR. &883 terrain = BTEST( wall_flags_total_0(k,j+1,i), 5 ) .OR. & 879 884 topo_no_distinct 880 building = BTEST( wall_flags_ static_0(k,j+1,i), 6 ) .OR. &885 building = BTEST( wall_flags_total_0(k,j+1,i), 6 ) .OR. & 881 886 topo_no_distinct 882 887 883 unresolved_building = BTEST( wall_flags_ static_0(k,j+1,i), 5 ) &884 .AND. BTEST( wall_flags_ static_0(k,j+1,i), 6 )888 unresolved_building = BTEST( wall_flags_total_0(k,j+1,i), 5 ) & 889 .AND. BTEST( wall_flags_total_0(k,j+1,i), 6 ) 885 890 886 891 IF ( land_surface .AND. terrain .AND. & … … 907 912 ! 908 913 !-- Eastward-facing 909 IF ( .NOT. BTEST( wall_flags_ static_0(k,j,i-1), 0 ) ) THEN914 IF ( .NOT. BTEST( wall_flags_total_0(k,j,i-1), 0 ) ) THEN 910 915 ! 911 916 !-- Determine flags indicating terrain or building 912 terrain = BTEST( wall_flags_ static_0(k,j,i-1), 5 ) .OR. &917 terrain = BTEST( wall_flags_total_0(k,j,i-1), 5 ) .OR. & 913 918 topo_no_distinct 914 building = BTEST( wall_flags_ static_0(k,j,i-1), 6 ) .OR. &919 building = BTEST( wall_flags_total_0(k,j,i-1), 6 ) .OR. & 915 920 topo_no_distinct 916 921 917 unresolved_building = BTEST( wall_flags_ static_0(k,j,i-1), 5 ) &918 .AND. BTEST( wall_flags_ static_0(k,j,i-1), 6 )922 unresolved_building = BTEST( wall_flags_total_0(k,j,i-1), 5 ) & 923 .AND. BTEST( wall_flags_total_0(k,j,i-1), 6 ) 919 924 920 925 IF ( land_surface .AND. terrain .AND. & … … 941 946 ! 942 947 !-- Westward-facing 943 IF ( .NOT. BTEST( wall_flags_ static_0(k,j,i+1), 0 ) ) THEN948 IF ( .NOT. BTEST( wall_flags_total_0(k,j,i+1), 0 ) ) THEN 944 949 ! 945 950 !-- Determine flags indicating terrain or building 946 terrain = BTEST( wall_flags_ static_0(k,j,i+1), 5 ) .OR. &951 terrain = BTEST( wall_flags_total_0(k,j,i+1), 5 ) .OR. & 947 952 topo_no_distinct 948 building = BTEST( wall_flags_ static_0(k,j,i+1), 6 ) .OR. &953 building = BTEST( wall_flags_total_0(k,j,i+1), 6 ) .OR. & 949 954 topo_no_distinct 950 955 951 unresolved_building = BTEST( wall_flags_ static_0(k,j,i+1), 5 ) &952 .AND. BTEST( wall_flags_ static_0(k,j,i+1), 6 )956 unresolved_building = BTEST( wall_flags_total_0(k,j,i+1), 5 ) & 957 .AND. BTEST( wall_flags_total_0(k,j,i+1), 6 ) 953 958 954 959 IF ( land_surface .AND. terrain .AND. & … … 2139 2144 ! 2140 2145 !-- Check if current gridpoint belongs to the atmosphere 2141 IF ( BTEST( wall_flags_ static_0(k,j,i), 0 ) ) THEN2146 IF ( BTEST( wall_flags_total_0(k,j,i), 0 ) ) THEN 2142 2147 ! 2143 2148 !-- Upward-facing surface. Distinguish between differet surface types. 2144 2149 !-- To do, think about method to flag natural and non-natural 2145 2150 !-- surfaces. 2146 IF ( .NOT. BTEST( wall_flags_ static_0(k-1,j,i), 0 ) ) THEN2151 IF ( .NOT. BTEST( wall_flags_total_0(k-1,j,i), 0 ) ) THEN 2147 2152 ! 2148 2153 !-- Determine flags indicating terrain or building 2149 terrain = BTEST( wall_flags_ static_0(k-1,j,i), 5 ) .OR. &2154 terrain = BTEST( wall_flags_total_0(k-1,j,i), 5 ) .OR. & 2150 2155 topo_no_distinct 2151 building = BTEST( wall_flags_ static_0(k-1,j,i), 6 ) .OR. &2156 building = BTEST( wall_flags_total_0(k-1,j,i), 6 ) .OR. & 2152 2157 topo_no_distinct 2153 2158 … … 2156 2161 !-- as terrain but with a non-grid resolved building on top. 2157 2162 !-- These surfaces will be flagged as urban surfaces. 2158 unresolved_building = BTEST( wall_flags_ static_0(k-1,j,i), 5 ) &2159 .AND. BTEST( wall_flags_ static_0(k-1,j,i), 6 )2163 unresolved_building = BTEST( wall_flags_total_0(k-1,j,i), 5 ) & 2164 .AND. BTEST( wall_flags_total_0(k-1,j,i), 6 ) 2160 2165 ! 2161 2166 !-- Natural surface type … … 2195 2200 !-- Check for any other downward-facing surface. So far only for 2196 2201 !-- default surface type. 2197 ELSEIF ( .NOT. BTEST( wall_flags_ static_0(k+1,j,i), 0 ) ) THEN2202 ELSEIF ( .NOT. BTEST( wall_flags_total_0(k+1,j,i), 0 ) ) THEN 2198 2203 CALL initialize_horizontal_surfaces( k, j, i, & 2199 2204 surf_def_h(1), & … … 2205 2210 !-- Check for vertical walls and, if required, initialize it. 2206 2211 ! Start with northward-facing surface. 2207 IF ( .NOT. BTEST( wall_flags_ static_0(k,j-1,i), 0 ) ) THEN2212 IF ( .NOT. BTEST( wall_flags_total_0(k,j-1,i), 0 ) ) THEN 2208 2213 ! 2209 2214 !-- Determine flags indicating terrain or building 2210 terrain = BTEST( wall_flags_ static_0(k,j-1,i), 5 ) .OR. &2215 terrain = BTEST( wall_flags_total_0(k,j-1,i), 5 ) .OR. & 2211 2216 topo_no_distinct 2212 building = BTEST( wall_flags_ static_0(k,j-1,i), 6 ) .OR. &2217 building = BTEST( wall_flags_total_0(k,j-1,i), 6 ) .OR. & 2213 2218 topo_no_distinct 2214 2219 2215 unresolved_building = BTEST( wall_flags_ static_0(k,j-1,i), 5 ) &2216 .AND. BTEST( wall_flags_ static_0(k,j-1,i), 6 )2220 unresolved_building = BTEST( wall_flags_total_0(k,j-1,i), 5 ) & 2221 .AND. BTEST( wall_flags_total_0(k,j-1,i), 6 ) 2217 2222 2218 2223 IF ( land_surface .AND. terrain .AND. & … … 2242 2247 ! 2243 2248 !-- southward-facing surface 2244 IF ( .NOT. BTEST( wall_flags_ static_0(k,j+1,i), 0 ) ) THEN2249 IF ( .NOT. BTEST( wall_flags_total_0(k,j+1,i), 0 ) ) THEN 2245 2250 ! 2246 2251 !-- Determine flags indicating terrain or building 2247 terrain = BTEST( wall_flags_ static_0(k,j+1,i), 5 ) .OR. &2252 terrain = BTEST( wall_flags_total_0(k,j+1,i), 5 ) .OR. & 2248 2253 topo_no_distinct 2249 building = BTEST( wall_flags_ static_0(k,j+1,i), 6 ) .OR. &2254 building = BTEST( wall_flags_total_0(k,j+1,i), 6 ) .OR. & 2250 2255 topo_no_distinct 2251 2256 2252 unresolved_building = BTEST( wall_flags_ static_0(k,j+1,i), 5 ) &2253 .AND. BTEST( wall_flags_ static_0(k,j+1,i), 6 )2257 unresolved_building = BTEST( wall_flags_total_0(k,j+1,i), 5 ) & 2258 .AND. BTEST( wall_flags_total_0(k,j+1,i), 6 ) 2254 2259 2255 2260 IF ( land_surface .AND. terrain .AND. & … … 2279 2284 ! 2280 2285 !-- eastward-facing surface 2281 IF ( .NOT. BTEST( wall_flags_ static_0(k,j,i-1), 0 ) ) THEN2286 IF ( .NOT. BTEST( wall_flags_total_0(k,j,i-1), 0 ) ) THEN 2282 2287 ! 2283 2288 !-- Determine flags indicating terrain or building 2284 terrain = BTEST( wall_flags_ static_0(k,j,i-1), 5 ) .OR. &2289 terrain = BTEST( wall_flags_total_0(k,j,i-1), 5 ) .OR. & 2285 2290 topo_no_distinct 2286 building = BTEST( wall_flags_ static_0(k,j,i-1), 6 ) .OR. &2291 building = BTEST( wall_flags_total_0(k,j,i-1), 6 ) .OR. & 2287 2292 topo_no_distinct 2288 2293 2289 unresolved_building = BTEST( wall_flags_ static_0(k,j,i-1), 5 ) &2290 .AND. BTEST( wall_flags_ static_0(k,j,i-1), 6 )2294 unresolved_building = BTEST( wall_flags_total_0(k,j,i-1), 5 ) & 2295 .AND. BTEST( wall_flags_total_0(k,j,i-1), 6 ) 2291 2296 2292 2297 IF ( land_surface .AND. terrain .AND. & … … 2316 2321 ! 2317 2322 !-- westward-facing surface 2318 IF ( .NOT. BTEST( wall_flags_ static_0(k,j,i+1), 0 ) ) THEN2323 IF ( .NOT. BTEST( wall_flags_total_0(k,j,i+1), 0 ) ) THEN 2319 2324 ! 2320 2325 !-- Determine flags indicating terrain or building 2321 terrain = BTEST( wall_flags_ static_0(k,j,i+1), 5 ) .OR. &2326 terrain = BTEST( wall_flags_total_0(k,j,i+1), 5 ) .OR. & 2322 2327 topo_no_distinct 2323 building = BTEST( wall_flags_ static_0(k,j,i+1), 6 ) .OR. &2328 building = BTEST( wall_flags_total_0(k,j,i+1), 6 ) .OR. & 2324 2329 topo_no_distinct 2325 2330 2326 unresolved_building = BTEST( wall_flags_ static_0(k,j,i+1), 5 ) &2327 .AND. BTEST( wall_flags_ static_0(k,j,i+1), 6 )2331 unresolved_building = BTEST( wall_flags_total_0(k,j,i+1), 5 ) & 2332 .AND. BTEST( wall_flags_total_0(k,j,i+1), 6 ) 2328 2333 2329 2334 IF ( land_surface .AND. terrain .AND. &
Note: See TracChangeset
for help on using the changeset viewer.