-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7bfe372
commit f0fac7c
Showing
18 changed files
with
381 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,46 @@ | ||
function EQFile = EQ_create_print (EQtype,EQID,EQdim,EQgeom,EQpos,EQslip,EQinv) | ||
function EQFile = EQ_create_print (type,ID,dim,geom,pos,slip,inv) | ||
|
||
% EQ_create_print.m | ||
% EQ Function that creates and prints to .eq files | ||
% Nathanael Wong Zhixin, Feng Lujia | ||
% | ||
% This function is created for the purpose of printing the initial input | ||
% information into .eq files, to be read and used for GTdef modelling | ||
% | ||
% INPUT: Earthquake event information | ||
% | ||
% OUTPUT: | ||
% -- EQFile : name of .eq file created | ||
% | ||
% FORMAT OF CALL: EQ_create_print (type,ID,dim,geom,pos,slip,inv) | ||
% | ||
% OVERVIEW: | ||
% 1) This function creates and prints data to a .eq file | ||
% | ||
% 2) The name of the .eq file is exported to the parent script | ||
% | ||
% VERSIONS: | ||
% 1) -- Final version validated and commented on 20190715 by Nathanael Wong | ||
|
||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CREATE FILE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
|
||
EQFile = EQ_create_printFile (EQtype,EQID,EQpos,EQslip); | ||
fEQ = fopen (EQFile,'w'); | ||
EQFile = EQ_create_printFile(type,ID,pos,slip); fEQ = fopen(EQFile,'w'); | ||
|
||
EQ_create_printHead (fEQ,EQID); | ||
EQ_create_printType (fEQ,EQtype); | ||
EQ_create_printXYZ (fEQ,EQpos); | ||
EQ_create_printDGeo (fEQ,EQdim,EQgeom); | ||
EQ_create_printSlip (fEQ,EQslip); | ||
EQ_create_printInv0 (fEQ,EQinv.O); | ||
EQ_create_printInvX (fEQ,EQinv.X); | ||
EQ_create_printInvN (fEQ,EQinv.N); | ||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PRINT DETAILS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
|
||
EQ_create_printHead(fEQ,ID); | ||
EQ_create_printType(fEQ,type); | ||
EQ_create_printXYZ (fEQ,pos); | ||
EQ_create_printDGeo(fEQ,dim,geom); | ||
EQ_create_printSlip(fEQ,slip); | ||
EQ_create_printInv0(fEQ,inv.O); | ||
EQ_create_printInvX(fEQ,inv.X); | ||
EQ_create_printInvN(fEQ,inv.N); | ||
|
||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLOSE FILE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
|
||
fclose (fEQ); | ||
|
||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,45 @@ | ||
function EQ_create_printDGeo (fEQ,EQdim,EQgeom) | ||
function EQ_create_printDGeo (fEQ,dim,geom) | ||
|
||
% EQ_create_printDGeo.m | ||
% EQ Function that print the event geometry to .eq | ||
% Nathanael Wong Zhixin, Feng Lujia | ||
% | ||
% This function is created for the purpose of printing the dimensions and | ||
% geometryinformation into .eq files, to be read and used in GTdef | ||
% | ||
% INPUT: | ||
% -- fEQ : file name | ||
% -- dim : dimension information | ||
% -- geom : geometry information | ||
% | ||
% OUTPUT: N/A | ||
% | ||
% FORMAT OF CALL: EQ_create_printDGeo (fEQ,dim,geom) | ||
% | ||
% OVERVIEW: | ||
% 1) This function prints the event dimensions and geometry | ||
% | ||
% VERSIONS: | ||
% 1) -- Final version validated and commented on 20190715 by Nathanael Wong | ||
|
||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PRINT HEADER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
|
||
fprintf (fEQ, '# DGeo Len Wid Area'); | ||
fprintf (fEQ, ' '); | ||
fprintf (fEQ, 'Str Dip\n'); | ||
|
||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PRINT UNITS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
|
||
fprintf (fEQ, '# (m) (m) (m^2)'); | ||
fprintf (fEQ, ' '); | ||
fprintf (fEQ, '(d) (d)\n'); | ||
|
||
fprintf (fEQ, ' DGeo %-6.0f %-6.0f %-e', EQdim); | ||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PRINT DETAILS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
|
||
fprintf (fEQ, ' DGeo %-6.0f %-6.0f %-e', dim); | ||
fprintf (fEQ, ' '); | ||
fprintf (fEQ, '%-5.1f %-4.1f\n\n', EQgeom); | ||
fprintf (fEQ, '%-5.1f %-4.1f\n\n', geom); | ||
|
||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,26 @@ | ||
function EQ_create_printType (fEQ,EQtype) | ||
|
||
function EQ_create_printType (fEQ,type) | ||
|
||
% EQ_create_printType.m | ||
% EQ function that prints the model type info to string for filename | ||
% Nathanael Wong Zhixin, Feng Lujia | ||
% | ||
% This function prints the model type information into the .eq file. | ||
% | ||
% INPUT: | ||
% -- fEQ : .eq file ID | ||
% -- tyoe : GTdef model type information | ||
% | ||
% OUTPUT: N/A | ||
% | ||
% FORMAT OF CALL: EQ_create_printType (fEQ,GTdef model type) | ||
% | ||
% OVERVIEW: | ||
% 1) This function prints the GTdef model type into the .eq file | ||
% | ||
% VERSIONS: | ||
% 1) -- Final version validated and commented on 20190715 by Nathanael Wong | ||
|
||
fprintf (fEQ, '# Type flt pnt slab evt reg\n'); | ||
fprintf (fEQ, ' Type %d %d %3.1f %d %d\n\n', EQtype); | ||
fprintf (fEQ, ' Type %d %d %3.1f %d %d\n\n', type); | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.