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
IFOS3D
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
7
Issues
7
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
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
IFOS3D
Commits
7da2cebb
Commit
7da2cebb
authored
Mar 08, 2016
by
Simone Butzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add additional input parameters
parent
67b9c79d
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
84 additions
and
46 deletions
+84
-46
bin/.gitignore
bin/.gitignore
+2
-0
par/grad/.gitignore
par/grad/.gitignore
+1
-0
par/hess/.gitignore
par/hess/.gitignore
+1
-0
par/in_and_out/.gitignore
par/in_and_out/.gitignore
+1
-0
par/in_and_out/fdmpi_toy.inp
par/in_and_out/fdmpi_toy.inp
+7
-3
par/model/.gitignore
par/model/.gitignore
+1
-0
par/su/.gitignore
par/su/.gitignore
+1
-0
par/su_obs/.gitignore
par/su_obs/.gitignore
+1
-0
src/.gitignore
src/.gitignore
+1
-0
src/Makefile
src/Makefile
+1
-1
src/exchange_par.c
src/exchange_par.c
+23
-11
src/globvar.h
src/globvar.h
+2
-1
src/hess_apply.c
src/hess_apply.c
+5
-5
src/modelupdate.c
src/modelupdate.c
+11
-7
src/read_par.c
src/read_par.c
+19
-13
src/readhess.c
src/readhess.c
+4
-4
src/writepar.c
src/writepar.c
+3
-1
No files found.
bin/.gitignore
View file @
7da2cebb
ifos3d
snapmerge
\ No newline at end of file
par/grad/.gitignore
View file @
7da2cebb
*.*
\ No newline at end of file
par/hess/.gitignore
View file @
7da2cebb
*.*
\ No newline at end of file
par/in_and_out/.gitignore
0 → 100644
View file @
7da2cebb
*.out
\ No newline at end of file
par/in_and_out/fdmpi_toy.inp
View file @
7da2cebb
...
...
@@ -10,9 +10,9 @@
#-----------------------------------------------------------------------------------
#
#-------------- Domain Decomposition -----------------------------
number_of_processors_in_x-direction_(NPROCX) =
8
number_of_processors_in_y-direction_(NPROCY) =
8
number_of_processors_in_z-direction_(NPROCZ) =
8
number_of_processors_in_x-direction_(NPROCX) =
2
number_of_processors_in_y-direction_(NPROCY) =
2
number_of_processors_in_z-direction_(NPROCZ) =
2
#
#-------------------- 3-D Grid -----------------------------------
number_of_gridpoints_in_x-direction_(NX) = 160
...
...
@@ -161,6 +161,10 @@ minimum/maximum_iteration_number_(>0)_(ITMIN,ITMAX) = 1 , 80
filtering_(yes=1/no=0)_(FILT) = 1
maximum_number_frequencies_per_iteration_(NFMAX) = 5
number_of_timestep_per_period_used_for_inversion_(TAST) = 100
average_model_parameter_(VP0,VS0,RHO0) = 6200.0, 3600.0, 2800.0
# velocities in m/s, density in kg/m³
parameter_class_weighting_factors_for_vp/vs/rho_(WEIGHT) = 1.0, 1.0, 0.0
# choose from 1.0 (full update) to 0.0 (no update)
#
#------------------------Steplength estimation----------------------------------------
number_of_shots_used_for_steplength_estimation_(NSHOTS_STEP) = 4
...
...
par/model/.gitignore
View file @
7da2cebb
*.*
\ No newline at end of file
par/su/.gitignore
View file @
7da2cebb
*.*
\ No newline at end of file
par/su_obs/.gitignore
View file @
7da2cebb
*.*
\ No newline at end of file
src/.gitignore
0 → 100644
View file @
7da2cebb
*.o
\ No newline at end of file
src/Makefile
View file @
7da2cebb
...
...
@@ -8,7 +8,7 @@
# source code for model generation (elastic)
MODEL_SCR
=
hh_toy
_florian
.c
MODEL_SCR
=
hh_toy.c
# Compiler (LAM: CC=hcc, CRAY T3E: CC=cc, SHARCNet: mpicc)
...
...
src/exchange_par.c
View file @
7da2cebb
...
...
@@ -44,9 +44,9 @@ void exchange_par(void){
extern
int
METHOD
;
extern
int
ITMIN
,
ITMAX
,
FILT
,
NFMAX
,
TAST
,
NSHOTS_STEP
,
DAMPTYPE
,
HESS
,
READ_HESS
,
REC_HESS
,
LBFGS
,
EXTOBS
;
/*extern float F_INV;*/
extern
float
TESTSTEP
,
WATER_HESS
[
3
];
extern
float
TESTSTEP
,
WATER_HESS
[
3
]
,
WEIGHT
[
3
],
VP0
,
VS0
,
RHO0
;
int
idum
[
55
];
float
fdum
[
36
];
float
fdum
[
42
];
if
(
MYID
==
0
){
...
...
@@ -81,10 +81,16 @@ void exchange_par(void){
fdum
[
29
]
=
ALPHA
;
fdum
[
30
]
=
BETA
;
fdum
[
31
]
=
VPPML
;
fdum
[
32
]
=
TESTSTEP
;
fdum
[
33
]
=
WATER_HESS
[
0
];
fdum
[
34
]
=
WATER_HESS
[
1
];
fdum
[
35
]
=
WATER_HESS
[
2
];
fdum
[
32
]
=
VP0
;
fdum
[
33
]
=
VS0
;
fdum
[
34
]
=
RHO0
;
fdum
[
35
]
=
WEIGHT
[
0
];
fdum
[
36
]
=
WEIGHT
[
1
];
fdum
[
37
]
=
WEIGHT
[
2
];
fdum
[
38
]
=
TESTSTEP
;
fdum
[
39
]
=
WATER_HESS
[
0
];
fdum
[
40
]
=
WATER_HESS
[
1
];
fdum
[
41
]
=
WATER_HESS
[
2
];
idum
[
0
]
=
FDORDER
;
idum
[
1
]
=
NPROCX
;
...
...
@@ -152,7 +158,7 @@ void exchange_par(void){
MPI_Barrier
(
MPI_COMM_WORLD
);
MPI_Bcast
(
&
idum
,
55
,
MPI_INT
,
0
,
MPI_COMM_WORLD
);
MPI_Bcast
(
&
fdum
,
36
,
MPI_FLOAT
,
0
,
MPI_COMM_WORLD
);
MPI_Bcast
(
&
fdum
,
42
,
MPI_FLOAT
,
0
,
MPI_COMM_WORLD
);
MPI_Bcast
(
&
SOURCE_FILE
,
STRING_SIZE
,
MPI_CHAR
,
0
,
MPI_COMM_WORLD
);
MPI_Bcast
(
&
SIGNAL_FILE
,
STRING_SIZE
,
MPI_CHAR
,
0
,
MPI_COMM_WORLD
);
...
...
@@ -201,10 +207,16 @@ void exchange_par(void){
ALPHA
=
fdum
[
29
];
BETA
=
fdum
[
30
];
VPPML
=
fdum
[
31
];
TESTSTEP
=
fdum
[
32
];
WATER_HESS
[
0
]
=
fdum
[
33
];
WATER_HESS
[
1
]
=
fdum
[
34
];
WATER_HESS
[
2
]
=
fdum
[
35
];
VP0
=
fdum
[
32
];
VS0
=
fdum
[
33
];
RHO0
=
fdum
[
34
];
WEIGHT
[
0
]
=
fdum
[
35
];
WEIGHT
[
1
]
=
fdum
[
36
];
WEIGHT
[
2
]
=
fdum
[
37
];
TESTSTEP
=
fdum
[
38
];
WATER_HESS
[
0
]
=
fdum
[
39
];
WATER_HESS
[
1
]
=
fdum
[
40
];
WATER_HESS
[
2
]
=
fdum
[
41
];
FDORDER
=
idum
[
0
];
NPROCX
=
idum
[
1
];
...
...
src/globvar.h
View file @
7da2cebb
...
...
@@ -57,4 +57,5 @@ float F_INV=0.0, TESTSTEP=0.0;
char
MOD_OUT_FILE
[
STRING_SIZE
],
HESS_FILE
[
STRING_SIZE
],
GRAD_FILE
[
STRING_SIZE
],
SEIS_OBS_FILE
[
STRING_SIZE
];
int
DAMPTYPE
,
ITMIN
,
ITMAX
,
FILT
,
NFMAX
,
NSHOTS_STEP
,
TAST
,
EXTOBS
;
int
HESS
,
READ_HESS
,
REC_HESS
,
LBFGS
;
float
WATER_HESS
[
3
]
=
{
0
.
0
,
0
.
0
,
0
.
0
};
\ No newline at end of file
float
WATER_HESS
[
3
]
=
{
0
.
0
,
0
.
0
,
0
.
0
},
WEIGHT
[
3
]
=
{
0
.
0
,
0
.
0
,
0
.
0
};
float
VP0
,
VS0
,
RHO0
;
\ No newline at end of file
src/hess_apply.c
View file @
7da2cebb
...
...
@@ -27,14 +27,14 @@
void
hess_apply
(
int
nx1
,
int
nx2
,
int
ny1
,
int
ny2
,
int
nz1
,
int
nz2
,
float
***
grad1
,
float
***
grad2
,
float
***
grad3
,
float
***
hess1
,
float
***
hess2
,
float
***
hess3
,
float
finv
,
int
iteration
){
extern
float
WATER_HESS
[
3
];
extern
float
WATER_HESS
[
3
]
,
VP0
,
VS0
,
RHO0
;
extern
int
NXG
,
NYG
,
NZG
,
FW
,
NX
,
NY
,
NZ
;
extern
FILE
*
FP
;
int
LBFGS
=
0
;
float
wl
[
3
],
buf
[
3
];
int
i
,
j
,
k
,
buf1
;
float
vp0
=
1240
.
0
,
vs0
=
730
.
0
,
rho0
=
1820
.
0
;
buf
[
0
]
=
0
.
0
;
buf
[
1
]
=
0
.
0
;
buf
[
2
]
=
0
.
0
;
wl
[
0
]
=
0
.
0
;
wl
[
1
]
=
0
.
0
;
wl
[
2
]
=
0
.
0
;
...
...
@@ -44,9 +44,9 @@ void hess_apply(int nx1, int nx2, int ny1, int ny2, int nz1, int nz2, float ***g
for
(
j
=
1
;
j
<=
ny2
;
j
++
){
for
(
i
=
1
;
i
<=
nx2
;
i
++
){
for
(
k
=
1
;
k
<=
nz2
;
k
++
){
grad1
[
j
][
i
][
k
]
=
grad1
[
j
][
i
][
k
]
*
vp
0
;
grad2
[
j
][
i
][
k
]
=
grad2
[
j
][
i
][
k
]
*
vs
0
;
grad3
[
j
][
i
][
k
]
=
grad3
[
j
][
i
][
k
]
*
rho
0
;
grad1
[
j
][
i
][
k
]
=
grad1
[
j
][
i
][
k
]
*
VP
0
;
grad2
[
j
][
i
][
k
]
=
grad2
[
j
][
i
][
k
]
*
VS
0
;
grad3
[
j
][
i
][
k
]
=
grad3
[
j
][
i
][
k
]
*
RHO
0
;
/*hess1[j][i][k]=hess1[j][i][k]*pow(vp0,2.0);
hess2[j][i][k]=hess2[j][i][k]*pow(vs0,2.0);
hess3[j][i][k]=hess3[j][i][k]*pow(rho0,2.0);*/
...
...
src/modelupdate.c
View file @
7da2cebb
...
...
@@ -27,20 +27,24 @@ void modelupdate(int nx, int ny, int nz, float ***gradvp, float ***gradvs, float
extern
FILE
*
FP
;
extern
int
NX
,
NY
,
NZ
,
LBFGS
;
extern
float
VP0
,
VS0
,
RHO0
,
WEIGHT
[
3
];
int
j
,
i
,
k
,
l
,
l1
;
float
vpnew
,
vsnew
,
rhonew
;
float
max
[
3
],
buf
[
3
],
max1
[
3
],
dummy
[
3
];
float
vp
,
vs
;
int
bfgsnum
=
5
,
w
;
float
scale1
=
1
.
0
,
scale2
=
1
.
0
;
float
vp0
=
6200
.
0
,
vs0
=
3600
.
0
,
rho0
=
2800
.
0
;
float
scale1
=
0
.
0
,
scale2
=
0
.
0
,
scale3
=
0
.
0
;
buf
[
0
]
=
0
.
0
;
buf
[
1
]
=
0
.
0
;
buf
[
2
]
=
0
.
0
;
max
[
0
]
=
0
.
0
;
max
[
1
]
=
0
.
0
;
max
[
2
]
=
0
.
0
;
dummy
[
0
]
=
0
.
0
;
dummy
[
1
]
=
0
.
0
;
dummy
[
2
]
=
0
.
0
;
max1
[
0
]
=
0
.
0
;
max1
[
1
]
=
0
.
0
;
max1
[
2
]
=
0
.
0
;
scale1
=
WEIGHT
[
0
];
scale2
=
WEIGHT
[
1
];
scale3
=
WEIGHT
[
2
];
/*if(iteration<20)scale1=0.7;
if(iteration>40)scale2=0.7;
if(iteration>60)scale2=0.4;*/
...
...
@@ -126,20 +130,20 @@ void modelupdate(int nx, int ny, int nz, float ***gradvp, float ***gradvs, float
/*update model*/
vpnew
=
0
.
0
;
/*vpnew=sqrt(pi[j][i][k]/rho[j][i][k])+max[0]*step*gradconvp[j][i][k];*/
vpnew
=
sqrt
(
pi
[
j
][
i
][
k
]
/
rho
[
j
][
i
][
k
])
+
step
*
scale1
*
gradvp
[
j
][
i
][
k
]
*
vp
0
;
vpnew
=
sqrt
(
pi
[
j
][
i
][
k
]
/
rho
[
j
][
i
][
k
])
+
step
*
scale1
*
gradvp
[
j
][
i
][
k
]
*
VP
0
;
vsnew
=
0
.
0
;
/*vsnew=sqrt(u[j][i][k]/rho[j][i][k])+max[1]*step*gradconvs[j][i][k];*/
vsnew
=
sqrt
(
u
[
j
][
i
][
k
]
/
rho
[
j
][
i
][
k
])
+
step
*
scale2
*
gradvs
[
j
][
i
][
k
]
*
vs
0
;
vsnew
=
sqrt
(
u
[
j
][
i
][
k
]
/
rho
[
j
][
i
][
k
])
+
step
*
scale2
*
gradvs
[
j
][
i
][
k
]
*
VS
0
;
rhonew
=
0
.
0
;
rhonew
=
rho
[
j
][
i
][
k
]
+
0
.
0
*
step
*
gradrho
[
j
][
i
][
k
]
*
rho
0
;
rhonew
=
rho
[
j
][
i
][
k
]
+
scale3
*
step
*
gradrho
[
j
][
i
][
k
]
*
RHO
0
;
if
(
LBFGS
){
/*save normalised model differences for LBFGS*/
l
++
;
l1
++
;
bfgsmod1
[
w
][
l
]
=
(
vpnew
-
sqrt
(
pi
[
j
][
i
][
k
]
/
rho
[
j
][
i
][
k
]))
/
vp
0
;
bfgsmod1
[
w
][
l1
]
=
(
vsnew
-
sqrt
(
u
[
j
][
i
][
k
]
/
rho
[
j
][
i
][
k
]))
/
vs
0
;
bfgsmod1
[
w
][
l
]
=
(
vpnew
-
sqrt
(
pi
[
j
][
i
][
k
]
/
rho
[
j
][
i
][
k
]))
/
VP
0
;
bfgsmod1
[
w
][
l1
]
=
(
vsnew
-
sqrt
(
u
[
j
][
i
][
k
]
/
rho
[
j
][
i
][
k
]))
/
VS
0
;
/*bfgsmod3[w][l]=(rhonew-rho[j][i][k])/rho0;*/
}
...
...
src/read_par.c
View file @
7da2cebb
...
...
@@ -48,7 +48,7 @@ int read_par(FILE *fp_in){
extern
int
METHOD
;
extern
int
ITMIN
,
ITMAX
,
FILT
,
NFMAX
,
TAST
,
NSHOTS_STEP
,
DAMPTYPE
,
HESS
,
READ_HESS
,
REC_HESS
,
EXTOBS
,
LBFGS
;
/*extern float F_INV;*/
extern
float
TESTSTEP
,
WATER_HESS
[
3
];
extern
float
TESTSTEP
,
WATER_HESS
[
3
]
,
WEIGHT
[
3
],
VP0
,
VS0
,
RHO0
;
/* definition of local variables */
char
s
[
256
],
cline
[
256
]
=
""
;
...
...
@@ -389,8 +389,7 @@ int read_par(FILE *fp_in){
case
69
:
sscanf
(
cline
,
"%s =%i , %i"
,
s
,
&
ITMIN
,
&
ITMAX
);
if
(
!
METHOD
)
ITMAX
=
1
;
break
;
break
;
case
70
:
sscanf
(
cline
,
"%s =%i"
,
s
,
&
FILT
);
break
;
...
...
@@ -400,31 +399,38 @@ int read_par(FILE *fp_in){
case
72
:
sscanf
(
cline
,
"%s =%i"
,
s
,
&
TAST
);
break
;
case
73
:
sscanf
(
cline
,
"%s =%
i"
,
s
,
&
NSHOTS_STEP
);
case
73
:
sscanf
(
cline
,
"%s =%
f, %f, %f"
,
s
,
&
VP0
,
&
VS0
,
&
RHO0
);
break
;
case
74
:
sscanf
(
cline
,
"%s =%f, %f, %f"
,
s
,
&
WEIGHT
[
0
],
&
WEIGHT
[
1
],
&
WEIGHT
[
2
]);
break
;
case
75
:
sscanf
(
cline
,
"%s =%i"
,
s
,
&
NSHOTS_STEP
);
break
;
case
76
:
sscanf
(
cline
,
"%s =%f"
,
s
,
&
TESTSTEP
);
break
;
case
7
5
:
case
7
7
:
sscanf
(
cline
,
"%s =%i"
,
s
,
&
DAMPTYPE
);
break
;
case
7
6
:
case
7
8
:
sscanf
(
cline
,
"%s =%i"
,
s
,
&
HESS
);
break
;
case
7
7
:
case
7
9
:
sscanf
(
cline
,
"%s =%i"
,
s
,
&
READ_HESS
);
break
;
case
78
:
case
80
:
sscanf
(
cline
,
"%s =%i"
,
s
,
&
REC_HESS
);
break
;
case
79
:
case
81
:
sscanf
(
cline
,
"%s =%f, %f, %f"
,
s
,
&
WATER_HESS
[
0
],
&
WATER_HESS
[
1
],
&
WATER_HESS
[
2
]);
break
;
case
8
0
:
case
8
2
:
sscanf
(
cline
,
"%s =%i"
,
s
,
&
LBFGS
);
break
;
case
8
1
:
case
8
3
:
nvarin
=
sscanf
(
cline
,
"%s =%i ,%i ,%i"
,
s
,
&
ASCIIEBCDIC
,
&
LITTLEBIG
,
&
IEEEIBM
);
switch
(
nvarin
){
case
0
:
;
...
...
@@ -439,7 +445,7 @@ int read_par(FILE *fp_in){
}
}
LOG
=
0
;
if
(
lineno
<
8
1
)
fprintf
(
stderr
,
" Warning: only %d non-commentary lines of input parameters read (expected 81
).
\n
"
,
lineno
);
if
(
lineno
<
8
3
)
fprintf
(
stderr
,
" Warning: only %d non-commentary lines of input parameters read (expected 83
).
\n
"
,
lineno
);
/* else if (lineno>71) fprintf(stderr," Warning: %d non-commentary lines of input parameters read \n \t(expected and interpreted: 67).\n",lineno); */
/* else fprintf(stderr," %d non-commentary lines of input parameters read.\n",lineno); */
fclose
(
fp_in
);
...
...
src/readhess.c
View file @
7da2cebb
...
...
@@ -26,8 +26,8 @@
void
readhess
(
int
nx
,
int
ny
,
int
nz
,
float
***
hess1
,
float
***
hess2
,
float
***
hess3
){
extern
int
NX
,
NY
,
NZ
,
NXG
,
NYG
,
NZG
,
POS
[
4
];
extern
float
VP0
,
VS0
,
RHO0
;
extern
FILE
*
FP
;
float
vp0
=
1240
.
0
,
vs0
=
730
.
0
,
rho0
=
1820
.
0
;
/* local variables */
float
rhov
,
vp
,
vs
;
/*qp, qs;*/
...
...
@@ -78,9 +78,9 @@ float vp0=1240.0, vs0=730.0, rho0=1820.0;
hess3[jj][ii][kk]=rhov;*/
hess1
[
jj
][
ii
][
kk
]
=
vp
*
pow
(
vp
0
,
2
);
hess2
[
jj
][
ii
][
kk
]
=
vs
*
pow
(
vs
0
,
2
);
hess3
[
jj
][
ii
][
kk
]
=
rhov
*
pow
(
rho
0
,
2
);
hess1
[
jj
][
ii
][
kk
]
=
vp
*
pow
(
VP
0
,
2
);
hess2
[
jj
][
ii
][
kk
]
=
vs
*
pow
(
VS
0
,
2
);
hess3
[
jj
][
ii
][
kk
]
=
rhov
*
pow
(
RHO
0
,
2
);
}
...
...
src/writepar.c
View file @
7da2cebb
...
...
@@ -42,7 +42,7 @@ void writepar(FILE *fp, int ns){
extern
int
METHOD
;
extern
int
NP
,
NPROCX
,
NPROCY
,
NPROCZ
,
MYID
;
extern
int
ITMIN
,
ITMAX
,
FILT
,
NFMAX
,
TAST
,
NSHOTS_STEP
,
DAMPTYPE
,
HESS
,
READ_HESS
,
REC_HESS
,
LBFGS
,
EXTOBS
;
extern
float
TESTSTEP
,
WATER_HESS
[
3
];
extern
float
TESTSTEP
,
WATER_HESS
[
3
]
,
WEIGHT
[
3
],
VP0
,
VS0
,
RHO0
;
/* definition of local variables */
char
th1
[
3
],
file_ext
[
8
];
char
th2
[
3
];
...
...
@@ -431,6 +431,8 @@ fprintf(fp," \n minimum/maximum_iteration_number: %d,%d\n",ITMIN,ITMAX);
fprintf
(
fp
,
"
\n
filtering: %d
\n
"
,
FILT
);
fprintf
(
fp
,
"
\n
maximum_number_frequencies_per_iteration: %d
\n
"
,
NFMAX
);
fprintf
(
fp
,
"
\n
number_of_timestep_per_wavelength_used_for_inversion: %d
\n
"
,
TAST
);
fprintf
(
fp
,
"
\n
average_model_parameter VP0=%5.2f m/s, VS0=%5.2f m/s, RHO0=%5.2f kg/m^3
\n
"
,
VP0
,
VS0
,
RHO0
);
fprintf
(
fp
,
"
\n
parameter_class_weighting_factors_for_vp: %5.2f, vs: %5.2f, rho: %5.2f
\n
"
,
WEIGHT
[
0
],
WEIGHT
[
1
],
WEIGHT
[
2
]);
fprintf
(
fp
,
"
\n
------------------------Steplength estimation----------------------------------------
\n
"
);
fprintf
(
fp
,
"
\n
number_of_shots_used_for_steplength_estimation: %d
\n
"
,
NSHOTS_STEP
);
...
...
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