PLUME-MoM-TSM  1.0
VolcanicPlumeModel
rise.f90
Go to the documentation of this file.
1 !********************************************************************************
3 !
9 !********************************************************************************
10 MODULE rise
11 
12  USE variables, ONLY : wp
13 
14  IMPLICIT NONE
15 
16  REAL(wp) :: plume_height
17  REAL(wp) :: column_regime
18 
19  INTEGER, PARAMETER :: n_rk = 7
20 
21  SAVE
22 
23 CONTAINS
24 
25  !******************************************************************************
27  !
34  !******************************************************************************
35 
36  SUBROUTINE plumerise
37 
38  ! external variables
39  USE meteo_module, ONLY : rho_atm , rair , u_wind , v_wind
44 
47 
49 
50  USE particles_module, ONLY : n_part , n_sections , mom , phil , phir , n_mom
54 
55  USE plume_module, ONLY: s , u , v , w , x , y , z , vent_height , r , log10_mfr
56  USE solver_module, ONLY: dz, dz0, f, ftemp, rhs, rhstemp , rhs1 , rhs2
57  USE solver_module, ONLY: f_stepold , itotal
60  USE variables, ONLY : write_flag , umbrella_flag
61  USE variables, ONLY : aggregation_flag
62  USE variables, ONLY : pi_g , height_nbl , flag_nbl , radius_nbl
63 
64  ! external procedures
71 
72 
73  IMPLICIT NONE
74 
75  CHARACTER(LEN=20) :: description
76 
77  CHARACTER(len=8) :: x1 ! format descriptor
78 
79  INTEGER :: i_part
80 
81  REAL(wp) :: mu(4)
82 
83  REAL(wp) :: k1 , k2
84 
85  REAL(wp) :: mu_phi , sigma_phi , skew_phi
86 
87  REAL(wp) :: mass_fract(n_part)
88 
89  REAL(wp) :: solid_mass_flux , solid_mass_flux0
90 
91  REAL(wp) :: solid_mass_flux_change
92 
93  REAL(wp) :: obj_function
94 
95  REAL(wp) :: w_old , w_oldold
96  REAL(wp) :: w_minrel , w_maxrel
97  REAL(wp) :: w_maxabs
98 
99  REAL(wp) :: check_sb
100  REAL(wp) :: eps_sb
101 
102 
103  INTEGER :: idx , idx1 , idx2
104 
105  REAL(wp) :: rho_mix_init , rho_mix_final
106 
107  REAL(wp) :: delta_rho
108 
109  REAL(wp) :: x_nbl , y_nbl , wind_nbl , w_nbl, u_nbl, v_nbl, theta_nbl
110  REAL(wp) :: u_wind_nbl , v_wind_nbl
111  REAL(wp) :: deltarho_min
112 
113 
114  REAL(wp) :: rho_atm_old
115  REAL(wp) :: z_old
116  REAL(wp) :: z_temp
117  REAL(wp) :: r_old
118  REAL(wp) :: deltarho , deltarho_old
119 
120  REAL(wp) :: partial_mf(n_sections)
121 
122  REAL(wp) :: rhs_RK(itotal,n_rk)
123  REAL(wp) :: rhs1_RK(itotal,n_rk)
124  REAL(wp) :: rhs2_RK(itotal,n_rk)
125  REAL(wp) :: f_RK(itotal,n_rk)
126 
127  REAL(wp) :: A_RK(n_rk,n_rk)
128  REAL(wp) :: B_RK(n_rk)
129  REAL(wp) :: C_RK(n_rk)
130  REAL(wp) :: D_RK(n_rk)
131 
132  REAL(wp) :: f5th(itotal)
133  REAL(wp) :: f4th(itotal)
134  REAL(wp) :: fscal(itotal)
135 
136  INTEGER :: i_sect
137 
138  INTEGER :: i_RK
139 
140  INTEGER :: i
141 
142  REAL(wp) :: delta
143  REAL(wp) :: eps_RK
144  REAL(wp) :: errmax
145 
146  REAL(wp), PARAMETER :: SAFETY = 0.9_wp
147  REAL(wp), PARAMETER :: PGROW = -0.2_wp
148  REAL(wp), PARAMETER :: PSHRNK = -0.25_wp
149  REAL(wp), PARAMETER :: ERRCON = 1.89e-4_wp
150 
151  REAL(wp) :: drho_atm_dz
152 
153  REAL(wp) :: phi_mean
154 
155  LOGICAL :: update_z
156 
157  REAL(wp) :: u_atm_nbl , v_atm_nbl
158  REAL(wp) :: u_atm_top , v_atm_top
159 
160  !
161  ! ... Set initial conditions at the release height
162  !
163  CALL initialize_plume
164 
165  !
166  ! ... Get meteo variables at release height
167  !
168  CALL zmet
169 
170  CALL initialize_mixture
171 
172  IF ( aggregation_flag ) CALL init_aggregation
173 
174  IF ( dakota_flag ) THEN
175 
176  description = 'Initial MFR'
177 
178  CALL write_dakota(description,mass_flow_rate)
179 
180  END IF
181 
182  w_old = w
183  w_oldold = w
184 
185  w_maxabs = w
186 
187  w_minrel = w
188  w_maxrel = w
189 
190 
191  delta_rho = rho_mix - rho_atm
192 
193  rho_mix_init = rho_mix
194 
195  DO i_part=1,n_part
196 
197  WRITE(x1,'(I2.2)') i_part ! converting integer to string using a 'internal file'
198 
199  description = 'Mean Diameter '//trim(x1)
200 
201  description = 'Sau. Mean Diam. '//trim(x1)
202 
203  END DO
204 
205  DO i_part=1,n_part
206 
207  ! converting integer to string using a 'internal file'
208  WRITE(x1,'(I2.2)') i_part
209 
210  mass_fract(i_part) = solid_partial_mass_fraction(i_part) * ( 1.0_wp - &
211  gas_mass_fraction)
212 
213  solid_mass_flux0 = solid_partial_mass_fraction(i_part) * ( 1.0_wp - &
214  gas_mass_fraction) * rho_mix * pi_g * r**2 * w
215 
216 
217  IF ( write_flag ) THEN
218 
219  mu_phi = sum( phir(:)*mom(1,:,i_part) ) / sum( mom(1,:,i_part) )
220  sigma_phi = sqrt( sum( (phir(:)-mu_phi)**2 *mom(1,:,i_part) ) / &
221  sum( mom(1,:,i_part) ) )
222 
223  IF ( dakota_flag ) THEN
224 
225  description = 'Init Avg Diam '//trim(x1)
226 
227  CALL write_dakota(description,mu_phi)
228 
229  description = 'Init Var Diam '//trim(x1)
230 
231  CALL write_dakota(description,sigma_phi)
232 
233  description = 'Init Mass Fract '//trim(x1)
234 
235  CALL write_dakota(description,mass_fract(i_part))
236 
237  description = 'Init Solid Flux '//trim(x1)
238 
239  CALL write_dakota(description,solid_mass_flux0)
240 
241  END IF
242 
243  END IF
244 
245  END DO
246 
247  !
248  ! ... Lump physical variables
249  !
250  CALL lump(f)
251  !
252  ! ----------------------------------------------------
253  ! ... assign initial stepping length and
254  ! ... start plume rise marching loop
255  ! ----------------------------------------------------
256  !
257 
258 
259  dz = dz0
260 
261  particle_loss_rate(1:n_part,1:n_sections) = 0.0_wp
262  cum_particle_loss_rate(1:n_part,1:n_sections) = 0.0_wp
263 
264  IF ( write_flag ) CALL write_column
265 
266  IF ( ( height_obj .EQ. 0.0_wp ) .OR. ( log10_mfr .EQ. 0.0_wp ) ) THEN
267 
268  WRITE(*,*) 'WRITING ZERO EMISSION HYSPLIT FILE'
269  CALL write_zero_hysplit
270  CALL write_column
271  stop
272 
273  END IF
274 
275  deltarho_min = 1000.0_wp
276 
277  deltarho_old = 0.0_wp
278 
279 
280  ! Dormand-Prince RK Coefficients
281 
282  ! nodes
283  d_rk(1) = 0.0_wp
284  d_rk(2) = 0.2_wp
285  d_rk(3) = 0.3_wp
286  d_rk(4) = 0.8_wp
287  d_rk(5) = 8.0_wp / 9.0_wp
288  d_rk(6) = 1.0_wp
289  d_rk(7) = 1.0_wp
290 
291  ! matrix
292  a_rk(1,1) = 0.0_wp
293  a_rk(1,2) = 0.0_wp
294  a_rk(1,3) = 0.0_wp
295  a_rk(1,4) = 0.0_wp
296  a_rk(1,5) = 0.0_wp
297  a_rk(1,6) = 0.0_wp
298  a_rk(1,7) = 0.0_wp
299 
300  a_rk(2,1) = 0.2_wp
301  a_rk(2,2) = 0.0_wp
302  a_rk(2,3) = 0.0_wp
303  a_rk(2,4) = 0.0_wp
304  a_rk(2,5) = 0.0_wp
305  a_rk(2,6) = 0.0_wp
306  a_rk(2,7) = 0.0_wp
307 
308  a_rk(3,1) = 3.0_wp / 40.0_wp
309  a_rk(3,2) = 9.0_wp / 40.0_wp
310  a_rk(3,3) = 0.0_wp
311  a_rk(3,4) = 0.0_wp
312  a_rk(3,5) = 0.0_wp
313  a_rk(3,6) = 0.0_wp
314  a_rk(3,7) = 0.0_wp
315 
316  a_rk(4,1) = 44.0_wp / 45.0_wp
317  a_rk(4,2) = - 56.0_wp / 15.0_wp
318  a_rk(4,3) = 32.0_wp / 9.0_wp
319  a_rk(4,4) = 0.0_wp
320  a_rk(4,5) = 0.0_wp
321  a_rk(4,6) = 0.0_wp
322  a_rk(4,7) = 0.0_wp
323 
324  a_rk(5,1) = 19372.0_wp / 6561.0_wp
325  a_rk(5,2) = - 25360.0_wp / 2187.0_wp
326  a_rk(5,3) = 64448.0_wp / 6561.0_wp
327  a_rk(5,4) = - 212.0_wp / 729.0_wp
328  a_rk(5,5) = 0.0_wp
329  a_rk(5,6) = 0.0_wp
330  a_rk(5,7) = 0.0_wp
331 
332  a_rk(6,1) = 9017.0_wp / 3168.0_wp
333  a_rk(6,2) = - 355.0_wp / 33.0_wp
334  a_rk(6,3) = 46732.0_wp / 5247.0_wp
335  a_rk(6,4) = 49.0_wp / 176.0_wp
336  a_rk(6,5) = - 5103.0_wp / 18656.0_wp
337  a_rk(6,6) = 0.0_wp
338  a_rk(6,7) = 0.0_wp
339 
340  a_rk(7,1) = 35.0_wp / 384.0_wp
341  a_rk(7,2) = 0.0_wp
342  a_rk(7,3) = 500.0_wp / 1113.0_wp
343  a_rk(7,4) = 125.0_wp / 192.0_wp
344  a_rk(7,5) = - 2187.0_wp / 6784.0_wp
345  a_rk(7,6) = 11.0_wp / 84.0_wp
346  a_rk(7,7) = 0.0_wp
347 
348  ! 5th order solution weights
349  b_rk(1) = 35.0_wp / 384.0_wp
350  b_rk(2) = 0.0_wp
351  b_rk(3) = 500.0_wp / 1113.0_wp
352  b_rk(4) = 125.0_wp / 192.0_wp
353  b_rk(5) = - 2187.0_wp / 6784.0_wp
354  b_rk(6) = 11.0_wp / 84.0_wp
355  b_rk(7) = 0.0_wp
356 
357  ! 4th order solution weights
358  c_rk(1) = 5179.0_wp / 57600.0_wp
359  c_rk(2) = 0.0_wp
360  c_rk(3) = 7571.0_wp / 16695.0_wp
361  c_rk(4) = 393.0_wp / 640.0_wp
362  c_rk(5) = - 92097.0_wp / 339200.0_wp
363  c_rk(6) = 187.0_wp / 2100.0_wp
364  c_rk(7) = 1.0_wp / 40.0_wp
365 
366  eps_rk = 1.0e-5_wp
367 
368  flag_nbl = .false.
369 
370  main_loop: DO
371 
372  f_stepold = f
373 
374  CALL unlump(f)
375 
376  rho_atm_old = rho_atm
377  r_old = r
378  z_old = z
379 
380  ! old velocities are updated only when previous step was successful
381  IF ( update_z ) THEN
382 
383  w_oldold = w_old
384  w_old = w
385 
386  END IF
387 
388  update_z = .false.
389 
390  CALL rate
391 
392  IF ( aggregation_flag ) THEN
393 
394  CALL aggr_rate
395 
396  ELSE
397 
398  rhs2(1:itotal) = 0.0_wp
399 
400  END IF
401 
402  fscal = abs( f_stepold)+abs(dz*rhs1+rhs2)+1.e-10
403 
404  rhs_rk(1:itotal,1:n_rk) = 0.0_wp
405 
406  z_temp = z
407 
408  rungekutta:DO i_rk = 1,n_rk
409 
410  DO i=1,itotal
411 
412  ftemp(i) = f_stepold(i) + dz * sum( rhs_rk(i,1:i_rk-1) &
413  * a_rk(i_rk,1:i_rk-1) )
414 
415  END DO
416 
417  ! compute the partial mass fraction on each bin
418  DO i_part=1,n_part
419 
420  DO i_sect=1,n_sections
421 
422  idx2 = 8+n_mom-1+(i_part-1)*n_sections*n_mom+(i_sect-1)*n_mom
423 
424  bin_partial_mass_fraction(i_sect,i_part) = ftemp(idx2)
425 
426  END DO
427 
428  END DO
429 
430  bin_partial_mass_fraction = bin_partial_mass_fraction / &
431  sum( bin_partial_mass_fraction )
432 
433  DO i_part=1,n_part
434 
435  DO i_sect=1,n_sections
436 
437  idx1 = 8+0+(i_part-1)*n_sections*n_mom+(i_sect-1)*n_mom
438  idx2 = 8+n_mom-1+(i_part-1)*n_sections*n_mom+(i_sect-1)*n_mom
439 
440  ! check on negative mass fractions
441  IF ( bin_partial_mass_fraction(i_sect,i_part) .LT. 0.0_wp) THEN
442 
443  ! if the negative value is small, set to zero
444  IF (bin_partial_mass_fraction(i_sect,i_part) .GT.-1.0e-3_wp) &
445  THEN
446 
447  ftemp(idx1:idx2) = 0.0_wp
448 
449  ELSE
450 
451  ! if error is large decrease the integration step
452  dz = 0.5_wp * dz
453  z = z_temp
454  f = f_stepold
455  cycle main_loop
456 
457  END IF
458 
459  END IF
460 
461  END DO
462 
463  END DO
464 
465  ! the height is updated to compute the correct values of the
466  ! atnospheric variables within unlump (where zmet is called)
467  z = z_temp + dz * d_rk(i_rk)
468 
469  CALL unlump( ftemp )
470 
471  ! ----- Check on the solution to reduce step-size condition -----------
472 
473  IF ( ( w .LE. 0.0_wp) .OR. ( rgasmix .LT. min(rair,rvolcgas_mix) ) ) &
474  THEN
475 
476  dz = 0.5_wp * dz
477  z = z_temp
478  f = f_stepold
479 
480  IF ( verbose_level .GT. 0 ) THEN
481 
482  IF ( w .LE. 0.0_wp) THEN
483 
484  WRITE(*,*) 'WARNING: negative velocity w= ',w
485 
486  ELSE
487 
488  WRITE(*,*) 'WARNING: rgasmix =',rgasmix
489 
490  WRITE(*,*) 'rair =',rair,' rvolcgas_mix =',rvolcgas_mix
491 
492  END IF
493 
494  WRITE(*,*) 'reducing step-size dz= ',dz
495  READ(*,*)
496 
497  END IF
498 
499  ! Repeat the iteration with reduced step-size
500  cycle main_loop
501 
502  END IF
503 
504  ! RATE uses the values computed from the last call of UNLUMP
505  CALL rate
506 
507  rhs1_rk(1:itotal,i_rk) = rhs1(1:itotal)
508 
509  IF ( aggregation_flag ) THEN
510 
511  CALL aggr_rate
512  rhs2_rk(1:itotal,i_rk) = rhs2(1:itotal)
513 
514  ELSE
515 
516  rhs2_rk(1:itotal,i_rk) = 0.0_wp
517 
518  END IF
519 
520  rhs_rk(1:itotal,i_rk) = rhs1_rk(1:itotal,i_rk) + rhs2_rk(1:itotal,i_rk)
521 
522  END DO rungekutta
523 
524 
525  ! Compute the new solution
526  DO i=1,itotal
527 
528  f5th(i) = f_stepold(i) + dz * sum( rhs_rk(i,1:n_rk) * b_rk(1:n_rk) )
529  f4th(i) = f_stepold(i) + dz * sum( rhs_rk(i,1:n_rk) * c_rk(1:n_rk) )
530 
531  END DO
532 
533  errmax = maxval( abs( (f5th-f4th)/fscal ) ) / eps_rk
534 
535  IF ( errmax .GT. 1.0_wp ) THEN
536 
537  !WRITE(*,*) 'errmax',errmax
538  !WRITE(*,*) f5th(MAXLOC( ABS( (f5th-f4th)/fscal ) ))
539  !WRITE(*,*) f4th(MAXLOC( ABS( (f5th-f4th)/fscal ) ))
540  !WRITE(*,*) f_stepold(MAXLOC( ABS( (f5th-f4th)/fscal ) ))
541  !READ(*,*)
542 
543  delta = safety*errmax**pshrnk
544  dz = sign( max(abs(dz*delta),0.1_wp*abs(dz)) , dz )
545  z = z_temp
546  f = f_stepold
547 
548  ! go to the next iteration
549  cycle main_loop
550 
551  END IF
552 
553  f(1:itotal) = f5th(1:itotal)
554 
555  ! compute the partial mass fraction on each bin
556  DO i_part=1,n_part
557 
558  DO i_sect=1,n_sections
559 
560  idx2 = 8+n_mom-1+(i_part-1)*n_sections*n_mom+(i_sect-1)*n_mom
561 
562  bin_partial_mass_fraction(i_sect,i_part) = f(idx2)
563 
564  END DO
565 
566  END DO
567 
568  bin_partial_mass_fraction = bin_partial_mass_fraction / &
569  sum( bin_partial_mass_fraction )
570 
571  DO i_part=1,n_part
572 
573  DO i_sect=1,n_sections
574 
575  idx1 = 8+0+(i_part-1)*n_sections*n_mom+(i_sect-1)*n_mom
576  idx2 = 8+n_mom-1+(i_part-1)*n_sections*n_mom+(i_sect-1)*n_mom
577 
578  ! check on negative mass fractions
579  IF ( bin_partial_mass_fraction(i_sect,i_part) .LT. 0.0_wp) THEN
580 
581  ! if the negative value is small, set to zero
582  IF (bin_partial_mass_fraction(i_sect,i_part) .GT. -1.0e-3_wp ) THEN
583 
584  f(idx1:idx2) = 0.0_wp
585 
586  ELSE
587 
588  WRITE(*,*) 'z,dz,i_part,i_sect',z,dz,i_part,i_sect
589  ! if error is large decrease the integration step
590  dz = 0.5_wp * dz
591  z = z_temp
592  f = f_stepold
593  cycle main_loop
594 
595  END IF
596 
597  END IF
598 
599  END DO
600 
601  END DO
602 
603 
604  ! the height is updated to compute the correct values of the
605  ! atnospheric variables within unlump (where zmet is called)
606  z = z_temp + dz
607 
608  CALL unlump(f)
609 
610  ! we restore the initial value of the height
611  z = z_temp
612 
613  ! ----- Reduce step-size condition and repeat iteration ------------------
614 
615  IF ( ( w .LE. 0.0_wp) .OR. ( rgasmix .LT. min(rair , rvolcgas_mix) ) ) THEN
616 
617  dz = 0.5_wp * dz
618  f = f_stepold
619 
620  IF ( verbose_level .GT. 0 ) THEN
621 
622  IF ( w .LE. 0.0_wp) THEN
623 
624  WRITE(*,*) 'WARNING: negative velocity w= ',w
625 
626  ELSE
627 
628  WRITE(*,*) 'WARNING: rgasmix = ',rgasmix
629 
630  END IF
631 
632  WRITE(*,*) 'reducing step-size dz= ',dz
633  READ(*,*)
634 
635  END IF
636 
637  ! go to the next iteration
638  cycle main_loop
639 
640  END IF
641 
642  ! ----------- check for nbl ---------------------------------------------
643 
644  delta_rho = min( delta_rho , rho_mix - rho_atm )
645 
646  ! used to define the neutral buoyancy level
647  deltarho = rho_mix - rho_atm
648 
649  IF ( deltarho * deltarho_old .LT. 0.0_wp ) THEN
650 
651  IF ( ( dz .GT. 1.0_wp ) .AND. ( deltarho .GT. 0.0_wp ) ) THEN
652 
653  dz = 0.5_wp * dz
654  f = f_stepold
655  cycle main_loop
656 
657  ELSE
658 
659  rho_nbl = rho_mix
660  height_nbl = z - vent_height
661  radius_nbl = r
662 
663  x_nbl = x
664  y_nbl = y
665 
666  u_nbl = u
667  v_nbl = v
668  w_nbl = w
669 
670  u_wind_nbl = u_wind
671  v_wind_nbl = v_wind
672 
673  wind_nbl = sqrt( u_wind**2 + v_wind**2 )
674 
675  drho_atm_dz = (rho_atm - rho_atm_old) / dz
676  drho_dz = drho_atm_dz
677  dr_dz = ( r - r_old ) / dz
678 
679  IF ( deltarho .GT. 0.0_wp ) THEN
680 
681  flag_nbl = .true.
682  !WRITE(*,*) 'z nbl',z
683  !WRITE(*,*) 'dz at nbl',dz
684  !WRITE(*,*) rho_atm,rho_atm_old
685  !WRITE(*,*) drho_dz
686  !READ(*,*)
687 
688  END IF
689 
690  END IF
691 
692  END IF
693 
694  deltarho_old = deltarho
695 
696  ! ------ update the solution ---------------------------------------------
697 
698  update_z = .true.
699  z = z + dz
700 
701  ! Compute the rate of particle loss due to settling from plume margin
702  DO i_part=1,n_part
703 
704  DO i_sect=1,n_sections
705 
706  idx = 9+(i_part-1)*n_sections*n_mom+(i_sect-1)*n_mom
707 
708  particle_loss_rate(i_part,i_sect) = dz * pi_g * &
709  sum( rhs1_rk(idx,1:n_rk) * b_rk(1:n_rk) )
710 
711  END DO
712 
713  END DO
714 
715  cum_particle_loss_rate(1:n_part,1:n_sections) = &
716  cum_particle_loss_rate(1:n_part,1:n_sections) + &
717  particle_loss_rate(1:n_part,1:n_sections)
718 
719  ! save minrel and maxrel of vertical velocity to search for
720  ! plume regime (buoyant, superbuoyant or collapsing)
721  IF ( ( w_old .LT. w ) .AND. ( w_old .LT. w_oldold ) ) THEN
722 
723  w_minrel = w_old
724 
725  END IF
726 
727  IF ( w .GT. w_maxabs ) w_maxabs = w
728 
729  IF ( ( w_old .GT. w ) .AND. ( w_old .GT. w_oldold ) ) THEN
730 
731  w_maxrel = w_old
732 
733  END IF
734 
735  IF ( write_flag ) CALL write_column
736 
737  ! update the integration step according to truncation error of
738  ! Runge-Kutta procedure
739  IF ( errmax .GT. errcon ) THEN
740 
741  dz = dz * safety * ( errmax**pgrow )
742 
743  ELSE
744 
745  dz = 2.0_wp * dz
746 
747  END IF
748 
749  ! limit the integration step
750  dz = min( dz, 50.0_wp )
751 
752  ! ----- Exit condition ---------------------------------------------------
753 
754  IF ( ( w .LE. 1.0e-5_wp ) .OR. ( dz .LE. 1.0e-5_wp ) ) THEN
755 
756  EXIT main_loop
757 
758  END IF
759 
760  END DO main_loop
761 
762 
763  IF ( write_flag) THEN
764 
765  WRITE(*,*)
766  WRITE(*,*) '---------- MODEL RESULTS ----------'
767  WRITE(*,*)
768 
769  END IF
770 
771  ! ---- check plume regime
772  check_sb = ( w_maxrel - w_minrel ) / w_maxabs
773 
774  eps_sb = 0.05_wp
775 
776 
777  IF ( delta_rho .GT. 0.0_wp ) THEN
778 
779  column_regime = 3
780 
781  rho_mix_final = rho_mix
782 
783  IF ( write_flag ) WRITE(*,*) 'Plume Regime: Collapsing'
784 
785 
786  IF ( hysplit_flag ) THEN
787 
788  WRITE(*,*) 'WARNING: problem in hysplit file'
789  ! CALL write_hysplit(x,y,z,.TRUE.)
790 
791  END IF
792 
793  ELSE
794 
795  IF ( hysplit_flag ) THEN
796 
797  IF ( nbl_stop ) THEN
798 
799  ! CALL write_hysplit(x_nbl,y_nbl,vent_height+height_nbl,.TRUE.)
800 
801  ELSE
802 
803  ! CALL write_hysplit(x,y,z,.TRUE.)
804 
805  END IF
806 
807  END IF
808 
809  IF ( check_sb .GT. eps_sb ) THEN
810 
811  !WRITE(*,*) 'w_minrel,w_maxrel,w_maxabs',w_minrel,w_maxrel,w_maxabs
812 
813  IF ( write_flag) WRITE(*,*) 'Plume Regime: Superbuoyant'
814 
815  column_regime = 2
816 
817  ELSE
818 
819  IF ( write_flag) WRITE(*,*) 'Plume Regime: Buoyant'
820 
821  column_regime = 1
822 
823  END IF
824 
825  END IF
826 
827  plume_height = z - vent_height
828 
829  IF ( dakota_flag ) THEN
830 
831  description = 'Column regime'
832 
833  CALL write_dakota(description,column_regime)
834 
835  description = 'NBL height (atv)'
836 
837  CALL write_dakota(description,height_nbl)
838 
839  description = 'Plume height (atv)'
840 
841  CALL write_dakota(description,plume_height)
842 
843  END IF
844 
845  DO i_part=1,n_part
846 
847  WRITE(x1,'(I2.2)') i_part ! convert int to string using an 'internal file'
848 
849  mass_fract(i_part) = solid_partial_mass_fraction(i_part) * ( 1.0_wp - &
850  gas_mass_fraction)
851 
852  solid_mass_flux = solid_partial_mass_fraction(i_part) * ( 1.0_wp - &
853  gas_mass_fraction) * rho_mix * pi_g * r**2 * w
854 
855  solid_mass_flux_change = 1.0_wp - solid_mass_flux / solid_mass_flux0
856 
857 
858  IF ( dakota_flag ) THEN
859 
860  mu_phi = sum( phir(:)*mom(1,:,i_part) ) / sum( mom(1,:,i_part) )
861  sigma_phi = sqrt( sum( (phir(:)-mu_phi)**2 *mom(1,:,i_part) ) / &
862  sum( mom(1,:,i_part) ) )
863 
864  description = 'Final Avg Diam '//trim(x1)
865 
866  CALL write_dakota(description,mu_phi)
867 
868  description = 'Final Var Diam '//trim(x1)
869 
870  CALL write_dakota(description,sigma_phi)
871 
872  description = 'Final Mass Fract '//trim(x1)
873 
874  CALL write_dakota(description,mass_fract(i_part))
875 
876  description = 'Final Mass Flux '//trim(x1)
877 
878  CALL write_dakota(description,solid_mass_flux)
879 
880  description = 'Solid Flux Lost '//trim(x1)
881 
882  CALL write_dakota(description,solid_mass_flux_change)
883 
884  description = 'VG Mass Fraction '
885 
886  CALL write_dakota(description,volcgas_mix_mass_fraction)
887 
888  description = 'WV Mass Fraction '
889 
890  CALL write_dakota(description,water_vapor_mass_fraction)
891 
892  description = 'LW Mass Fraction '
893 
894  CALL write_dakota(description,liquid_water_mass_fraction)
895 
896  description = 'DA Mass Fraction '
897 
898  CALL write_dakota(description,dry_air_mass_fraction)
899 
900  END IF
901 
902  END DO
903 
904  x_source = x_nbl
905  y_source = y_nbl
907  vol_flux_source = pi_g * radius_nbl**2 * w_nbl
908  u_source = u_nbl
909  v_source = v_nbl
910  u_atm_nbl = u_wind_nbl
911  v_atm_nbl = v_wind_nbl
912  u_atm_top = u_wind
913  v_atm_top = v_wind
914 
915  u_atm_umbl = u_atm_nbl
916  v_atm_umbl = v_atm_nbl
917 
918  ! u_atm_umbl = 0.5_wp * ( u_atm_nbl + u_atm_top )
919  ! v_atm_umbl = 0.5_wp * ( v_atm_nbl + v_atm_top )
920 
921  IF ( write_flag) THEN
922 
923  WRITE(*,*) 'Plume height above the vent [m] =', plume_height
924  WRITE(*,*) 'Plume height above sea level [m] =',z
925 
926  IF ( column_regime .LT. 3 ) THEN
927 
928  WRITE(*,*) 'Neutral buoyance level height above the vent [m] =',height_nbl
929  WRITE(*,*) 'Neutral buoyance level height above sea level [m] =', &
930  height_nbl + ( z - plume_height )
931  WRITE(*,*) 'Plume density at neutral buoyancy level [kg/m3]',rho_nbl
932  WRITE(*,*) 'Atmospheric density at top height [kg/m3]',rho_atm
933  WRITE(*,*) 'Radius at neutral buoyancy level [m] =',radius_nbl
934  WRITE(*,*) 'Vertical gradient of radius at nbl: dr/dz [m/m] =', dr_dz
935  WRITE(*,*) 'Mass flow rate at neutral buoyancy level [kg/s] =', &
936  rho_nbl * pi_g * radius_nbl**2 * w_nbl
937  WRITE(*,*) 'Volume flow rate at neutral buoyancy level [m3/s] =', &
938  pi_g * radius_nbl**2 * w_nbl
939  WRITE(*,*) 'Plume vertical velocity at neutral buoyancy level [m/s] =', &
940  w_nbl
941  WRITE(*,*) 'Plume horizontal velocity at neutral buoyancy level [m/s] =',&
943  WRITE(*,*) 'Wind velocity at neutral buoyancy level [m/s] =', u_atm_nbl ,&
944  v_atm_nbl
945  WRITE(*,*) 'Atmospheric density vertical gradient at nbl [kg/m4] =', &
946  drho_atm_dz
947  WRITE(*,*) 'Wind velocity at plume top [m/s] =', u_atm_top ,&
948  v_atm_top
949 
950  END IF
951 
952  WRITE(*,*)
953  WRITE(*,*) 'Dry air mass fraction =',dry_air_mass_fraction
954  WRITE(*,*) 'Water vapor mass fraction =',water_vapor_mass_fraction
955  WRITE(*,*) 'Other volcanic gas mass_fraction =',volcgas_mix_mass_fraction
956  WRITE(*,*)
957  WRITE(*,*) 'Gas mass fraction (volcgas + water vapor + dry air) =', &
958  gas_mass_fraction
959  WRITE(*,*) 'Particles mass fraction =',mass_fract
960  WRITE(*,*) 'Liquid water mass fraction =',liquid_water_mass_fraction
961  WRITE(*,*) 'Ice mass fraction =',ice_mass_fraction
962  WRITE(*,*)
963  WRITE(*,*) 'Water mass fraction (water vapor + liquid water + ice) =', &
964  water_mass_fraction
965  WRITE(*,*)
966  WRITE(*,*) 'Solid partial mass distribution'
967 
968  phi_mean = 0.0_wp
969 
970  DO i_part=1,n_part
971 
972  partial_mf(:) = mom(1,:,i_part) / sum( mom(1,:,i_part) )
973 
974  phi_mean = sum(partial_mf(:) * phir(:))
975 
976  WRITE(*,*) 'Particle phase:',i_part
977  WRITE(*,"(30F8.2)") phil(n_sections:1:-1)
978  WRITE(*,"(30F8.2)") phir(n_sections:1:-1)
979  WRITE(*,"(30ES8.1)") partial_mf(n_sections:1:-1)
980  WRITE(*,*)
981  WRITE(*,*) 'Phi mean',phi_mean
982  !READ(*,*)
983 
984  END DO
985 
986 
987  END IF
988 
989  RETURN
990 
991 
992 
993 
994  END SUBROUTINE plumerise
995 
996 END MODULE rise
997 !----------------------------------------------------------------------
subroutine write_zero_hysplit
Hysplit output initialization.
Definition: inpout.f90:2843
subroutine aggr_rate
Compute the right-hand side of the equations.
logical dakota_flag
Flag for dakota run (less files on output)
Definition: variables.f90:36
integer n_part
number of particle phases
Definition: particles.f90:23
real(wp) v_wind
Definition: meteo.f90:57
subroutine write_dakota(description, value)
Dakota outputs.
Definition: inpout.f90:2779
real(wp), dimension(:), allocatable f_stepold
Integrated variables.
Definition: solver_rise.f90:40
real(wp) u
plume x-horizontal velocity
Definition: plume.f90:23
real(wp) rho_atm
Atmospheric density.
Definition: meteo.f90:60
real(wp), dimension(:), allocatable rhs2
Right-Hand Side (rhs2) aggregation terms only.
Definition: solver_rise.f90:25
logical inversion_flag
Definition: variables.f90:67
real(wp) ice_mass_fraction
mass fraction of ice in the mixture
Definition: mixture.f90:118
real(wp) liquid_water_mass_fraction
mass fraction of liquid water in the mixture
Definition: mixture.f90:106
real(wp) r_source
logical flag_nbl
Definition: variables.f90:47
Parameters.
real(wp) v
plume y-horizontal velocity
Definition: plume.f90:24
integer itotal
Total number of equations.
Definition: solver_rise.f90:46
real(wp), dimension(:,:), allocatable cum_particle_loss_rate
cumulative rate of particles lost up to the integration height ( kg s^-1)
Definition: particles.f90:50
real(wp) dz0
Initial integration step.
Definition: solver_rise.f90:52
subroutine initialize_mixture
Mixture properties initialization.
Definition: mixture.f90:154
real(wp) water_vapor_mass_fraction
mass fraction of water vapor in the mixture
Definition: mixture.f90:112
real *8 pi_g
Greek pi.
Definition: variables.f90:30
real(wp) dry_air_mass_fraction
mass fraction of dry air in the mixture
Definition: mixture.f90:100
logical write_flag
Definition: variables.f90:74
Particles module.
Definition: particles.f90:11
real(wp) x
plume location (downwind)
Definition: plume.f90:19
real(wp) rvolcgas_mix
gas constant of volcanic gases mixture ( J/(kg K) )
Definition: mixture.f90:88
real(wp) volcgas_mix_mass_fraction
mass fraction of the volcanic gas in the mixture
Definition: mixture.f90:97
logical aggregation_flag
Definition: variables.f90:72
Input/Output module.
Definition: inpout.f90:11
integer, parameter n_rk
Definition: rise.f90:19
logical hysplit_flag
Flag for hysplit run.
Definition: variables.f90:39
logical nbl_stop
Flag for hysplit output .
Definition: variables.f90:45
subroutine rate
Compute the right-hand side of the equations.
real(wp), dimension(:), allocatable f
Integrated variables.
Definition: solver_rise.f90:37
Constitutive equations.
real(wp) y
plume location (crosswind)
Definition: plume.f90:20
real(wp), dimension(:,:), allocatable bin_partial_mass_fraction
mass fraction of the bins of particle with respect to the total solid
Definition: particles.f90:44
real(wp), dimension(:), allocatable solid_partial_mass_fraction
mass fraction of the particle phases with respect to the total solid
Definition: particles.f90:26
Meteo module.
Definition: meteo.f90:11
subroutine init_aggregation
Aggregation initialization.
Definition: particles.f90:1638
real(wp) rgasmix
universal constant for the mixture
Definition: mixture.f90:28
real(wp) radius_nbl
Definition: variables.f90:62
subroutine initialize_plume
Plume variables initialization.
Definition: plume.f90:56
real(wp) dz
Integration step.
Definition: solver_rise.f90:49
Gas/particles mixture module.
Definition: mixture.f90:11
real(wp) rho_mix
mixture density
Definition: mixture.f90:31
real(wp) s
length along plume centerline
Definition: plume.f90:18
Plume module.
Definition: plume.f90:11
subroutine write_column
Write outputs.
Definition: inpout.f90:2611
subroutine zmet
Meteo parameters.
Definition: meteo.f90:229
real(wp) column_regime
Definition: rise.f90:17
real(wp) rair
perfect gas constant for dry air ( J/(kg K) )
Definition: meteo.f90:88
real(wp) height_nbl
Definition: variables.f90:60
real(wp), dimension(:,:,:), allocatable mom
Moments of the particles diameter.
Definition: particles.f90:53
real(wp), dimension(:), allocatable phil
left boundaries of the sections in phi-scale
Definition: particles.f90:164
real(wp), dimension(:), allocatable rhs
Right-Hand Side (rhs)
Definition: solver_rise.f90:31
real(wp), dimension(:), allocatable rhstemp
Right-Hand Side (rhs)
Definition: solver_rise.f90:28
real(wp) mass_flow_rate
Definition: mixture.f90:61
Solver module.
Definition: solver_rise.f90:11
real(wp) u_wind
Definition: meteo.f90:56
real(wp) y_source
real(wp) vent_height
height of the base of the plume
Definition: plume.f90:35
real(wp) z
plume vertical coordinate
Definition: plume.f90:21
real(wp) water_mass_fraction
mass fraction of water in the mixture
Definition: mixture.f90:103
logical umbrella_flag
Flag to solve the model for the umbrella spreading.
Definition: variables.f90:53
real(wp), dimension(:,:), allocatable particle_loss_rate
rate of particles lost from the plume in the integration steps ( kg s^-1)
Definition: particles.f90:47
integer, parameter wp
working precision
Definition: variables.f90:21
subroutine plumerise
Main subroutine for the integration.
Definition: rise.f90:37
real(wp), dimension(:), allocatable ftemp
Integrated variables.
Definition: solver_rise.f90:34
real(wp) vol_flux_source
real(wp), dimension(:), allocatable phir
right boundaries of the sections in phi-scale
Definition: particles.f90:167
real(wp), dimension(:), allocatable rhs1
Right-Hand Side (rhs1) terms without aggregation.
Definition: solver_rise.f90:22
subroutine initialize_meteo
Meteo parameters initialization.
Definition: meteo.f90:160
subroutine lump(f_)
Calculate the lumped variables.
subroutine marching(fold, fnew, rate)
Marching s one step.
Predictor-corrector module.
Definition: rise.f90:10
real(wp) u_source
real(wp) r
plume radius
Definition: plume.f90:22
real(wp) v_source
subroutine unlump(f_)
Calculate physical variables from lumped variables.
real(wp) log10_mfr
Definition: plume.f90:38
real(wp) x_source
real(wp) height_obj
Definition: variables.f90:76
Global variables.
Definition: variables.f90:10
real(wp) gas_mass_fraction
gas mass fraction in the mixture
Definition: mixture.f90:19
real(wp) w
plume vertical velocity
Definition: plume.f90:25
real(wp) plume_height
Definition: rise.f90:16
integer verbose_level
Level of verbose output (0 = minimal output on screen)
Definition: variables.f90:33