Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
GPIAG-Software
IFOS3D
Commits
7d13a5aa
Commit
7d13a5aa
authored
Apr 21, 2016
by
Tilman Steinweg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup and small bugfix in json reading
parent
befea09f
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
20 additions
and
16 deletions
+20
-16
par/in_and_out/ifos3d_toy_FW.json
par/in_and_out/ifos3d_toy_FW.json
+3
-1
src/ifos3d.c
src/ifos3d.c
+5
-5
src/modelupdate.c
src/modelupdate.c
+1
-1
src/precongrad.c
src/precongrad.c
+3
-3
src/read_par_json.c
src/read_par_json.c
+4
-0
src/readhess.c
src/readhess.c
+3
-3
src/readinv.c
src/readinv.c
+0
-2
src/readseis.c
src/readseis.c
+1
-1
No files found.
par/in_and_out/ifos3d_toy_FW.json
View file @
7d13a5aa
...
...
@@ -69,5 +69,7 @@
"Method"
:
"comment"
,
"METHOD"
:
"0"
"METHOD"
:
"0"
,
"MOD_OUT_FILE"
:
"./model/toy"
}
src/ifos3d.c
View file @
7d13a5aa
...
...
@@ -30,7 +30,7 @@ int main(int argc, char **argv){
int
lsnap
,
nsnap
=
0
,
lsamp
=
0
,
nlsamp
=
0
,
buffsize
;
int
ntr
=
0
,
ntr_loc
=
0
,
ntr_glob
=
0
,
nsrc
=
0
,
nsrc_loc
=
0
,
ishot
,
ishot1
,
nshots
;
double
time1
=
0
.
0
,
time2
=
0
.
0
,
time3
=
0
.
0
,
time4
=
0
.
0
;
double
time1
=
0
.
0
,
time2
=
0
.
0
,
time4
=
0
.
0
;
double
*
time_v_update
,
*
time_s_update
,
*
time_s_exchange
,
*
time_v_exchange
,
*
time_timestep
;
int
*
xb
,
*
yb
,
*
zb
,
l
,
i
,
j
;
...
...
@@ -84,11 +84,11 @@ int main(int argc, char **argv){
MPI_Request
*
req_send
,
*
req_rec
,
*
sreq_send
,
*
sreq_rec
;
MPI_Status
*
send_statuses
,
*
rec_statuses
;
/*
MPI_Status *send_statuses, *rec_statuses;
*/
float
memdyn
,
memmodel
,
memseismograms
,
membuffer
,
memtotal
,
memcpml
=
0
.
0
,
memdynf
=
0
.
0
,
memgrad
=
0
.
0
,
membfgs
=
0
.
0
;
float
fac1
,
fac2
,
fac3
;
char
*
buff_addr
,
ext
[
10
];
char
*
buff_addr
;
//
ext[10];
char
buffer
[
STRING_SIZE
],
bufferstring
[
10
];
/*char comp[6];*/
FILE
*
fpsrc
=
NULL
;
...
...
@@ -275,8 +275,8 @@ MPI_Barrier(MPI_COMM_WORLD);
req_rec
=
(
MPI_Request
*
)
malloc
(
REQUEST_COUNT
*
sizeof
(
MPI_Request
));
sreq_send
=
(
MPI_Request
*
)
malloc
(
REQUEST_COUNT
*
sizeof
(
MPI_Request
));
sreq_rec
=
(
MPI_Request
*
)
malloc
(
REQUEST_COUNT
*
sizeof
(
MPI_Request
));
send_statuses
=
(
MPI_Status
*
)
malloc
(
REQUEST_COUNT
*
sizeof
(
MPI_Status
));
rec_statuses
=
(
MPI_Status
*
)
malloc
(
REQUEST_COUNT
*
sizeof
(
MPI_Status
));
/*
send_statuses=(MPI_Status *)malloc(REQUEST_COUNT*sizeof(MPI_Status));
rec_statuses=(MPI_Status *)malloc(REQUEST_COUNT*sizeof(MPI_Status));
*/
/* allocation for timing arrays used for performance analysis */
time_v_update
=
dvector
(
1
,
NT
);
...
...
src/modelupdate.c
View file @
7d13a5aa
...
...
@@ -34,7 +34,7 @@ void modelupdate(int nx, int ny, int nz, float ***gradvp, float ***gradvs, float
float
vpnew
,
vsnew
,
rhonew
;
float
max
[
3
],
buf
[
3
],
max1
[
3
],
dummy
[
3
];
float
vp
,
vs
;
int
w
;
int
w
=
0
;
float
scale1
=
0
.
0
,
scale2
=
0
.
0
,
scale3
=
0
.
0
;
buf
[
0
]
=
0
.
0
;
buf
[
1
]
=
0
.
0
;
buf
[
2
]
=
0
.
0
;
...
...
src/precongrad.c
View file @
7d13a5aa
...
...
@@ -31,7 +31,7 @@ void precon_grad(int nx,int ny,int nz, float ***grad1, float ***grad2,float ***g
extern
int
POS
[
4
],
NXG
,
NYG
,
NZG
,
FW
,
DAMPTYPE
,
FREE_SURF
;
extern
FILE
*
FP
;
int
i
,
j
,
k
,
l
,
n
,
ii
=
0
,
kk
=
0
,
jj
=
0
,
sx
=
0
,
sy
=
0
,
sz
=
0
,
rx
,
ry
,
rz
,
h
;
int
i
,
j
,
k
,
l
,
n
,
ii
=
0
,
kk
=
0
,
jj
=
0
,
sx
=
0
,
sy
=
0
,
sz
=
0
,
rx
,
ry
,
rz
;
//
,h;
int
sh
,
rh
;
/*distance of source and receiver arrays to model edge (grid points)*/
float
r
=
0
.
0
,
G
[
3
];
G
[
0
]
=
0
.
0
;
G
[
1
]
=
0
.
0
;
G
[
2
]
=
0
.
0
;
...
...
@@ -222,8 +222,8 @@ void precon_grad(int nx,int ny,int nz, float ***grad1, float ***grad2,float ***g
for
(
k
=
1
;
k
<=
nz
;
k
++
){
/*-------------------------------------------*/
/*damping y-direction*/
h
=
0
;
h
=
iround
(
srcpos
[
2
][
1
]
/
DY
);
//
h=0;
//
h=iround(srcpos[2][1]/DY);
r
=
0
.
0
;
r
=
(
jj
-
sh
)
*
1
.
0
;
if
(
r
<
0
)
G
[
0
]
=
0
.
0
;
...
...
src/read_par_json.c
View file @
7d13a5aa
...
...
@@ -705,6 +705,10 @@ void read_par_json(FILE *fp, char *fileinp) {
FILT
=
0
;
fprintf
(
fp
,
" Variable FILT is set to default value %d.
\n
"
,
FILT
);
if
(
get_string_from_objectlist
(
"MOD_OUT_FILE"
,
number_readobjects
,
MOD_OUT_FILE
,
varname_list
,
value_list
))
{
err
(
"Variable MOD_OUT_FILE could not be retrieved from the json input file!"
);
}
}
}
...
...
src/readhess.c
View file @
7d13a5aa
...
...
@@ -45,15 +45,15 @@ void readhess(int nx, int ny, int nz, float *** hess1, float *** hess2, float
fprintf
(
FP
,
"
\n
...reading hess information from hess-files...
\n
"
);
/*sprintf(filename,"hess/hess.vp");*/
sprintf
(
filename
,
"%s.vp_%4.2fHz_it%d"
,
HESS_FILE
,
finv
,
iteration
,
POS
[
1
],
POS
[
2
],
POS
[
3
]
);
sprintf
(
filename
,
"%s.vp_%4.2fHz_it%d"
,
HESS_FILE
,
finv
,
iteration
);
fp_vp
=
fopen
(
filename
,
"r"
);
if
(
fp_vp
==
NULL
)
err
(
" Could not open hess_vp ! "
);
sprintf
(
filename
,
"%s.vs_%4.2fHz_it%d"
,
HESS_FILE
,
finv
,
iteration
,
POS
[
1
],
POS
[
2
],
POS
[
3
]
);
sprintf
(
filename
,
"%s.vs_%4.2fHz_it%d"
,
HESS_FILE
,
finv
,
iteration
);
fp_vs
=
fopen
(
filename
,
"r"
);
if
(
fp_vs
==
NULL
)
err
(
" Could not open hess_vs! "
);
sprintf
(
filename
,
"%s.rho_%4.2fHz_it%d"
,
HESS_FILE
,
finv
,
iteration
,
POS
[
1
],
POS
[
2
],
POS
[
3
]
);
sprintf
(
filename
,
"%s.rho_%4.2fHz_it%d"
,
HESS_FILE
,
finv
,
iteration
);
fp_rho
=
fopen
(
filename
,
"r"
);
if
(
fp_rho
==
NULL
)
err
(
" Could not open hess_rho ! "
);
...
...
src/readinv.c
View file @
7d13a5aa
...
...
@@ -28,8 +28,6 @@ void readinv(float *finv, int *nf, int *groupnum,int *itpergroup,int nfmax){
extern
FILE
*
FP
;
extern
int
MYID
,
VERBOSE
;
char
buffer
[
256
];
int
idummy
;
float
fdummy
;
int
mute
,
i
;
float
twin
[
2
],
owin
[
2
];
float
abort
;
...
...
src/readseis.c
View file @
7d13a5aa
...
...
@@ -28,7 +28,7 @@ void readseis(int ishot, float **section, float **sectionf, int ntr, int ns, int
extern
FILE
*
FP
;
extern
int
MYID
,
RUN_MULTIPLE_SHOTS
,
VERBOSE
;
extern
int
MYID
,
RUN_MULTIPLE_SHOTS
;
extern
char
SEIS_OBS_FILE
[
STRING_SIZE
];
char
file_ext
[
5
];
FILE
*
fpdata
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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