62 REAL(wp) :: r_opt , w_opt
63 LOGICAL :: search_flag
69 WRITE(*,*)
'Inversion: Searching for velocity/radius' 75 WRITE(*,*)
'Inversion: Searching for velocity' 79 WRITE(*,*)
'Plume_height [m] =',
opt_height,search_flag
80 WRITE(*,*)
'Velocity [m/s] =',w_opt
96 WRITE(*,*)
'Inversion: Searching for radius' 100 WRITE(*,*)
'Best height [m] =',
opt_height,search_flag
101 WRITE(*,*)
'Radius [m] =',r_opt
112 WRITE(*,*)
'No Inversion: radius and velocity fixed in input file' 141 LOGICAL :: search_flag
144 97
FORMAT(1x,
' radius (m) ',1x,
' velocity (m/s) ',1x, &
145 'MER (kg/s) ', 1x,
'plume height (m)',1x, &
146 ' inversion ',1x,
'column regime')
161 101
FORMAT(2(2x,f15.8),1(1x,es15.8),1(1x,f15.2)4x,l,7x,i4)
186 REAL(wp),
INTENT(OUT) :: w_opt
187 LOGICAL,
INTENT(OUT) :: search_flag
189 REAL(wp) :: w0_0 ,w0_2
190 REAL(wp) :: plume_height_0 , plume_height_2
191 REAL(wp) :: sign_0 , sign_2
192 REAL(wp) :: init_sign , mult_fact
194 INTEGER :: iter_interval
200 w0_init = sqrt(w_max*w_min)
226 mult_fact = 1.0_wp/((w_max/w_min)**0.125_wp)
231 mult_fact = ((w_max/w_min)**0.125_wp)
239 search_interval:
DO iter_interval=1,4
241 w0 = (mult_fact**iter_interval)*w0_init
267 IF ( (
check_height-height_obj)*init_sign .LT. 0.0_wp )
EXIT search_interval
269 END DO search_interval
271 IF ( iter_interval .EQ. 5 )
THEN 275 search_flag = .false.
282 IF ( mult_fact .GT. 1.0_wp )
THEN 286 w0_0 =
w0 / mult_fact
292 w0_2 =
w0 / mult_fact
296 sign_0 = plume_height_0-height_obj
297 sign_2 = plume_height_2-height_obj
301 w0 = 0.5_wp * ( w0_0 + w0_2 )
332 IF ( abs(plume_height_0-plume_height_2) .LT. 1.e-3_wp )
EXIT search_zero
333 IF ( abs(
check_height-height_obj)/height_obj .LT. 1.e-5_wp )
EXIT search_zero
334 IF ( abs(w0_2-w0_0) .LT. 1.e-6_wp )
THEN 336 search_flag = .false.
341 IF ( (
check_height-height_obj)*sign_2 .LT. 0.0_wp )
THEN 345 sign_0 = plume_height_0-height_obj
351 sign_2 = plume_height_2-height_obj
382 REAL(wp),
INTENT(OUT) :: r_opt
383 LOGICAL,
INTENT(OUT) :: search_flag
385 REAL(wp) :: r0_0 ,r0_2
386 REAL(wp) :: plume_height_0 , plume_height_2
387 REAL(wp) :: sign_0 , sign_2
388 REAL(wp) :: init_sign , mult_fact
390 INTEGER :: iter_interval
433 search_interval:
DO iter_interval=1,5
461 IF ( (
check_height-height_obj)*init_sign .LT. 0.0_wp )
EXIT search_interval
463 END DO search_interval
467 IF ( iter_interval .EQ. 6 )
THEN 471 search_flag = .false.
476 init_sign = plume_height-height_obj
478 IF ( mult_fact .GT. 1.0_wp )
THEN 481 plume_height_2 = plume_height
487 plume_height_0 = plume_height
493 sign_0 = plume_height_0-height_obj
494 sign_2 = plume_height_2-height_obj
498 r0 = 0.5_wp * ( r0_0 + r0_2 )
527 IF ( abs(plume_height_0-plume_height_2) .LT. 1.e-3_wp )
EXIT search_zero
528 IF ( abs(
check_height-height_obj)/height_obj .LT. 1.e-5_wp )
EXIT search_zero
529 IF ( abs(r0_2-r0_0) .LT. 1.e-6_wp )
THEN 531 search_flag = .false.
536 IF ( (
check_height-height_obj)*sign_2 .LT. 0.0_wp )
THEN 540 sign_0 = plume_height_0-height_obj
546 sign_2 = plume_height_2-height_obj
real(wp) opt_value
Optimal value of velocity.
real(wp) w0
initial vertical velocity of the plume
integer opt_regime
Optimal solution regime.
subroutine velocity_radius_search
Height-radius/velocity inversion.
logical nbl_stop
Flag for hysplit output .
subroutine write_inversion(r0, w_opt, opt_mfr, opt_height, search_flag, opt_regime)
Write inversion file.
real(wp) opt_mfr
Optimal solution mass flow rate.
real(wp) r0
initial radius of the plume
subroutine velocity_search(w_opt, search_flag)
Height-velocity inversion.
Gas/particles mixture module.
logical function isset(var)
Input variable check.
logical umbrella_flag
Flag to solve the model for the umbrella spreading.
subroutine invert_height
Height inversion.
integer, parameter wp
working precision
subroutine plumerise
Main subroutine for the integration.
real(wp) opt_height
Optimal height found (can be different from the input one)
Predictor-corrector module.
subroutine radius_search(r_opt, search_flag)
Height-radius inversion.