SPECFEM / specfem3d

SPECFEM3D_Cartesian simulates acoustic (fluid), elastic (solid), coupled acoustic/elastic, poroelastic or seismic wave propagation in any type of conforming mesh of hexahedra (structured or not).
GNU General Public License v3.0
409 stars 228 forks source link

Error in reading Par_file_faults when reproducing splay faults example with two faults #1405

Open mingdeyu opened 3 years ago

mingdeyu commented 3 years ago

I got the error that ' Bad integer for item 1 in list input' when running the splay faults example. This happens on line 104 of src/specfem3D/fault_solver_kinematic.f90 when it tries to read the simulation type. It seems that fault_solver_kinematic.f90 does not support more than 1 fault in Par_file_faults? Can anyone help overcome this issue, e.g., how can I switch to fault_solver_dynamic.f90 (this one seems loop over faults to read etas) for simulation? Many thanks.

Deyu

jpampuero commented 3 years ago

The module fault_solver_kinematic.f90 is not used by this example ... unless you changed the Par_file_faults. I infer that you changed line 4, replacing 1 (dynamic) by 2 (kinematic), and thus your intention is to use kinematic faults instead of the original dynamic faults. Is that correct? Did you make other changes in Par_file_faults? For instance, did you provide the input parameters needed by kinematic faults?

mingdeyu commented 3 years ago

@jpampuero No, I did not change the Par_file_faults at all and have set 1 as simulation type. I have a CMTSOLUTION file in the DATA folder as a place holder as without it the simulation exits. Would this issue be due to my simulation ran on GPU rather on CPU?

BTW, what parameters in Par_file_faults are only for kinematic faults? I thought the Par_file_faults is only for dynamic?

mingdeyu commented 3 years ago

@jpampuero I have fixed the issue. On line 103 of fault_solver_kinematic.f90, it reads eta, however it only reads one item even if there are more than one fault so when it reads simulation type there is an error because it actually reads the second eta. I replace line 103 by do iflt = 1,nbfaults read(IIN_PAR,*) enddo and remake the xspecfem3d, then the simulation works without the issue.

jpampuero commented 3 years ago

Good catch, thank you. I will incorporate your fix it in the devel version.

AwaiNYB commented 3 years ago

Hey there! Are there any available kinematic fault examples? I reviewed the provided fault examples, and all are for dynamic faults. Thus, I don't know what I should provide for kinematic fault simulations. By my understanding, the slip rate on fault should be loaded as input, and I deed see them in the subroutine: load_vslip_snapshots(dataXZ,itime,iflt,myrank) in which a file named "ProcSnapshot.bin" is read. However, I didn't find anywhere in the generate database procedure this file is created.

Best regards, Teddy

jpampuero commented 3 years ago

The kinematic source feature is not documented and is not in a user-friendly form, unfortunately. The user must provide the slip velocity snapshot files INPUT_FILES/Proc[processor#]_Snapshot[snapshot#]_F[fault#].bin. Their format can be inferred from subroutine load_vslip_snapshots in module fault_solver_kinematic. Each snapshot file contains slip velocities at all the nodes on the fault, at a given time. The code then creates a smooth kinematic source model by interpolating in time between these snapshots. To create the snapshot files, the user must extract the positions of the fault nodes from the fault database files proc[processor#]fault_db.txt. I hope that helps.

AwaiNYB commented 3 years ago

The kinematic source feature is not documented and is not in a user-friendly form, unfortunately. The user must provide the slip velocity snapshot files INPUT_FILES/Proc[processor#]_Snapshot[snapshot#]_F[fault#].bin. Their format can be inferred from subroutine load_vslip_snapshots in module fault_solver_kinematic. Each snapshot file contains slip velocities at all the nodes on the fault, at a given time. The code then creates a smooth kinematic source model by interpolating in time between these snapshots. To create the snapshot files, the user must extract the positions of the fault nodes from the fault database files proc[processor#]fault_db.txt. I hope that helps.

Dear jpampuero, Thank you for the prompt reply that helps a lot. Are there any papers or books that the kinematic fault coding refers to? Coz I assume we still need to modify the ''Par_file_faults'' a little bit to provide some necessary properties for kinematic faults? Regards, Teddy

jpampuero commented 3 years ago

The kinematic source feature was used in the following papers with @snsomala : S. N. Somala, J. P. Ampuero and N. Lapusta (2018), Finite-fault source inversion using adjoint methods in 3D heterogeneous media, Geophys. J. Int., 214 (1), 402–420, doi:10.1093/gji/ggy148
J. Harms, J.-P. Ampuero, M. Barsuglia, E. Chassande-Mottin, J.-P. Montagner, S. N. Somala and B. F. Whiting (2015), Transient gravity perturbations induced by earthquake rupture, Geophys. J. Int., 201 (3), 1416-1425, doi:10.1093/gji/ggv090 S. N. Somala, J.-P. Ampuero and N. Lapusta (2014), Resolution of rise time in earthquake slip inversions: Effect of station spacing and rupture velocity, Bull. Seismo. Soc. Am., 104 (6), 2717-2734, doi:10.1785/0120130185

The source is arbitrary: it is up to the user to provide a fault geometry and a history of slip velocities over the whole fault. The parameters to modify in Par_file_faults are documented in the manual, namely the type of simulation (1=dynamic , 2 = kinematic) and the number of time steps between fault snapshots.