-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEQ_print_inFile.m
executable file
·62 lines (53 loc) · 1.94 KB
/
EQ_print_inFile.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
function [ fID ] = EQ_print_inFile (ii,data,EQin,sites,vel)
% EQ_print_inFile.m
% EQ Function that defines the names of the input files
% Nathanael Wong Zhixin, Feng Lujia
%
% This function defines the names of the various EQ files that are used
% during the earthquake model run. The function then creates an input file
% based on the imported data for the earthquake event.
%
% INPUT:
% -- ii : run ID for rake
% -- data : information on the earthquake event
% -- EQin : earthquake fault input information
% -- sites : GPS station input information
% -- vel : GPS displacement information
%
% OUTPUT:
% -- fID : structure containing information on file names
%
% FORMAT OF CALL: EQ_print_bfitFile (name,data,EQin,sites,vel)
%
% OVERVIEW:
% 1) This function extracts information on the GTdef-fault and GPS
% information type
%
% 2) The function then creates the filenames for the respective earthquake
%
% 3) The function then creates an input file based on the information for
% the earthquake imported from the parent function.
%
% VERSIONS:
% 1) -- Final version validated and commented on 20190811 by Nathanael Wong
EQID = data.EQID;
flt = data.type(1); pnt = data.type(2);
fID.in = {}; fID.out = {};
fID.pch = {}; fID.pnt = {}; fID.xsc = {};
fID.in = [ EQID '_' num2str(ii) '.in' ];
fID.out = [ EQID '_' num2str(ii) '_fwd.out' ];
fID.pch = [ EQID '_' num2str(ii) '_fwd_patches.out' ];
fID.pnt = [ EQID '_' num2str(ii) '_fwd_point.out' ];
fID.xsc = [ EQID '_' num2str(ii) '_fwd_xsection.out' ];
fEQin = fopen (fID.in,'w');
if flt == 1, EQ_print_flt1 (fEQin,data,EQin);
elseif flt == 2, EQ_print_flt2 (fEQin,data,EQin);
elseif flt == 3, EQ_print_flt3 (fEQin,data,EQin);
elseif flt == 4, EQ_print_flt4 (fEQin,data,EQin);
end
if pnt == 1, EQ_print_pnt1 (fEQin,sites,vel);
elseif pnt == 2, EQ_print_pnt2 (fEQin,sites,vel);
elseif pnt == 3, EQ_print_pnt3 (fEQin,sites,vel);
end
fclose (fEQin);
end