MAMMA  1.0
Conduitsolver
inpout.f90
Go to the documentation of this file.
1 !********************************************************************
5 !
9 !********************************************************************
10 
11 MODULE inpout
12 
13  ! -- Variables for the namelist TRANSIENT_PARAMETERS
14  USE parameters, ONLY : verbose_level
15  USE parameters, ONLY : n_cry , n_gas , n_eqns , n_vars , n_mom
16 
17  ! -- Variables for the namelist NEWRUN_PARAMETERS
18  USE geometry, ONLY : z0 , zn , radius_fixed, radius_min, radius_max, &
21 
22  ! -- Variables for the namelist STEADY_BOUNDARY_CONDITIONS
23  USE init, ONLY : t_in , p1_in , delta_p_in , p_out , u1_in
24  USE constitutive, ONLY : x_ex_dis_in
25  USE parameters, ONLY : shooting
26  USE parameters, ONLY : eps_conv
27 
28  ! -- Variables for the namelist EXSOLVED_GAS_PARAMETERS
29  USE constitutive, ONLY : rho0_g , cv_g , gamma_g , t0_g , &
30  bar_e_g , visc_2 , perm0, pc_g, &
31  tc_g, a_g, b_g, s0_g, gas_law
32 
34 
35  ! -- Variables for the namelist DISSOLVED_GAS_PARAMETERS
36  USE constitutive, ONLY : rho0_d , c0_d , cv_d , gamma_d , p0_d , t0_d , &
38 
39  ! -- Variables for the namelist CRYSTALS_PARAMETERS
40  USE constitutive, ONLY : rho0_c , c0_c , cv_c , gamma_c , p0_c , t0_c , &
42 
43  ! -- Variables for the namelist MELT_PARAMETERS
44  USE constitutive, ONLY : rho0_m , c0_m , cv_m , gamma_m , p0_m , t0_m , &
45  bar_e_m , bar_p_m , s0_m
46 
47  ! -- Variables for the namelist VISCOSITY_PARAMETERS
50 
51  ! -- Variables for the namelist TEMPERATURE_PARAMETERS
52  USE equations, ONLY : isothermal , fixed_temp
53 
54  ! -- Variables for the namelist FRAGMENTATION_PARAMETERS
56 
57  ! -- Variables for the namelist EXTERNAL_WATER_PARAMETERS
60 
61  ! -- Variables for the namelist SOURCE_PARAMETERS
62  USE constitutive, ONLY : grav
63 
64  ! -- Variables for the namelist COUNTRY_ROCK_PARAMETERS
65  USE constitutive, ONLY : rho_cr, k_cr
66 
67  ! -- Variables for the namelist RELAXATION_PARAMETERS
70 
71  ! -- Variables for the namelist FORCHHEIMER_PARAMETERS
75 
76  ! USE parameters, ONLY : atmospheric_pressure, chocked_flow
77 
78  ! -- Variables for the card meltcomposition
79  USE constitutive, ONLY : wt_init
80 
81  IMPLICIT NONE
82 
83  CHARACTER(LEN=50) :: run_name
84  CHARACTER(LEN=50) :: bak_name
85  CHARACTER(LEN=50) :: input_file
86  CHARACTER(LEN=50) :: output_q_file
87  CHARACTER(LEN=50) :: output_p_file
88  CHARACTER(LEN=50) :: steady_p_file
89  CHARACTER(LEN=50) :: steady_q_file
90  CHARACTER(LEN=50) :: exit_file
91 
92  INTEGER, PARAMETER :: input_unit = 7
93  INTEGER, PARAMETER :: backup_unit = 8
94  INTEGER, PARAMETER :: output_q_unit = 10
95  INTEGER, PARAMETER :: output_p_unit = 11
96  INTEGER, PARAMETER :: steady_p_output_unit = 13
97  INTEGER, PARAMETER :: steady_q_output_unit = 14
98  INTEGER, PARAMETER :: dakota_unit = 15
99  INTEGER, PARAMETER :: dakota_unit2 = 17
100  INTEGER, PARAMETER :: exit_unit = 16
101 
102 
103  LOGICAL :: close_units
104 
105  REAL*8 :: log10_k_cr
106 
107  ! -- Variables for the namelist RELAXATION_PARAMETERS
109 
110  REAL*8, ALLOCATABLE :: log10_tau_c(:)
111  REAL*8, ALLOCATABLE :: log10_tau_d(:)
112 
113  namelist / run_parameters / run_name , verbose_level
114 
115  namelist / geometry_parameters / z0 , zn , radius_model , radius_fixed , &
117 
118  namelist / phases_parameters / n_gas , n_cry , n_mom
119 
120  namelist / steady_boundary_conditions / t_in , p1_in , delta_p_in , &
121  x_ex_dis_in , p_out , u1_in , eps_conv, shooting
122 
123  namelist / exsolved_gas_parameters / gas_law, pc_g , tc_g , cv_g , gamma_g , &
124  rho0_g , t0_g , bar_e_g , s0_g, visc_2 , lateral_degassing_flag , &
125  alfa2_lat_thr , perm0
126  namelist / dissolved_gas_parameters / rho0_d , c0_d , cv_d , gamma_d , p0_d , &
127  t0_d , bar_e_d , bar_p_d , s0_d , exsol_model , solub , solub_exp
128 
129  namelist / crystals_parameters / rho0_c , c0_c , cv_c , gamma_c , p0_c , &
130  t0_c , bar_e_c , bar_p_c , s0_c , beta0 , beta_max, crystallization_model
131 
132  namelist / melt_parameters / rho0_m , c0_m , cv_m , gamma_m , p0_m , t0_m , &
133  bar_e_m , bar_p_m , s0_m
134 
135  namelist / viscosity_parameters / visc_melt_model , bubbles_model , &
136  theta_model , theta_fixed
137 
138  namelist / temperature_parameters / isothermal , fixed_temp
139 
140  namelist / fragmentation_parameters / explosive , fragmentation_model , &
141  frag_thr
142 
143  namelist / external_water_parameters / ext_water , total_water_influx , &
145 
146  namelist / source_parameters / grav
147 
148  namelist / country_rock_parameters / rho_cr , log10_k_cr
149 
150  namelist / relaxation_parameters / drag_funct_model , log10_drag_funct_coeff ,&
151  p_relax_model , log10_tau_p_coeff, log10_tau_c , log10_tau_d
152 
153  namelist / bubbles_parameters / bubble_number_density
154 
155  namelist / forchheimer_parameters / log10_bubble_number_density , &
156  tortuosity_factor , throat_bubble_ratio , friction_coefficient , c_d , &
157  r_a
158 
159  namelist / permeability_parameters / xa, xb, xc
160 
161 
162 CONTAINS
163 
164  !******************************************************************************
168  !
173  !******************************************************************************
174 
175  SUBROUTINE init_param
177  IMPLICIT none
178 
179  LOGICAL :: lexist
180 
181  INTEGER :: n_gas_init
182 
183  INTEGER :: n_cry_init
184 
185  ! -- Variables for the namelist DISSOLVED_GAS_PARAMETERS
186  REAL*8 :: rho0_d_init, C0_d_init , cv_d_init , gamma_d_init , p0_d_init , &
187  T0_d_init , bar_e_d_init , bar_p_d_init , s0_d_init , solub_init , &
188  solub_exp_init
189 
190  ! -- Variables for the namelist CRYSTALS_PARAMETERS
191  REAL*8 :: rho0_c_init , C0_c_init , cv_c_init , gamma_c_init , p0_c_init ,&
192  T0_c_init , bar_e_c_init , bar_p_c_init , s0_c_init , beta0_init , &
193  beta_max_init
194 
195  REAL*8 :: log10_tau_c_init , log10_tau_d_init
196 
197  REAL*8 :: x_ex_dis_in_init, xa, xb, xc
198 
199  REAL*8 :: Pc_g_init , Tc_g_init , cv_g_init , gamma_g_init , rho0_g_init ,&
200  T0_g_init , bar_e_g_init, s0_g_init
201 
202  CHARACTER*20 :: gas_law_init
203 
204  namelist / phases_parameters_init / n_gas_init , n_cry_init
205 
206  namelist / steady_boundary_conditions_init / t_in , p1_in , delta_p_in , &
207  x_ex_dis_in_init , p_out , u1_in , eps_conv, shooting
208 
209  namelist / exsolved_gas_parameters_init / gas_law_init, pc_g_init , &
210  tc_g_init , cv_g_init , gamma_g_init , rho0_g_init , t0_g_init , &
211  bar_e_g_init , s0_g_init, visc_2 , lateral_degassing_flag , &
212  alfa2_lat_thr , perm0
213 
214  namelist / dissolved_gas_parameters_init / rho0_d_init , &
215  c0_d_init , cv_d_init , gamma_d_init , p0_d_init , t0_d_init , &
216  bar_e_d_init , bar_p_d_init , s0_d_init , exsol_model , &
217  solub_init , solub_exp_init
218 
219  namelist / crystals_parameters_init / rho0_c_init , &
220  c0_c_init , cv_c_init , gamma_c_init , p0_c_init , t0_c_init , &
221  bar_e_c_init , bar_p_c_init , s0_c_init , beta0_init , beta_max_init
222 
223 
224  namelist / relaxation_parameters_init / drag_funct_model , &
225  log10_drag_funct_coeff , p_relax_model , log10_tau_p_coeff , &
226  log10_tau_c_init , log10_tau_d_init
227 
228 
229  !-- Inizialization of the Variables for the namelist RUN_PARAMETERS
230  run_name = 'test'
231  verbose_level = 4
232 
233  !-- Inizialization of the Variables for the namelist geometry_parameters
234  z0 = 0.d0
235  zn = 5200.d0
236  radius_fixed = 0.d0
237  radius_min = 0.d0
238  radius_max = 0.d0
239  radius_z = 0.d0
240  radius_z_sig = 0.d0
241  radius_model = 'fixed'
242  comp_cells = 500
243 
244  !-- Inizialization of the Variables for the namelist
245  !-- steady_boundary_condition_parameters
246  t_in = 1323.d0
247  p1_in = 135000000.d0
248  delta_p_in = 0.d0
249  x_ex_dis_in_init = 5.0d-2
250  p_out = 101300
251  u1_in = 0.d0
252  shooting = .true.
253  eps_conv = 1.d-5
254 
255  ! exsolved gas parameters
256  gas_law_init = 'VDW'
257  pc_g_init = 22064000.d0
258  tc_g_init = 647.d0
259  cv_g_init = 1571.d0
260  gamma_g_init = 1.324d0
261  rho0_g_init = 0.52924425d0
262  t0_g_init = 373.0
263  s0_g_init = 2373.0
264  visc_2 = 1.5d-2
265  lateral_degassing_flag = .false.
266  alfa2_lat_thr = 1.1d0
267  perm0 = 5.0d-3
268 
269  n_gas_init = 1
270  n_cry_init = 1
271 
272  n_mom = 1
273 
274  n_vars = 5 + 2 * n_gas_init + n_cry_init * n_mom
275  n_eqns = n_vars
276 
277  ! dissolved gas parameters
278  rho0_d_init = 1000.d0
279  c0_d_init = 2000.d0
280  cv_d_init = 1200.d0
281  gamma_d_init = 2.3d0
282  p0_d_init = 1.0d8
283  s0_d_init = 0.d0
284  exsol_model = 'Henry'
285  solub_init = 4.11d-06
286  solub_exp_init = 0.5d0
287 
288  ! crystals parameters
289  rho0_c_init = 2600.d0
290  c0_c_init = 2000.d0
291  cv_c_init = 1200.d0
292  gamma_c_init = 2.3d0
293  p0_c_init = 1.0d8
294  s0_c_init = 0.d0
295  beta0_init = 0.0d0
296  beta_max_init = 0.6d0
297  crystallization_model = 'Vitturi2010'
298 
299  ! MELT_PARAMETERS
300  rho0_m = 2300.0000000000000
301  c0_m = 2000.0000000000000
302  cv_m = 1200.0000000000000
303  gamma_m = 2.3
304  p0_m = 100000000.00000000
305  s0_m = 0.0000000000000000
306 
307  !-- Inizialization of the Variables for the namelist viscosity_parameters
308  visc_melt_model = 'Hess_and_Dingwell1996'
309  bubbles_model = 'none'
310  theta_model = 'Fixed_value'
311  theta_fixed = 50.d0
312 
313  !-- Inizialization of the Variables for the namelist temperature_parameters
314  isothermal = .false.
315  fixed_temp = 1323.d0
316 
317  !-- Inizialization of the Variables for the namelist
318  !-- fragmentation_parameters
319  explosive = .true.
320  fragmentation_model = 1
321  frag_thr = 0.60d+0
322  !tau_frag_coeff = 1.D0
323  !tau_frag_exp = 5.0D0
324 
325  !-- Inizialization of the Variables for the namelist
326  !-- external_water_parameters
327  ext_water = .false.
328  total_water_influx = 0.d0
329  min_z_influx = 0.d0
330  delta_z_influx = 0.d0
331  t_w = 0.d0
332  inst_vaporization = .false.
333  aquifer_type = "unconfined"
334 
335  !-- Inizialization of the Variables for the namelist source_parameters
336  grav = 9.81d0
337 
338 
339  !-- Inizialization of the Variables for the namelist country_rock_parameters
340  rho_cr = 2600
341  log10_k_cr = -12
342 
343 
344  !-- Initialization of the variables for the namelist relaxation_parameters
345  drag_funct_model = 'forchheimer'
346  log10_drag_funct_coeff = 1.0d0
347  p_relax_model = 'constant'
348  log10_tau_p_coeff = -8.d0
349  log10_tau_d_init = -4.0d0
350  log10_tau_c_init = -4.0d0
351 
352  drag_funct_coeff = 10.d0 ** log10_drag_funct_coeff
353  tau_p_coeff = 10.d0 ** log10_tau_p_coeff
354  tau_d(1:n_gas) = 10.d0 ** log10_tau_d
355  tau_c(1:n_cry) = 10.d0 ** log10_tau_c(1:n_cry)
356 
357  ! Forchheimer (Eq. 16 Degruyter et al. 2012)
358 
359  log10_bubble_number_density = 15.0d0
360  bubble_number_density = 10.0d0 ** log10_bubble_number_density
361  tortuosity_factor = 3.5
362  throat_bubble_ratio = 0.1
363  friction_coefficient = 10.d0
364 
365  c_d = 0.8d0
366  r_a = 1.d-3
367 
368  xa = 1.0
369  xb = 1.0
370  xc = 1.0
371 
372  input_file = 'conduit_solver.inp'
373 
374  INQUIRE (file=input_file,exist=lexist)
375 
376  IF ( .NOT. lexist ) THEN
377 
378  OPEN(input_unit,file=input_file,status='NEW')
379 
380  WRITE(input_unit, run_parameters )
381 
382  WRITE(input_unit, geometry_parameters )
383 
384  WRITE(input_unit, phases_parameters_init )
385 
386  WRITE(input_unit, steady_boundary_conditions_init )
387 
388  WRITE(input_unit, exsolved_gas_parameters_init )
389 
390  WRITE(input_unit, dissolved_gas_parameters_init )
391 
392  WRITE(input_unit, crystals_parameters_init )
393 
394  WRITE(input_unit, melt_parameters )
395 
396  WRITE(input_unit, viscosity_parameters )
397 
398  WRITE(input_unit, temperature_parameters )
399 
400  WRITE(input_unit, fragmentation_parameters )
401 
402  WRITE(input_unit, external_water_parameters )
403 
404  WRITE(input_unit, source_parameters )
405 
406  IF ( lateral_degassing_flag ) THEN
407 
408  WRITE(input_unit, country_rock_parameters )
409 
410  END IF
411 
412  WRITE(input_unit, relaxation_parameters_init )
413 
414  IF ( drag_funct_model .EQ. 'eval' ) THEN
415 
416  WRITE(input_unit, bubbles_parameters )
417 
418  ELSEIF ( ( drag_funct_model .EQ. 'darcy' ) .OR. &
419  drag_funct_model .EQ. 'forchheimer' .OR. &
420  drag_funct_model .EQ. 'forchheimer_wt') THEN
421 
422  WRITE(input_unit, forchheimer_parameters )
423 
424  END IF
425 
426  CLOSE(input_unit)
427 
428  WRITE(*,*) 'Input file not found'
429  WRITE(*,*) 'A new one with default values has been created'
430  stop
431 
432  ELSE
433 
434 
435  END IF
436 
437  END SUBROUTINE init_param
438 
439  !******************************************************************************
443  !
449  !******************************************************************************
450 
451  SUBROUTINE read_param
453  ! external subroutines
455 
456  ! external variables
461  USE constitutive, ONLY : t0_c , bar_p_c !, bar_e_c
462  USE constitutive, ONLY : t0_m , bar_p_m !, bar_e_m
463 
464  USE init, ONLY : beta_in , xd_md_in
465 
466  IMPLICIT none
467 
468  INTEGER :: i
469  LOGICAL :: tend1
470  CHARACTER(LEN=80) :: card
471 
472  LOGICAL :: check_model
473 
474  INTEGER :: ios
475 
476  OPEN(input_unit,file=input_file,status='old')
477 
478 
479  ! ------- READ run_parameters NAMELIST --------------------------------------
480 
481  READ(input_unit, run_parameters , iostat = ios )
482 
483  IF ( ios .NE. 0 ) THEN
484 
485  WRITE(*,*) 'IOSTAT=',ios
486  WRITE(*,*) 'ERROR: problem with namelist RUN_PARAMETERS'
487  WRITE(*,*) 'Please check the input file'
488  stop
489 
490  ELSE
491 
492  rewind(input_unit)
493 
494  END IF
495 
496  READ(input_unit,geometry_parameters , iostat = ios )
497 
498  IF ( ios .NE. 0 ) THEN
499 
500  WRITE(*,*) 'IOSTAT=',ios
501  WRITE(*,*) 'ERROR: problem with namelist GEOMETRY_PARAMETERS'
502  WRITE(*,*) 'Please check the input file'
503  stop
504 
505  ELSE
506 
507  rewind(input_unit)
508 
509  END IF
510 
511  IF ( radius_model == 'fixed' ) THEN
512 
513  IF ( radius_min .NE. 0.d0 ) WRITE(*,*) 'WARNING: radius_min not used'
514  IF ( radius_max .NE. 0.d0 ) WRITE(*,*) 'WARNING: radius_max not used'
515  IF ( radius_z .NE. 0.d0 ) WRITE(*,*) 'WARNING: radius_z not used'
516  IF ( radius_z_sig .NE. 0.d0 ) WRITE(*,*) 'WARNING: radius_z_sig not used'
517 
518  ELSEIF ( radius_model == 'linear' ) THEN
519 
520  IF ( radius_fixed .NE. 0.d0 ) WRITE(*,*) 'WARNING: radius_fixed not used'
521  IF ( radius_z .NE. 0.d0 ) WRITE(*,*) 'WARNING: radius_z not used'
522  IF ( radius_z_sig .NE. 0.d0 ) WRITE(*,*) 'WARNING: radius_z_sig not used'
523 
524  END IF
525 
526 
527  ! ------- READ phases_parameters NAMELIST -----------------------------------
528  READ(input_unit, phases_parameters , iostat = ios )
529 
530  IF ( ios .NE. 0 ) THEN
531 
532  WRITE(*,*) 'IOSTAT=',ios
533  WRITE(*,*) 'ERROR: problem with namelist PHASES_PARAMETERS'
534  WRITE(*,*) 'Please check the input file'
535  stop
536 
537  ELSE
538 
539  rewind(input_unit)
540 
541  END IF
542 
543 
544  IF ( n_mom .LE. 1 ) THEN
545 
546  WRITE(*,*) 'Solving for crystal volume fraction only'
547 
548  ELSE
549 
550  WRITE(*,*) 'Solving for ',n_mom,' moments for each crystal phase'
551 
552  END IF
553 
554  n_vars = 5 + 2 * n_gas + n_cry * n_mom
555  n_eqns = n_vars
556 
557  ALLOCATE( beta_in(n_cry) )
558  ALLOCATE( xd_md_in(n_gas) )
559 
560  CALL allocate_phases_parameters
561 
562  READ(input_unit,steady_boundary_conditions , iostat = ios )
563 
564  IF ( ios .NE. 0 ) THEN
565 
566  WRITE(*,*) 'IOSTAT=',ios
567  WRITE(*,*) 'ERROR: problem with namelist STEADY_BOUNDARY_CONDITIONS'
568  WRITE(*,*) 'Please check the input file'
569  stop
570 
571  ELSE
572 
573  rewind(input_unit)
574 
575  END IF
576 
577 
578  IF ( u1_in .GT. 0.d0 ) THEN
579 
580  IF ( shooting .EQV. .true.) THEN
581  WRITE(*,*) 'Shooting technique to search for inlet velocity'
582  ELSE
583  WRITE(*,*) 'Single run: no shooting'
584  END IF
585 
586  ELSE
587 
588  shooting = .true.
589  WRITE(*,*) 'Shooting technique to search for inlet velocity'
590 
591  END IF
592 
593 
594  ! ------- READ exsolved_gas_parameters NAMELIST ----------------------------
595  READ(input_unit, exsolved_gas_parameters , iostat = ios )
596 
597  IF ( ios .NE. 0 ) THEN
598 
599  WRITE(*,*) 'IOSTAT=',ios
600  WRITE(*,*) 'ERROR: problem with namelist EXSOLVED_GAS_PARAMETERS'
601  WRITE(*,*) 'Please check the input file'
602  stop
603 
604  ELSE
605 
606  rewind(input_unit)
607 
608  END IF
609 
610 
611  IF ( gas_law .EQ. 'IDEAL' ) THEN
612 
613  a_g(1:n_gas) = 0.d0
614  b_g(1:n_gas) = 0.d0
615 
616  ELSEIF ( gas_law .EQ. 'VDW' ) THEN
617 
618  a_g(1:n_gas) = 27.0 / 64.0 * ( cv_g(1:n_gas)*(gamma_g(1:n_gas) - 1) &
619  * tc_g(1:n_gas))**2.0 / pc_g(1:n_gas)
620 
621  b_g(1:n_gas) = 1.0 / 8.0 * ( cv_g(1:n_gas)*(gamma_g(1:n_gas) - 1) &
622  * tc_g(1:n_gas)) / pc_g(1:n_gas)
623 
624  ELSE
625 
626  WRITE(*,*) ''
627  WRITE(*,*) 'Wrong gas law chosen.'
628  WRITE(*,*) 'Please choose between:'
629  WRITE(*,*) ''
630  WRITE(*,*) 'IDEAL'
631  WRITE(*,*) 'VDW'
632  WRITE(*,*) ''
633  CALL abort
634 
635  END IF
636 
637  ! ------- READ dissolved_gas_parameters NAMELIST ---------------------------
638  READ(input_unit, dissolved_gas_parameters , iostat = ios )
639 
640  IF ( ios .NE. 0 ) THEN
641 
642  WRITE(*,*) 'IOSTAT=',ios
643  WRITE(*,*) 'ERROR: problem with namelist DISSOLVED_GAS_PARAMETERS'
644  WRITE(*,*) 'Please check the input file'
645  stop
646 
647  ELSE
648 
649  rewind(input_unit)
650 
651  END IF
652 
653 
654  t0_d(1:n_gas) = c0_d(1:n_gas) **2.d0 / ( cv_d(1:n_gas) * gamma_d(1:n_gas) &
655  * ( gamma_d(1:n_gas) - 1.d0 ) )
656 
657  bar_p_d(1:n_gas) = ( rho0_d(1:n_gas) * c0_d(1:n_gas)**2.d0 - &
658  gamma_d(1:n_gas) * p0_d(1:n_gas) ) / gamma_d(1:n_gas)
659 
660 
661  ! ------- READ crystals_parameters NAMELIST ---------------------------------
662  READ(input_unit, crystals_parameters , iostat = ios )
663 
664  IF ( ios .NE. 0 ) THEN
665 
666  WRITE(*,*) 'IOSTAT=',ios
667  WRITE(*,*) 'ERROR: problem with namelist CRYSTALS_PARAMETERS'
668  WRITE(*,*) 'Please check the input file'
669  stop
670 
671  ELSE
672 
673  rewind(input_unit)
674 
675  END IF
676 
677 
678  t0_c(1:n_cry) = c0_c(1:n_cry) **2.d0 / ( cv_c(1:n_cry) * gamma_c(1:n_cry) &
679  * ( gamma_c(1:n_cry) - 1.d0 ) )
680 
681  bar_p_c(1:n_cry) = ( rho0_c(1:n_cry) * c0_c(1:n_cry) ** 2.d0 - &
682  gamma_c(1:n_cry) * p0_c(1:n_cry) ) / gamma_c(1:n_cry)
683 
684 
685  IF (.NOT. (crystallization_model .EQ. 'Vitturi2010' ) ) THEN
686 
687  WRITE(*,*) ''
688  WRITE(*,*) 'Wrong crystallization model chosen.'
689  WRITE(*,*) 'Please choose between:'
690  WRITE(*,*) ''
691  WRITE(*,*) 'Vitturi2010'
692  WRITE(*,*) ''
693 
694  CALL abort
695 
696  END IF
697 
698  IF ( (crystallization_model .EQ. 'Vitturi2010' ) .AND. &
699  (.NOT.(n_cry .EQ. 1 )) ) THEN
700 
701  WRITE(*,*) ''
702  WRITE(*,*) 'Wrong number of crystal components inserted'
703  WRITE(*,*) 'Using Vitturi2010, n_cry has to be 1'
704  WRITE(*,*) ''
705 
706  CALL abort
707 
708  END IF
709 
710  ! ------- READ melt_parameters NAMELIST -------------------------------------
711  READ(input_unit, melt_parameters , iostat = ios )
712 
713  IF ( ios .NE. 0 ) THEN
714 
715  WRITE(*,*) 'IOSTAT=',ios
716  WRITE(*,*) 'ERROR: problem with namelist MELT_PARAMETERS'
717  WRITE(*,*) 'Please check the input file'
718  stop
719 
720  ELSE
721 
722  rewind(input_unit)
723 
724  END IF
725 
726 
727  t0_m = c0_m **2.d0 / ( cv_m * gamma_m * ( gamma_m - 1.d0 ) )
728  bar_p_m = ( rho0_m * c0_m ** 2.d0 - gamma_m * p0_m ) / gamma_m
729 
730  ! ------- READ viscosity_parameters NAMELIST --------------------------------
731  READ(input_unit, viscosity_parameters , iostat = ios )
732 
733  IF ( ios .NE. 0 ) THEN
734 
735  WRITE(*,*) 'IOSTAT=',ios
736  WRITE(*,*) 'ERROR: problem with namelist VISCOSITY_PARAMETERS'
737  WRITE(*,*) 'Please check the input file'
738  stop
739 
740  ELSE
741 
742  rewind(input_unit)
743 
744  END IF
745 
746 
747  check_model = .false.
748 
749  DO i=1,n_visc_melt_models
750 
751  IF ( trim(visc_melt_model) .EQ. trim(available_visc_melt_models(i)) ) THEN
752 
753  check_model = .true.
754 
755  END IF
756 
757  END DO
758 
759  IF ( .NOT.check_model ) THEN
760 
761  WRITE(*,*) 'Wrong drag_funct_model chosen.'
762  WRITE(*,*) 'Please choose between:'
763 
764  DO i=1,n_visc_melt_models
765 
766  WRITE(*,*) available_visc_melt_models(i)
767 
768  END DO
769 
770  stop
771 
772  END IF
773 
774 
775  IF ( visc_melt_model .EQ. 'Giordano_et_al2008' ) THEN
776 
777  tend1 = .false.
778 
779  WRITE(*,*) 'search melt composition'
780 
781  melt_comp_search: DO
782 
783  READ(input_unit,*, end = 300 ) card
784 
785  IF( trim(card) == 'MELTCOMPOSITION' ) THEN
786 
787  EXIT melt_comp_search
788 
789  END IF
790 
791  END DO melt_comp_search
792 
793  READ(input_unit,*)
794  READ(input_unit,*) wt_init(1:12)
795 
796  IF ( verbose_level .GE. 1 ) WRITE(*,*) wt_init(1:12)
797 
798  GOTO 310
799 300 tend1 = .true.
800 310 CONTINUE
801 
802  rewind(input_unit)
803 
804  END IF
805 
806  check_model = .false.
807 
808  DO i=1,n_theta_models
809 
810  IF ( trim(theta_model) .EQ. trim(available_theta_models(i)) ) THEN
811 
812  check_model = .true.
813 
814  END IF
815 
816  END DO
817 
818  IF ( .NOT.check_model ) THEN
819 
820  WRITE(*,*) 'Wrong theta_model chosen.'
821  WRITE(*,*) 'Please choose between:'
822 
823  DO i=1,n_theta_models
824 
825  WRITE(*,*) available_theta_models(i)
826 
827  END DO
828 
829  stop
830 
831  END IF
832 
833  IF ( (theta_model .EQ. 'Vona_et_al2013_eq19' ) .OR. &
834  (theta_model .EQ. 'Vona_et_al2013_eq20' ) .OR. &
835  (theta_model .EQ. 'Vona_et_al2013_eq21' ) ) THEN
836 
837  WRITE(*,*) 'WARNING: bubbles_model not used.'
838  WRITE(*,*) 'Effect of bubbles is included by using Vona 2013 equations'
839 
840  END IF
841 
842  check_model = .false.
843 
844  DO i=1,n_bubble_models
845 
846  IF ( trim(bubbles_model) .EQ. trim(available_bubble_models(i)) ) THEN
847 
848  check_model = .true.
849 
850  END IF
851 
852  END DO
853 
854  IF ( .NOT.check_model ) THEN
855 
856  WRITE(*,*) 'Wrong bubbles_model chosen.'
857  WRITE(*,*) 'Please choose between:'
858 
859  DO i=1,n_bubble_models
860 
861  WRITE(*,*) available_bubble_models(i)
862 
863  END DO
864 
865  stop
866 
867  END IF
868 
869 
870  ! ------- READ temperature_parameters NAMELIST ------------------------------
871  READ(input_unit, temperature_parameters , iostat = ios )
872 
873  IF ( ios .NE. 0 ) THEN
874 
875  WRITE(*,*) 'IOSTAT=',ios
876  WRITE(*,*) 'ERROR: problem with namelist TEMPERATURE_PARAMETERS'
877  WRITE(*,*) 'Please check the input file'
878  stop
879 
880  ELSE
881 
882  rewind(input_unit)
883 
884  END IF
885 
886 
887  IF ( isothermal ) THEN
888 
889  t_in = fixed_temp
890 
891  END IF
892 
893  ! ------- READ fragmentation_parameters NAMELIST ----------------------------
894  READ(input_unit, fragmentation_parameters , iostat = ios )
895 
896  IF ( ios .NE. 0 ) THEN
897 
898  WRITE(*,*) 'IOSTAT=',ios
899  WRITE(*,*) 'ERROR: problem with namelist FRAGMENTATION_PARAMETERS'
900  WRITE(*,*) 'Please check the input file'
901  stop
902 
903  ELSE
904 
905  rewind(input_unit)
906 
907  END IF
908 
909 
910  IF (fragmentation_model .NE. 1 ) THEN
911 
912  WRITE(*,*) ''
913  WRITE(*,*) 'Wrong fragmentation model chosen.'
914  WRITE(*,*) 'Please choose between:'
915  WRITE(*,*) ''
916  WRITE(*,*) '1 (Volume_Fraction)'
917  WRITE(*,*) ''
918 
919  CALL abort
920 
921  END IF
922 
923  ! ------- READ external_water_parameters NAMELIST ---------------------------
924  READ(input_unit, external_water_parameters , iostat = ios )
925 
926  IF ( ios .NE. 0 ) THEN
927 
928  WRITE(*,*) 'IOSTAT=',ios
929  WRITE(*,*) 'ERROR: problem with namelist EXTERNAL_WATER_PARAMETERS'
930  WRITE(*,*) 'Please check the input file'
931  stop
932 
933  ELSE
934 
935  rewind(input_unit)
936 
937  END IF
938 
939 
940  IF (ext_water) THEN
941 
942  IF ( (.NOT. (aquifer_type .EQ. 'confined' ) ) .AND. &
943  (.NOT. (aquifer_type .EQ. 'unconfined' ) ) ) THEN
944 
945  WRITE(*,*) ''
946  WRITE(*,*) 'Wrong aquifer type chosen.'
947  WRITE(*,*) 'Please choose between:'
948  WRITE(*,*) ''
949  WRITE(*,*) 'confined'
950  WRITE(*,*) 'unconfined'
951  WRITE(*,*) ''
952 
953  CALL abort
954 
955  END IF
956 
957  END IF
958 
959  ! ------- READ source_parameters NAMELIST -----------------------------------
960  READ(input_unit, source_parameters , iostat = ios )
961 
962  IF ( ios .NE. 0 ) THEN
963 
964  WRITE(*,*) 'IOSTAT=',ios
965  WRITE(*,*) 'ERROR: problem with namelist SOURCE_PARAMETERS'
966  WRITE(*,*) 'Please check the input file'
967  stop
968 
969  ELSE
970 
971  rewind(input_unit)
972 
973  END IF
974 
975 
976  ! ------- READ country_rock_parameters NAMELIST -----------------------------
977  IF ( lateral_degassing_flag ) THEN
978 
979  READ(input_unit, country_rock_parameters , iostat = ios )
980 
981  IF ( ios .NE. 0 ) THEN
982 
983  WRITE(*,*) 'IOSTAT=',ios
984  WRITE(*,*) 'ERROR: problem with namelist COUNTRY_ROCK_PARAMETERS'
985  WRITE(*,*) 'Please check the input file'
986  stop
987 
988  ELSE
989 
990  rewind(input_unit)
991 
992  END IF
993 
994  END IF
995 
996  k_cr = 10 ** log10_k_cr
997 
998  ! ------- READ relaxation_parameters NAMELIST -------------------------------
999  ALLOCATE( log10_tau_d(n_gas) )
1000  ALLOCATE( log10_tau_c(n_cry) )
1001 
1002  READ(input_unit, relaxation_parameters , iostat = ios )
1003 
1004  IF ( ios .NE. 0 ) THEN
1005 
1006  WRITE(*,*) 'IOSTAT=',ios
1007  WRITE(*,*) 'ERROR: problem with namelist RELAXATION_PARAMETERS'
1008  WRITE(*,*) 'Please check the input file'
1009  stop
1010 
1011  ELSE
1012 
1013  rewind(input_unit)
1014 
1015  END IF
1016 
1017 
1018  drag_funct_coeff = 10.d0 ** log10_drag_funct_coeff
1019  tau_p_coeff = 10.d0 ** log10_tau_p_coeff
1020  tau_d(1:n_gas) = 10.d0 ** log10_tau_d(1:n_gas)
1021  tau_c(1:n_cry) = 10.d0 ** log10_tau_c(1:n_cry)
1022 
1023 
1024  check_model = .false.
1025 
1026  DO i=1,n_drag_models
1027 
1028  IF ( trim(drag_funct_model) .EQ. trim(available_drag_models(i)) ) THEN
1029 
1030  check_model = .true.
1031 
1032  END IF
1033 
1034  END DO
1035 
1036  IF ( .NOT.check_model ) THEN
1037 
1038  WRITE(*,*) 'Wrong drag_funct_model chosen.'
1039  WRITE(*,*) 'Please choose between:'
1040 
1041  DO i=1,n_drag_models
1042 
1043  WRITE(*,*) available_drag_models(i)
1044 
1045  END DO
1046 
1047  stop
1048 
1049  END IF
1050 
1051  IF ( ( drag_funct_model .EQ. 'eval' ) .OR. &
1052  ( drag_funct_model .EQ. 'Klug_and_Cashman' ) .OR. &
1053  ( drag_funct_model .EQ. 'drag' ) ) THEN
1054 
1055  READ(input_unit, bubbles_parameters , iostat = ios )
1056 
1057  IF ( ios .NE. 0 ) THEN
1058 
1059  WRITE(*,*) 'IOSTAT=',ios
1060  WRITE(*,*) 'ERROR: problem with namelist BUBBLES_PARAMETERS'
1061  WRITE(*,*) 'Please check the input file'
1062  stop
1063 
1064  ELSE
1065 
1066  rewind(input_unit)
1067 
1068  END IF
1069 
1070  ELSEIF ( ( drag_funct_model .EQ. 'darcy' ) .OR. &
1071  ( drag_funct_model .EQ. 'forchheimer') .OR. &
1072  ( drag_funct_model .EQ. 'forchheimer_wt')) THEN
1073 
1074  READ(input_unit, forchheimer_parameters , iostat = ios )
1075 
1076  IF ( ios .NE. 0 ) THEN
1077 
1078  WRITE(*,*) 'IOSTAT=',ios
1079  WRITE(*,*) 'ERROR: problem with namelist FORCHHEIMER_PARAMETERS'
1080  WRITE(*,*) 'Please check the input file'
1081  stop
1082 
1083  ELSE
1084 
1085  rewind(input_unit)
1086 
1087  END IF
1088 
1089  bubble_number_density = 10.0d0 ** log10_bubble_number_density
1090 
1091  ELSEIF ( ( drag_funct_model .EQ. 'forchheimer_mod' ) .OR. &
1092  ( drag_funct_model .EQ. 'forchheimer_mod2' ) .OR. &
1093  ( drag_funct_model .EQ. 'forchheimer_mod3' ) ) THEN
1094 
1095  READ(input_unit, permeability_parameters , iostat = ios )
1096 
1097  IF ( ios .NE. 0 ) THEN
1098 
1099  WRITE(*,*) 'IOSTAT=',ios
1100  WRITE(*,*) 'ERROR: problem with namelist PERMEABILITY_PARAMETERS'
1101  WRITE(*,*) 'Please check the input file'
1102  stop
1103 
1104  ELSE
1105 
1106  rewind(input_unit)
1107 
1108  END IF
1109 
1110  END IF
1111 
1112  CLOSE( input_unit )
1113 
1114  bak_name = trim(run_name)//'.bak'
1115 
1116  OPEN(backup_unit,file=bak_name,status='unknown')
1117 
1118  WRITE(backup_unit, run_parameters )
1119 
1120  WRITE(backup_unit, geometry_parameters )
1121 
1122  WRITE(backup_unit, phases_parameters )
1123 
1124  WRITE(backup_unit, steady_boundary_conditions )
1125 
1126  WRITE(backup_unit, exsolved_gas_parameters )
1127 
1128  WRITE(backup_unit, dissolved_gas_parameters )
1129 
1130  WRITE(backup_unit, crystals_parameters )
1131 
1132  WRITE(backup_unit, melt_parameters )
1133 
1134  WRITE(backup_unit, viscosity_parameters )
1135 
1136  WRITE(backup_unit, temperature_parameters )
1137 
1138  WRITE(backup_unit, fragmentation_parameters )
1139 
1140  WRITE(backup_unit, external_water_parameters )
1141 
1142  WRITE(backup_unit, source_parameters )
1143 
1144  IF ( lateral_degassing_flag ) THEN
1145 
1146  WRITE(backup_unit, country_rock_parameters )
1147 
1148  END IF
1149 
1150  WRITE(backup_unit, relaxation_parameters )
1151 
1152 
1153  IF ( ( drag_funct_model .EQ. 'eval' ) .OR. &
1154  ( drag_funct_model .EQ. 'Klug_and_Cashman' ) .OR. &
1155  ( drag_funct_model .EQ. 'drag' ) ) THEN
1156 
1157  WRITE(backup_unit, bubbles_parameters )
1158 
1159  ELSEIF ( ( drag_funct_model .EQ. 'darcy' ) .OR. &
1160  ( drag_funct_model .EQ. 'forchheimer') .OR. &
1161  ( drag_funct_model .EQ. 'forchheimer_wt')) THEN
1162 
1163  WRITE(backup_unit, forchheimer_parameters )
1164 
1165  ELSEIF ( ( drag_funct_model .EQ. 'forchheimer_mod' ) .OR. &
1166  ( drag_funct_model .EQ. 'forchheimer_mod2' ) .OR. &
1167  ( drag_funct_model .EQ. 'forchheimer_mod3' ) ) THEN
1168 
1169  WRITE(backup_unit, permeability_parameters )
1170 
1171  END IF
1172 
1173 
1174  IF ( visc_melt_model .EQ. 'Giordano_et_al2008' ) THEN
1175 
1176  WRITE(backup_unit,*) '''MELTCOMPOSITION'''
1177  WRITE(backup_unit,*) 'SiO2 TiO2 Al2O3 FeO MnO MgO CaO Na2O K2O P2O5 H2O F2O-1'
1178  WRITE(backup_unit,107) wt_init(1:12)
1179 
1180 107 FORMAT(12(f5.2,1x))
1181 
1182  END IF
1183 
1184 
1185  CLOSE(backup_unit)
1186 
1187  END SUBROUTINE read_param
1188 
1189  !******************************************************************************
1193  !
1201  !******************************************************************************
1202 
1203  SUBROUTINE output_steady(zeta,qp,radius)
1205  ! External variables
1206  USE parameters, ONLY : n_vars , n_cry , n_gas
1207 
1208  USE parameters, ONLY : idx_p1 , idx_p2 , idx_u1 , idx_u2 , idx_t , &
1210 
1211  USE geometry, ONLY : zeta_exit
1212 
1213  ! External subroutine
1214  USE constitutive, ONLY : sound_speeds
1215  USE constitutive, ONLY : frag_eff
1216  USE equations, ONLY : eval_qp2
1217 
1218  IMPLICIT NONE
1219 
1220  REAL*8, INTENT(IN) :: zeta
1221  REAL*8 :: qp(n_vars)
1222  REAL*8, INTENT(IN) :: radius
1223 
1224  REAL*8 :: qp2(1+n_cry+n_gas+n_gas+4)
1225  REAL*8 :: mass_flow_rate
1226  REAL*8 :: pi
1227 
1228  REAL*8 :: C_mix, mach, mix_velocity
1229 
1230  REAL*8 :: rho1, rho2(n_gas), rho_mix
1231 
1232  REAL*8 :: gasTotVolFrac
1233 
1234  INTEGER :: i,j
1235 
1236  CALL eval_qp2( qp, qp2 )
1237 
1238  IF ( zeta .EQ. z0 ) THEN
1239 
1240  steady_p_file = trim(run_name)//'_p.std'
1241 
1242  OPEN(steady_p_output_unit,file=steady_p_file,status='UNKNOWN')
1243 
1244  OPEN(steady_q_output_unit,file='test.out',status='UNKNOWN')
1245  !WRITE(steady_p_output_unit,*) radius_fixed
1246  !WRITE(steady_p_output_unit,*) radius_min
1247  !WRITE(steady_p_output_unit,*) radius_max
1248  !WRITE(steady_p_output_unit,*) radius_z
1249  !WRITE(steady_p_output_unit,*) radius_z_sig
1250  !WRITE(steady_p_output_unit,*) radius_model
1251  !WRITE(steady_p_output_unit,*) comp_cells
1252 
1253  END IF
1254 
1255 
1256 
1257  DO i = 1,n_vars
1258 
1259  IF ( abs(qp(i)) .LT. 1d-20 ) THEN
1260  qp(i) = 0.d0
1261  END IF
1262 
1263  END DO
1264 
1265  DO i = 1,1+n_cry+n_gas+n_gas+4
1266 
1267  IF ( abs(qp2(i)) .LT. 1d-20 ) THEN
1268  qp2(i) = 0.d0
1269  END IF
1270 
1271  END DO
1272 
1273  WRITE(steady_p_output_unit, *) (zeta)
1274  WRITE(steady_p_output_unit, 1006) (qp(i), i=1,n_vars)
1275  WRITE(steady_p_output_unit, 1006) (qp2(i), i=1,1+n_cry+n_gas+n_gas+4)
1276  WRITE(steady_p_output_unit, *) radius
1277 
1278 1006 FORMAT(4e20.12)
1279 
1280  WRITE(steady_q_output_unit,1007,advance="no") zeta
1281 
1282  DO i = 1,n_vars
1283 
1284  WRITE(steady_q_output_unit,1007,advance="no") qp(i)
1285 
1286  END DO
1287 
1288  DO i = 1,1+n_cry+n_gas+n_gas+4
1289 
1290  WRITE(steady_q_output_unit,1007,advance="no") qp2(i)
1291 
1292  END DO
1293 
1294  WRITE(steady_q_output_unit,1007) radius
1295 
1296 1007 FORMAT(1x,e15.8)
1297 
1298  IF ( zeta .EQ. zeta_exit ) THEN
1299 
1300  rho1 = qp2(1)
1301 
1302  gastotvolfrac = 0.0
1303 
1304  DO j=1,n_gas
1305 
1306  rho2(j) = qp2(1+j)
1307  gastotvolfrac = gastotvolfrac + qp(j)
1308 
1309  END DO
1310 
1311  rho_mix = (1.0d0 - gastotvolfrac) * rho1
1312 
1313  DO j=1,n_gas
1314 
1315  rho_mix = rho_mix + qp(j) * rho2(j)
1316 
1317  END DO
1318 
1319  mix_velocity = (1.0d0 - gastotvolfrac) * rho1 / rho_mix * qp(idx_u1)
1320 
1321  DO j=1,n_gas
1322 
1323  mix_velocity = mix_velocity + qp(j) * rho2(j) / rho_mix * qp(idx_u2)
1324 
1325  END DO
1326 
1327  CLOSE(steady_p_output_unit)
1328  CLOSE(steady_q_output_unit)
1329 
1330  OPEN( dakota_unit,file='MAMMA.out',status='UNKNOWN')
1331 
1332  pi = 4.d0 * atan(1.d0)
1333 
1334  WRITE(dakota_unit,*) 'Total Gas volume fraction', gastotvolfrac
1335  WRITE(dakota_unit,*) 'Pressure 1',qp(idx_p1)
1336  WRITE(dakota_unit,*) 'Pressure 2',qp(idx_p2)
1337  WRITE(dakota_unit,*) 'Liquid/particles velocity',qp(idx_u1)
1338  WRITE(dakota_unit,*) 'Gas velocity',qp(idx_u2)
1339  WRITE(dakota_unit,*) 'Exit Temperature',qp(idx_t)
1340  WRITE(dakota_unit,*) 'Crystals volume fraction',sum(qp(idx_beta_first: &
1341  idx_beta_last))
1342 
1343  CALL sound_speeds(c_mix,mach)
1344  CALL update_radius(zeta)
1345 
1346  WRITE(dakota_unit,*) 'Mach number',mach
1347  WRITE(dakota_unit,*) 'Exit mixture velocity', mix_velocity
1348  WRITE(dakota_unit,*) 'Mass flow rate', pi * radius * radius &
1349  * mix_velocity * rho_mix
1350  WRITE(dakota_unit,*) 'Fragmentation', frag_eff
1351 
1352  CLOSE( dakota_unit )
1353 
1354  OPEN( dakota_unit2,file='dakota.out',status='UNKNOWN')
1355 
1356  pi = 4.d0 * atan(1.d0)
1357 
1358  WRITE(dakota_unit2,*) gastotvolfrac
1359  WRITE(dakota_unit2,*) qp(idx_p1)
1360  WRITE(dakota_unit2,*) qp(idx_p2)
1361  WRITE(dakota_unit2,*) qp(idx_u1)
1362  WRITE(dakota_unit2,*) qp(idx_u2)
1363  WRITE(dakota_unit2,*) qp(idx_t)
1364  WRITE(dakota_unit2,*) mach
1365  WRITE(dakota_unit2,*) mix_velocity
1366  WRITE(dakota_unit2,*) pi * radius * radius * mix_velocity * rho_mix
1367  WRITE(dakota_unit2,*) frag_eff
1368 
1369  CLOSE( dakota_unit2 )
1370 
1371  exit_file = trim(run_name)//'_exit.std'
1372 
1373  OPEN( exit_unit,file=exit_file,status='UNKNOWN')
1374 
1375  WRITE(exit_unit,*) 'Mass_flow_rate',mass_flow_rate
1376  WRITE(exit_unit,*) 'Gas volume fraction',1.d0-sum(qp(idx_alfa_first: &
1377  idx_alfa_last))
1378  WRITE(exit_unit,*) 'Pressure 1',qp(idx_p1)
1379  WRITE(exit_unit,*) 'Pressure 2',qp(idx_p2)
1380  WRITE(exit_unit,*) 'Crystals volume fraction',sum(qp(idx_beta_first: &
1381  idx_beta_last))
1382  WRITE(exit_unit,*) 'Liquid/particles velocity',qp(idx_u1)
1383  WRITE(exit_unit,*) 'Gas velocity',qp(idx_u2)
1384  WRITE(exit_unit,*) 'Mach number',mach
1385 
1386  CLOSE( exit_unit )
1387 
1388  END IF
1389 
1390  END SUBROUTINE output_steady
1391 
1392  !------------------------------------------------------------------------------
1396  !
1401  !------------------------------------------------------------------------------
1402 
1403  CHARACTER*4 FUNCTION lettera(k)
1404  IMPLICIT NONE
1405  CHARACTER ones,tens,hund,thou
1406  !
1407  INTEGER :: k
1408  !
1409  INTEGER :: iten, ione, ihund, ithou
1410  !
1411  ithou=int(k/1000)
1412  ihund=int((k-(ithou*1000))/100)
1413  iten=int((k-(ithou*1000)-(ihund*100))/10)
1414  ione=k-ithou*1000-ihund*100-iten*10
1415  ones=char(ione+48)
1416  tens=char(iten+48)
1417  hund=char(ihund+48)
1418  thou=char(ithou+48)
1419  lettera=thou//hund//tens//ones
1420  !
1421  RETURN
1422  END FUNCTION lettera
1423 
1424 END MODULE inpout
1425 
real *8, dimension(:), allocatable bar_p_c
crystals cohesion pressure
real *8, dimension(:), allocatable x_ex_dis_in
real *8, dimension(:), allocatable log10_tau_d
Definition: inpout.f90:111
logical isothermal
Flag for isothermal runs: .
Definition: equations.f90:33
character *4 function lettera(k)
Numeric to String conversion.
Definition: inpout.f90:1404
integer idx_p2
Index of p2 in the qp array.
Definition: parameters.f90:38
Parameters.
Definition: parameters.f90:10
character(len=30), dimension(20) available_visc_melt_models
real *8 total_water_influx
Total water influx.
Definition: equations.f90:71
real *8, dimension(:), allocatable bar_e_c
crystals formation energy
character(len=50) input_file
Name of the file with the run parameters.
Definition: inpout.f90:85
real *8, dimension(:), allocatable gamma_d
dissolved gas adiabatic exponent
real *8, dimension(:), allocatable b_g
parameter for the VDW EOS
real *8, dimension(:), allocatable bar_e_d
dissolved gas formation energy
real *8, dimension(:), allocatable t0_c
crystals gas reference temperature
integer, parameter dakota_unit
Dakota Output unit.
Definition: inpout.f90:98
real *8 drag_funct_coeff
coefficient for the drag function for the relative velocity:
real *8 grav
gravitational acceleration
subroutine allocate_phases_parameters
Initialization of relaxation flags.
character(len=50) steady_p_file
Name of the steady output file.
Definition: inpout.f90:88
logical ext_water
Flag to activate the injection of external water: .
Definition: equations.f90:57
real *8 bar_p_m
melt cohesion pressure
real *8 theta_fixed
Fixed value for the relative viscosity of the crystals.
real *8, dimension(:), allocatable log10_tau_c
Definition: inpout.f90:110
real *8 radius_max
Fixed value of the maximum radius (used in non cylindrical conduits)
Definition: geometry.f90:40
real *8, dimension(:), allocatable s0_d
dissolved gas reference entropy
integer, parameter backup_unit
Backup input data unit.
Definition: inpout.f90:93
integer idx_u2
Index of u2 in the qp array.
Definition: parameters.f90:40
real *8 t0_m
melt reference temperature
real *8 p0_m
melt reference pressure
integer n_gas
Numbeer of crystal phases.
Definition: parameters.f90:30
real *8 fixed_temp
Temperature for isothermal runs.
Definition: equations.f90:36
real *8 eps_conv
Residual for the convergence of the shooting method. The solution is accepted if one of these conditi...
Definition: parameters.f90:122
real *8, dimension(:), allocatable p0_d
dissolved gas reference pressure
logical explosive
Flag to choose the eruptive style: .
logical shooting
Flag for the shooting technique: .
Definition: parameters.f90:107
real *8 gamma_m
melt adiabatic exponent
real *8 visc_2
gas viscosity
character *30 theta_model
Parameter to choose the model for the influence of crystal on the mixture: 'Lejeune_and_Richet1995' '...
integer, parameter output_p_unit
Output data unit.
Definition: inpout.f90:95
real *8, dimension(:), allocatable gamma_c
crystals adiabatic exponent
real *8, dimension(:), allocatable rho0_d
dissolved gas reference density
real *8 p_out
Outlet pressure.
Definition: init.f90:38
integer comp_cells
Number of control volumes in the computational domain.
Definition: geometry.f90:44
real *8, dimension(:), allocatable bar_e_g
exsolved gas formation energy
character *30 aquifer_type
Aquifer type: .
Definition: equations.f90:68
real *8, dimension(:), allocatable tc_g
critical gas temperature
integer n_theta_models
real *8 frag_thr
Threshold for the fragmentation.
subroutine update_radius(zeta)
Definition: geometry.f90:166
character *20 bubbles_model
Parameter to choose the model for the influence of the bubbles on the mixture: .
character *20 crystallization_model
Model for the equilibrium crystal volume fraction: .
character(len=50) exit_file
Name of the steady output file.
Definition: inpout.f90:90
real *8 c0_m
melt sound speed at atmospheric conditions
real *8, dimension(12) wt_init
Input/Output module.
Definition: inpout.f90:11
real *8, dimension(:), allocatable c0_c
crystals sound speed at atm conditions
integer, parameter steady_q_output_unit
Output unit.
Definition: inpout.f90:97
integer fragmentation_model
Parameter to choose the fragmentation model: .
subroutine eval_qp2(r_qp, qp2)
Conservative to physical variables.
Definition: equations.f90:232
real *8, dimension(:), allocatable tau_c
crystallization parameter:
real *8 delta_p_in
Inlet pressure difference ( p2-p1 )
Definition: init.f90:30
integer idx_alfa_first
First index of alfa in the qp array.
Definition: parameters.f90:44
real *8 bubble_number_density
bubble number density
logical lateral_degassing_flag
Input flag for lateral degassing: .
Definition: equations.f90:42
integer n_cry
Numbeer of crystal phases.
Definition: parameters.f90:29
real *8, dimension(:), allocatable rho0_c
crystals reference density
logical close_units
Definition: inpout.f90:103
integer n_drag_models
integer n_visc_melt_models
character *20 gas_law
equation of state for gas
real *8 z0
Left (bottom) of the physical domain.
Definition: geometry.f90:20
real *8 s0_m
melt reference entropy
character(len=30), dimension(20) available_drag_models
real *8, dimension(:), allocatable bar_p_d
dissolved gas cohesion pressure
character *20 p_relax_model
pressure relaxation model
real *8 friction_coefficient
real *8, dimension(:), allocatable tau_d
exsolution parameter:
subroutine sound_speeds(C_mix, mach)
Local sound speeds.
real *8, dimension(:), allocatable s0_c
crystals reference entropy
real *8, dimension(:), allocatable c0_d
dissolved gas sound speed at atm conditions
real *8 tortuosity_factor
tortuosity factor
real *8 k_cr
country rock permeability
subroutine read_param
Read the input file.
Definition: inpout.f90:452
real *8 radius_fixed
Fixed value of the radius.
Definition: geometry.f90:38
integer idx_alfa_last
Last index of alfa in the qp array.
Definition: parameters.f90:45
real *8 radius_z_sig
Characteristic sigma for radius model trans1 and trans2.
Definition: geometry.f90:42
character(len=50) run_name
Name of the run.
Definition: inpout.f90:83
real *8, dimension(:), allocatable beta_max
maximum crystal volume fraction
character *20 exsol_model
String for exsolution model: .
Governing equations.
Definition: equations.f90:9
real *8 cv_m
melt specific heat capacity at constant volume
real *8 bar_e_m
melt formation energy
real *8, dimension(:), allocatable rho0_g
exsolved gas reference density
integer, parameter dakota_unit2
Dakota Output unit.
Definition: inpout.f90:99
integer idx_beta_first
First index of beta in the qp array.
Definition: parameters.f90:46
real *8 zeta_exit
Right (top) of the physical domain.
Definition: geometry.f90:22
real *8 t_in
Inlet temperature.
Definition: init.f90:33
Initial solution.
Definition: init.f90:11
logical inst_vaporization
Flag for instantaneous vaporization: .
Definition: equations.f90:62
real *8 tau_p_coeff
pressure relaxation coefficient:
real *8 u1_in
Inlet first phase velocity.
Definition: init.f90:31
real *8 frag_eff
index of fragmentation in the interval [0;1]
integer n_mom
Number of moments for each crystal phase.
Definition: parameters.f90:35
integer n_bubble_models
real *8, dimension(:), allocatable cv_g
exsolved gas heat capacity at constant volume
real *8, dimension(:), allocatable p0_c
crystals reference pressure
integer, parameter exit_unit
Exit Output unit.
Definition: inpout.f90:100
real *8 rho0_m
melt reference density
integer idx_p1
Index of p1 in the qp array.
Definition: parameters.f90:37
real *8 zn
Right (top) of the physical domain.
Definition: geometry.f90:21
integer idx_u1
Index of u1 in the qp array.
Definition: parameters.f90:39
character *30 drag_funct_model
drag function model
Constitutive equations.
Definition: constitutive.f90:9
character *30 radius_model
geometry model
Definition: geometry.f90:36
real *8 log10_tau_p_coeff
Definition: inpout.f90:108
real *8, dimension(:), allocatable cv_d
dissolved gas heat capacity at constant volume
character *30 visc_melt_model
Parameter to select the melt viscosity (bubbles and crystal-free) model: .
integer idx_beta_last
Last index of beta in the qp array.
Definition: parameters.f90:47
real *8, dimension(:), allocatable beta_in
Inlet crystal volume fraction.
Definition: init.f90:34
real *8 log10_drag_funct_coeff
Definition: inpout.f90:108
real *8 delta_z_influx
Definition: equations.f90:76
character(len=50) output_p_file
Name of the output files.
Definition: inpout.f90:87
real *8, dimension(:), allocatable cv_c
crystals specific heat capacity at constant volume
character(len=50) steady_q_file
Name of the steady output file.
Definition: inpout.f90:89
character(len=30), dimension(20) available_bubble_models
real *8 p1_in
Inlet first phase pressure.
Definition: init.f90:28
real *8, dimension(:), allocatable a_g
parameter for the VDW EOS
real *8 min_z_influx
Minimum depth of influx.
Definition: equations.f90:74
real *8 log10_bubble_number_density
real *8, dimension(:), allocatable solub
Solubility parameter for the Henry's law.
integer, parameter input_unit
Input data unit.
Definition: inpout.f90:92
real *8 rho_cr
contry rock density
real *8, dimension(:), allocatable t0_g
exsolved gas reference temperature
real *8, dimension(:), allocatable pc_g
critical gas pressure
real *8 t_w
Water temperature in the aquifer.
Definition: equations.f90:82
integer n_vars
Number of conservative variables.
Definition: parameters.f90:32
real *8 log10_k_cr
Definition: inpout.f90:105
real *8 throat_bubble_ratio
throat bubble ratio
real *8 alfa2_lat_thr
Exsolved gas volume fraction threshold for lateral degassing.
Definition: equations.f90:52
integer, parameter output_q_unit
Output data unit.
Definition: inpout.f90:94
subroutine init_param
Initialization of the variables read from the input file.
Definition: inpout.f90:176
integer verbose_level
Definition: parameters.f90:101
real *8, dimension(:), allocatable gamma_g
exsolved gas adiabatic exponent
real *8 radius_z
Characteristic depth for radius models trans1 and trans2.
Definition: geometry.f90:41
real *8, dimension(:), allocatable s0_g
exsolved gas reference entropy
subroutine output_steady(zeta, qp, radius)
Write the steady solution on the output unit.
Definition: inpout.f90:1204
real *8, dimension(:), allocatable t0_d
dissolved gas reference temperature
character(len=50) bak_name
Name of the backup file for the parameters.
Definition: inpout.f90:84
real *8, dimension(:), allocatable xd_md_in
Inlet dissolved gas mass fraction.
Definition: init.f90:35
character(len=50) output_q_file
Name of the output files.
Definition: inpout.f90:86
integer, parameter steady_p_output_unit
Output unit.
Definition: inpout.f90:96
Grid module.
Definition: geometry.f90:7
character(len=30), dimension(20) available_theta_models
real *8, dimension(:), allocatable solub_exp
integer idx_t
Index of T in the qp array.
Definition: parameters.f90:41
integer n_eqns
Number of equations.
Definition: parameters.f90:33
real *8, dimension(:), allocatable beta0
chamber (equilibrium) crystal volume fraction
real *8 radius_min
Fixed value of the minimum radius (used in non cylindrical conduits)
Definition: geometry.f90:39