- Timestamp:
- Jan 17, 2018 4:24:59 PM (7 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/diffusion_s.f90
r2718 r2759 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Major bugfix, horizontal diffusion at vertical surfaces corrected. 28 ! 29 ! 2718 2018-01-02 08:49:38Z maronga 27 30 ! Corrected "Former revisions" section 28 31 ! … … 136 139 137 140 USE grid_variables, & 138 ONLY: ddx 2, ddy2141 ONLY: ddx, ddx2, ddy, ddy2 139 142 140 143 USE indices, & … … 231 234 DO m = surf_s, surf_e 232 235 k = surf_def_v(0)%k(m) 233 tend(k,j,i) = tend(k,j,i) + s_flux_def_v_north(m) * ddy 2236 tend(k,j,i) = tend(k,j,i) + s_flux_def_v_north(m) * ddy 234 237 ENDDO 235 238 ! … … 239 242 DO m = surf_s, surf_e 240 243 k = surf_def_v(1)%k(m) 241 tend(k,j,i) = tend(k,j,i) + s_flux_def_v_south(m) * ddy 2244 tend(k,j,i) = tend(k,j,i) + s_flux_def_v_south(m) * ddy 242 245 ENDDO 243 246 ! … … 247 250 DO m = surf_s, surf_e 248 251 k = surf_def_v(2)%k(m) 249 tend(k,j,i) = tend(k,j,i) + s_flux_def_v_east(m) * ddx 2252 tend(k,j,i) = tend(k,j,i) + s_flux_def_v_east(m) * ddx 250 253 ENDDO 251 254 ! … … 255 258 DO m = surf_s, surf_e 256 259 k = surf_def_v(3)%k(m) 257 tend(k,j,i) = tend(k,j,i) + s_flux_def_v_west(m) * ddx 2260 tend(k,j,i) = tend(k,j,i) + s_flux_def_v_west(m) * ddx 258 261 ENDDO 259 262 ! … … 264 267 DO m = surf_s, surf_e 265 268 k = surf_lsm_v(0)%k(m) 266 tend(k,j,i) = tend(k,j,i) + s_flux_lsm_v_north(m) * ddy 2269 tend(k,j,i) = tend(k,j,i) + s_flux_lsm_v_north(m) * ddy 267 270 ENDDO 268 271 ! … … 272 275 DO m = surf_s, surf_e 273 276 k = surf_lsm_v(1)%k(m) 274 tend(k,j,i) = tend(k,j,i) + s_flux_lsm_v_south(m) * ddy 2277 tend(k,j,i) = tend(k,j,i) + s_flux_lsm_v_south(m) * ddy 275 278 ENDDO 276 279 ! … … 280 283 DO m = surf_s, surf_e 281 284 k = surf_lsm_v(2)%k(m) 282 tend(k,j,i) = tend(k,j,i) + s_flux_lsm_v_east(m) * ddx 2285 tend(k,j,i) = tend(k,j,i) + s_flux_lsm_v_east(m) * ddx 283 286 ENDDO 284 287 ! … … 288 291 DO m = surf_s, surf_e 289 292 k = surf_lsm_v(3)%k(m) 290 tend(k,j,i) = tend(k,j,i) + s_flux_lsm_v_west(m) * ddx 2293 tend(k,j,i) = tend(k,j,i) + s_flux_lsm_v_west(m) * ddx 291 294 ENDDO 292 295 ! … … 297 300 DO m = surf_s, surf_e 298 301 k = surf_usm_v(0)%k(m) 299 tend(k,j,i) = tend(k,j,i) + s_flux_usm_v_north(m) * ddy 2302 tend(k,j,i) = tend(k,j,i) + s_flux_usm_v_north(m) * ddy 300 303 ENDDO 301 304 ! … … 305 308 DO m = surf_s, surf_e 306 309 k = surf_usm_v(1)%k(m) 307 tend(k,j,i) = tend(k,j,i) + s_flux_usm_v_south(m) * ddy 2310 tend(k,j,i) = tend(k,j,i) + s_flux_usm_v_south(m) * ddy 308 311 ENDDO 309 312 ! … … 313 316 DO m = surf_s, surf_e 314 317 k = surf_usm_v(2)%k(m) 315 tend(k,j,i) = tend(k,j,i) + s_flux_usm_v_east(m) * ddx 2318 tend(k,j,i) = tend(k,j,i) + s_flux_usm_v_east(m) * ddx 316 319 ENDDO 317 320 ! … … 321 324 DO m = surf_s, surf_e 322 325 k = surf_usm_v(3)%k(m) 323 tend(k,j,i) = tend(k,j,i) + s_flux_usm_v_west(m) * ddx 2326 tend(k,j,i) = tend(k,j,i) + s_flux_usm_v_west(m) * ddx 324 327 ENDDO 325 328 … … 448 451 449 452 USE grid_variables, & 450 ONLY: ddx 2, ddy2453 ONLY: ddx, ddx2, ddy, ddy2 451 454 452 455 USE indices, & … … 543 546 DO m = surf_s, surf_e 544 547 k = surf_def_v(0)%k(m) 545 tend(k,j,i) = tend(k,j,i) + s_flux_def_v_north(m) * ddy 2548 tend(k,j,i) = tend(k,j,i) + s_flux_def_v_north(m) * ddy 546 549 ENDDO 547 550 ! … … 551 554 DO m = surf_s, surf_e 552 555 k = surf_def_v(1)%k(m) 553 tend(k,j,i) = tend(k,j,i) + s_flux_def_v_south(m) * ddy 2556 tend(k,j,i) = tend(k,j,i) + s_flux_def_v_south(m) * ddy 554 557 ENDDO 555 558 ! … … 559 562 DO m = surf_s, surf_e 560 563 k = surf_def_v(2)%k(m) 561 tend(k,j,i) = tend(k,j,i) + s_flux_def_v_east(m) * ddx 2564 tend(k,j,i) = tend(k,j,i) + s_flux_def_v_east(m) * ddx 562 565 ENDDO 563 566 ! … … 567 570 DO m = surf_s, surf_e 568 571 k = surf_def_v(3)%k(m) 569 tend(k,j,i) = tend(k,j,i) + s_flux_def_v_west(m) * ddx 2572 tend(k,j,i) = tend(k,j,i) + s_flux_def_v_west(m) * ddx 570 573 ENDDO 571 574 ! … … 576 579 DO m = surf_s, surf_e 577 580 k = surf_lsm_v(0)%k(m) 578 tend(k,j,i) = tend(k,j,i) + s_flux_lsm_v_north(m) * ddy 2581 tend(k,j,i) = tend(k,j,i) + s_flux_lsm_v_north(m) * ddy 579 582 ENDDO 580 583 ! … … 584 587 DO m = surf_s, surf_e 585 588 k = surf_lsm_v(1)%k(m) 586 tend(k,j,i) = tend(k,j,i) + s_flux_lsm_v_south(m) * ddy 2589 tend(k,j,i) = tend(k,j,i) + s_flux_lsm_v_south(m) * ddy 587 590 ENDDO 588 591 ! … … 592 595 DO m = surf_s, surf_e 593 596 k = surf_lsm_v(2)%k(m) 594 tend(k,j,i) = tend(k,j,i) + s_flux_lsm_v_east(m) * ddx 2597 tend(k,j,i) = tend(k,j,i) + s_flux_lsm_v_east(m) * ddx 595 598 ENDDO 596 599 ! … … 600 603 DO m = surf_s, surf_e 601 604 k = surf_lsm_v(3)%k(m) 602 tend(k,j,i) = tend(k,j,i) + s_flux_lsm_v_west(m) * ddx 2605 tend(k,j,i) = tend(k,j,i) + s_flux_lsm_v_west(m) * ddx 603 606 ENDDO 604 607 ! … … 609 612 DO m = surf_s, surf_e 610 613 k = surf_usm_v(0)%k(m) 611 tend(k,j,i) = tend(k,j,i) + s_flux_usm_v_north(m) * ddy 2614 tend(k,j,i) = tend(k,j,i) + s_flux_usm_v_north(m) * ddy 612 615 ENDDO 613 616 ! … … 617 620 DO m = surf_s, surf_e 618 621 k = surf_usm_v(1)%k(m) 619 tend(k,j,i) = tend(k,j,i) + s_flux_usm_v_south(m) * ddy 2622 tend(k,j,i) = tend(k,j,i) + s_flux_usm_v_south(m) * ddy 620 623 ENDDO 621 624 ! … … 625 628 DO m = surf_s, surf_e 626 629 k = surf_usm_v(2)%k(m) 627 tend(k,j,i) = tend(k,j,i) + s_flux_usm_v_east(m) * ddx 2630 tend(k,j,i) = tend(k,j,i) + s_flux_usm_v_east(m) * ddx 628 631 ENDDO 629 632 ! … … 633 636 DO m = surf_s, surf_e 634 637 k = surf_usm_v(3)%k(m) 635 tend(k,j,i) = tend(k,j,i) + s_flux_usm_v_west(m) * ddx 2638 tend(k,j,i) = tend(k,j,i) + s_flux_usm_v_west(m) * ddx 636 639 ENDDO 637 640 -
palm/trunk/SOURCE/surface_mod.f90
r2753 r2759 26 26 ! ----------------- 27 27 ! $Id$ 28 ! Bugfix, consider density in vertical fluxes of passive scalar as well as 29 ! chemical species. 30 ! 31 ! 2753 2018-01-16 14:16:49Z suehring 28 32 ! +r_a_green, r_a_window 29 33 ! … … 116 120 117 121 USE arrays_3d, & 118 ONLY: zu, zw, heatflux_input_conversion, waterflux_input_conversion,&119 momentumflux_input_conversion122 ONLY: heatflux_input_conversion, momentumflux_input_conversion, & 123 rho_air, rho_air_zw, zu, zw, waterflux_input_conversion 120 124 121 125 #if defined( __chem ) … … 1753 1757 IF ( .NOT. random_heatflux ) THEN 1754 1758 surf%shf(num_h) = surface_heatflux * & 1755 heatflux_input_conversion( nzb)1759 heatflux_input_conversion(k-1) 1756 1760 ! 1757 1761 !-- Check if surface heat flux might be replaced by … … 1784 1788 IF ( constant_waterflux ) THEN 1785 1789 surf%qsws(num_h) = surface_waterflux * & 1786 waterflux_input_conversion( nzb)1790 waterflux_input_conversion(k-1) 1787 1791 IF ( k-1 /= 0 ) THEN 1788 1792 surf%qsws(num_h) = wall_humidityflux(0) * & … … 1801 1805 IF ( upward_facing ) THEN 1802 1806 IF ( constant_scalarflux ) THEN 1803 surf%ssws(num_h) = surface_scalarflux 1807 surf%ssws(num_h) = surface_scalarflux * rho_air_zw(k-1) 1804 1808 1805 1809 IF ( k-1 /= 0 ) & 1806 surf%ssws(num_h) = wall_scalarflux(0) 1810 surf%ssws(num_h) = wall_scalarflux(0) * & 1811 rho_air_zw(k-1) 1807 1812 1808 1813 ELSE … … 1810 1815 ENDIF 1811 1816 ELSE 1812 surf%ssws(num_h) = wall_scalarflux(5) 1817 surf%ssws(num_h) = wall_scalarflux(5) * rho_air_zw(k) 1813 1818 ENDIF 1814 1819 ENDIF … … 1824 1829 IF ( upward_facing ) THEN 1825 1830 IF ( constant_csflux(lsp_pr) ) THEN 1826 surf%cssws(lsp,num_h) = surface_csflux(lsp_pr) 1827 1828 IF ( k-1 /= 0 ) & 1829 surf%cssws(lsp,num_h) = wall_csflux(lsp,0) 1831 surf%cssws(lsp,num_h) = & 1832 surface_csflux(lsp_pr) *& 1833 rho_air_zw(k-1) 1834 1835 IF ( k-1 /= 0 ) & 1836 surf%cssws(lsp,num_h) = & 1837 wall_csflux(lsp,0) * & 1838 rho_air_zw(k-1) 1830 1839 ELSE 1831 1840 surf%cssws(lsp,num_h) = 0.0_wp 1832 1841 ENDIF 1833 1842 ELSE 1834 surf%cssws(lsp,num_h) = wall_csflux(lsp,5) 1843 surf%cssws(lsp,num_h) = wall_csflux(lsp,5) * & 1844 rho_air_zw(k) 1835 1845 ENDIF 1836 1846 ENDIF … … 1843 1853 IF ( ocean ) THEN 1844 1854 IF ( upward_facing ) THEN 1845 surf%sasws(num_h) = bottom_salinityflux 1855 surf%sasws(num_h) = bottom_salinityflux * rho_air_zw(k-1) 1846 1856 ELSE 1847 1857 surf%sasws(num_h) = 0.0_wp … … 1907 1917 !-- Prescribe top scalar flux 1908 1918 IF ( passive_scalar .AND. constant_top_scalarflux ) & 1909 surf%ssws(num_h) = top_scalarflux 1919 surf%ssws(num_h) = top_scalarflux * rho_air_zw(nzt+1) 1910 1920 ! 1911 1921 !-- Prescribe top chemical species' flux … … 1913 1923 DO lsp = 1, nvar 1914 1924 IF ( air_chemistry .AND. constant_top_csflux(lsp) ) THEN 1915 surf%cssws(lsp,num_h) = top_csflux(lsp) 1925 surf%cssws(lsp,num_h) = top_csflux(lsp) * rho_air_zw(nzt+1) 1916 1926 ENDIF 1917 1927 ENDDO … … 1920 1930 !-- Prescribe top salinity flux 1921 1931 IF ( ocean .AND. constant_top_salinityflux) & 1922 surf%sasws(num_h) = top_salinityflux 1932 surf%sasws(num_h) = top_salinityflux * rho_air_zw(nzt+1) 1923 1933 ! 1924 1934 !-- Top momentum fluxes
Note: See TracChangeset
for help on using the changeset viewer.