Changeset 3003 for palm/trunk/SOURCE/flow_statistics.f90
 Timestamp:
 Apr 23, 2018 10:22:58 AM (4 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

palm/trunk/SOURCE/flow_statistics.f90
r2968 r3003 25 25 !  26 26 ! $Id$ 27 ! The inversion height will not be calcuated before the first timestep in 28 ! case of restarts. 29 ! 30 ! 2968 20180413 11:52:24Z suehring 27 31 ! Bugfix in output of timeseries quantities in case of elevated model surfaces. 28 32 ! … … 277 281 USE control_parameters, & 278 282 ONLY: average_count_pr, cloud_droplets, cloud_physics, do_sum, & 279 dt_3d, g, humidity, kappa, land_surface, large_scale_forcing, & 280 large_scale_subsidence, max_pr_user, message_string, neutral, & 281 microphysics_morrison, microphysics_seifert, ocean, & 282 passive_scalar, simulated_time, use_subsidence_tendencies, & 283 dt_3d, g, humidity, initializing_actions, kappa, land_surface, & 284 large_scale_forcing, large_scale_subsidence, max_pr_user, & 285 message_string, neutral, microphysics_morrison, & 286 microphysics_seifert, ocean, passive_scalar, simulated_time, & 287 simulated_time_at_begin, use_subsidence_tendencies, & 283 288 use_surface_fluxes, use_top_fluxes, ws_scheme_mom, & 284 289 ws_scheme_sca … … 357 362 REAL(wp) :: v2 !< 358 363 REAL(wp) :: w2 !< 359 REAL(wp) :: z_i(2) !<360 364 361 365 REAL(wp) :: dptdz(nzb+1:nzt+1) !< … … 2004 2008 ! is less than 1.5 times the height where the heat flux becomes negative 2005 2009 ! (positive) for the first time. 2006 z_i(1) = 0.0_wp 2007 first = .TRUE. 2008 2009 IF ( ocean ) THEN 2010 DO k = nzt, nzb+1, 1 2011 IF ( first .AND. hom(k,1,18,sr) < 1.0E8_wp ) THEN 2012 first = .FALSE. 2013 height = zw(k) 2014 ENDIF 2015 IF ( hom(k,1,18,sr) < 1.0E8_wp .AND. & 2016 hom(k1,1,18,sr) > hom(k,1,18,sr) ) THEN 2017 IF ( zw(k) < 1.5_wp * height ) THEN 2018 z_i(1) = zw(k) 2019 ELSE 2020 z_i(1) = height 2021 ENDIF 2022 EXIT 2023 ENDIF 2024 ENDDO 2025 ELSE 2026 DO k = nzb, nzt1 2027 IF ( first .AND. hom(k,1,18,sr) < 1.0E8_wp ) THEN 2028 first = .FALSE. 2029 height = zw(k) 2030 ENDIF 2031 IF ( hom(k,1,18,sr) < 1.0E8_wp .AND. & 2032 hom(k+1,1,18,sr) > hom(k,1,18,sr) ) THEN 2033 IF ( zw(k) < 1.5_wp * height ) THEN 2034 z_i(1) = zw(k) 2035 ELSE 2036 z_i(1) = height 2037 ENDIF 2038 EXIT 2039 ENDIF 2040 ENDDO 2041 ENDIF 2042 2043 ! 2044 ! Second scheme: Gradient scheme from Sullivan et al. (1998), modified 2045 ! by Uhlenbrock(2006). The boundary layer height is the height with the 2046 ! maximal local temperature gradient: starting from the second (the last 2047 ! but one) vertical gridpoint, the local gradient must be at least 2048 ! 0.2K/100m and greater than the next four gradients. 2049 ! WARNING: The threshold value of 0.2K/100m must be adjusted for the 2050 ! ocean case! 2051 z_i(2) = 0.0_wp 2052 DO k = nzb+1, nzt+1 2053 dptdz(k) = ( hom(k,1,4,sr)  hom(k1,1,4,sr) ) * ddzu(k) 2054 ENDDO 2055 dptdz_threshold = 0.2_wp / 100.0_wp 2056 2057 IF ( ocean ) THEN 2058 DO k = nzt+1, nzb+5, 1 2059 IF ( dptdz(k) > dptdz_threshold .AND. & 2060 dptdz(k) > dptdz(k1) .AND. dptdz(k) > dptdz(k2) .AND. & 2061 dptdz(k) > dptdz(k3) .AND. dptdz(k) > dptdz(k4) ) THEN 2062 z_i(2) = zw(k1) 2063 EXIT 2064 ENDIF 2065 ENDDO 2066 ELSE 2067 DO k = nzb+1, nzt3 2068 IF ( dptdz(k) > dptdz_threshold .AND. & 2069 dptdz(k) > dptdz(k+1) .AND. dptdz(k) > dptdz(k+2) .AND. & 2070 dptdz(k) > dptdz(k+3) .AND. dptdz(k) > dptdz(k+4) ) THEN 2071 z_i(2) = zw(k1) 2072 EXIT 2073 ENDIF 2074 ENDDO 2010 IF ( TRIM( initializing_actions ) /= 'read_restart_data' .OR. & 2011 simulated_time_at_begin /= simulated_time ) THEN 2012 2013 z_i(1) = 0.0_wp 2014 first = .TRUE. 2015 2016 IF ( ocean ) THEN 2017 DO k = nzt, nzb+1, 1 2018 IF ( first .AND. hom(k,1,18,sr) < 1.0E8_wp ) THEN 2019 first = .FALSE. 2020 height = zw(k) 2021 ENDIF 2022 IF ( hom(k,1,18,sr) < 1.0E8_wp .AND. & 2023 hom(k1,1,18,sr) > hom(k,1,18,sr) ) THEN 2024 IF ( zw(k) < 1.5_wp * height ) THEN 2025 z_i(1) = zw(k) 2026 ELSE 2027 z_i(1) = height 2028 ENDIF 2029 EXIT 2030 ENDIF 2031 ENDDO 2032 ELSE 2033 DO k = nzb, nzt1 2034 IF ( first .AND. hom(k,1,18,sr) < 1.0E8_wp ) THEN 2035 first = .FALSE. 2036 height = zw(k) 2037 ENDIF 2038 IF ( hom(k,1,18,sr) < 1.0E8_wp .AND. & 2039 hom(k+1,1,18,sr) > hom(k,1,18,sr) ) THEN 2040 IF ( zw(k) < 1.5_wp * height ) THEN 2041 z_i(1) = zw(k) 2042 ELSE 2043 z_i(1) = height 2044 ENDIF 2045 EXIT 2046 ENDIF 2047 ENDDO 2048 ENDIF 2049 2050 ! 2051 ! Second scheme: Gradient scheme from Sullivan et al. (1998), modified 2052 ! by Uhlenbrock(2006). The boundary layer height is the height with the 2053 ! maximal local temperature gradient: starting from the second (the 2054 ! last but one) vertical gridpoint, the local gradient must be at least 2055 ! 0.2K/100m and greater than the next four gradients. 2056 ! WARNING: The threshold value of 0.2K/100m must be adjusted for the 2057 ! ocean case! 2058 z_i(2) = 0.0_wp 2059 DO k = nzb+1, nzt+1 2060 dptdz(k) = ( hom(k,1,4,sr)  hom(k1,1,4,sr) ) * ddzu(k) 2061 ENDDO 2062 dptdz_threshold = 0.2_wp / 100.0_wp 2063 2064 IF ( ocean ) THEN 2065 DO k = nzt+1, nzb+5, 1 2066 IF ( dptdz(k) > dptdz_threshold .AND. & 2067 dptdz(k) > dptdz(k1) .AND. dptdz(k) > dptdz(k2) .AND.& 2068 dptdz(k) > dptdz(k3) .AND. dptdz(k) > dptdz(k4) ) THEN 2069 z_i(2) = zw(k1) 2070 EXIT 2071 ENDIF 2072 ENDDO 2073 ELSE 2074 DO k = nzb+1, nzt3 2075 IF ( dptdz(k) > dptdz_threshold .AND. & 2076 dptdz(k) > dptdz(k+1) .AND. dptdz(k) > dptdz(k+2) .AND.& 2077 dptdz(k) > dptdz(k+3) .AND. dptdz(k) > dptdz(k+4) ) THEN 2078 z_i(2) = zw(k1) 2079 EXIT 2080 ENDIF 2081 ENDDO 2082 ENDIF 2083 2075 2084 ENDIF 2076 2085 … … 2087 2096 ENDIF 2088 2097 ENDDO 2098 2089 2099 ! 2090 2100 ! Computation of both the characteristic vertical velocity and
Note: See TracChangeset
for help on using the changeset viewer.