Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
GPIAG-Software
IFOS3D
Commits
0750aa60
Commit
0750aa60
authored
Sep 02, 2016
by
Tilman Steinweg
Browse files
added documentation
parent
ba2301c1
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/ifos3d.c
View file @
0750aa60
...
...
@@ -682,6 +682,7 @@ MPI_Barrier(MPI_COMM_WORLD);
if
(
HESS
&&
READ_HESS
==
1
)
readhess
(
NX
,
NY
,
NZ
,
hessian
,
finv
[
0
],
iteration
+
1
-
it_group
);
MPI_Barrier
(
MPI_COMM_WORLD
);
if
(
METHOD
==
1
&&
EXTOBS
==
1
){
/* Read Seismograms from external file and save them for each CPU */
for
(
ishot
=
1
;
ishot
<=
nshots
;
ishot
++
){
if
(
ntr_loc
>
0
){
readseis_split
(
ishot
,
section
->
vx
,
ntr_glob
,
acq
->
rnum_loc
,
ns
,
1
);
...
...
src/readseis_split.c
View file @
0750aa60
...
...
@@ -19,6 +19,7 @@
/*----------------------------------------------------------------------------
* reads seismograms from files
* and splits them in parts belonging to each CPU
-----------------------------------------------------------------------------*/
...
...
src/saveseis.c
View file @
0750aa60
...
...
@@ -116,7 +116,7 @@ void saveseis(FILE *fp, st_seismogram *section, st_acquisition *acq, int ntr, in
MPI_Barrier
(
MPI_COMM_WORLD
);
if
(
MYID
==
0
){
sprintf
(
outfile
,
"%s_vx_it%d.%s.shot%d"
,
seisfile
,
iteration
,
file_ext
,
ishot
);
/
*
fprintf(FP,"outfile:%s",outfile);
*/
/
/
fprintf(FP,"outfile:%s",outfile);
fout
=
fopen
(
outfile
,
"w"
);
buf2
=
vector
(
1
,
ns
);
buf1
=
vector
(
1
,
240
/
sizeof
(
float
));
...
...
@@ -131,12 +131,12 @@ void saveseis(FILE *fp, st_seismogram *section, st_acquisition *acq, int ntr, in
else
{
fprintf
(
FP
,
"attention: Error in seisfile"
);
l
=
0
;
}
/
*
fprintf(FP,"l=%d",l);
fprintf(FP,"infile:%s,MYID=%d\n",infile,i);
*/
/
/
fprintf(FP,"l=%d",l);
//
fprintf(FP,"infile:%s,MYID=%d\n",infile,i);
fseek
(
fin
,
0
,
SEEK_SET
);
for
(
m
=
1
;
m
<=
l
;
m
++
){
/
*
fprintf(FP,"m=%d",m);
*/
/
/
fprintf(FP,"m=%d",m);
fread
(
buf1
,
sizeof
(
float
),
240
/
sizeof
(
float
),
fin
);
...
...
@@ -156,7 +156,7 @@ void saveseis(FILE *fp, st_seismogram *section, st_acquisition *acq, int ntr, in
if
(
MYID
==
0
){
sprintf
(
outfile
,
"%s_vy_it%d.%s.shot%d"
,
seisfile
,
iteration
,
file_ext
,
ishot
);
/
*
fprintf(FP,"outfile:%s",outfile);
*/
/
/
fprintf(FP,"outfile:%s",outfile);
fout
=
fopen
(
outfile
,
"w"
);
buf2
=
vector
(
1
,
ns
);
buf1
=
vector
(
1
,
240
/
sizeof
(
float
));
...
...
@@ -172,12 +172,12 @@ void saveseis(FILE *fp, st_seismogram *section, st_acquisition *acq, int ntr, in
else
{
fprintf
(
FP
,
"attention: Error in seisfile"
);
l
=
0
;
}
/
*
fprintf(FP,"l=%d",l);
fprintf(FP,"infile:%s,MYID=%d",infile,MYID);
*/
/
/
fprintf(FP,"l=%d",l);
//
fprintf(FP,"infile:%s,MYID=%d",infile,MYID);
fseek
(
fin
,
0
,
SEEK_SET
);
for
(
m
=
1
;
m
<=
l
;
m
++
){
/
*
fprintf(FP,"m=%d",m);
*/
/
/
fprintf(FP,"m=%d",m);
fread
(
buf1
,
sizeof
(
float
),
240
/
sizeof
(
float
),
fin
);
...
...
@@ -196,7 +196,7 @@ void saveseis(FILE *fp, st_seismogram *section, st_acquisition *acq, int ntr, in
if
(
MYID
==
0
){
sprintf
(
outfile
,
"%s_vz_it%d.%s.shot%d"
,
seisfile
,
iteration
,
file_ext
,
ishot
);
/
*
fprintf(FP,"outfile:%s",outfile);
*/
/
/
fprintf(FP,"outfile:%s",outfile);
fout
=
fopen
(
outfile
,
"w"
);
buf2
=
vector
(
1
,
ns
);
buf1
=
vector
(
1
,
240
/
sizeof
(
float
));
...
...
@@ -211,8 +211,8 @@ void saveseis(FILE *fp, st_seismogram *section, st_acquisition *acq, int ntr, in
else
{
fprintf
(
FP
,
"attention: Error in seisfile"
);
l
=
0
;
}
/
*f
printf(FP,"l=%d",l);
fprintf(FP,"infile:%s,MYID=%d",infile,MYID);
*/
/
/
printf(FP,"l=%d",l);
//
fprintf(FP,"infile:%s,MYID=%d",infile,MYID);
fseek
(
fin
,
0
,
SEEK_SET
);
for
(
m
=
1
;
m
<=
l
;
m
++
){
...
...
@@ -234,6 +234,8 @@ void saveseis(FILE *fp, st_seismogram *section, st_acquisition *acq, int ntr, in
free_matrix
(
srcpos1
,
1
,
7
,
1
,
1
);
MPI_Barrier
(
MPI_COMM_WORLD
);
/* Remove seismogram parts (only keep merged seismogram) only for modeled data (not obs) */
if
(
iteration
>
0
&&
ntr
>
0
&&
METHOD
&&!
obs
){
sprintf
(
infile
,
"%s_vx_it%d.%s.shot%d.%d"
,
seisfile
,
iteration
,
file_ext
,
ishot
,
MYID
);
remove
(
infile
);
...
...
src/splitrec.c
View file @
0750aa60
...
...
@@ -37,7 +37,7 @@ int **splitrec(int **recpos,int *ntr_loc, int ntr, int *rnum_loc)
b
=
(
recpos
[
2
][
j
]
-
1
)
/
IENDY
;
c
=
(
recpos
[
3
][
j
]
-
1
)
/
IENDZ
;
/*only if receiver is inside subgrid rnum_loc is set to 1 and local rewc position is saved in recpos_dummy*/
if
((
POS
[
1
]
==
a
)
&&
(
POS
[
2
]
==
b
)
&&
(
POS
[
3
]
==
c
))
{
i
++
;
recpos_dummy
[
1
][
i
]
=
((
recpos
[
1
][
j
]
-
1
)
%
IENDX
)
+
1
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment