Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
IFOS2D
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
4
Issues
4
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Environments
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
GPIAG-Software
IFOS2D
Commits
74505328
Commit
74505328
authored
Feb 29, 2016
by
niklas.thiel
Browse files
Options
Browse Files
Download
Plain Diff
Merge master into pup
Merge branch 'master' of git.scc.kit.edu:GPIAG-Software/IFOS2D into pup Conflicts: src/Makefile
parents
2a316380
0e8335b9
Changes
106
Hide whitespace changes
Inline
Side-by-side
Showing
106 changed files
with
1948 additions
and
1521 deletions
+1948
-1521
contrib/aff/Makefile
contrib/aff/Makefile
+2
-0
contrib/fourier/Makefile
contrib/fourier/Makefile
+2
-0
contrib/libcseife/Makefile
contrib/libcseife/Makefile
+6
-2
contrib/stfinv/Makefile
contrib/stfinv/Makefile
+2
-0
genmod/1D_linear_gradient_ac.c
genmod/1D_linear_gradient_ac.c
+1
-1
genmod/1D_linear_gradient_el.c
genmod/1D_linear_gradient_el.c
+1
-1
genmod/1D_linear_gradient_visc.c
genmod/1D_linear_gradient_visc.c
+1
-1
genmod/1D_linear_gradient_viscac.c
genmod/1D_linear_gradient_viscac.c
+1
-1
genmod/1D_start.c
genmod/1D_start.c
+7
-7
genmod/FLnodes_visc.c
genmod/FLnodes_visc.c
+1
-1
genmod/model_grad_loh_visc.c
genmod/model_grad_loh_visc.c
+2
-2
genmod/toy_example_ac_start.c
genmod/toy_example_ac_start.c
+2
-2
genmod/toy_example_ac_true.c
genmod/toy_example_ac_true.c
+1
-1
genmod/toy_example_elastic_manuell.c
genmod/toy_example_elastic_manuell.c
+264
-0
genmod/toy_example_elastic_start.c
genmod/toy_example_elastic_start.c
+3
-3
genmod/toy_example_elastic_true.c
genmod/toy_example_elastic_true.c
+1
-1
genmod/toy_example_start.c
genmod/toy_example_start.c
+2
-2
genmod/toy_example_true.c
genmod/toy_example_true.c
+1
-1
par/Makefile
par/Makefile
+10
-1
par/in_and_out/IFOS2D_FW.json
par/in_and_out/IFOS2D_FW.json
+1
-8
par/in_and_out/IFOS2D_FW_all_parameters.json
par/in_and_out/IFOS2D_FW_all_parameters.json
+1
-8
par/in_and_out/IFOS2D_INV.json
par/in_and_out/IFOS2D_INV.json
+1
-8
par/in_and_out/IFOS2D_INV_all_parameters.json
par/in_and_out/IFOS2D_INV_all_parameters.json
+6
-9
par/in_and_out/toy_example/toy_example_FW.json
par/in_and_out/toy_example/toy_example_FW.json
+1
-8
par/in_and_out/toy_example/toy_example_FW_SH.json
par/in_and_out/toy_example/toy_example_FW_SH.json
+1
-8
par/in_and_out/toy_example/toy_example_INV.json
par/in_and_out/toy_example/toy_example_INV.json
+1
-8
par/in_and_out/toy_example/toy_example_INV_SH.json
par/in_and_out/toy_example/toy_example_INV_SH.json
+1
-8
par/in_and_out/toy_example/toy_example_ac_FW.json
par/in_and_out/toy_example/toy_example_ac_FW.json
+1
-8
par/in_and_out/toy_example/toy_example_ac_INV.json
par/in_and_out/toy_example/toy_example_ac_INV.json
+2
-9
par/run_toy_example.sh
par/run_toy_example.sh
+2
-4
par/run_toy_example_SH.sh
par/run_toy_example_SH.sh
+2
-4
par/run_toy_example_ac.sh
par/run_toy_example_ac.sh
+2
-4
src/IFOS2D.c
src/IFOS2D.c
+50
-84
src/LBFGS.c
src/LBFGS.c
+24
-11
src/Makefile
src/Makefile
+57
-31
src/PCG.c
src/PCG.c
+6
-6
src/PCG_SH.c
src/PCG_SH.c
+5
-7
src/calc_energy.c
src/calc_energy.c
+23
-11
src/calc_envelope.c
src/calc_envelope.c
+2
-2
src/calc_hilbert.c
src/calc_hilbert.c
+2
-2
src/calc_mat_change_test.c
src/calc_mat_change_test.c
+4
-5
src/calc_misfit.c
src/calc_misfit.c
+25
-14
src/calc_opt_step.c
src/calc_opt_step.c
+3
-3
src/calc_res.c
src/calc_res.c
+23
-14
src/checkfd.c
src/checkfd.c
+15
-15
src/checkfd_ssg_elastic.c
src/checkfd_ssg_elastic.c
+3
-3
src/checkfd_ssg_visc.c
src/checkfd_ssg_visc.c
+4
-4
src/conv_FD.c
src/conv_FD.c
+1
-2
src/count_killed_traces.c
src/count_killed_traces.c
+31
-9
src/create_trkill_table.c
src/create_trkill_table.c
+21
-10
src/eprecond1.c
src/eprecond1.c
+1
-1
src/exchange_par.c
src/exchange_par.c
+5
-0
src/fd.h
src/fd.h
+3
-3
src/filter_frequencies.c
src/filter_frequencies.c
+1
-1
src/globvar.h
src/globvar.h
+1
-0
src/holbergcoeff.c
src/holbergcoeff.c
+2
-2
src/initproc.c
src/initproc.c
+3
-3
src/inseis.c
src/inseis.c
+3
-4
src/inseis_source_wavelet.c
src/inseis_source_wavelet.c
+14
-3
src/joint_inversion.c
src/joint_inversion.c
+1
-1
src/json_parser.c
src/json_parser.c
+391
-376
src/max_grad.c
src/max_grad.c
+3
-5
src/median2D.c
src/median2D.c
+2
-2
src/merge.c
src/merge.c
+3
-3
src/mergemod.c
src/mergemod.c
+1
-1
src/norm.c
src/norm.c
+2
-6
src/note.c
src/note.c
+2
-5
src/rd_sour.c
src/rd_sour.c
+1
-1
src/read_par_json.c
src/read_par_json.c
+134
-123
src/read_workflow.c
src/read_workflow.c
+2
-2
src/readdsk.c
src/readdsk.c
+2
-2
src/readmod.c
src/readmod.c
+76
-35
src/readmod_acoustic.c
src/readmod_acoustic.c
+77
-70
src/readmod_elastic.c
src/readmod_elastic.c
+35
-36
src/readmod_viscac.c
src/readmod_viscac.c
+45
-22
src/receiver.c
src/receiver.c
+2
-2
src/saveseis_glob.c
src/saveseis_glob.c
+1
-1
src/smooth.c
src/smooth.c
+2
-2
src/snapmerge.c
src/snapmerge.c
+1
-1
src/sources.c
src/sources.c
+8
-8
src/spat_filt.c
src/spat_filt.c
+1
-1
src/stf.c
src/stf.c
+101
-54
src/surface_PML.c
src/surface_PML.c
+1
-1
src/taper_grad.c
src/taper_grad.c
+6
-6
src/taper_grad_shot.c
src/taper_grad_shot.c
+6
-6
src/time_window.c
src/time_window.c
+2
-2
src/time_window_glob.c
src/time_window_glob.c
+2
-2
src/timedomain_filt_vector.c
src/timedomain_filt_vector.c
+1
-1
src/update_p_visc_PML.c
src/update_p_visc_PML.c
+1
-1
src/update_s_elastic_PML.c
src/update_s_elastic_PML.c
+2
-2
src/update_s_elastic_PML_SH.c
src/update_s_elastic_PML_SH.c
+1
-1
src/update_s_elastic_ssg.c
src/update_s_elastic_ssg.c
+2
-2
src/update_s_visc_PML.c
src/update_s_visc_PML.c
+1
-1
src/update_s_visc_PML_SH.c
src/update_s_visc_PML_SH.c
+1
-1
src/update_v_PML.c
src/update_v_PML.c
+2
-2
src/update_v_PML_SH.c
src/update_v_PML_SH.c
+1
-1
src/util.c
src/util.c
+341
-341
src/wavelet.c
src/wavelet.c
+4
-2
src/wolfe_condition.c
src/wolfe_condition.c
+1
-1
src/write_par.c
src/write_par.c
+8
-8
src/write_workflow.c
src/write_workflow.c
+2
-4
src/writedsk.c
src/writedsk.c
+2
-2
src/zero_fdveps.c
src/zero_fdveps.c
+1
-1
src/zero_fdveps_ac.c
src/zero_fdveps_ac.c
+1
-1
src/zero_fdveps_visc.c
src/zero_fdveps_visc.c
+1
-1
src/zero_fdveps_viscac.c
src/zero_fdveps_viscac.c
+1
-1
No files found.
contrib/aff/Makefile
View file @
74505328
...
...
@@ -166,7 +166,9 @@ libaff.so: $(INSTHEADER) $(LIBOBS)
> $@; \
[ -s $@ ] || rm -f $@'
ifneq
($(MAKECMDGOALS),clean)
include
$(patsubst %.cc,%.d,$(SRC))
endif
# this include will be used once we initiate the precompiled library version
# until then it's just waiting here
...
...
contrib/fourier/Makefile
View file @
74505328
...
...
@@ -200,7 +200,9 @@ libfourierxx.so: install-include libfourier.a $(LIBOBSXX)
> $@; \
[ -s $@ ] || rm -f $@'
ifneq
($(MAKECMDGOALS),clean)
include
$(patsubst %.cc,%.d,$(SRC))
endif
#======================================================================
# header files
...
...
contrib/libcseife/Makefile
View file @
74505328
...
...
@@ -113,14 +113,16 @@ SUBS=$(patsubst %.f,%.o,$(wildcard subs/*.f))
# Fortran include dependencies
%.d
:
%.f
echo
$<
:
$(
addprefix
subs/,
$(
shell
cat
$<
| egrep
'^ +include'
|
cut
-f
2
-d
\'
|
sort
|
uniq
))
>
$@
include
$(patsubst %.f,%.d,$(wildcard subs/*.f))
ifneq
($(MAKECMDGOALS),clean)
include
$(patsubst %.f,%.d,$(wildcard subs/*.f))
endif
#======================================================================
$(INCINSTALLPATH)/%.h
:
%.h
mkdir
-p
$(INCINSTALLPATH)
-
rm
-fv
$@
/bin/cp
-vp
d
$<
$@
/bin/cp
-vp
$<
$@
.PHONY
:
install-include
install-include
:
$(INSTHEADER)
...
...
@@ -152,7 +154,9 @@ reinstall:
# library part
# ------------
ifneq
($(MAKECMDGOALS),clean)
include
$(patsubst %.c,%.d,$(CLIBSRC))
endif
libcseife.a
:
$(patsubst %.c
,
%.o
,
$(CLIBSRC))
libseife.a
:
$(SUBS)
...
...
contrib/stfinv/Makefile
View file @
74505328
...
...
@@ -170,8 +170,10 @@ clean: ;
# library part
# ------------
ifneq
($(MAKECMDGOALS),clean)
include
$(patsubst %.cc,%.d,$(LIBCCSRC) $(TESTCCSRC)) \
$(patsubst
%.c,%.d,$(LIBCSRC)
$(TESTCSRC))
endif
libstfinv.a
:
$(patsubst %.cc
,
%.o
,
$(LIBCCSRC))
\
$(patsubst %.c
,
%.o
,
$(LIBCSRC))
...
...
genmod/1D_linear_gradient_ac.c
View file @
74505328
...
...
@@ -46,7 +46,7 @@ void model_acoustic(float ** rho, float ** pi){
/*-----------------------------------------------------------------------*/
y
=
h
/
DH
;
if
(
y
==
NYG
)
er
r
(
"
\n
y is equal NYG !! see src/model_grad.c
\n
"
);
if
(
y
==
NYG
)
declare_erro
r
(
"
\n
y is equal NYG !! see src/model_grad.c
\n
"
);
grad1
=
(
vp2
-
vp1
)
/
y
;
grad3
=
(
rho2
-
rho1
)
/
y
;
...
...
genmod/1D_linear_gradient_el.c
View file @
74505328
...
...
@@ -46,7 +46,7 @@ void model_elastic(float ** rho, float ** pi, float ** u){
/*-----------------------------------------------------------------------*/
y
=
h
/
DH
;
if
(
y
==
NYG
)
er
r
(
"
\n
y is equal NYG !! see src/model_grad.c
\n
"
);
if
(
y
==
NYG
)
declare_erro
r
(
"
\n
y is equal NYG !! see src/model_grad.c
\n
"
);
grad1
=
(
vp2
-
vp1
)
/
y
;
grad2
=
(
vs2
-
vs1
)
/
y
;
grad3
=
(
rho2
-
rho1
)
/
y
;
...
...
genmod/1D_linear_gradient_visc.c
View file @
74505328
...
...
@@ -52,7 +52,7 @@ void model(float ** rho, float ** pi, float ** u, float ** taus, float **
y
=
h
/
DH
;
if
(
y
==
NYG
)
er
r
(
"
\n
y is equal NYG !! see src/model_grad.c
\n
"
);
if
(
y
==
NYG
)
declare_erro
r
(
"
\n
y is equal NYG !! see src/model_grad.c
\n
"
);
grad1
=
(
vp2
-
vp1
)
/
y
;
grad2
=
(
vs2
-
vs1
)
/
y
;
grad3
=
(
rho2
-
rho1
)
/
y
;
...
...
genmod/1D_linear_gradient_viscac.c
View file @
74505328
...
...
@@ -52,7 +52,7 @@ void model_viscac(float ** rho, float ** pi, float ** taup, float * eta){
y
=
h
/
DH
;
if
(
y
==
NYG
)
er
r
(
"
\n
y is equal NYG !! see src/model_grad.c
\n
"
);
if
(
y
==
NYG
)
declare_erro
r
(
"
\n
y is equal NYG !! see src/model_grad.c
\n
"
);
grad1
=
(
vp2
-
vp1
)
/
y
;
grad3
=
(
rho2
-
rho1
)
/
y
;
...
...
genmod/1D_start.c
View file @
74505328
...
...
@@ -38,7 +38,7 @@ void model_elastic(float ** rho, float ** pi, float ** u){
/* local variables */
float
rhov
,
muv
,
piv
,
vp
,
vs
;
float
rhov
,
vp
,
vs
;
float
vp0
,
vs0
,
rho0
,
gvp
,
gvs
,
grho
;
int
i
,
j
,
ii
,
jj
;
FILE
*
fp_vs
,
*
fp_vp
,
*
fp_rho
;
...
...
@@ -66,18 +66,18 @@ void model_elastic(float ** rho, float ** pi, float ** u){
fprintf
(
FP
,
"
\t
Vp:
\n\t
%s.vp
\n\n
"
,
MFILE
);
sprintf
(
filename
,
"%s.vp"
,
MFILE
);
fp_vp
=
fopen
(
filename
,
"r"
);
if
(
fp_vp
==
NULL
)
er
r
(
" Could not open model file for Vp ! "
);
if
(
fp_vp
==
NULL
)
declare_erro
r
(
" Could not open model file for Vp ! "
);
fprintf
(
FP
,
"
\t
Vs:
\n\t
%s.vs
\n\n
"
,
MFILE
);
sprintf
(
filename
,
"%s.vs"
,
MFILE
);
fp_vs
=
fopen
(
filename
,
"r"
);
if
(
fp_vs
==
NULL
)
er
r
(
" Could not open model file for Vs ! "
);
if
(
fp_vs
==
NULL
)
declare_erro
r
(
" Could not open model file for Vs ! "
);
fprintf
(
FP
,
"
\t
Density:
\n\t
%s.rho
\n\n
"
,
MFILE
);
sprintf
(
filename
,
"%s.rho"
,
MFILE
);
fp_rho
=
fopen
(
filename
,
"r"
);
if
(
fp_rho
==
NULL
)
er
r
(
" Could not open model file for densities ! "
);
if
(
fp_rho
==
NULL
)
declare_erro
r
(
" Could not open model file for densities ! "
);
}
/* read density and Lame parameters */
...
...
@@ -86,18 +86,18 @@ void model_elastic(float ** rho, float ** pi, float ** u){
fprintf
(
FP
,
"
\t
Lame parameter lambda:
\n\t
%s.lam
\n\n
"
,
MFILE
);
sprintf
(
filename
,
"%s.lam"
,
MFILE
);
fp_vp
=
fopen
(
filename
,
"r"
);
if
(
fp_vp
==
NULL
)
er
r
(
" Could not open model file for Lame parameter lambda ! "
);
if
(
fp_vp
==
NULL
)
declare_erro
r
(
" Could not open model file for Lame parameter lambda ! "
);
fprintf
(
FP
,
"
\t
Lame parameter mu:
\n\t
%s.vs
\n\n
"
,
MFILE
);
sprintf
(
filename
,
"%s.mu"
,
MFILE
);
fp_vs
=
fopen
(
filename
,
"r"
);
if
(
fp_vs
==
NULL
)
er
r
(
" Could not open model file for Lame parameter mu ! "
);
if
(
fp_vs
==
NULL
)
declare_erro
r
(
" Could not open model file for Lame parameter mu ! "
);
fprintf
(
FP
,
"
\t
Density:
\n\t
%s.rho
\n\n
"
,
MFILE
);
sprintf
(
filename
,
"%s.rho"
,
MFILE
);
fp_rho
=
fopen
(
filename
,
"r"
);
if
(
fp_rho
==
NULL
)
er
r
(
" Could not open model file for densities ! "
);
if
(
fp_rho
==
NULL
)
declare_erro
r
(
" Could not open model file for densities ! "
);
}
...
...
genmod/FLnodes_visc.c
View file @
74505328
...
...
@@ -67,7 +67,7 @@ void model(float ** rho, float ** pi, float ** u, float ** taus, float **
/*read FL nodes from File*/
flfile
=
fopen
(
"model/final.mod.flnodes.Q20"
,
"r"
);
if
(
flfile
==
NULL
)
er
r
(
" FL-file could not be opened !"
);
if
(
flfile
==
NULL
)
declare_erro
r
(
" FL-file could not be opened !"
);
...
...
genmod/model_grad_loh_visc.c
View file @
74505328
...
...
@@ -33,7 +33,7 @@ void model(float ** rho, float ** pi, float ** u, float ** taus, float **
extern
char
INV_MODELFILE
[
STRING_SIZE
];
extern
float
DH
,
*
FL
,
TAU
,
DT
;
/* local variables */
float
vp
,
vs
,
rhov
,
grad
,
y1
,
y2
,
ts
,
tp
,
muv
,
piv
,
*
pts
;
float
vp
,
vs
,
rhov
,
grad
,
y1
,
y2
,
ts
,
tp
,
*
pts
;
int
i
,
j
,
ii
,
jj
,
l
;
char
modfile
[
STRING_SIZE
];
...
...
@@ -53,7 +53,7 @@ void model(float ** rho, float ** pi, float ** u, float ** taus, float **
y1
=
h
/
DH
;
y2
=
layer
/
DH
;
if
(
y1
==
NYG
)
er
r
(
"
\n
y is equal NYG !! see src/model_grad.c
\n
"
);
if
(
y1
==
NYG
)
declare_erro
r
(
"
\n
y is equal NYG !! see src/model_grad.c
\n
"
);
grad
=
(
vs2
-
vs1
)
/
y1
;
...
...
genmod/toy_example_ac_start.c
View file @
74505328
...
...
@@ -57,7 +57,7 @@ void model_acoustic(float **rho, float **pi){
if
(
SWS_TAPER_FILE
)
taper
=
matrix
(
-
nd
+
1
,
NY
+
nd
,
-
nd
+
1
,
NX
+
nd
);
flfile
=
fopen
(
"model_true/flnodes.toy_example_ac.start"
,
"r"
);
if
(
flfile
==
NULL
)
er
r
(
" FL-file could not be opened !"
);
if
(
flfile
==
NULL
)
declare_erro
r
(
" FL-file could not be opened !"
);
/* Read parameters */
for
(
l
=
1
;
l
<=
nodes
;
l
++
){
...
...
@@ -187,7 +187,7 @@ void model_acoustic(float **rho, float **pi){
flrho
=
vector
(
1
,
nodes
);
flvp
=
vector
(
1
,
nodes
);
flfile
=
fopen
(
"model_true/flnodes.toy_example_ac"
,
"r"
);
if
(
flfile
==
NULL
)
er
r
(
" FL-file could not be opened !"
);
if
(
flfile
==
NULL
)
declare_erro
r
(
" FL-file could not be opened !"
);
/* Read parameters */
for
(
l
=
1
;
l
<=
nodes
;
l
++
){
...
...
genmod/toy_example_ac_true.c
View file @
74505328
...
...
@@ -63,7 +63,7 @@ void model_acoustic(float **rho, float **pi){
/*read FL nodes from File*/
flfile
=
fopen
(
"model_true/flnodes.toy_example_ac"
,
"r"
);
if
(
flfile
==
NULL
)
er
r
(
" FL-file could not be opened !"
);
if
(
flfile
==
NULL
)
declare_erro
r
(
" FL-file could not be opened !"
);
for
(
l
=
1
;
l
<=
nodes
;
l
++
){
...
...
genmod/toy_example_elastic_manuell.c
0 → 100644
View file @
74505328
/*-----------------------------------------------------------------------------------------
* Copyright (C) 2016
*
* This file is part of IFOS2D.
*
* IFOS2D is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 2.0 of the License only.
*
* IFOS2D is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with IFOS2D. See file COPYING and/or <http://www.gnu.org/licenses/gpl-2.0.html>.
-----------------------------------------------------------------------------------------*/
#include "fd.h"
void
model_elastic
(
float
**
rho
,
float
**
pi
,
float
**
u
){
/*--------------------------------------------------------------------------*/
/* extern variables */
extern
int
NX
,
NY
,
NXG
,
NYG
,
POS
[
3
],
MYID
,
L
;
extern
float
DH
,
DT
,
*
FL
,
TAU
;
extern
char
MFILE
[
STRING_SIZE
];
extern
char
INV_MODELFILE
[
STRING_SIZE
];
/* local variables */
float
muv
,
piv
,
vp
,
vs
,
rhov
,
ts
,
tp
,
*
pts
;
int
i
,
j
,
ii
,
jj
,
l
;
char
modfile
[
STRING_SIZE
];
FILE
*
flfile
;
int
nodes
;
char
cline
[
256
];
float
*
fldepth
,
*
flrho
,
*
flvp
,
*
flvs
;
/**************************************************/
/* creation of shear wave velocity and TAU models */
/**************************************************/
/*read FL nodes from File*/
nodes
=
3
;
fldepth
=
vector
(
1
,
nodes
);
flvs
=
vector
(
1
,
nodes
);
flrho
=
vector
(
1
,
nodes
);
flvp
=
vector
(
1
,
nodes
);
flfile
=
fopen
(
"model_true/flnodes.toy_example.start"
,
"r"
);
if
(
flfile
==
NULL
)
declare_error
(
" FL-file could not be opened !"
);
for
(
l
=
1
;
l
<=
nodes
;
l
++
){
fgets
(
cline
,
255
,
flfile
);
if
(
cline
[
0
]
!=
'#'
){
sscanf
(
cline
,
"%f%f%f%f"
,
&
fldepth
[
l
],
&
flrho
[
l
],
&
flvp
[
l
],
&
flvs
[
l
]);
}
else
l
=
l
-
1
;
}
if
(
MYID
==
0
){
printf
(
" ------------------------------------------------------------------
\n\n
"
);
printf
(
" Information of FL nodes:
\n\n
"
);
printf
(
"
\t
depth
\t
vs
\n\n
"
);
for
(
l
=
1
;
l
<=
nodes
;
l
++
){
printf
(
"
\t
%f
\t
%f
\n\n
"
,
fldepth
[
l
],
flvs
[
l
]);
}
printf
(
" ------------------------------------------------------------------
\n\n
"
);
}
/* loop over global grid */
for
(
i
=
1
;
i
<=
NXG
;
i
++
){
for
(
l
=
1
;
l
<
nodes
;
l
++
){
if
(
fldepth
[
l
]
==
fldepth
[
l
+
1
]){
if
((
i
==
1
)
&&
(
MYID
==
0
)){
printf
(
"depth: %f m: double node
\n
"
,
fldepth
[
l
]);}}
else
{
for
(
j
=
(
int
)(
fldepth
[
l
]
/
DH
)
+
1
;
j
<=
(
int
)(
fldepth
[
l
+
1
]
/
DH
);
j
++
){
vs
=
0
.
0
;
vs
=
(
DH
*
(
j
-
1
)
-
fldepth
[
l
])
*
(
flvs
[
l
+
1
]
-
flvs
[
l
])
/
(
fldepth
[
l
+
1
]
-
fldepth
[
l
])
+
flvs
[
l
];
vs
=
vs
*
1000
.
0
;
muv
=
vs
;
ts
=
TAU
;
tp
=
TAU
;
/* only the PE which belongs to the current global gridpoint
is saving model parameters in his local arrays */
if
((
POS
[
1
]
==
((
i
-
1
)
/
NX
))
&&
(
POS
[
2
]
==
((
j
-
1
)
/
NY
))){
ii
=
i
-
POS
[
1
]
*
NX
;
jj
=
j
-
POS
[
2
]
*
NY
;
u
[
jj
][
ii
]
=
muv
;
}
}
}
}
for
(
j
=
(
int
)(
fldepth
[
nodes
]
/
DH
)
+
1
;
j
<=
NYG
;
j
++
){
vs
=
0
.
0
;
vs
=
flvs
[
nodes
]
*
1000
.
0
;
muv
=
vs
;
/* only the PE which belongs to the current global gridpoint
is saving model parameters in his local arrays */
if
((
POS
[
1
]
==
((
i
-
1
)
/
NX
))
&&
(
POS
[
2
]
==
((
j
-
1
)
/
NY
))){
ii
=
i
-
POS
[
1
]
*
NX
;
jj
=
j
-
POS
[
2
]
*
NY
;
u
[
jj
][
ii
]
=
muv
;
}
}
}
free_vector
(
fldepth
,
1
,
nodes
);
free_vector
(
flrho
,
1
,
nodes
);
free_vector
(
flvp
,
1
,
nodes
);
free_vector
(
flvs
,
1
,
nodes
);
/**************************************************/
/* creation of P wave velocity and density models */
/**************************************************/
/*read FL nodes from File*/
nodes
=
7
;
fldepth
=
vector
(
1
,
nodes
);
flvs
=
vector
(
1
,
nodes
);
flrho
=
vector
(
1
,
nodes
);
flvp
=
vector
(
1
,
nodes
);
flfile
=
fopen
(
"model_true/flnodes.toy_example"
,
"r"
);
flfile
=
fopen
(
"model_true/flnodes.toy_example.start"
,
"r"
);
if
(
flfile
==
NULL
)
declare_error
(
" FL-file could not be opened !"
);
for
(
l
=
1
;
l
<=
nodes
;
l
++
){
fgets
(
cline
,
255
,
flfile
);
if
(
cline
[
0
]
!=
'#'
){
sscanf
(
cline
,
"%f%f%f%f"
,
&
fldepth
[
l
],
&
flrho
[
l
],
&
flvp
[
l
],
&
flvs
[
l
]);
}
else
l
=
l
-
1
;
}
if
(
MYID
==
0
){
printf
(
" ------------------------------------------------------------------
\n\n
"
);
printf
(
" Information of FL nodes:
\n\n
"
);
printf
(
"
\t
depth
\t
vp
\t
rho
\n\n
"
);
for
(
l
=
1
;
l
<=
nodes
;
l
++
){
printf
(
"
\t
%f
\t
%f
\t
%f
\n\n
"
,
fldepth
[
l
],
flvp
[
l
],
flrho
[
l
]);
}
printf
(
" ------------------------------------------------------------------
\n\n
"
);
}
/* loop over global grid */
for
(
i
=
1
;
i
<=
NXG
;
i
++
){
for
(
l
=
1
;
l
<
nodes
;
l
++
){
if
(
fldepth
[
l
]
==
fldepth
[
l
+
1
]){
if
((
i
==
1
)
&&
(
MYID
==
0
)){
printf
(
"depth: %f m: double node
\n
"
,
fldepth
[
l
]);}}
else
{
for
(
j
=
(
int
)(
fldepth
[
l
]
/
DH
)
+
1
;
j
<=
(
int
)(
fldepth
[
l
+
1
]
/
DH
);
j
++
){
vp
=
0
.
0
;
rhov
=
0
.
0
;
vp
=
(
DH
*
(
j
-
1
)
-
fldepth
[
l
])
*
(
flvp
[
l
+
1
]
-
flvp
[
l
])
/
(
fldepth
[
l
+
1
]
-
fldepth
[
l
])
+
flvp
[
l
];
vp
=
vp
*
1000
.
0
;
rhov
=
(
DH
*
(
j
-
1
)
-
fldepth
[
l
])
*
(
flrho
[
l
+
1
]
-
flrho
[
l
])
/
(
fldepth
[
l
+
1
]
-
fldepth
[
l
])
+
flrho
[
l
];
rhov
=
rhov
*
1000
.
0
;
piv
=
vp
;
/* only the PE which belongs to the current global gridpoint
is saving model parameters in his local arrays */
if
((
POS
[
1
]
==
((
i
-
1
)
/
NX
))
&&
(
POS
[
2
]
==
((
j
-
1
)
/
NY
))){
ii
=
i
-
POS
[
1
]
*
NX
;
jj
=
j
-
POS
[
2
]
*
NY
;
rho
[
jj
][
ii
]
=
rhov
;
pi
[
jj
][
ii
]
=
piv
;
}
}
}
}
for
(
j
=
(
int
)(
fldepth
[
nodes
]
/
DH
)
+
1
;
j
<=
NYG
;
j
++
){
vp
=
0
.
0
;
rhov
=
0
.
0
;
vp
=
flvp
[
nodes
]
*
1000
.
0
;
rhov
=
flrho
[
nodes
]
*
1000
.
0
;
piv
=
vp
;
/* only the PE which belongs to the current global gridpoint
is saving model parameters in his local arrays */
if
((
POS
[
1
]
==
((
i
-
1
)
/
NX
))
&&
(
POS
[
2
]
==
((
j
-
1
)
/
NY
))){
ii
=
i
-
POS
[
1
]
*
NX
;
jj
=
j
-
POS
[
2
]
*
NY
;
rho
[
jj
][
ii
]
=
rhov
;
pi
[
jj
][
ii
]
=
piv
;
}
}
}
// free_vector(fldepth,1,nodes);
// free_vector(flrho,1,nodes);
// free_vector(flvp,1,nodes);
// free_vector(flvs,1,nodes);
//
sprintf
(
modfile
,
"%s_rho_it0.bin"
,
INV_MODELFILE
);
writemod
(
modfile
,
rho
,
3
);
MPI_Barrier
(
MPI_COMM_WORLD
);
if
(
MYID
==
0
)
mergemod
(
modfile
,
3
);
MPI_Barrier
(
MPI_COMM_WORLD
);
sprintf
(
modfile
,
"%s_rho_it0.bin.%i%i"
,
INV_MODELFILE
,
POS
[
1
],
POS
[
2
]);
remove
(
modfile
);
sprintf
(
modfile
,
"%s_vs_it0.bin"
,
INV_MODELFILE
);
writemod
(
modfile
,
u
,
3
);
MPI_Barrier
(
MPI_COMM_WORLD
);
if
(
MYID
==
0
)
mergemod
(
modfile
,
3
);
MPI_Barrier
(
MPI_COMM_WORLD
);
sprintf
(
modfile
,
"%s_vs_it0.bin.%i%i"
,
INV_MODELFILE
,
POS
[
1
],
POS
[
2
]);
remove
(
modfile
);
sprintf
(
modfile
,
"%s_vp_it0.bin"
,
INV_MODELFILE
);
writemod
(
modfile
,
pi
,
3
);
MPI_Barrier
(
MPI_COMM_WORLD
);
if
(
MYID
==
0
)
mergemod
(
modfile
,
3
);
MPI_Barrier
(
MPI_COMM_WORLD
);
sprintf
(
modfile
,
"%s_vp_it0.bin.%i%i"
,
INV_MODELFILE
,
POS
[
1
],
POS
[
2
]);
remove
(
modfile
);
// free_vector(pts,1,L);
}
genmod/toy_example_elastic_start.c
View file @
74505328
...
...
@@ -38,7 +38,7 @@ void model_elastic(float ** rho, float ** pi, float ** u){
extern
char
INV_MODELFILE
[
STRING_SIZE
];
/* local variables */
float
muv
,
piv
,
vp
,
vs
,
rhov
,
ts
,
tp
,
*
pts
;
float
muv
,
piv
,
vp
,
vs
,
rhov
,
ts
,
tp
;
int
i
,
j
,
ii
,
jj
,
l
;
char
modfile
[
STRING_SIZE
];
...
...
@@ -62,7 +62,7 @@ void model_elastic(float ** rho, float ** pi, float ** u){
flrho
=
vector
(
1
,
nodes
);
flvp
=
vector
(
1
,
nodes
);
flfile
=
fopen
(
"model_true/flnodes.toy_example.start"
,
"r"
);
if
(
flfile
==
NULL
)
er
r
(
" FL-file could not be opened !"
);
if
(
flfile
==
NULL
)
declare_erro
r
(
" FL-file could not be opened !"
);
...
...
@@ -154,7 +154,7 @@ void model_elastic(float ** rho, float ** pi, float ** u){
flrho
=
vector
(
1
,
nodes
);
flvp
=
vector
(
1
,
nodes
);
flfile
=
fopen
(
"model_true/flnodes.toy_example"
,
"r"
);
if
(
flfile
==
NULL
)
er
r
(
" FL-file could not be opened !"
);
if
(
flfile
==
NULL
)
declare_erro
r
(
" FL-file could not be opened !"
);
for
(
l
=
1
;
l
<=
nodes
;
l
++
){
fgets
(
cline
,
255
,
flfile
);
...
...
genmod/toy_example_elastic_true.c
View file @
74505328
...
...
@@ -55,7 +55,7 @@ void model_elastic(float ** rho, float ** pi, float ** u){
/*read FL nodes from File*/
flfile
=
fopen
(
"model_true/flnodes.toy_example"
,
"r"
);
if
(
flfile
==
NULL
)
er
r
(
" FL-file could not be opened !"
);
if
(
flfile
==
NULL
)
declare_erro
r
(
" FL-file could not be opened !"
);
...
...
genmod/toy_example_start.c
View file @
74505328
...
...
@@ -67,7 +67,7 @@ void model(float ** rho, float ** pi, float ** u, float ** taus, float **
flrho
=
vector
(
1
,
nodes
);
flvp
=
vector
(
1
,
nodes
);
flfile
=
fopen
(
"model_true/flnodes.toy_example.start"
,
"r"
);
if
(
flfile
==
NULL
)
er
r
(
" FL-file could not be opened !"
);
if
(
flfile
==
NULL
)
declare_erro
r
(
" FL-file could not be opened !"
);
...
...
@@ -165,7 +165,7 @@ void model(float ** rho, float ** pi, float ** u, float ** taus, float **
flrho
=
vector
(
1
,
nodes
);
flvp
=
vector
(
1
,
nodes
);
flfile
=
fopen
(
"model_true/flnodes.toy_example"
,
"r"
);
if
(
flfile
==
NULL
)
er
r
(
" FL-file could not be opened !"
);
if
(
flfile
==
NULL
)
declare_erro
r
(
" FL-file could not be opened !"
);
for
(
l
=
1
;
l
<=
nodes
;
l
++
){
fgets
(
cline
,
255
,
flfile
);
...
...
genmod/toy_example_true.c
View file @
74505328
...
...
@@ -65,7 +65,7 @@ void model(float ** rho, float ** pi, float ** u, float ** taus, float **
/*read FL nodes from File*/
flfile
=
fopen
(
"model_true/flnodes.toy_example"
,
"r"
);
if
(
flfile
==
NULL
)
er
r
(
" FL-file could not be opened !"
);
if
(
flfile
==
NULL
)
declare_erro
r
(
" FL-file could not be opened !"
);
...
...
par/Makefile
View file @
74505328
...
...
@@ -25,12 +25,21 @@ else
$(MAKE)
-C
../src/ IFOS2D
endif
.PHONY
:
install
install
:
clean-bin IFOS2D
.PHONY
:
clean
clean
:
rm
-rf
../bin/
IFOS2D
rm
-rf
../bin/
*
$(MAKE)
-C
../contrib/aff clean
$(MAKE)
-C
../contrib/fourier clean
$(MAKE)
-C
../contrib/stfinv clean
$(MAKE)
-C
../contrib/libcseife clean
$(MAKE)
-C
../src/ clean
.PHONY
:
clean-bin
clean-bin
:
rm
-rf
../bin/
*
.PHONY
:
reinstall
reinstall
:
clean IFOS2D
\ No newline at end of file
par/in_and_out/IFOS2D_FW.json
View file @
74505328
#-----------------------------------------------------------------
#
JSON
PARAMETER
FILE
FOR
IFOS
#-----------------------------------------------------------------
#
description:
#
description/name
of
the
model:
2
layer
example,
model
grid
created
by
../genmod/
2
layer.c
#
{
"Domain Decomposition"
:
"comment"
,
"NPROCX"
:
"4"
,
...
...
@@ -68,5 +61,5 @@
"FORWARD_ONLY"
:
"10"
,
"Verbose mode"
:
"comment"
,
"VERBOSE"
:
"0"
,
"VERBOSE"
:
"0"
}
par/in_and_out/IFOS2D_FW_all_parameters.json
View file @
74505328
#-----------------------------------------------------------------
#
JSON
PARAMETER
FILE
FOR
IFOS
#-----------------------------------------------------------------
#
description:
#
description/name
of
the
model:
2
layer
example,
model
grid
created
by