179 namelist / run_parameters /
run_name ,
restart , t_start , t_end , dt_output ,&
183 namelist / restart_parameters /
restart_file, t_init, t_ambient , sed_vol_perc
185 namelist / newrun_parameters / x0 , y0 , comp_cells_x , comp_cells_y , &
186 cell_size , rheology_flag , riemann_flag , energy_flag , liquid_flag , &
187 radial_source_flag , collapsing_volume_flag , topo_change_flag , gas_flag
189 namelist / initial_conditions / released_volume , x_release , y_release , &
190 velocity_mod_release , velocity_ang_release , t_init , t_ambient
192 namelist / left_state / riemann_interface , hb_w , u_w , v_w , alphas_w , t_w
208 namelist / numeric_parameters / solver_scheme, dt0 , max_dt , cfl, limiter , &
209 theta , reconstr_coeff , interfaces_relaxation , n_rk
211 namelist / expl_terms_parameters / grav
213 namelist / radial_source_parameters / x_source , y_source , r_source , &
214 vel_source , t_source , h_source , alphas_source , alphal_source , time_param
216 namelist / collapsing_volume_parameters / x_collapse , y_collapse , &
217 r_collapse , t_collapse , h_collapse , alphas_collapse
219 namelist / temperature_parameters / emissivity , atm_heat_transf_coeff , &
220 thermal_conductivity , exp_area_fract , c_p , enne , emme , t_env , &
223 namelist / rheology_parameters / rheology_model , mu , xi , tau , nu_ref , &
224 visc_par , t_ref , alpha2 , beta2 ,
alpha1_ref , beta1 , kappa , n_td , &
233 namelist / gas_transport_parameters / sp_heat_a , sp_gas_const_a , kin_visc_a,&
234 pres , t_ambient , entrainment_flag
288 rheology_flag = .false.
290 energy_flag = .false.
291 topo_change_flag = .false.
292 radial_source_flag = .false.
293 collapsing_volume_flag = .false.
294 liquid_flag = .false.
298 riemann_interface = 0.5d0
378 exp_area_fract = 0.5d0
380 atm_heat_transf_coeff = 0.0d0
381 thermal_conductivity = 0.0d0
408 IF (lexist .EQV. .false.)
THEN 458 108
FORMAT(3(1x,e14.7))
466 WRITE(*,*)
'Input file SW_VAR_DENS_MODEL.inp not found' 467 WRITE(*,*)
'A new one with default values has been created' 521 exp_area_fract = -1.d0
523 atm_heat_transf_coeff = -1.d0
524 thermal_conductivity = -1.d0
538 settling_flag = .false.
541 t_s_substrate = -1.d0
545 sp_gas_const_a = -1.d0
560 time_param(1:4) = -1.d0
599 CHARACTER(LEN=80) :: card
605 CHARACTER(LEN=3) :: check_file
609 CHARACTER(LEN=15) :: chara
613 REAL*8 :: expA , expB , Tc
621 IF ( ios .NE. 0 )
THEN 623 WRITE(*,*)
'IOSTAT=',ios
624 WRITE(*,*)
'ERROR: problem with namelist RUN_PARAMETERS' 625 WRITE(*,*)
'Please check the input file' 637 IF ( ios .NE. 0 )
THEN 639 WRITE(*,*)
'IOSTAT=',ios
640 WRITE(*,*)
'ERROR: problem with namelist NEWRUN_PARAMETERS' 641 WRITE(*,*)
'Please check the input file' 650 IF ( ( comp_cells_x .EQ. 1 ) .OR. ( comp_cells_y .EQ. 1 ) )
THEN 652 WRITE(*,*)
'----- 1D SIMULATION -----' 656 WRITE(*,*)
'----- 2D SIMULATION -----' 660 IF ( ( .NOT. liquid_flag ) .AND. ( .NOT. gas_flag ) )
THEN 662 WRITE(*,*)
'IOSTAT=',ios
663 WRITE(*,*)
'ERROR: problem with namelist NEWRUN_PARAMETERS' 664 WRITE(*,*)
'One of these parameters must be set to .TRUE.' 665 WRITE(*,*)
'LIQUID_FLAG',liquid_flag
666 WRITE(*,*)
'GAS_FLAG',liquid_flag
667 WRITE(*,*)
'Please check the input file' 674 READ(
input_unit, gas_transport_parameters,iostat=ios)
676 IF ( ios .NE. 0 )
THEN 678 WRITE(*,*)
'IOSTAT=',ios
679 WRITE(*,*)
'ERROR: problem with namelist GAS_TRANSPORT_PARAMETERS' 680 WRITE(*,*)
'Please check the input file' 689 IF ( sp_heat_a .EQ. -1.d0 )
THEN 691 WRITE(*,*)
'ERROR: problem with namelist GAS_TRANSPORT_PARAMETERS' 692 WRITE(*,*)
'SP_HEAT_a =' , sp_heat_a
693 WRITE(*,*)
'Please check the input file' 698 IF ( sp_gas_const_a .EQ. -1.d0 )
THEN 700 WRITE(*,*)
'ERROR: problem with namelist GAS_TRANSPORT_PARAMETERS' 701 WRITE(*,*)
'SP_GAS_CONST_a =' , sp_gas_const_a
702 WRITE(*,*)
'Please check the input file' 707 IF ( kin_visc_a .EQ. -1.d0 )
THEN 709 WRITE(*,*)
'ERROR: problem with namelist GAS_TRANSPORT_PARAMETERS' 710 WRITE(*,*)
'KIN_VISC_CONST_a =' , kin_visc_a
711 WRITE(*,*)
'Please check the input file' 718 WRITE(*,*)
'CARRIER PHASE: gas' 719 WRITE(*,*)
'Carrier phase kinematic viscosity:',kin_visc_a
726 IF ( pres .EQ. -1.d0 )
THEN 728 WRITE(*,*)
'ERROR: problem with namelist GAS_TRANSPORT_PARAMETERS' 729 WRITE(*,*)
'pres =' , pres
730 WRITE(*,*)
'Please check the input file' 735 IF ( t_ambient .EQ. -1.d0 )
THEN 737 WRITE(*,*)
'ERROR: problem with namelist GAS_TRANSPORT_PARAMETERS' 738 WRITE(*,*)
'T_ambient =' , t_ambient
739 WRITE(*,*)
'Please check the input file' 744 IF ( ( .NOT. gas_flag ) .AND. ( liquid_flag .AND. entrainment_flag ) )
THEN 746 WRITE(*,*)
'ERROR: problem with namelist GAS_TRANSPORT_PARAMETERS' 747 WRITE(*,*)
'LIQUID_FLAG',liquid_flag
748 WRITE(*,*)
'ENTRAINMENT_FLAG =' , entrainment_flag
749 WRITE(*,*)
'Please check the input file' 754 rho_a_amb = pres / ( sp_gas_const_a * t_ambient )
755 WRITE(*,*)
'Ambient density = ',rho_a_amb,
' (kg/m3)' 761 IF ( liquid_flag )
THEN 763 IF ( gas_flag ) n_vars = n_vars + 1
765 READ(
input_unit, liquid_transport_parameters,iostat=ios)
767 IF ( ios .NE. 0 )
THEN 769 WRITE(*,*)
'IOSTAT=',ios
770 WRITE(*,*)
'ERROR: problem with namelist LIQUID_TRANSPORT_PARAMETERS' 771 WRITE(*,*)
'Please check the input file' 780 IF ( sp_heat_l .EQ. -1.d0 )
THEN 782 WRITE(*,*)
'ERROR: problem with namelist LIQUID_TRANSPORT_PARAMETERS' 783 WRITE(*,*)
'SP_HEAT_l =' , sp_heat_l
784 WRITE(*,*)
'Please check the input file' 789 IF ( rho_l .EQ. -1.d0 )
THEN 791 WRITE(*,*)
'ERROR: problem with namelist LIQUID_TRANSPORT_PARAMETERS' 792 WRITE(*,*)
'RHO_L =' , rho_l
793 WRITE(*,*)
'Please check the input file' 798 IF ( kin_visc_l .EQ. -1.d0 )
THEN 800 WRITE(*,*)
'ERROR: problem with namelist LIQUID_TRANSPORT_PARAMETERS' 801 WRITE(*,*)
'KIN_VISC_L =' , kin_visc_l
802 WRITE(*,*)
'Please check the input file' 807 IF ( .NOT. gas_flag )
THEN 809 WRITE(*,*)
'CARRIER PHASE: liquid' 810 WRITE(*,*)
'Carrier phase kinematic viscosity:',kin_visc_l
822 READ(
input_unit, solid_transport_parameters,iostat=ios)
824 IF ( ios .NE. 0 )
THEN 826 WRITE(*,*)
'IOSTAT=',ios
827 WRITE(*,*)
'ERROR: problem with namelist SOLID_TRANSPORT_PARAMETERS' 828 WRITE(*,*)
'Please check the input file' 837 IF ( n_solid .LT. 1 )
THEN 839 WRITE(*,*)
'ERROR: problem with namelist SOLID_TRANSPORT_PARAMETERS' 840 WRITE(*,*)
'n_solid =' , n_solid
841 WRITE(*,*)
'Please check the input file' 846 IF ( any(
rho0_s(1:n_solid) .EQ. -1.d0 ) )
THEN 848 WRITE(*,*)
'ERROR: problem with namelist SOLID_TRANSPORT_PARAMETERS' 849 WRITE(*,*)
'RHO_s =' ,
rho0_s(1:n_solid)
850 WRITE(*,*)
'Please check the input file' 855 IF ( any(
sp_heat0_s(1:n_solid) .EQ. -1.d0 ) )
THEN 857 WRITE(*,*)
'ERROR: problem with namelist SOLID_TRANSPORT_PARAMETERS' 858 WRITE(*,*)
'RHO_s =' ,
rho0_s(1:n_solid)
859 WRITE(*,*)
'Please check the input file' 866 WRITE(*,*)
'ERROR: problem with namelist SOLID_TRANSPORT_PARAMETERS' 867 WRITE(*,*)
'EROSION_COEFF =' , erosion_coeff
868 WRITE(*,*)
'Please check the input file' 873 IF ( t_s_substrate .LT. 0.d0 )
THEN 875 WRITE(*,*)
'ERROR: problem with namelist SOLID_TRANSPORT_PARAMETERS' 876 WRITE(*,*)
'T_s_substrate =' , t_s_substrate
877 WRITE(*,*)
'Please check the input file' 882 n_vars = n_vars + n_solid
894 ALLOCATE(
bcw(n_vars) ,
bce(n_vars) ,
bcs(n_vars) ,
bcn(n_vars) )
896 bcw(1:n_vars)%flag = -1
897 bce(1:n_vars)%flag = -1
898 bcs(1:n_vars)%flag = -1
899 bcn(1:n_vars)%flag = -1
901 ALLOCATE( rho_s(n_solid) , diam_s(n_solid) , sp_heat_s(n_solid) )
903 ALLOCATE( alphas_init(n_solid) , sed_vol_perc(n_solid) )
905 ALLOCATE( erosion_coeff(n_solid) )
907 rho_s(1:n_solid) =
rho0_s(1:n_solid)
908 diam_s(1:n_solid) =
diam0_s(1:n_solid)
912 ALLOCATE(
deposit( comp_cells_x , comp_cells_y , n_solid ) )
914 deposit(1:comp_cells_x,1:comp_cells_y,1:n_solid ) = 0.d0
919 READ(
input_unit,restart_parameters,iostat=ios)
921 IF ( ios .NE. 0 )
THEN 923 WRITE(*,*)
'IOSTAT=',ios
924 WRITE(*,*)
'ERROR: problem with namelist RESTART_PARAMETERS' 925 WRITE(*,*)
'Please check the input file' 934 IF ( check_file .EQ.
'asc' )
THEN 936 IF ( ( any(sed_vol_perc .LT. 0.d0 ) ) .OR. ( any(sed_vol_perc .GT. 100.d0 ) ) ) &
939 WRITE(*,*)
'ERROR: problem with namelist RESTART_PARAMETERS' 940 WRITE(*,*)
'SED_VOL_PERC =' , sed_vol_perc
945 alphas_init = 1.d-2 * sed_vol_perc
946 WRITE(*,*)
'INITIAL VOLUME FRACTION OF SOLIDS:', alphas_init
950 IF ( t_init*t_ambient .EQ. 0.d0 )
THEN 952 WRITE(*,*)
'T_init=',t_init
953 WRITE(*,*)
'T_ambient=',t_ambient
954 WRITE(*,*)
'Add the variables to the namelist RESTART_PARAMETERS' 965 IF ( riemann_flag )
THEN 969 IF ( ios .NE. 0 )
THEN 971 WRITE(*,*)
'IOSTAT=',ios
972 WRITE(*,*)
'ERROR: problem with namelist LEFT_PARAMETERS' 973 WRITE(*,*)
'Please check the input file' 980 IF ( t_w .EQ. -1.d0 )
THEN 982 WRITE(*,*)
'ERROR: problem with namelist LEFT_PARAMETERS' 983 WRITE(*,*)
'Initial temperature T_W not defined' 992 IF ( ios .NE. 0 )
THEN 994 WRITE(*,*)
'IOSTAT=',ios
995 WRITE(*,*)
'ERROR: problem with namelist RIGHT_PARAMETERS' 996 WRITE(*,*)
'Please check the input file' 1003 IF (
t_e .EQ. -1.d0 )
THEN 1005 WRITE(*,*)
'ERROR: problem with namelist RIGHT_PARAMETERS' 1006 WRITE(*,*)
'Initial temperature T_E not defined' 1025 IF ( ios .NE. 0 )
THEN 1027 WRITE(*,*)
'IOSTAT=',ios
1028 WRITE(*,*)
'ERROR: problem with namelist NUMERIC_PARAMETERS' 1029 WRITE(*,*)
'Please check the input file' 1038 IF ( ( solver_scheme .NE.
'LxF' ) .AND. ( solver_scheme .NE.
'KT' ) .AND. &
1039 ( solver_scheme .NE.
'GFORCE' ) .AND. ( solver_scheme .NE.
'UP' ) )
THEN 1041 WRITE(*,*)
'WARNING: no correct solver scheme selected',solver_scheme
1042 WRITE(*,*)
'Chose between: LxF, GFORCE or KT' 1047 IF ( ( solver_scheme.EQ.
'LxF' ) .OR. ( solver_scheme.EQ.
'GFORCE' ) )
THEN 1053 IF ( ( comp_cells_x .EQ. 1 ) .OR. ( comp_cells_y .EQ. 1 ) )
THEN 1066 IF ( ( cfl .GT. max_cfl ) .OR. ( cfl .LT. 0.d0 ) )
THEN 1068 WRITE(*,*)
'WARNING: wrong value of cfl ',cfl
1069 WRITE(*,*)
'Choose a value between 0.0 and ',max_cfl
1074 IF ( verbose_level .GE. 1 )
WRITE(*,*)
'Limiters',limiter(1:n_vars)
1076 limiter(n_vars+1) = limiter(2)
1077 limiter(n_vars+2) = limiter(3)
1079 IF ( ( maxval(limiter(1:n_vars)) .GT. 3 ) .OR. &
1080 ( minval(limiter(1:n_vars)) .LT. 0 ) )
THEN 1082 WRITE(*,*)
'WARNING: wrong limiter ',limiter(1:n_vars)
1083 WRITE(*,*)
'Choose among: none, minmod,superbee,van_leer' 1089 WRITE(*,*)
'Linear reconstruction and b. c. applied to variables:' 1090 WRITE(*,*)
'h,hu,hv,T,alphas' 1092 IF ( ( reconstr_coeff .GT. 1.0d0 ) .OR. ( reconstr_coeff .LT. 0.d0 ) )
THEN 1094 WRITE(*,*)
'WARNING: wrong value of reconstr_coeff ',reconstr_coeff
1095 WRITE(*,*)
'Change the value between 0.0 and 1.0 in the input file' 1102 IF ( comp_cells_x .GT. 1 )
THEN 1106 READ(
input_unit,west_boundary_conditions,iostat=ios)
1108 IF ( ios .NE. 0 )
THEN 1110 WRITE(*,*)
'IOSTAT=',ios
1111 WRITE(*,*)
'ERROR: problem with namelist WEST_BOUNDARY_CONDITIONS' 1112 WRITE(*,*)
'Please check the input file' 1121 IF ( (
h_bcw%flag .EQ. -1 ) )
THEN 1123 WRITE(*,*)
'ERROR: problem with namelist WEST_BOUNDARY_CONDITIONS' 1124 WRITE(*,*)
'B.C. for h not set properly' 1125 WRITE(*,*)
'Please check the input file' 1130 IF ( comp_cells_x .GT. 1 )
THEN 1132 IF (
hu_bcw%flag .EQ. -1 )
THEN 1134 WRITE(*,*)
'ERROR: problem with namelist WEST_BOUNDARY_CONDITIONS' 1135 WRITE(*,*)
'B.C. for hu not set properly' 1136 WRITE(*,*)
'Please check the input file' 1148 IF ( comp_cells_y .GT. 1 )
THEN 1150 IF (
hv_bcw%flag .EQ. -1 )
THEN 1152 WRITE(*,*)
'ERROR: problem with namelist WEST_BOUNDARY_CONDITIONS' 1153 WRITE(*,*)
'B.C. for hv not set properly' 1154 WRITE(*,*)
'Please check the input file' 1168 WRITE(*,*)
'ERROR: problem with namelist WEST_BOUNDARY_CONDITIONS' 1169 WRITE(*,*)
'B.C. for sediment conentration not set properly' 1170 WRITE(*,*)
'Please check the input file' 1171 WRITE(*,*)
'alphas_bcW' 1177 IF (
t_bcw%flag .EQ. -1 )
THEN 1179 WRITE(*,*)
'ERROR: problem with namelist WEST_BOUNDARY_CONDITIONS' 1180 WRITE(*,*)
'B.C. for temperature not set properly' 1181 WRITE(*,*)
'Please check the input file' 1195 READ(
input_unit,east_boundary_conditions,iostat=ios)
1197 IF ( ios .NE. 0 )
THEN 1199 WRITE(*,*)
'IOSTAT=',ios
1200 WRITE(*,*)
'ERROR: problem with namelist EAST_BOUNDARY_CONDITIONS' 1201 WRITE(*,*)
'Please check the input file' 1210 IF ( (
h_bce%flag .EQ. -1 ) )
THEN 1212 WRITE(*,*)
'ERROR: problem with namelist EAST_BOUNDARY_CONDITIONS' 1213 WRITE(*,*)
'B.C. for h not set properly' 1214 WRITE(*,*)
'Please check the input file' 1219 IF ( comp_cells_x .GT. 1 )
THEN 1221 IF (
hu_bce%flag .EQ. -1 )
THEN 1223 WRITE(*,*)
'ERROR: problem with namelist EAST_BOUNDARY_CONDITIONS' 1224 WRITE(*,*)
'B.C. for hu not set properly' 1225 WRITE(*,*)
'Please check the input file' 1237 IF ( comp_cells_y .GT. 1 )
THEN 1239 IF (
hv_bce%flag .EQ. -1 )
THEN 1241 WRITE(*,*)
'ERROR: problem with namelist EAST_BOUNDARY_CONDITIONS' 1242 WRITE(*,*)
'B.C. for hv not set properly' 1243 WRITE(*,*)
'Please check the input file' 1258 WRITE(*,*)
'ERROR: problem with namelist EAST_BOUNDARY_CONDITIONS' 1259 WRITE(*,*)
'B.C. for sediment concentration not set properly' 1260 WRITE(*,*)
'Please check the input file' 1261 WRITE(*,*)
'alphas_bcE' 1267 IF (
t_bce%flag .EQ. -1 )
THEN 1269 WRITE(*,*)
'ERROR: problem with namelist EAST_BOUNDARY_CONDITIONS' 1270 WRITE(*,*)
'B.C. for temperature not set properly' 1271 WRITE(*,*)
'Please check the input file' 1282 IF ( comp_cells_y .GT. 1 )
THEN 1286 READ(
input_unit,south_boundary_conditions,iostat=ios)
1288 IF ( ios .NE. 0 )
THEN 1290 WRITE(*,*)
'IOSTAT=',ios
1291 WRITE(*,*)
'ERROR: problem with namelist SOUTH_BOUNDARY_CONDITIONS' 1292 WRITE(*,*)
'Please check the input file' 1301 IF ( (
h_bcs%flag .EQ. -1 ) )
THEN 1303 WRITE(*,*)
'ERROR: problem with namelist SOUTH_BOUNDARY_CONDITIONS' 1304 WRITE(*,*)
'B.C. for h not set properly' 1305 WRITE(*,*)
'Please check the input file' 1310 IF ( comp_cells_x .GT. 1 )
THEN 1312 IF (
hu_bcs%flag .EQ. -1 )
THEN 1314 WRITE(*,*)
'ERROR: problem with namelist SOUTH_BOUNDARY_CONDITIONS' 1315 WRITE(*,*)
'B.C. for hu not set properly' 1316 WRITE(*,*)
'Please check the input file' 1328 IF ( comp_cells_y .GT. 1 )
THEN 1330 IF (
hv_bcs%flag .EQ. -1 )
THEN 1332 WRITE(*,*)
'ERROR: problem with namelist SOUTH_BOUNDARY_CONDITIONS' 1333 WRITE(*,*)
'B.C. for hv not set properly' 1334 WRITE(*,*)
'Please check the input file' 1348 WRITE(*,*)
'ERROR: problem with namelist SOUTH_BOUNDARY_CONDITIONS' 1349 WRITE(*,*)
'B.C. for sediment concentrations not set properly' 1350 WRITE(*,*)
'Please check the input file' 1351 WRITE(*,*)
'alphas_bcS' 1357 IF (
t_bcs%flag .EQ. -1 )
THEN 1359 WRITE(*,*)
'ERROR: problem with namelist SOUTH_BOUNDARY_CONDITIONS' 1360 WRITE(*,*)
'B.C. for temperature not set properly' 1361 WRITE(*,*)
'Please check the input file' 1372 READ(
input_unit,north_boundary_conditions,iostat=ios)
1374 IF ( ios .NE. 0 )
THEN 1376 WRITE(*,*)
'IOSTAT=',ios
1377 WRITE(*,*)
'ERROR: problem with namelist NORTH_BOUNDARY_CONDITIONS' 1378 WRITE(*,*)
'Please check the input file' 1388 IF ( (
h_bcn%flag .EQ. -1 ) )
THEN 1390 WRITE(*,*)
'ERROR: problem with namelist NORTH_BOUNDARY_CONDITIONS' 1391 WRITE(*,*)
'B.C. for h not set properly' 1392 WRITE(*,*)
'Please check the input file' 1398 IF ( comp_cells_x .GT. 1 )
THEN 1400 IF (
hu_bcn%flag .EQ. -1 )
THEN 1402 WRITE(*,*)
'ERROR: problem with namelist NORTH_BOUNDARY_CONDITIONS' 1403 WRITE(*,*)
'B.C. for hu not set properly' 1404 WRITE(*,*)
'Please check the input file' 1416 IF ( comp_cells_y .GT. 1 )
THEN 1418 IF (
hv_bcn%flag .EQ. -1 )
THEN 1420 WRITE(*,*)
'ERROR: problem with namelist NORTH_BOUNDARY_CONDITIONS' 1421 WRITE(*,*)
'B.C. for hv not set properly' 1422 WRITE(*,*)
'Please check the input file' 1436 WRITE(*,*)
'ERROR: problem with namelist NORTH_BOUNDARY_CONDITIONS' 1437 WRITE(*,*)
'B.C. for sediment concentrations not set properly' 1438 WRITE(*,*)
'Please check the input file' 1439 WRITE(*,*)
'alphas_bcN' 1445 IF (
t_bcn%flag .EQ. -1 )
THEN 1447 WRITE(*,*)
'ERROR: problem with namelist NORTH_BOUNDARY_CONDITIONS' 1448 WRITE(*,*)
'B.C. for temperature not set properly' 1449 WRITE(*,*)
'Please check the input file' 1470 WRITE(*,*)
'bcE',
bce 1474 READ(
input_unit, expl_terms_parameters,iostat=ios)
1476 IF ( ios .NE. 0 )
THEN 1478 WRITE(*,*)
'IOSTAT=',ios
1479 WRITE(*,*)
'ERROR: problem with namelist EXPL_TERMS_PARAMETERS' 1480 WRITE(*,*)
'Please check the input file' 1489 IF ( grav .EQ. -1.d0 )
THEN 1491 WRITE(*,*)
'ERROR: problem with namelist EXPL_TERMS_PARAMETERS' 1492 WRITE(*,*)
'GRAV not set properly' 1493 WRITE(*,*)
'Please check the input file' 1500 IF ( radial_source_flag )
THEN 1502 alphal_source = -1.d0
1504 ALLOCATE( alphas_source(n_solid) )
1506 READ(
input_unit,radial_source_parameters,iostat=ios)
1508 IF ( ios .NE. 0 )
THEN 1510 WRITE(*,*)
'IOSTAT=',ios
1511 WRITE(*,*)
'ERROR: problem with namelist RADIAL_SOURCE_PARAMETERS' 1512 WRITE(*,*)
'Please check the input file' 1519 IF ( t_source .EQ. -1.d0 )
THEN 1521 WRITE(*,*)
'ERROR: problem with namelist RADIAL_SOURCE_PARAMETERS' 1522 WRITE(*,*)
'PLEASE CHEC VALUE OF T_SOURCE',t_source
1527 IF ( h_source .EQ. -1.d0 )
THEN 1529 WRITE(*,*)
'ERROR: problem with namelist RADIAL_SOURCE_PARAMETERS' 1530 WRITE(*,*)
'PLEASE CHEC VALUE OF H_SOURCE',h_source
1535 IF ( r_source .EQ. -1.d0 )
THEN 1537 WRITE(*,*)
'ERROR: problem with namelist RADIAL_SOURCE_PARAMETERS' 1538 WRITE(*,*)
'PLEASE CHEC VALUE OF R_SOURCE',r_source
1543 IF ( vel_source .EQ. -1.d0 )
THEN 1545 WRITE(*,*)
'ERROR: problem with namelist RADIAL_SOURCE_PARAMETERS' 1546 WRITE(*,*)
'PLEASE CHEC VALUE OF VEL_SOURCE',vel_source
1551 IF ( ( x_source - r_source ) .LE. x0 + cell_size )
THEN 1553 WRITE(*,*)
'ERROR: problem with namelist RADIAL_SOURCE_PARAMETERS' 1554 WRITE(*,*)
'SOURCE TOO LARGE' 1555 WRITE(*,*)
' x_source - radius ',x_source-r_source
1560 IF ( ( x_source + r_source ) .GE. x0+(comp_cells_x-1)*cell_size )
THEN 1562 WRITE(*,*)
'ERROR: problem with namelist RADIAL_SOURCE_PARAMETERS' 1563 WRITE(*,*)
'SOURCE TOO LARGE' 1564 WRITE(*,*)
' x_source + radius ',x_source+r_source
1569 IF ( ( y_source - r_source ) .LE. y0 + cell_size )
THEN 1571 WRITE(*,*)
'ERROR: problem with namelist RADIAL_SOURCE_PARAMETERS' 1572 WRITE(*,*)
'SOURCE TOO LARGE' 1573 WRITE(*,*)
' y_source - radius ',y_source-r_source
1578 IF ( ( y_source + r_source ) .GE. y0 +(comp_cells_y-1)*cell_size )
THEN 1580 WRITE(*,*)
'ERROR: problem with namelist RADIAL_SOURCE_PARAMETERS' 1581 WRITE(*,*)
'SOURCE TOO LARGE' 1582 WRITE(*,*)
' y_source + radius ',y_source+r_source
1587 IF ( gas_flag .AND. liquid_flag )
THEN 1589 IF ( alphal_source .LT. 0.d0 )
THEN 1591 WRITE(*,*)
'ERROR: problem with namelist RADIAL_SOURCE_PARAMETERS' 1592 WRITE(*,*)
'PLEASE CHECK VALUE OF ALPHAL_SOURCE',alphal_source
1599 IF ( any(time_param .LT. 0.d0 ) )
THEN 1602 WRITE(*,*)
'WARNING: problem with namelist RADIAL_SOURCEPARAMETERS' 1603 WRITE(*,*)
'time_param =' , time_param
1604 time_param(1) = t_end
1605 time_param(2) = t_end
1606 time_param(3) = 0.d0
1607 time_param(4) = t_end
1608 WRITE(*,*)
'CHANGED TO time_param =',time_param
1609 WRITE(*,*)
'Radial source now constant in time' 1614 IF ( time_param(2) .GT. time_param(1) )
THEN 1616 WRITE(*,*)
'ERROR: problem with namelist RADIAL_SOURCEPARAMETERS' 1617 WRITE(*,*)
'time_param(1),time_param(2) =' , time_param(1:2)
1618 WRITE(*,*)
'time_param(1) must be larger than time_param(2)' 1623 IF ( time_param(3) .GT. ( 0.5d0*time_param(2) ) )
THEN 1625 WRITE(*,*)
'ERROR: problem with namelist RADIAL_SOURCE_PARAMETERS' 1626 WRITE(*,*)
'time_param(3) =', time_param(3)
1627 WRITE(*,*)
'time_param(3) must be smaller than 0.5*time_param(2)' 1644 IF ( collapsing_volume_flag )
THEN 1646 ALLOCATE( alphas_collapse(n_solid) )
1648 READ(
input_unit,collapsing_volume_parameters,iostat=ios)
1650 IF ( ios .NE. 0 )
THEN 1652 WRITE(*,*)
'IOSTAT=',ios
1653 WRITE(*,*)
'ERROR: problem with namelist COLLAPSING_VOLUME_PARAMETERS' 1654 WRITE(*,*)
'Please check the input file' 1661 IF ( t_collapse .EQ. -1.d0 )
THEN 1663 WRITE(*,*)
'ERROR: problem with namelist COLLAPSING_VOLUME_PARAMETERS' 1664 WRITE(*,*)
'PLEASE CHECK VALUE OF T_COLLAPSE',t_collapse
1669 IF ( h_collapse .EQ. -1.d0 )
THEN 1671 WRITE(*,*)
'ERROR: problem with namelist COLLAPSING_VOLUME_PARAMETERS' 1672 WRITE(*,*)
'PLEASE CHECK VALUE OF H_COLLAPSE',h_collapse
1677 IF ( r_collapse .EQ. -1.d0 )
THEN 1679 WRITE(*,*)
'ERROR: problem with namelist COLLAPSING_VOLUME_PARAMETERS' 1680 WRITE(*,*)
'PLEASE CHECK VALUE OF R_COLLAPSE',r_collapse
1685 IF ( ( x_collapse - r_collapse ) .LE. x0 + cell_size )
THEN 1687 WRITE(*,*)
'ERROR: problem with namelist COLLAPSING_VOLUME_PARAMETERS' 1688 WRITE(*,*)
'COLLAPSING VOLUME TOO LARGE' 1689 WRITE(*,*)
' x_collapse - radius ',x_collapse-r_collapse
1694 IF ( ( x_collapse + r_collapse ) .GE. x0+(comp_cells_x-1)*cell_size )
THEN 1696 WRITE(*,*)
'ERROR: problem with namelist COLLAPSING_VOLUME_PARAMETERS' 1697 WRITE(*,*)
'COLLAPSING VOLUME TOO LARGE' 1698 WRITE(*,*)
' x_collapse + radius ',x_collapse+r_collapse
1703 IF ( ( y_collapse - r_collapse ) .LE. y0 + cell_size )
THEN 1705 WRITE(*,*)
'ERROR: problem with namelist COLLAPSING_VOLUME_PARAMETERS' 1706 WRITE(*,*)
'COLLAPSING VOLUME TOO LARGE' 1707 WRITE(*,*)
' y_collapse - radius ',y_collapse-r_collapse
1712 IF ( ( y_collapse + r_collapse ) .GE. y0 +(comp_cells_y-1)*cell_size )
THEN 1714 WRITE(*,*)
'ERROR: problem with namelist COLLAPSING_VOLUME_PARAMETERS' 1715 WRITE(*,*)
'COLLAPSING VOLUME TOO LARGE' 1716 WRITE(*,*)
' y_collapse + radius ',y_collapse+r_collapse
1728 READ(
input_unit, temperature_parameters,iostat=ios)
1730 IF ( ios .NE. 0 )
THEN 1732 WRITE(*,*)
'IOSTAT=',ios
1733 WRITE(*,*)
'ERROR: problem with namelist TEMPERATURE_PARAMETERS' 1734 WRITE(*,*)
'Please check the input file' 1745 IF ( rheology_flag )
THEN 1747 READ(
input_unit, rheology_parameters,iostat=ios)
1749 IF ( ios .NE. 0 )
THEN 1751 WRITE(*,*)
'IOSTAT=',ios
1752 WRITE(*,*)
'ERROR: problem with namelist RHEOLOGY_PARAMETERS' 1753 WRITE(*,*)
'Please check the input file' 1762 IF ( rheology_model .EQ. 0 )
THEN 1764 WRITE(*,*)
'ERROR: problem with namelist RHEOLOGY_PARAMETERS' 1765 WRITE(*,*)
'RHEOLOGY_FLAG' , rheology_flag ,
'RHEOLOGY_MODEL =' , &
1767 WRITE(*,*)
'Please check the input file' 1770 ELSEIF ( rheology_model .EQ. 1 )
THEN 1772 IF ( ( mu .EQ. -1.d0 ) .AND. ( xi .EQ. -1.d0 ) )
THEN 1774 WRITE(*,*)
'ERROR: problem with namelist RHEOLOGY_PARAMETERS' 1775 WRITE(*,*)
'RHEOLOGY_MODEL =' , rheology_model
1776 WRITE(*,*)
'MU =' , mu ,
' XI =' , xi
1777 WRITE(*,*)
'Please check the input file' 1782 IF ( ( t_ref .NE. -1.d0 ) .OR. ( nu_ref .NE. -1.d0 ) .OR. &
1783 ( visc_par .NE. -1.d0 ) .OR. ( tau .NE. -1.d0 ) )
THEN 1785 WRITE(*,*)
'WARNING: parameters not used in RHEOLOGY_PARAMETERS' 1786 IF ( t_ref .NE. -1.d0 )
WRITE(*,*)
'T_ref =',t_ref
1787 IF ( nu_ref .NE. -1.d0 )
WRITE(*,*)
'nu_ref =',nu_ref
1788 IF ( visc_par .NE. -1.d0 )
WRITE(*,*)
'visc_par =',visc_par
1789 IF ( tau .NE. -1.d0 )
WRITE(*,*)
'tau =',tau
1790 WRITE(*,*)
'Press ENTER to continue' 1795 ELSEIF ( rheology_model .EQ. 2 )
THEN 1797 IF ( tau .EQ. -1.d0 )
THEN 1799 WRITE(*,*)
'ERROR: problem with namelist RHEOLOGY_PARAMETERS' 1800 WRITE(*,*)
'RHEOLOGY_MODEL =' , rheology_model
1801 WRITE(*,*)
'TAU =' , tau
1802 WRITE(*,*)
'Please check the input file' 1807 IF ( ( t_ref .NE. -1.d0 ) .OR. ( nu_ref .NE. -1.d0 ) .OR. &
1808 ( visc_par .NE. -1.d0 ) .OR. ( mu .NE. -1.d0 ) .OR. &
1809 ( xi .NE. -1.d0 ) )
THEN 1811 WRITE(*,*)
'WARNING: parameters not used in RHEOLOGY_PARAMETERS' 1812 IF ( t_ref .NE. -1.d0 )
WRITE(*,*)
'T_ref =',t_ref
1813 IF ( nu_ref .NE. -1.d0 )
WRITE(*,*)
'nu_ref =',nu_ref
1814 IF ( visc_par .NE. -1.d0 )
WRITE(*,*)
'visc_par =',visc_par
1815 IF ( mu .NE. -1.d0 )
WRITE(*,*)
'mu =',mu
1816 IF ( xi .NE. -1.d0 )
WRITE(*,*)
'xi =',xi
1817 WRITE(*,*)
'Press ENTER to continue' 1823 ELSEIF ( rheology_model .EQ. 3 )
THEN 1825 IF ( nu_ref .EQ. -1.d0 )
THEN 1827 WRITE(*,*)
'ERROR: problem with namelist RHEOLOGY_PARAMETERS' 1828 WRITE(*,*)
'NU_REF =' , nu_ref
1829 WRITE(*,*)
'Please check the input file' 1834 IF ( visc_par .EQ. -1.d0 )
THEN 1836 WRITE(*,*)
'ERROR: problem with namelist RHEOLOGY_PARAMETERS' 1837 WRITE(*,*)
'VISC_PAR =' , visc_par
1838 WRITE(*,*)
'Please check the input file' 1841 ELSEIF ( visc_par .EQ. 0.d0 )
THEN 1843 WRITE(*,*)
'WARNING: temperature and momentum uncoupled' 1844 WRITE(*,*)
'VISC_PAR =' , visc_par
1845 WRITE(*,*)
'Press ENTER to continue' 1850 IF ( t_ref .EQ. -1.d0 )
THEN 1852 WRITE(*,*)
'ERROR: problem with namelist RHEOLOGY_PARAMETERS' 1853 WRITE(*,*)
'T_REF =' , t_ref
1854 WRITE(*,*)
'Please check the input file' 1861 IF ( ( mu .NE. -1.d0 ) .OR. ( xi .NE. -1.d0 ) .OR. ( tau .NE. -1.d0 ) ) &
1864 WRITE(*,*)
'WARNING: parameters not used in RHEOLOGY_PARAMETERS' 1865 IF ( mu .NE. -1.d0 )
WRITE(*,*)
'mu =',mu
1866 IF ( xi .NE. -1.d0 )
WRITE(*,*)
'xi =',xi
1867 IF ( tau .NE. -1.d0 )
WRITE(*,*)
'tau =',tau
1868 WRITE(*,*)
'Press ENTER to continue' 1873 ELSEIF ( rheology_model .EQ. 4 )
THEN 1875 IF ( gas_flag .OR. ( .NOT. liquid_flag ) )
THEN 1877 WRITE(*,*)
'ERROR: problem with namelist RHEOLOGY_PARAMETERS' 1878 WRITE(*,*)
'RHEOLOGY_MODEL =' , rheology_model
1879 WRITE(*,*)
'GAS FLAG = ' , gas_flag
1880 WRITE(*,*)
'LIQUID FLAG = ' , liquid_flag
1885 IF ( any(sed_vol_perc .EQ. -1.d0 ) )
THEN 1887 WRITE(*,*)
'ERROR: problem with namelist RHEOLOGY_PARAMETERS' 1888 WRITE(*,*)
'RHEOLOGY_MODEL =' , rheology_model
1889 WRITE(*,*)
'SED_VOL_PERC = ' , sed_vol_perc
1894 IF ( alpha2 .EQ. -1.d0 )
THEN 1896 WRITE(*,*)
'ERROR: problem with namelist RHEOLOGY_PARAMETERS' 1897 WRITE(*,*)
'ALPHA2 =' , alpha2
1898 WRITE(*,*)
'Please check the input file' 1903 IF ( beta2 .EQ. -1.d0 )
THEN 1905 WRITE(*,*)
'ERROR: problem with namelist RHEOLOGY_PARAMETERS' 1906 WRITE(*,*)
'BETA2 =' , beta2
1907 WRITE(*,*)
'Please check the input file' 1912 IF ( t_ref .LE. 273.15d0 )
THEN 1914 WRITE(*,*)
'ERROR: problem with namelist RHEOLOGY_PARAMETERS' 1915 WRITE(*,*)
'T_REF =' , t_ref
1916 WRITE(*,*)
'Please check the input file' 1923 WRITE(*,*)
'ERROR: problem with namelist RHEOLOGY_PARAMETERS' 1925 WRITE(*,*)
'Please check the input file' 1930 tc = t_ref - 273.15d0
1932 IF ( tc .LT. 20.d0 )
THEN 1934 expa = 1301.d0 / ( 998.333d0 + 8.1855d0 * ( tc - 20.d0 ) &
1935 + 0.00585d0 * ( tc - 20.d0 )**2 ) - 1.30223d0
1937 alpha1_coeff =
alpha1_ref / ( 1.d-3 * 10.d0**expa )
1941 expb = ( 1.3272d0 * ( 20.d0 - tc ) - 0.001053d0 * &
1942 ( tc - 20.d0 )**2 ) / ( tc + 105.0d0 )
1944 alpha1_coeff =
alpha1_ref / ( 1.002d-3 * 10.d0**expb )
1948 WRITE(*,*)
'alpha1 coefficient:',alpha1_coeff
1952 IF ( beta1 .EQ. -1.d0 )
THEN 1954 WRITE(*,*)
'ERROR: problem with namelist RHEOLOGY_PARAMETERS' 1955 WRITE(*,*)
'BETA1 =' , beta1
1956 WRITE(*,*)
'Please check the input file' 1961 IF ( kappa .EQ. -1.d0 )
THEN 1963 WRITE(*,*)
'ERROR: problem with namelist RHEOLOGY_PARAMETERS' 1964 WRITE(*,*)
'KAPPA =' , kappa
1965 WRITE(*,*)
'Please check the input file' 1970 IF ( n_td .EQ. -1.d0 )
THEN 1972 WRITE(*,*)
'ERROR: problem with namelist RHEOLOGY_PARAMETERS' 1973 WRITE(*,*)
'N_TD =' , n_td
1974 WRITE(*,*)
'Please check the input file' 1979 ELSEIF ( rheology_model .EQ. 5 )
THEN 1981 WRITE(*,*)
'RHEOLOGY_MODEL =' , rheology_model
1982 WRITE(*,*)
'Kurganov & Petrova Example 5' 1984 ELSEIF ( rheology_model .EQ. 6 )
THEN 1986 WRITE(*,*)
'RHEOLOGY_MODEL =' , rheology_model
1987 WRITE(*,*)
'Bursik & Woods' 1989 IF ( friction_factor .LT. 0.d0 )
THEN 1991 WRITE(*,*)
'ERROR: problem with namelist RHEOLOGY_PARAMETERS' 1992 WRITE(*,*)
'FRICTION_FACTOR =' , friction_factor
1993 WRITE(*,*)
'Please check the input file' 2000 WRITE(*,*)
'ERROR: problem with namelist RHEOLOGY_PARAMETERS' 2001 WRITE(*,*)
'RHEOLOGY_MODEL =' , rheology_model
2002 WRITE(*,*)
'Please check the input file' 2012 IF ( verbose_level .GE. 1 )
WRITE(*,*)
2014 WRITE(*,*)
'Searching for DEM file' 2016 INQUIRE(file=
'topography_dem.asc',exist=lexist)
2020 OPEN(2001, file=
'topography_dem.asc', status=
'old', action=
'read')
2024 WRITE(*,*)
'no dem file' 2029 READ(2001,*) chara,
ncols 2030 READ(2001,*) chara,
nrows 2041 WRITE(*,*)
'Computational domain problem' 2049 IF ( x0 + ( comp_cells_x ) * cell_size .GT. &
2052 WRITE(*,*)
'Computational domain problem' 2053 WRITE(*,*)
'right edge > xllcorner+ncols*cellsize', &
2061 WRITE(*,*)
'Computational domain problem' 2067 IF ( abs( ( y0 + comp_cells_y * cell_size ) - (
yllcorner + 0.5d0 + &
2070 WRITE(*,*)
'Computational domain problem' 2071 WRITE(*,*)
'top edge > yllcorner+nrows*cellsize', &
2078 WRITE(*,*)
'Reading DEM file' 2079 WRITE(*,*)
'ncols',
ncols 2080 WRITE(*,*)
'nrows',
nrows 2082 n_topography_profile_x =
ncols 2084 n_topography_profile_y =
nrows 2086 ALLOCATE( topography_profile( 3 , n_topography_profile_x , &
2087 n_topography_profile_y) )
2089 DO j=1,n_topography_profile_x
2095 DO k=1,n_topography_profile_y
2103 DO k=1,n_topography_profile_y
2105 WRITE(*,fmt=
"(A1,A,t21,F6.2,A)",advance=
"NO") achar(13), &
2106 &
" Percent Complete: " , &
2107 (
REAL(k) /
REAL(n_topography_profile_y))*100.0,
"%" 2109 READ(2001,*) topography_profile(3,:,n_topography_profile_y-k+1)
2113 topography_profile(3,:,:) = max(0.d0,topography_profile(3,:,:))
2124 READ(
input_unit, runout_parameters,iostat=ios)
2126 IF ( ios .NE. 0 )
THEN 2128 WRITE(*,*)
'IOSTAT=',ios
2129 WRITE(*,*)
'ERROR: problem with namelist RUNOUT_PARAMETERS' 2130 WRITE(*,*)
'Please check the input file' 2141 WRITE(*,*)
'Runout reference location not defined' 2147 WRITE(*,*)
'Computational domain problem' 2148 WRITE(*,*)
'x0_runout < x0',x0,
x0_runout 2153 IF ( x0 .GT. x0+comp_cells_x*cell_size )
THEN 2155 WRITE(*,*)
'Computational domain problem' 2156 WRITE(*,*)
'x0_runout > x0+comp_cells_x*cell_size' , x0 , &
2164 WRITE(*,*)
'Computational domain problem' 2165 WRITE(*,*)
'y0_runout < y0',y0,
y0_runout 2170 IF ( y0 .GT. y0+comp_cells_y*cell_size )
THEN 2172 WRITE(*,*)
'Computational domain problem' 2173 WRITE(*,*)
'y0_runout > y0+comp_cells_y*cell_size' , y0 , &
2192 WRITE(*,*)
'Searching for topography_profile' 2200 IF( trim(card) ==
'PROBES_COORDS' )
THEN 2206 END DO probes_search
2219 IF ( verbose_level.GE.0 )
WRITE(*,*) k ,
probes_coords( 1:2 , k )
2250 IF ( riemann_flag)
THEN 2265 IF ( comp_cells_x .GT. 1 )
THEN 2272 IF ( comp_cells_y .GT. 1 )
THEN 2287 IF ( rheology_flag )
WRITE(
backup_unit,rheology_parameters)
2300 109
FORMAT(2(1x,e14.7))
2330 CHARACTER(LEN=40) :: run_name_org
2331 LOGICAL :: restart_org
2332 REAL*8 :: t_start_org
2334 REAL*8 :: dt_output_org
2335 LOGICAL :: output_cons_flag_org
2336 LOGICAL :: output_phys_flag_org
2337 LOGICAL :: output_esri_flag_org
2338 INTEGER :: verbose_level_org
2342 t_start_org = t_start
2344 dt_output_org = dt_output
2348 verbose_level_org = verbose_level
2356 IF ( ios .NE. 0 )
THEN 2358 WRITE(*,*)
'IOSTAT=',ios
2359 WRITE(*,*)
'ERROR: problem with namelist RUN_PARAMETERS' 2360 WRITE(*,*)
'Please check the input file' 2371 IF ( t_end_org .NE. t_end )
THEN 2373 WRITE(*,*)
'Modified input file: t_end =',t_end
2377 IF ( dt_output_org .NE. dt_output )
THEN 2379 WRITE(*,*)
'Modified input file: dt_output =',dt_output
2401 IF ( verbose_level_org .NE. verbose_level )
THEN 2403 WRITE(*,*)
'Modified input file: verbose_level =',verbose_level
2409 t_start_org = t_start
2442 CHARACTER(LEN=15) :: chara
2450 CHARACTER(LEN=30) :: string
2452 CHARACTER(LEN=3) :: check_file
2454 INTEGER :: ncols , nrows , nodata_value
2456 REAL*8 :: xllcorner , yllcorner , cellsize
2460 REAL*8,
ALLOCATABLE :: thickness_input(:,:)
2462 REAL*8,
ALLOCATABLE :: x1(:) , y1(:)
2466 REAL*8 :: xl , xr , yl , yr
2468 REAL*8 :: rho_c , rho_m , mass_fract(n_solid)
2472 INTEGER :: solid_idx
2481 IF ( lexist .EQV. .false.)
THEN 2498 IF ( check_file .EQ.
'asc' )
THEN 2500 IF ( liquid_flag .AND. gas_flag )
THEN 2502 WRITE(*,*)
'ERROR: problem with namelist NEWRUN_PARAMETERS' 2503 WRITE(*,*)
'When restarting from .asc file only' 2504 WRITE(*,*)
'one of these parameters must be set to .TRUE.' 2505 WRITE(*,*)
'LIQUID_FLAG',liquid_flag
2506 WRITE(*,*)
'GAS_FLAG',liquid_flag
2507 WRITE(*,*)
'Please check the input file' 2511 ELSEIF ( ( .NOT.liquid_flag ) .AND. ( .NOT. gas_flag ) )
THEN 2513 WRITE(*,*)
'ERROR: problem with namelist NEWRUN_PARAMETERS' 2514 WRITE(*,*)
'When restarting from .asc file only one' 2515 WRITE(*,*)
'of these parameters must be set to .TRUE.' 2516 WRITE(*,*)
'LIQUID_FLAG',liquid_flag
2517 WRITE(*,*)
'GAS_FLAG',liquid_flag
2518 WRITE(*,*)
'Please check the input file' 2522 ELSEIF ( gas_flag )
THEN 2524 WRITE(*,*)
'Carrier phase: gas' 2526 ELSEIF ( liquid_flag )
THEN 2528 WRITE(*,*)
'Carrier phase: liquid' 2540 ALLOCATE( thickness_input(ncols,nrows) )
2542 IF ( ( xllcorner - x0 ) .GT. 1.d-5*cellsize )
THEN 2545 WRITE(*,*)
'WARNING: initial solution and domain extent' 2546 WRITE(*,*)
'xllcorner greater than x0', xllcorner , x0
2550 IF ( ( yllcorner - y0 ) .GT. 1.d-5*cellsize )
THEN 2553 WRITE(*,*)
'WARNING: initial solution and domain extent' 2554 WRITE(*,*)
'yllcorner greater then y0', yllcorner , y0
2558 IF ( x0+cell_size*(comp_cells_x+1) - ( xllcorner+cellsize*(ncols+1) ) &
2559 .GT. 1.d-5*cellsize )
THEN 2562 WRITE(*,*)
'WARNING: initial solution and domain extent' 2563 WRITE(*,*)
'xrrcorner greater than ', xllcorner , x0
2567 IF ( x0+cell_size*(comp_cells_x+1) - ( xllcorner+cellsize*(ncols+1) ) &
2568 .GT. 1.d-5*cellsize )
THEN 2571 WRITE(*,*)
'WARNING: initial solution and domain extent' 2572 WRITE(*,*)
'yllcorner greater then y0', yllcorner , y0
2577 IF ( cellsize .NE. cell_size )
THEN 2580 WRITE(*,*)
'WARNING: changing resolution of restart' 2581 WRITE(*,*)
'cellsize not equal to cell_size', cellsize , cell_size
2588 WRITE(*,fmt=
"(A1,A,t21,F6.2,A)",advance=
"NO") achar(13), &
2589 &
" Percent Complete: ",(
REAL(k) /
REAL(nrows))*100.0,
"%" 2591 READ(
restart_unit,*) thickness_input(1:ncols,nrows-k+1)
2596 WRITE(*,*)
'Total volume from restart =',cellsize**2*sum(thickness_input)
2606 ALLOCATE( x1(ncols) , y1(nrows) )
2610 x1(j) = xllcorner + (j-1)*cellsize
2616 y1(k) = yllcorner + (k-1)*cellsize
2622 x2 = x0 + (j-1)*cell_size
2626 y2 = y0 + (k-1)*cell_size
2628 CALL interp_2d_scalarb( x1 , y1 , thickness_input , x2 , y2 , &
2636 DEALLOCATE( x1 , y1 )
2638 ALLOCATE( x1(ncols+1) , y1(nrows+1) )
2642 x1(j) = xllcorner + (j-1)*cellsize
2648 y1(k) = yllcorner + (k-1)*cellsize
2654 xl = x0 + (j-1)*cell_size
2655 xr = x0 + (j)*cell_size
2659 yl = y0 + (k-1)*cell_size
2660 yr = y0 + (k)*cell_size
2662 CALL regrid_scalar( x1 , y1 , thickness_input , xl , xr , yl , &
2672 IF ( gas_flag )
THEN 2674 rho_c = pres / ( sp_gas_const_a * t_init )
2675 sp_heat_c = sp_heat_a
2684 rho_m = sum( rho_s(1:n_solid)*alphas_init(1:n_solid) ) + ( 1.d0 - &
2685 sum( alphas_init(1:n_solid) ) ) * rho_c
2687 mass_fract = rho_s * alphas_init / rho_m
2691 WRITE(*,*)
'Total volume on computational grid =',cell_size**2 * &
2693 WRITE(*,*)
'Total mass on computational grid =',cell_size**2 * &
2706 q(4,:,:) =
q(1,:,:) * t_init * ( sum( mass_fract(1:n_solid) * &
2707 sp_heat_s(1:n_solid) ) + &
2708 ( 1.d0 - sum( mass_fract ) ) *
sp_heat_l )
2712 DO solid_idx=5,4+n_solid
2715 q(solid_idx,:,:) = 0.d0
2726 WRITE(*,*)
'MAXVAL(q(5,:,:))',maxval(
q(5:4+n_solid,:,:))
2728 WRITE(*,*)
'Total sediment volume =',cell_size**2*sum(
thickness_init* &
2733 IF ( verbose_level .GE. 1 )
THEN 2735 WRITE(*,*)
'Min q(1,:,:) =',minval(
q(1,:,:))
2736 WRITE(*,*)
'Max q(1,:,:) =',maxval(
q(1,:,:))
2737 WRITE(*,*)
'SUM(q(1,:,:)) =',sum(
q(1,:,:))
2746 WRITE(*,*)
'SUM(B_cent(:,:)) =',sum(
b_cent(:,:))
2751 DEALLOCATE( thickness_input )
2753 WRITE(*,*)
'n_vars',
n_vars 2755 ELSEIF ( check_file .EQ.
'q_2' )
THEN 2762 (
q(i_vars,j,k),i_vars=1,
n_vars)
2764 IF (
q(1,j,k) .LE. 0.d0 )
q(1:
n_vars,j,k) = 0.d0
2772 WRITE(*,*)
'Total mass =',dx*dy* sum(
q(1,:,:) )
2774 DO solid_idx=5,4+n_solid
2776 WRITE(*,*)
'Total sediment mass =',dx*dy* sum(
q(solid_idx,:,:) )
2786 WRITE(*,*)
'Starting from output index ',
output_idx 2792 WRITE(*,*)
'Restart file not in the right format (*.asc or *)' 2834 REAL*8,
INTENT(IN) :: time
2836 CHARACTER(LEN=4) :: idx_string
2838 REAL*8 :: qp(n_vars+2)
2842 REAL*8 :: r_u , r_v , r_h , r_alphas(n_solid) , r_T , r_Ri , r_rho_m
2844 REAL*8 :: r_red_grav
2873 IF ( dabs(
q(i,j,k)) .LT. 1d-99)
q(i,j,k) = 0.d0
2878 (
q(i_vars,j,k),i_vars=1,n_vars)
2905 CALL qc_to_qp(
q(1:n_vars,j,k) , qp(1:n_vars+2))
2907 CALL mixt_var(qp(1:n_vars+2),r_ri,r_rho_m,r_rho_c,r_red_grav)
2913 r_alphas(1:n_solid) = qp(5:4+n_solid)
2915 IF ( dabs( r_h ) .LT. 1d-99) r_h = 0.d0
2916 IF ( dabs( r_u ) .LT. 1d-99) r_u = 0.d0
2917 IF ( dabs( r_v ) .LT. 1d-99) r_v = 0.d0
2918 IF ( dabs(
b_cent(j,k)) .LT. 1d-99)
THEN 2930 IF ( dabs( r_alphas(i) ) .LT. 1d-99) r_alphas(i) = 0.d0
2935 IF ( dabs( r_t ) .LT. 1d-99) r_t = 0.d0
2936 IF ( dabs( r_rho_m ) .LT. 1d-99) r_rho_m = 0.d0
2937 IF ( dabs( r_red_grav ) .LT. 1d-99) r_red_grav = 0.d0
2940 b_out , r_h + b_out , r_alphas , r_t , r_rho_m , r_red_grav , &
2956 1010
FORMAT(100es13.5e2)
2958 t_output = time + dt_output
2964 IF ( ( time .GE. t_end ) .OR. ( time .GE.
t_steady ) )
THEN 3006 WHERE (
q1max(:,:).GE. 1.d-5 )
3019 DO j = comp_cells_y,1,-1
3053 INTEGER,
INTENT(IN) :: output_idx
3055 CHARACTER(LEN=4) :: idx_string
3056 CHARACTER(LEN=4) :: isolid_string
3060 IF ( output_idx .EQ. 1 )
THEN 3062 OPEN(
dem_esri_unit,file=
'dem_esri.asc',status=
'unknown',form=
'formatted')
3071 DO j = comp_cells_y,1,-1
3081 idx_string =
lettera(output_idx-1)
3092 WHERE (
qp(1,:,:).GE. 1.d-5 )
3105 DO j = comp_cells_y,1,-1
3122 WHERE (
qp(1,:,:) .GE. 1.d-5 )
3135 DO j = comp_cells_y,1,-1
3146 isolid_string =
lettera(i_solid)
3156 WHERE (
deposit(:,:,i_solid) .GT. 0.d0 )
3169 DO j = comp_cells_y,1,-1
3205 CHARACTER*4 FUNCTION lettera(k)
3207 CHARACTER ones,tens,hund,thou
3211 INTEGER :: iten, ione, ihund, ithou
3214 ihund=int((k-(ithou*1000))/100)
3215 iten=int((k-(ithou*1000)-(ihund*100))/10)
3216 ione=k-ithou*1000-ihund*100-iten*10
3221 lettera=thou//hund//tens//ones
3247 INTEGER,
INTENT(IN) :: output_idx
3249 CHARACTER(LEN=4) :: idx_string
3255 idx_string =
lettera(output_idx-1)
3297 REAL*8,
INTENT(IN) :: time
3298 LOGICAL,
INTENT(INOUT) :: stop_flag
3300 REAL*8,
ALLOCATABLE :: X(:,:), Y(:,:) , dist(:,:)
3302 INTEGER :: imax(2) , imin(2)
3304 REAL*8 :: area , area0 , dareaRel_dt
3310 ALLOCATE( x(sx,sy) , y(sx,sy) , dist(sx,sy) )
3312 x(:,:) = spread(
x_comp, 2, sy )
3313 y(:,:) = spread(
y_comp, 1, sx )
3317 IF ( time .EQ. t_start )
THEN 3319 ALLOCATE(
h_old(sx,sy) )
3325 WHERE(
q(1,:,:) > 1.d-5 ) dist =
b_cent 3326 imin = maxloc( dist )
3331 WRITE(*,*)
'Runout calculated as linear distance from: (' , &
3336 WHERE(
q(1,:,:) >1.d-5 ) dist = dsqrt( (x-
x0_runout)**2 &
3339 imax = maxloc( dist )
3349 WHERE(
h_old(:,:) > 1.d-5 ) dist = dsqrt(
q(2,:,:)**2 +
q(3,:,:)**2 )
3351 max_mom = maxval( dist )
3359 WHERE(
q(1,:,:) > 1.d-5 ) dist = dsqrt( ( x -
x0_runout )**2 &
3362 imax = maxloc( dist )
3364 OPEN(
dakota_unit,file=
'dakota.txt',status=
'replace',form=
'formatted')
3370 area0 =
dx*
dy*count(
q0(1,:,:).GT.1.d-7)
3371 area =
dx*
dy*count(
q(1,:,:).GT.1.d-7)
3373 WRITE(
runout_unit,
'(A,F12.3,A,F12.3,A,F14.3)')
'Time (s) = ',time , &
3374 ' Runout (m) = ',dist(imax(1),imax(2)) -
init_runout,
' Area (m^2) = ', &
3381 WHERE(
q(1,:,:) > 1.d-5 ) dist = abs(
q(1,:,:)-
q0(1,:,:)) / &
3382 max(
q(1,:,:),
q0(1,:,:))
3384 IF ( time .GT. t_start )
THEN 3386 darearel_dt = abs( area - area0 ) / ( area *
dt )
3388 dhrel_dt = sum( dist /
dt ) / count(
q(1,:,:).GT.1.d-5)
3390 IF ( ( max(darearel_dt,dhrel_dt) .LT.
eps_stop ) .AND. &
3391 (.NOT.stop_flag) )
THEN 3393 WRITE(*,*)
'Steady solution reached' 3394 WRITE(*,*)
'dareaRel_dt',darearel_dt
3395 WRITE(*,*)
'dhRel_dt',dhrel_dt
3402 DEALLOCATE( x , y , dist )
real *8 kin_visc_a
Kinematic viscosity of air (units: m2 s-1)
real *8 emissivity
emissivity (eps in Costa & Macedonio, 2005)
real *8 max_dt
Largest time step allowed.
integer, parameter probes_unit
Probes data unit.
real *8, dimension(:,:), allocatable probes_coords
real *8 dy
Control volumes size.
integer n_rk
Runge-Kutta order.
character(len=40) run_name
Name of the run.
real *8 sp_heat_l
Sepcific heat of liquid (units: J K-1 kg-1)
real *8 t_steady
end time when reached steady solution
real *8, dimension(:), allocatable alphas_w
Left sediment concentration.
real *8, dimension(:), allocatable x_comp
Location of the centers (x) of the control volume of the domain.
real *8 y0
Bottom of the physical domain.
real *8 nu_ref
reference kinematic viscosity [m2/s]
real *8 t_ground
temperature of lava-ground interface
real *8, dimension(:,:,:), allocatable q0
Conservative variables.
subroutine output_probes(output_idx)
Write solution at selected points on file.
real *8, dimension(:,:), allocatable b_cent
Topography at the centers of the control volumes.
integer comp_cells_x
Number of control volumes x in the comp. domain.
real *8 beta2
2nd param for yield strenght empirical relationship (O'Brian et al, 1993)
real *8, dimension(:), allocatable alphas_init
Initial sediment concentration in the pile of material.
real *8, dimension(:,:), allocatable thickness_init
real *8, dimension(:), allocatable y_comp
Location of the centers (y) of the control volume of the domain.
logical rheology_flag
Flag to choose if we add the rheology.
integer, parameter output_esri_unit
Esri Output unit.
integer n_topography_profile_y
subroutine mixt_var(qpj, r_Ri, r_rho_m, r_rho_c, r_red_grav)
Physical variables.
type(bc), dimension(:), allocatable alphas_bcs
logical entrainment_flag
flag to activate air entrainment
subroutine read_solution
Read the solution from the restart unit.
real *8 t_init
Initial temperature of the pile of material.
real *8 u_e
Right velocity x.
real *8 c_p
specific heat [J kg-1 K-1]
real *8 v_w
Left velocity y.
real *8 dx
Control volumes size.
logical output_esri_flag
Flag to save the output in esri ascii format *.asc.
real *8 y_release
Initial y-coordinate of the pile.
real *8 t_end
end time for the run
integer comp_cells_y
Number of control volumes y in the comp. domain.
character(len=40) restart_file
Name of the restart file.
real *8 kin_visc_l
Kinematic viscosity of liquid (units: m2 s-1)
integer rheology_model
choice of the rheology model
character(len=40) probes_file
Name of the probes file.
type(bc), dimension(:), allocatable bcw
bcW&flag defines the west boundary condition:
real *8 riemann_interface
Riemann problem interface relative position. It is a value between 0 and 1.
real *8 sp_gas_const_a
Specific gas constant of air (units: J kg-1 K-1)
subroutine update_param
Read the input file.
real *8 u_w
Left velocity x.
real *8 thermal_conductivity
thermal conductivity [W m-1 K-1] (k in Costa & Macedonio, 2005)
real *8 velocity_ang_release
Initial velocity direction (angle in degree): .
real *8 t_s_substrate
temperature of solid substrate (units: K)
subroutine regrid_scalar(xin, yin, fin, xl, xr, yl, yr, fout)
Scalar regrid (2D)
real *8 velocity_mod_release
Initial velocity module of the pile.
real *8 sp_heat_a
Specific heat of air (units: J K-1 kg-1)
integer n_topography_profile_x
real *8 beta1
2nd param for fluid viscosity empirical relationship (O'Brian et al, 1993)
real *8 released_volume
Initial volume of the flow.
character(len=40) output_esri_file
Name of the esri output files.
real *8 kin_visc_c
Kinematic viscosity of carrier phase (units: m2 s-1)
real *8, dimension(4) time_param
integer n_vars
Number of conservative variables.
subroutine output_max
Write the maximum thickness in ESRI format.
integer, parameter dakota_unit
real *8, dimension(:), allocatable alphas_collapse
real *8 cfl
Courant-Friedrichs-Lewy parameter.
real *8, dimension(:), allocatable alphas_source
real *8 enne
thermal boundary layer fraction of total thickness
real *8 dt0
Initial time step.
real *8, dimension(:), allocatable alphas_e
Right sediment concentration.
real *8, dimension(1000) sp_heat0_s
real *8 grav
gravitational acceleration
real *8 mu
drag coefficients (Voellmy-Salm model)
real *8 visc_par
viscosity parameter [K-1] (b in Table 1 Costa & Macedonio, 2005)
real *8 alpha1_coeff
ratio between reference value from input and computed values from eq.
real *8 x_release
Initial x-coordiante of the pile.
real *8, dimension(:), allocatable diam_s
Diameter of sediments ( units: m )
real *8 n_td
Mannings roughness coefficient ( units: T L^(-1/3) )
logical restart
Flag to start a run from a previous output: .
real *8, dimension(:), allocatable erosion_coeff
erosion model coefficient (units: m-1 )
real *8 x0
Left of the physical domain.
logical settling_flag
Flag to determine if sedimentation is active.
subroutine output_runout(time, stop_flag)
Write runout on file.
subroutine output_solution(time)
Write the solution on the output unit.
integer, parameter backup_unit
Backup input data unit.
real *8 rho_l
liquid density (units: kg m-3)
character *4 function lettera(k)
Numeric to String conversion.
character(len=20) solver_scheme
Finite volume method: .
logical output_phys_flag
Flag to save the physical variables on file *.p_2d.
real *8, dimension(:,:), allocatable grid_output
Solution in ascii grid format (ESRI)
integer, parameter output_unit_2d
Output data 2D unit.
real *8 t_env
evironment temperature [K]
real *8 alpha2
1st param for yield strenght empirical relationship (O'Brian et al, 1993)
integer, parameter output_unit
Output data unit.
character(len=40) output_max_file
Name of the esri max. thick. file.
integer, parameter runout_unit
logical output_cons_flag
Flag to save the conservative variables on file *.q_2d.
real *8 theta
Van Leer limiter parameter.
logical riemann_flag
Flag to choose the sort of problem to solve.
character(len=40) output_file
Name of the output files.
real *8, dimension(1000) rho0_s
real *8 t_w
Left temperature.
real *8 atm_heat_transf_coeff
atmospheric heat trasnfer coefficient [W m-2 K-1] (lambda in C&M, 2005)
real *8 v_e
Right velocity y.
real *8 t_output
time of the next output
real *8 rho_a_amb
Ambient density of air ( units: kg m-3 )
subroutine read_param
Read the input file.
real *8 pres
ambient pressure (units: Pa)
real *8, dimension(:,:,:), allocatable topography_profile
real *8 t_ref
reference temperature [K]
subroutine qc_to_qp(qc, qp)
Conservative to physical variables.
character(len=40) input_file
File with the run parameters.
integer, parameter output_max_unit
Esri max thick. output unit.
subroutine interp_2d_scalarb(x1, y1, f1, x2, y2, f2)
Scalar interpolation (2D)
subroutine output_esri(output_idx)
Write the thickness in ESRI format.
type(bc), dimension(:), allocatable alphas_bce
logical energy_flag
Flag to choose the equation for temperature to solve.
real *8 exp_area_fract
fractional area of the exposed inner core (f in C&M, 2005)
integer, dimension(10) limiter
Limiter for the slope in the linear reconstruction: .
real *8, dimension(:), allocatable sp_heat_s
Specific heat of solids (units: J K-1 kg-1)
type(bc), dimension(:), allocatable alphas_bcw
integer output_idx
Counter for the output files.
type(bc), dimension(:), allocatable bcn
bcN&flag defines the north boundary condition:
real *8 t_runout
time of the next runout output
real *8 t_e
Right temperature.
real *8, dimension(1000) erosion_coeff0
integer n_eqns
Number of equations.
real *8, dimension(:,:,:), allocatable deposit
deposit for the different classes
character(len=40) output_file_2d
Name of the output files.
integer, parameter dem_esri_unit
Computational grid Esri fmt unit.
real *8 t_ambient
Temperature of ambient air (units: K)
character(len=40) bak_name
Backup file for the parameters.
subroutine init_param
Initialization of the variables read from the input file.
real *8, dimension(:,:), allocatable h_old
real *8 reconstr_coeff
Slope coefficient in the linear reconstruction.
type(bc), dimension(:), allocatable bcs
bcS&flag defines the south boundary condition:
real *8 emme
velocity boundary layer fraction of total thickness
type(bc), dimension(:), allocatable alphas_bcn
real *8 tau
drag coefficients (plastic model)
type(bc), dimension(:), allocatable bce
bcE&flag defines the east boundary condition:
real *8 friction_factor
drag coefficients (B&W model)
real *8, dimension(:,:), allocatable q1max
Maximum over time of thickness.
real *8 dt_output
time interval for the output of the solution
logical radial_source_flag
integer, parameter input_unit
Input data unit.
real *8 kappa
Empirical resistance parameter (dimensionless, input parameter)
integer, parameter restart_unit
Restart data unit.
character(len=40) runout_file
Name of the runout file.
subroutine allocate_solver_variables
Memory allocation.
logical collapsing_volume_flag
real *8, dimension(1000) diam0_s
real *8 hb_e
Right height.
integer n_solid
Number of solid classes.
real *8, dimension(:), allocatable rho_s
Density of sediments ( units: kg m-3 )
logical interfaces_relaxation
Flag to add the relaxation terms after the linear reconstruction: .
real *8, dimension(:,:,:), allocatable qp
Physical variables ( )
logical output_runout_flag
Flag to save the max runout at ouput times.
real *8 t_start
initial time for the run
real *8, dimension(:), allocatable sed_vol_perc
real *8, dimension(:,:,:), allocatable q
Conservative variables.