Changeset 3145 for palm/trunk/SOURCE/turbulence_closure_mod.f90
- Timestamp:
- Jul 18, 2018 5:24:10 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/turbulence_closure_mod.f90
r3130 r3145 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Use MOST for km only in RANS mode 28 ! 29 ! 3130 2018-07-16 11:08:55Z gronemeier 27 30 ! - move boundary condition of km and kh to tcm_diffusivities 28 31 ! - calculate km at boundaries according to MOST … … 1905 1908 ONLY: constant_flux_layer 1906 1909 1910 USE surface_layer_fluxes_mod, & 1911 ONLY: phi_m 1912 1907 1913 USE surface_mod, & 1908 1914 ONLY : surf_def_h, surf_lsm_h, surf_usm_h … … 1914 1920 INTEGER(iwp) :: k !< grid index z-direction 1915 1921 INTEGER(iwp) :: m !< running index surface elements 1922 1923 REAL(wp) :: km_sfc !< diffusion coefficient, used to compute virtual velocities 1916 1924 1917 1925 IF ( constant_flux_layer ) THEN … … 1937 1945 !-- interpolation of km onto the u/v-grid is necessary. However, the 1938 1946 !-- effect of this error is negligible. 1947 km_sfc = kappa * surf_def_h(0)%us(m) * surf_def_h(0)%z_mo(m) / & 1948 phi_m( surf_def_h(0)%z_mo(m) / surf_def_h(0)%ol(m) ) 1949 1939 1950 surf_def_h(0)%u_0(m) = u(k+1,j,i) + surf_def_h(0)%usws(m) * & 1940 1951 drho_air_zw(k-1) * & 1941 1952 ( zu(k+1) - zu(k-1) ) / & 1942 ( km (k,j,i)+ 1.0E-20_wp )1953 ( km_sfc + 1.0E-20_wp ) 1943 1954 surf_def_h(0)%v_0(m) = v(k+1,j,i) + surf_def_h(0)%vsws(m) * & 1944 1955 drho_air_zw(k-1) * & 1945 1956 ( zu(k+1) - zu(k-1) ) / & 1946 ( km (k,j,i)+ 1.0E-20_wp )1957 ( km_sfc + 1.0E-20_wp ) 1947 1958 1948 1959 IF ( ABS( u(k+1,j,i) - surf_def_h(0)%u_0(m) ) > & … … 1999 2010 !-- interpolation of km onto the u/v-grid is necessary. However, the 2000 2011 !-- effect of this error is negligible. 2012 km_sfc = kappa * surf_lsm_h%us(m) * surf_lsm_h%z_mo(m) / & 2013 phi_m( surf_lsm_h%z_mo(m) / surf_lsm_h%ol(m) ) 2014 2001 2015 surf_lsm_h%u_0(m) = u(k+1,j,i) + surf_lsm_h%usws(m) * & 2002 2016 drho_air_zw(k-1) * & 2003 ( zu(k+1) - zu(k-1) ) /&2004 ( km (k,j,i)+ 1.0E-20_wp )2017 ( zu(k+1) - zu(k-1) ) / & 2018 ( km_sfc + 1.0E-20_wp ) 2005 2019 surf_lsm_h%v_0(m) = v(k+1,j,i) + surf_lsm_h%vsws(m) * & 2006 2020 drho_air_zw(k-1) * & 2007 2021 ( zu(k+1) - zu(k-1) ) / & 2008 ( km (k,j,i)+ 1.0E-20_wp )2022 ( km_sfc + 1.0E-20_wp ) 2009 2023 2010 2024 IF ( ABS( u(k+1,j,i) - surf_lsm_h%u_0(m) ) > & … … 2030 2044 !-- interpolation of km onto the u/v-grid is necessary. However, the 2031 2045 !-- effect of this error is negligible. 2046 km_sfc = kappa * surf_usm_h%us(m) * surf_usm_h%z_mo(m) / & 2047 phi_m( surf_usm_h%z_mo(m) / surf_usm_h%ol(m) ) 2048 2032 2049 surf_usm_h%u_0(m) = u(k+1,j,i) + surf_usm_h%usws(m) * & 2033 2050 drho_air_zw(k-1) * & 2034 2051 ( zu(k+1) - zu(k-1) ) / & 2035 ( km (k,j,i)+ 1.0E-20_wp )2052 ( km_sfc + 1.0E-20_wp ) 2036 2053 surf_usm_h%v_0(m) = v(k+1,j,i) + surf_usm_h%vsws(m) * & 2037 2054 drho_air_zw(k-1) * & 2038 2055 ( zu(k+1) - zu(k-1) ) / & 2039 ( km (k,j,i)+ 1.0E-20_wp )2056 ( km_sfc + 1.0E-20_wp ) 2040 2057 2041 2058 IF ( ABS( u(k+1,j,i) - surf_usm_h%u_0(m) ) > & … … 4591 4608 ! ------------ 4592 4609 !> Computation of the turbulent diffusion coefficients for momentum and heat. 4610 !> @bug unstable stratification is not properly considered for kh in rans mode. 4593 4611 !------------------------------------------------------------------------------! 4594 4612 SUBROUTINE tcm_diffusivities( var, var_reference ) … … 4642 4660 4643 4661 ! 4644 !-- Set boundary values (Neumann conditions at downward facing surfaces, 4645 !-- according to MOST at upward facing surfaces and vertical surfaces). 4646 ! 4662 !-- In RANS mode, use MOST to calculate km and kh within the surface layer. 4663 IF ( rans_tke_e ) THEN 4664 ! 4665 !-- Upward facing surfaces 4666 !-- Default surfaces 4667 n = 0 4668 !$OMP PARALLEL DO PRIVATE(i,j,k,m) 4669 DO m = 1, surf_def_h(0)%ns 4670 i = surf_def_h(0)%i(m) 4671 j = surf_def_h(0)%j(m) 4672 k = surf_def_h(0)%k(m) 4673 km(k,j,i) = kappa * surf_def_h(0)%us(m) * surf_def_h(0)%z_mo(m) / & 4674 phi_m( surf_def_h(0)%z_mo(m) / surf_def_h(0)%ol(m) ) 4675 kh(k,j,i) = 1.35_wp * km(k,j,i) 4676 ENDDO 4677 ! 4678 !-- Natural surfaces 4679 !$OMP PARALLEL DO PRIVATE(i,j,k,m) 4680 DO m = 1, surf_lsm_h%ns 4681 i = surf_lsm_h%i(m) 4682 j = surf_lsm_h%j(m) 4683 k = surf_lsm_h%k(m) 4684 km(k,j,i) = kappa * surf_lsm_h%us(m) * surf_lsm_h%z_mo(m) / & 4685 phi_m( surf_lsm_h%z_mo(m) / surf_lsm_h%ol(m) ) 4686 kh(k,j,i) = 1.35_wp * km(k,j,i) 4687 ENDDO 4688 ! 4689 !-- Urban surfaces 4690 !$OMP PARALLEL DO PRIVATE(i,j,k,m) 4691 DO m = 1, surf_usm_h%ns 4692 i = surf_usm_h%i(m) 4693 j = surf_usm_h%j(m) 4694 k = surf_usm_h%k(m) 4695 km(k,j,i) = kappa * surf_usm_h%us(m) * surf_usm_h%z_mo(m) / & 4696 phi_m( surf_usm_h%z_mo(m) / surf_usm_h%ol(m) ) 4697 kh(k,j,i) = 1.35_wp * km(k,j,i) 4698 ENDDO 4699 4700 ! 4701 !-- North-, south-, west and eastward facing surfaces 4702 !-- Do not consider stratification at these surfaces. 4703 DO n = 0, 3 4704 ! 4705 !-- Default surfaces 4706 !$OMP PARALLEL DO PRIVATE(i,j,k,m) 4707 DO m = 1, surf_def_v(n)%ns 4708 i = surf_def_v(n)%i(m) 4709 j = surf_def_v(n)%j(m) 4710 k = surf_def_v(n)%k(m) 4711 km(k,j,i) = kappa * surf_def_v(n)%us(m) * surf_def_v(n)%z_mo(m) 4712 kh(k,j,i) = 1.35_wp * km(k,j,i) 4713 ENDDO 4714 ! 4715 !-- Natural surfaces 4716 !$OMP PARALLEL DO PRIVATE(i,j,k,m) 4717 DO m = 1, surf_lsm_v(n)%ns 4718 i = surf_lsm_v(n)%i(m) 4719 j = surf_lsm_v(n)%j(m) 4720 k = surf_lsm_v(n)%k(m) 4721 km(k,j,i) = kappa * surf_lsm_v(n)%us(m) * surf_lsm_v(n)%z_mo(m) 4722 kh(k,j,i) = 1.35_wp * km(k,j,i) 4723 ENDDO 4724 ! 4725 !-- Urban surfaces 4726 !$OMP PARALLEL DO PRIVATE(i,j,k,m) 4727 DO m = 1, surf_usm_v(n)%ns 4728 i = surf_usm_v(n)%i(m) 4729 j = surf_usm_v(n)%j(m) 4730 k = surf_usm_v(n)%k(m) 4731 km(k,j,i) = kappa * surf_usm_v(n)%us(m) * surf_usm_v(n)%z_mo(m) 4732 kh(k,j,i) = 1.35_wp * km(k,j,i) 4733 ENDDO 4734 ENDDO 4735 4736 CALL exchange_horiz( km, nbgp ) 4737 CALL exchange_horiz( kh, nbgp ) 4738 4739 ENDIF 4740 ! 4741 !-- Set boundary values (Neumann conditions) 4647 4742 !-- Downward facing surfaces 4648 4743 !$OMP PARALLEL DO PRIVATE(i,j,k) … … 4654 4749 kh(k+1,j,i) = kh(k,j,i) 4655 4750 ENDDO 4656 4657 !-- Upward facing surfaces 4658 !-- Default surfaces 4659 n = 0 4660 !$OMP PARALLEL DO PRIVATE(i,j,k,m) 4661 DO m = 1, surf_def_h(n)%ns 4662 i = surf_def_h(n)%i(m) 4663 j = surf_def_h(n)%j(m) 4664 k = surf_def_h(n)%k(m) 4665 km(k,j,i) = kappa * surf_def_h(n)%us(m) * surf_def_h(n)%z_mo(m) / & 4666 phi_m( surf_def_h(n)%z_mo(m) / surf_def_h(n)%ol(m) ) 4667 kh(k,j,i) = 1.35_wp * km(k,j,i) 4751 ! 4752 !-- Downward facing surfaces 4753 !$OMP PARALLEL DO PRIVATE(i,j,k) 4754 DO m = 1, bc_h(0)%ns 4755 i = bc_h(0)%i(m) 4756 j = bc_h(0)%j(m) 4757 k = bc_h(0)%k(m) 4758 km(k-1,j,i) = km(k,j,i) 4759 kh(k-1,j,i) = kh(k,j,i) 4668 4760 ENDDO 4669 !4670 !-- Natural surfaces4671 !$OMP PARALLEL DO PRIVATE(i,j,k,m)4672 DO m = 1, surf_lsm_h%ns4673 i = surf_lsm_h%i(m)4674 j = surf_lsm_h%j(m)4675 k = surf_lsm_h%k(m)4676 km(k,j,i) = kappa * surf_lsm_h%us(m) * surf_lsm_h%z_mo(m) / &4677 phi_m( surf_lsm_h%z_mo(m) / surf_lsm_h%ol(m) )4678 kh(k,j,i) = 1.35_wp * km(k,j,i)4679 ENDDO4680 !4681 !-- Urban surfaces4682 !$OMP PARALLEL DO PRIVATE(i,j,k,m)4683 DO m = 1, surf_usm_h%ns4684 i = surf_usm_h%i(m)4685 j = surf_usm_h%j(m)4686 k = surf_usm_h%k(m)4687 km(k,j,i) = kappa * surf_usm_h%us(m) * surf_usm_h%z_mo(m) / &4688 phi_m( surf_usm_h%z_mo(m) / surf_usm_h%ol(m) )4689 kh(k,j,i) = 1.35_wp * km(k,j,i)4690 ENDDO4691 4692 !4693 !-- North-, south-, west and eastward facing surfaces4694 DO n = 0, 34695 !4696 !-- Default surfaces4697 !$OMP PARALLEL DO PRIVATE(i,j,k,m)4698 DO m = 1, surf_def_v(n)%ns4699 i = surf_def_v(n)%i(m)4700 j = surf_def_v(n)%j(m)4701 k = surf_def_v(n)%k(m)4702 km(k,j,i) = kappa * surf_def_v(n)%us(m) * surf_def_v(n)%z_mo(m) / &4703 phi_m( surf_def_v(n)%z_mo(m) / surf_def_v(n)%ol(m) )4704 kh(k,j,i) = 1.35_wp * km(k,j,i)4705 ENDDO4706 !4707 !-- Natural surfaces4708 !$OMP PARALLEL DO PRIVATE(i,j,k,m)4709 DO m = 1, surf_lsm_v(n)%ns4710 i = surf_lsm_v(n)%i(m)4711 j = surf_lsm_v(n)%j(m)4712 k = surf_lsm_v(n)%k(m)4713 km(k,j,i) = kappa * surf_lsm_v(n)%us(m) * surf_lsm_v(n)%z_mo(m) / &4714 phi_m( surf_lsm_v(n)%z_mo(m) / surf_lsm_v(n)%ol(m) )4715 kh(k,j,i) = 1.35_wp * km(k,j,i)4716 ENDDO4717 !4718 !-- Urban surfaces4719 !$OMP PARALLEL DO PRIVATE(i,j,k,m)4720 DO m = 1, surf_usm_v(n)%ns4721 i = surf_usm_v(n)%i(m)4722 j = surf_usm_v(n)%j(m)4723 k = surf_usm_v(n)%k(m)4724 km(k,j,i) = kappa * surf_usm_v(n)%us(m) * surf_usm_v(n)%z_mo(m) / &4725 phi_m( surf_usm_v(n)%z_mo(m) / surf_usm_v(n)%ol(m) )4726 kh(k,j,i) = 1.35_wp * km(k,j,i)4727 ENDDO4728 ENDDO4729 4730 CALL exchange_horiz( km, nbgp )4731 CALL exchange_horiz( kh, nbgp )4732 4733 4761 ! 4734 4762 !-- Model top
Note: See TracChangeset
for help on using the changeset viewer.