Changeset 3579 for palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90
- Timestamp:
- Nov 29, 2018 3:32:39 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90
r3376 r3579 25 25 ! ----------------- 26 26 ! $Id$ 27 ! - Bugfix in calculation of turbulence scaling parameters for turbulence 28 ! generator in case of topography 29 ! - Additional checks implemented - no STG in RANS-RANS nesting or LES-LES 30 ! nesting 31 ! 32 ! 3376 2018-10-19 10:15:32Z suehring 27 33 ! Error messages and numbers reivsed. 28 34 ! … … 408 414 IF ( use_syn_turb_gen ) THEN 409 415 416 IF ( child_domain .AND. .NOT. rans_mode .AND. & 417 .NOT. rans_mode_parent ) THEN 418 message_string = 'Using synthetic turbulence generator ' // & 419 'is not allowed in LES-LES nesting.' 420 CALL message( 'stg_check_parameters', 'PA0620', 1, 2, 0, 6, 0 ) 421 422 ENDIF 423 424 IF ( child_domain .AND. rans_mode .AND. & 425 rans_mode_parent ) THEN 426 message_string = 'Using synthetic turbulence generator ' // & 427 'is not allowed in RANS-RANS nesting.' 428 CALL message( 'stg_check_parameters', 'PA0621', 1, 2, 0, 6, 0 ) 429 430 ENDIF 431 410 432 IF ( .NOT. nesting_offline .AND. .NOT. child_domain ) THEN 411 433 … … 413 435 .AND. INDEX( initializing_actions, 'read_restart_data' ) == 0 ) THEN 414 436 message_string = 'Using synthetic turbulence generator ' // & 415 'requires %initializing_actions = ' //&416 417 437 'requires %initializing_actions = ' // & 438 '"set_constant_profiles" or "read_restart_data"' //& 439 ', if not offline nesting is applied.' 418 440 CALL message( 'stg_check_parameters', 'PA0015', 1, 2, 0, 6, 0 ) 419 441 ENDIF … … 427 449 IF ( bc_ns /= 'cyclic' ) THEN 428 450 message_string = 'Using synthetic turbulence generator ' // & 429 'requires &bc_ns = "cyclic", ' // &451 'requires &bc_ns = "cyclic", ' // & 430 452 'if not offline nesting is applied.' 431 453 CALL message( 'stg_check_parameters', 'PA0037', 1, 2, 0, 6, 0 ) … … 1726 1748 r32(k) = 10E-8_wp 1727 1749 ENDIF 1728 ! write(9,*) zu(k), r11(k), r33(k), r31(k), zi_ribulk, scale_us, scale_wm, scale_l1729 1750 ENDDO 1730 1751 … … 1970 1991 1971 1992 USE surface_mod, & 1972 ONLY: surf_def_h, surf_lsm_h, surf_usm_h1993 ONLY: get_topography_top_index_ji, surf_def_h, surf_lsm_h, surf_usm_h 1973 1994 1974 1995 IMPLICIT NONE … … 1977 1998 INTEGER(iwp) :: j !< loop index in y-direction 1978 1999 INTEGER(iwp) :: k !< loop index in z-direction 1979 INTEGER(iwp) :: k_ref !< index in z-direction for reference height 2000 INTEGER(iwp) :: k_ref !< index in z-direction for COSMO reference height 2001 INTEGER(iwp) :: k_topo !< topography top index 1980 2002 INTEGER(iwp) :: m !< surface element index 1981 2003 … … 2030 2052 !-- However, friction velocity is used for turbulence 2031 2053 !-- parametrization, so that more physically meaningful values are important. 2032 !-- Hence, derive friction velocity from wind speed at a reference height. 2054 !-- Hence, derive friction velocity from wind speed at a reference height, 2055 !-- which is 10 m, according to the height of the 1st vertical grid level 2056 !-- in the COSMO level. However, in case of topography that is higher than 2057 !-- the reference level, the k index is determined from the 1st vertical 2058 !-- PALM grid level instead. 2033 2059 !-- For a first guess use 20 m, which is in the range of the first 2034 2060 !-- COSMO vertical level. … … 2042 2068 DO j = nys, nyn 2043 2069 ! 2070 !-- Determine the k index and topography top index 2071 k_topo = MAX( get_topography_top_index_ji( j, i, 'u' ), & 2072 get_topography_top_index_ji( j, i, 'v' ) ) 2073 k = MAX( k_ref, k_topo + 1 ) 2074 ! 2044 2075 !-- Note, in u- and v- component the imposed perturbations 2045 2076 !-- from the STG are already included. Check whether this 2046 2077 !-- makes any difference compared to using the pure-mean 2047 2078 !-- inflow profiles. 2048 u_int = MERGE( u(k _ref,j,i+1), u(k_ref,j,i), bc_dirichlet_l )2049 v_int = v(k _ref,j,i)2079 u_int = MERGE( u(k,j,i+1), u(k,j,i), bc_dirichlet_l ) 2080 v_int = v(k,j,i) 2050 2081 ! 2051 2082 !-- Calculate friction velocity and sum-up. Therefore, assume … … 2053 2084 friction_vel_l = friction_vel_l + kappa * & 2054 2085 SQRT( u_int * u_int + v_int * v_int ) / & 2055 LOG( zu(k_ref) / z0_mean )2086 LOG( ( zu(k) - zu(k_topo) ) / z0_mean ) 2056 2087 2057 2088 ENDDO … … 2065 2096 DO i = nxl, nxr 2066 2097 2067 u_int = u(k_ref,j,i) 2068 v_int = MERGE( v(k_ref,j+1,i), v(k_ref,j,i), bc_dirichlet_s ) 2098 k_topo = MAX( get_topography_top_index_ji( j, i, 'u' ), & 2099 get_topography_top_index_ji( j, i, 'v' ) ) 2100 k = MAX( k_ref, k_topo + 1 ) 2101 2102 u_int = u(k,j,i) 2103 v_int = MERGE( v(k,j+1,i), v(k,j,i), bc_dirichlet_s ) 2069 2104 2070 2105 friction_vel_l = friction_vel_l + kappa * & 2071 2106 SQRT( u_int * u_int + v_int * v_int ) / & 2072 LOG( zu(k_ref) / z0_mean )2107 LOG( ( zu(k) - zu(k_topo) ) / z0_mean ) 2073 2108 2074 2109 ENDDO
Note: See TracChangeset
for help on using the changeset viewer.