Commit bc9adffc authored by Florian Wittkamp's avatar Florian Wittkamp

Renaming a few global variables

INVMAT - > FORWARD_ONLY
INVMAT1 - > PARAMETERIZATION
parent 1c13799e
......@@ -223,7 +223,7 @@ Default value is:
With this option pure acoustic modelling and/or inversion can be performed (ACOUSTIC = 1). Only a P-wave and a density model need to be provided. Acoustic modelling and inversion can be a quick estimate, especially for marine environments.
For acoustic modelling the option VELOCITY is not available and only INVMAT1 = 1 is possible.
For acoustic modelling the option VELOCITY is not available and only PARAMETERIZATION = 1 is possible.
\section{PSV and SH modelling}
{\color{blue}{\begin{verbatim}
......@@ -418,8 +418,8 @@ If TIME\_FILT is set to one the log file L2\_LOG.dat contains a 9th column with
"General inversion parameters" : "comment",
"ITERMAX" : "10",
"DATA_DIR" : "su/measured_data/IFOS2D_real",
"INVMAT1" : "1",
"INVMAT" : "0",
"PARAMETERIZATION" : "1",
"FORWARD_ONLY" : "0",
"ADJOINT_TYPE" : "1",
"MISFIT_LOG_FILE" : "L2_LOG.dat",
"VELOCITY" : "0",
......@@ -439,9 +439,9 @@ INV_VP_ITER=0
INV_VS_ITER=0
\end{verbatim}}}
This section covers some general inversion parameters. The maximum number of iterations is defined by ITERMAX. The switch INVMAT controls if only the forward modeling code should be used (INVMAT=10), e.\,g. to calculate synthetic seismograms or a complete FWT run (INVMAT=0). The seismic sections of the real data need to be located in DATA\_DIR and should have the ending \_x.su.shot<shotnumber> for the x-component and so on. As noted in section \ref{model parametrizations} the gradients can be expressed for different model parameterizations. The switch INVMAT1 defines which parameterization should be used, seismic velocities and density (Vp,Vs,rho, INVMAT1=1), seismic impedances (Zp,Zs,rho, INVMAT1=2) or Lam$\rm{\acute{e}}$ parameters ($\rm{\lambda,\mu,\rho}$, INVMAT1=3). Please use INVMAT1>1 with care, as current developers are only working with INVMAT1=1.
This section covers some general inversion parameters. The maximum number of iterations is defined by ITERMAX. The switch FORWARD\_ONLY controls if only the forward modeling code should be used (FORWARD\_ONLY=1), e.\,g. to calculate synthetic seismograms or a complete FWT run (FORWARD\_ONLY=0). The seismic sections of the real data need to be located in DATA\_DIR and should have the ending \_x.su.shot<shotnumber> for the x-component and so on. As noted in section \ref{model parametrizations} the gradients can be expressed for different model parameterizations. The switch PARAMETERIZATION defines which parameterization should be used, seismic velocities and density (Vp,Vs,rho, PARAMETERIZATION=1), seismic impedances (Zp,Zs,rho, PARAMETERIZATION=2) or Lam$\rm{\acute{e}}$ parameters ($\rm{\lambda,\mu,\rho}$, PARAMETERIZATION=3). Please use PARAMETERIZATION>1 with care, as current developers are only working with PARAMETERIZATION=1.
If models are read from binary files appropriate file extensions are required for the different models (see section \ref{gen_of_mod}). Depending on the data different components of the seismic sections can be backpropagated. For two component data (x- and y-component) set ADJOINT\_TYPE=1, only the y-component (ADJOINT\_TYPE=2) and only the x-component (ADJOINT\_TYPE=3). For the inversion of pressure seismograms ADJOINT\_TYPE=4 has to be used.
If models are read from binary files appropriate file extensions are required for the different models (see section \ref{gen_of_mod}). Depending on the data different components of the seismic sections can be back propagated. For two component data (x- and y-component) set ADJOINT\_TYPE=1, only the y-component (ADJOINT\_TYPE=2) and only the x-component (ADJOINT\_TYPE=3). For the inversion of pressure seismograms ADJOINT\_TYPE=4 has to be used.
During the inversion the misfit values are saved in a log file specified in MISFIT\_LOG\_FILE. The log file consists of eight or nine columns and each line corresponds to one iteration step. The used step length is written in the first column. In the second to fourth column the three test step lengths used for the step length estimation are saved. The corresponding misfit values for these test step lengthes and the test shots are written to column five to seven. Column eight corresponds to the total misfit for all shots and if you use frequency filtering then the ninth column corresponds to the corner frequency of the lowpass filter used in the inversion step.
......@@ -845,7 +845,7 @@ RHOUPPERLIM=25000.0
RHOLOWERLIM=0.0
\end{verbatim}}}
The six limits for the model parameters specify the minimum and maximum values which may be achieved by the inversion. Here, known a priori information can be used. Depending on the choice of the parameter INVMAT1, either vp and vs or lambda and mu is meant.
The six limits for the model parameters specify the minimum and maximum values which may be achieved by the inversion. Here, known a priori information can be used. Depending on the choice of the parameter PARAMETERIZATION, either vp and vs or lambda and mu is meant.
\subsection{Limited update of model parameters}
{\color{blue}{\begin{verbatim}
......
......@@ -63,7 +63,7 @@
"General inversion parameters" : "comment",
"INVMAT1" : "1",
"INVMAT" : "10",
"PARAMETERIZATION" : "1",
"FORWARD_ONLY" : "10",
}
\end{verbatim}}
......@@ -64,8 +64,8 @@
"SEIS_FILE" : "su/IFOS",
"General inversion parameters" : "comment",
"INVMAT1" : "1",
"INVMAT" : "10",
"PARAMETERIZATION" : "1",
"FORWARD_ONLY" : "10",
"Verbose mode" : "comment",
"VERBOSE" : "0",
......
......@@ -94,8 +94,8 @@
"General inversion parameters" : "comment",
"INVMAT1" : "1",
"INVMAT" : "10",
"PARAMETERIZATION" : "1",
"FORWARD_ONLY" : "10",
"Verbose mode" : "comment",
"VERBOSE" : "0",
......
......@@ -66,8 +66,8 @@
"General inversion parameters" : "comment",
"ITERMAX" : "10",
"DATA_DIR" : "su/measured_data/IFOS_real",
"INVMAT1" : "1",
"INVMAT" : "0",
"PARAMETERIZATION" : "1",
"FORWARD_ONLY" : "0",
"ADJOINT_TYPE" : "1",
"Output of inverted models" : "comment",
......
......@@ -95,8 +95,8 @@
"General inversion parameters" : "comment",
"ITERMAX" : "10",
"DATA_DIR" : "su/measured_data/IFOS_real",
"INVMAT1" : "1",
"INVMAT" : "0",
"PARAMETERIZATION" : "1",
"FORWARD_ONLY" : "0",
"ADJOINT_TYPE" : "1",
"MISFIT_LOG_FILE" : "L2_LOG.dat",
"VELOCITY" : "0",
......
......@@ -79,8 +79,8 @@
"General inversion parameters" : "comment",
"ITERMAX" : "1",
"INVMAT1" : "1",
"INVMAT" : "10",
"PARAMETERIZATION" : "1",
"FORWARD_ONLY" : "10",
"Verbose mode" : "comment",
"VERBOSE" : "0",
......
......@@ -93,8 +93,8 @@
"General inversion parameters" : "comment",
"ITERMAX" : "1",
"INVMAT1" : "1",
"INVMAT" : "10",
"PARAMETERIZATION" : "1",
"FORWARD_ONLY" : "10",
"Verbose" : "comment",
"VERBOSE" : "0",
......
......@@ -77,8 +77,8 @@
"General inversion parameters" : "comment",
"ITERMAX" : "400",
"DATA_DIR" : "su/measured_data/toy_example",
"INVMAT1" : "1",
"INVMAT" : "0",
"PARAMETERIZATION" : "1",
"FORWARD_ONLY" : "0",
"ADJOINT_TYPE" : "1",
"MISFIT_LOG_FILE" : "LOG_toy_example.dat",
......
......@@ -83,8 +83,8 @@
"General inversion parameters" : "comment",
"ITERMAX" : "5",
"DATA_DIR" : "su/measured_data/toy_example",
"INVMAT1" : "1",
"INVMAT" : "0",
"PARAMETERIZATION" : "1",
"FORWARD_ONLY" : "0",
"ADJOINT_TYPE" : "1",
"ADJOINT_TYPE values: 1=x y; 2=x; 3=y; 4=z; 5=x y z" : "comment",
"MISFIT_LOG_FILE" : "LOG_toy_example.dat",
......
......@@ -85,8 +85,8 @@
"General inversion parameters" : "comment",
"ITERMAX" : "1",
"INVMAT1" : "1",
"INVMAT" : "10",
"PARAMETERIZATION" : "1",
"FORWARD_ONLY" : "10",
"Verbose mode" : "comment",
"VERBOSE" : "0",
......
......@@ -77,8 +77,8 @@
"General inversion parameters" : "comment",
"ITERMAX" : "400",
"DATA_DIR" : "su/measured_data/toy_example_ac",
"INVMAT1" : "1",
"INVMAT" : "0",
"PARAMETERIZATION" : "1",
"FORWARD_ONLY" : "0",
"ADJOINT_TYPE" : "4",
"MISFIT_LOG_FILE" : "LOG_toy_example_ac.dat",
......
This diff is collapsed.
......@@ -28,7 +28,7 @@
void PCG(float ** waveconv, float ** taper_coeff, int nsrc, float ** srcpos, int ** recpos, int ntr_glob, int iter, float C_vp, float ** gradp, int nfstart_jac, float ** waveconv_u, float C_vs, float ** gradp_u, float ** waveconv_rho, float C_rho, float ** gradp_rho, float Vs_avg, float FC){
extern int NX, NY, IDX, IDY, SPATFILTER, GRAD_FILTER;
extern int INVMAT, SWS_TAPER_GRAD_VERT, SWS_TAPER_GRAD_HOR, SWS_TAPER_GRAD_SOURCES, SWS_TAPER_FILE;
extern int FORWARD_ONLY, SWS_TAPER_GRAD_VERT, SWS_TAPER_GRAD_HOR, SWS_TAPER_GRAD_SOURCES, SWS_TAPER_FILE;
extern int POS[3], MYID, ACOUSTIC;
extern char JACOBIAN[STRING_SIZE];
extern int RESTART_WORKFLOW;
......@@ -48,7 +48,7 @@ void PCG(float ** waveconv, float ** taper_coeff, int nsrc, float ** srcpos, int
/* ===================================================== GRADIENT ZP ================================================================================== */
/* ===================================================================================================================================================== */
if((INVMAT==0)){
if((FORWARD_ONLY==0)){
/* Preconditioning of the gradient */
/* ------------------------------- */
......@@ -285,7 +285,7 @@ void PCG(float ** waveconv, float ** taper_coeff, int nsrc, float ** srcpos, int
/* ===================================================== GRADIENT Zs ================================================================================== */
/* ===================================================================================================================================================== */
if((INVMAT==0)&&(!ACOUSTIC)){
if((FORWARD_ONLY==0)&&(!ACOUSTIC)){
/* Preconditioning of the gradient */
/* ------------------------------- */
......@@ -515,7 +515,7 @@ void PCG(float ** waveconv, float ** taper_coeff, int nsrc, float ** srcpos, int
/* ===================================================== GRADIENT rho ================================================================================== */
/* ===================================================================================================================================================== */
if((INVMAT==0)){
if((FORWARD_ONLY==0)){
/* Preconditioning of the gradient */
/* ------------------------------- */
......
......@@ -28,7 +28,7 @@
void PCG_SH(float ** taper_coeff, int nsrc, float ** srcpos, int ** recpos, int ntr_glob, int iter, int nfstart_jac, float ** waveconv_u, float C_vs, float ** gradp_u, float ** waveconv_rho, float C_rho, float ** gradp_rho, float Vs_avg, float FC){
extern int NX, NY, IDX, IDY, SPATFILTER, GRAD_FILTER;
extern int INVMAT, SWS_TAPER_GRAD_VERT, SWS_TAPER_GRAD_HOR, SWS_TAPER_GRAD_SOURCES, SWS_TAPER_FILE;
extern int FORWARD_ONLY, SWS_TAPER_GRAD_VERT, SWS_TAPER_GRAD_HOR, SWS_TAPER_GRAD_SOURCES, SWS_TAPER_FILE;
extern int POS[3], MYID, ACOUSTIC,WAVETYPE;
extern char JACOBIAN[STRING_SIZE];
......@@ -47,7 +47,7 @@ void PCG_SH(float ** taper_coeff, int nsrc, float ** srcpos, int ** recpos, int
/* ===================================================== GRADIENT Zs ================================================================================== */
/* ===================================================================================================================================================== */
if((INVMAT==0)&&(!ACOUSTIC)){
if((FORWARD_ONLY==0)&&(!ACOUSTIC)){
/* Preconditioning of the gradient */
/* ------------------------------- */
......@@ -279,7 +279,7 @@ void PCG_SH(float ** taper_coeff, int nsrc, float ** srcpos, int ** recpos, int
/* ===================================================== GRADIENT rho ================================================================================== */
/* ===================================================================================================================================================== */
if((INVMAT==0)){
if((FORWARD_ONLY==0)){
/* Preconditioning of the gradient */
/* ------------------------------- */
......
......@@ -21,11 +21,11 @@
void av_mue(float ** u, float ** uipjp,float ** rho){
extern int NX, NY, INVMAT1;
extern int NX, NY, PARAMETERIZATION;
int i, j;
float u1, u2, u3, u4;
if(INVMAT1==3){
if(PARAMETERIZATION==3){
for (j=1;j<=NY;j++){
for (i=1;i<=NX;i++){
......@@ -42,7 +42,7 @@ void av_mue(float ** u, float ** uipjp,float ** rho){
}
if(INVMAT1==1){
if(PARAMETERIZATION==1){
for (j=1;j<=NY;j++){
for (i=1;i<=NX;i++){
......
......@@ -26,7 +26,7 @@
#include "fd.h"
void calc_mat_change_test(float ** waveconv, float ** waveconv_rho, float ** waveconv_u, float ** rho, float ** rhonp1, float ** pi, float ** pinp1, float ** u, float ** unp1, int iter,
int epstest, int INVMAT, float eps_scale, int itest, int nfstart, float ** u_start, float ** pi_start, float ** rho_start,int wavetype_start,float **s_LBFGS,int N_LBFGS,int LBFGS_NPAR,float Vs_avg,float Vp_avg,float rho_avg,int LBFGS_iter_start){
int epstest, int FORWARD_ONLY, float eps_scale, int itest, int nfstart, float ** u_start, float ** pi_start, float ** rho_start,int wavetype_start,float **s_LBFGS,int N_LBFGS,int LBFGS_NPAR,float Vs_avg,float Vp_avg,float rho_avg,int LBFGS_iter_start){
/*--------------------------------------------------------------------------*/
......@@ -34,7 +34,7 @@ void calc_mat_change_test(float ** waveconv, float ** waveconv_rho, float *
/* extern variables */
extern float DH, DT, VP_VS_RATIO;
extern float EPSILON, EPSILON_u, EPSILON_rho, MUN;
extern int NX, NY, NXG, NYG, POS[3], MYID, INVMAT1,WAVETYPE;
extern int NX, NY, NXG, NYG, POS[3], MYID, PARAMETERIZATION,WAVETYPE;
extern int INV_RHO_ITER, INV_VP_ITER, INV_VS_ITER;
extern int VERBOSE;
......@@ -228,7 +228,7 @@ void calc_mat_change_test(float ** waveconv, float ** waveconv_rho, float *
for (j=1;j<=NY;j++){
/* update lambda, mu, rho */
if((INVMAT1==3) || (INVMAT1==1)){
if((PARAMETERIZATION==3) || (PARAMETERIZATION==1)){
testuplow=0;
......
......@@ -31,7 +31,7 @@ void checkfd(FILE *fp, float ** prho, float ** ppi, float ** pu, float ** ptaus,
extern float DH, DT, TS;
extern float XREC1, XREC2, YREC1, YREC2;
extern int NX, NY, MYID, INVMAT1, FW, L, NT, NDT, ACOUSTIC;
extern int NX, NY, MYID, PARAMETERIZATION, FW, L, NT, NDT, ACOUSTIC;
extern int READREC, NPROCX,NPROCY, SRCREC, FREE_SURF;
extern int SEISMO, SEIS_FORMAT[6];
extern char SOURCE_FILE[STRING_SIZE], REC_FILE[STRING_SIZE];
......@@ -70,9 +70,9 @@ void checkfd(FILE *fp, float ** prho, float ** ppi, float ** pu, float ** ptaus,
sumu=sumu+((ws*ws*ts*ts*ptaus[j][i])/(1.0+ws*ws*ts*ts));
}
if(INVMAT1==1){
if(PARAMETERIZATION==1){
pu_ref=prho[j][i]*pu[j][i]*pu[j][i];}
if(INVMAT1==3){
if(PARAMETERIZATION==3){
pu_ref=pu[j][i];}
......@@ -92,10 +92,10 @@ void checkfd(FILE *fp, float ** prho, float ** ppi, float ** pu, float ** ptaus,
for (i=1+nfw;i<=(nx-nfw);i++){
for (j=ny1;j<=(ny-nfw);j++){
if(INVMAT1==3){
if(PARAMETERIZATION==3){
c=sqrt(pu[j][i]/prho[j][i]);}
if(INVMAT1==1){
if(PARAMETERIZATION==1){
c=pu[j][i];
}
......@@ -119,9 +119,9 @@ void checkfd(FILE *fp, float ** prho, float ** ppi, float ** pu, float ** ptaus,
sumpi=sumpi+((ws*ws*ts*ts*ptaup[j][i])/(1.0+ws*ws*ts*ts));
}
if(INVMAT1==1){
if(PARAMETERIZATION==1){
ppi_ref=prho[j][i]*ppi[j][i]*ppi[j][i];}
if(INVMAT1==3){
if(PARAMETERIZATION==3){
ppi_ref=ppi[j][i]+2*pu[j][i];}
/* minimum phase velocity of P waves */
......@@ -141,10 +141,10 @@ void checkfd(FILE *fp, float ** prho, float ** ppi, float ** pu, float ** ptaus,
for (i=1+nfw;i<=(nx-nfw);i++){
for (j=ny1;j<=(ny-nfw);j++){
if(INVMAT1==3){
if(PARAMETERIZATION==3){
c=sqrt((ppi[j][i]+2.0*pu[j][i])/prho[j][i]);}
if(INVMAT1==1){
if(PARAMETERIZATION==1){
c=ppi[j][i];}
if (cmax_p<c) cmax_p=c;
......
......@@ -30,7 +30,7 @@
void checkfd_ssg_elastic(FILE *fp, float ** prho, float ** ppi, float ** pu, float *hc){
extern float DH, DT, TS;
extern int NX, NY, MYID, INVMAT1, FW;
extern int NX, NY, MYID, PARAMETERIZATION, FW;
/* local variables */
......@@ -52,10 +52,10 @@ void checkfd_ssg_elastic(FILE *fp, float ** prho, float ** ppi, float ** pu, flo
for (i=1+nfw;i<=(nx-nfw);i++){
for (j=ny1;j<=(ny-nfw);j++){
if(INVMAT1==3){
if(PARAMETERIZATION==3){
c=sqrt(pu[j][i]/prho[j][i]);}
if(INVMAT1==1){
if(PARAMETERIZATION==1){
c=pu[j][i];}
if (cmax_s<c) cmax_s=c;
......@@ -70,10 +70,10 @@ void checkfd_ssg_elastic(FILE *fp, float ** prho, float ** ppi, float ** pu, flo
for (i=1+nfw;i<=(nx-nfw);i++){
for (j=ny1;j<=(ny-nfw);j++){
if(INVMAT1==3){
if(PARAMETERIZATION==3){
c=sqrt((ppi[j][i]+2.0*pu[j][i])/prho[j][i]);}
if(INVMAT1==1){
if(PARAMETERIZATION==1){
c=ppi[j][i];}
if (cmax_p<c) cmax_p=c;
......
......@@ -30,7 +30,7 @@
void checkfd_ssg_visc(FILE *fp, float ** prho, float ** ppi, float ** pu, float ** ptaus, float ** ptaup, float *peta, float *hc){
extern float DH, DT, TS;
extern int NX, NY, MYID, INVMAT1, FW, L, NT, NDT;
extern int NX, NY, MYID, PARAMETERIZATION, FW, L, NT, NDT;
extern int SEISMO, SEIS_FORMAT[6];
/* local variables */
......@@ -63,9 +63,9 @@ void checkfd_ssg_visc(FILE *fp, float ** prho, float ** ppi, float ** pu, float
sumu=sumu+((ws*ws*ts*ts*ptaus[j][i])/(1.0+ws*ws*ts*ts));
}
if(INVMAT1==1){
if(PARAMETERIZATION==1){
pu_ref=prho[j][i]*pu[j][i]*pu[j][i];}
if(INVMAT1==3){
if(PARAMETERIZATION==3){
pu_ref=pu[j][i];}
......@@ -96,9 +96,9 @@ void checkfd_ssg_visc(FILE *fp, float ** prho, float ** ppi, float ** pu, float
sumpi=sumpi+((ws*ws*ts*ts*ptaup[j][i])/(1.0+ws*ws*ts*ts));
}
if(INVMAT1==1){
if(PARAMETERIZATION==1){
ppi_ref=prho[j][i]*ppi[j][i]*ppi[j][i];}
if(INVMAT1==3){
if(PARAMETERIZATION==3){
ppi_ref=ppi[j][i]+2*pu[j][i];}
/* minimum phase velocity of P waves */
......
......@@ -43,7 +43,7 @@ void exchange_par(void){
extern char JACOBIAN[STRING_SIZE], DATA_DIR[STRING_SIZE], INV_MODELFILE[STRING_SIZE], FREQ_FILE[STRING_SIZE];
extern int RUN_MULTIPLE_SHOTS, TAPERLENGTH, INVTYPE;
extern int NPROC, NPROCX, NPROCY, MYID, IDX, IDY;
extern int GRADT1, GRADT2, GRADT3, GRADT4, ITERMAX, INVMAT1, INVMAT, ADJOINT_TYPE;
extern int GRADT1, GRADT2, GRADT3, GRADT4, ITERMAX, PARAMETERIZATION, FORWARD_ONLY, ADJOINT_TYPE;
extern int GRAD_METHOD;
extern float TSHIFT_back;
extern int MODEL_FILTER, FILT_SIZE;
......@@ -252,9 +252,9 @@ void exchange_par(void){
idum[38] = GRADT3;
idum[39] = GRADT4;
idum[40] = ITERMAX;
idum[41] = INVMAT1;
idum[41] = PARAMETERIZATION;
idum[42] = FW;
idum[43] = INVMAT;
idum[43] = FORWARD_ONLY;
idum[44] = ADJOINT_TYPE;
idum[45] = TESTSHOT_START;
......@@ -527,9 +527,9 @@ void exchange_par(void){
GRADT3 = idum[38];
GRADT4 = idum[39];
ITERMAX = idum[40];
INVMAT1 = idum[41];
PARAMETERIZATION = idum[41];
FW = idum[42];
INVMAT = idum[43];
FORWARD_ONLY = idum[43];
ADJOINT_TYPE = idum[44];
TESTSHOT_START = idum[45];
......
......@@ -65,7 +65,7 @@ void calc_mat_change(float ** waveconv, float ** waveconv_rho, float ** waveco
float ** unp1, int iter, int epstest, int calcneweps, float eps_scale_vp, float eps_scale_vs);
void calc_mat_change_test(float ** waveconv, float ** waveconv_rho, float ** waveconv_u, float ** rho, float ** rhonp1, float ** pi, float ** pinp1, float ** u, float ** unp1, int iter,
int epstest, int INVMAT, float eps_scale, int itest, int nfstart, float ** u_start, float ** pi_start, float ** rho_start,int wavetype_start,float **bfgsmod,int bfgsnum,int bfgspar,float Vs_avg,float Vp_avg,float rho_avg,int LBFGS_iter_start);
int epstest, int FORWARD_ONLY, float eps_scale, int itest, int nfstart, float ** u_start, float ** pi_start, float ** rho_start,int wavetype_start,float **bfgsmod,int bfgsnum,int bfgspar,float Vs_avg,float Vp_avg,float rho_avg,int LBFGS_iter_start);
double calc_res(float **sectiondata, float **section, float **sectiondiff, float **sectiondiffold, int ntr, int ns, int LNORM, float L2, int itest, int sws, int swstestshot, int ntr_glob, int **recpos_loc, int nsrc_glob, int ishot, int iter);
......
......@@ -42,7 +42,7 @@ int WORKFLOW_STAGE;
int TAPER, TAPERLENGTH, INVTYPE;
int GRADT1,GRADT2,GRADT3,GRADT4;
int ITERMAX, REC1, REC2, INVMAT1, INVMAT, ADJOINT_TYPE;
int ITERMAX, REC1, REC2, PARAMETERIZATION, FORWARD_ONLY, ADJOINT_TYPE;
int GRAD_METHOD;
float TSHIFT_back;
int MODEL_FILTER, FILT_SIZE;
......
......@@ -23,7 +23,7 @@ void prepare_update_s(float *etajm, float *etaip, float *peta, float **fipjp, fl
float **ptausipjp, float **f, float **g, float *bip, float *bjm,
float *cip, float *cjm, float ***dip, float ***d, float ***e) {
extern int NX, NY, L, INVMAT1, MYID;
extern int NX, NY, L, PARAMETERIZATION, MYID;
extern float DT, *FL;
int i, j, l;
extern char MFILE[STRING_SIZE];
......@@ -57,7 +57,7 @@ void prepare_update_s(float *etajm, float *etaip, float *peta, float **fipjp, fl
etaip[l] = peta[l];
}
if (INVMAT1==1){
if (PARAMETERIZATION==1){
for (j=1;j<=NY;j++){
for (i=1;i<=NX;i++){
mu=(pu[j][i]*pu[j][i]*prho[j][i])/(1.0+sumu*ptaus[j][i]);
......@@ -80,7 +80,7 @@ void prepare_update_s(float *etajm, float *etaip, float *peta, float **fipjp, fl
}
}
if (INVMAT1==3){
if (PARAMETERIZATION==3){
for (j=1;j<=NY;j++){
for (i=1;i<=NX;i++){
mu=pu[j][i]/(1.0+sumu*ptaus[j][i]);
......
......@@ -41,7 +41,7 @@ void read_par_json(FILE *fp, char *fileinp){
extern char SEIS_FILE[STRING_SIZE];
extern char JACOBIAN[STRING_SIZE],DATA_DIR[STRING_SIZE],FREQ_FILE[STRING_SIZE];
extern int NPROCX, NPROCY, MYID, IDX, IDY;
extern int GRADT1, GRADT2, GRADT3, GRADT4, ITERMAX, INVMAT1, INVMAT, ADJOINT_TYPE;
extern int GRADT1, GRADT2, GRADT3, GRADT4, ITERMAX, PARAMETERIZATION, FORWARD_ONLY, ADJOINT_TYPE;
extern int GRAD_METHOD;
extern float TSHIFT_back;
extern int FILT_SIZE, MODEL_FILTER;
......@@ -431,17 +431,17 @@ void read_par_json(FILE *fp, char *fileinp){
section inversion parameters
=================================*/
if (get_int_from_objectlist("INVMAT1",number_readobjects,&INVMAT1,varname_list, value_list))
err("Variable INVMAT1 could not be retrieved from the json input file!");
if (get_int_from_objectlist("PARAMETERIZATION",number_readobjects,&PARAMETERIZATION,varname_list, value_list))
err("Variable PARAMETERIZATION could not be retrieved from the json input file!");
else
if(ACOUSTIC){
INVMAT1=1;
fprintf(fp,"For acoustic modelling only INVMAT1=%d possible.\n",INVMAT1);}
PARAMETERIZATION=1;
fprintf(fp,"For acoustic modelling only PARAMETERIZATION=%d possible.\n",PARAMETERIZATION);}
if (get_int_from_objectlist("INVMAT",number_readobjects,&INVMAT,varname_list, value_list))
err("Variable INVMAT could not be retrieved from the json input file!");
if (get_int_from_objectlist("FORWARD_ONLY",number_readobjects,&FORWARD_ONLY,varname_list, value_list))
err("Variable FORWARD_ONLY could not be retrieved from the json input file!");
else {
if (INVMAT==0) { /* FWI is calculated */
if (FORWARD_ONLY==0) { /* FWI is calculated */
/* General inversion parameters */
if (get_int_from_objectlist("ITERMAX",number_readobjects,&ITERMAX,varname_list, value_list))
......@@ -862,9 +862,10 @@ void read_par_json(FILE *fp, char *fileinp){
err("Variable GAMMA could not be retrieved from the json input file!");
}
}
} /* end if (INVMAT==0) */
} /* end if (FORWARD_ONLY==0) */
else {
if (INVMAT==10){ /* only forward modeling is applied */
if (FORWARD_ONLY>0){ /* only forward modeling is applied */
FORWARD_ONLY=1;
ITERMAX=1;
strcpy(INV_MODELFILE,MFILE);
DTINV=1;
......
......@@ -32,7 +32,7 @@ void readmod(float ** rho, float ** pi, float ** u, float ** taus, float **
extern float DT, *FL, TAU;
extern int L,WAVETYPE, VERBOSE;
extern int NX, NY, NXG, NYG, POS[3], MYID, INVMAT1;
extern int NX, NY, NXG, NYG, POS[3], MYID, PARAMETERIZATION;
extern char MFILE[STRING_SIZE];
extern FILE *FP;
......@@ -55,7 +55,7 @@ void readmod(float ** rho, float ** pi, float ** u, float ** taus, float **
/* read density and seismic velocities */
/* ----------------------------------- */
if(INVMAT1==1){
if(PARAMETERIZATION==1){
if(WAVETYPE==1||WAVETYPE==3){
fprintf(FP,"\t Vp:\n\t %s.vp\n\n",MFILE);
......@@ -101,7 +101,7 @@ void readmod(float ** rho, float ** pi, float ** u, float ** taus, float **
/* read density and Lame parameters */
/* ----------------------------------- */
if(INVMAT1==3){
if(PARAMETERIZATION==3){
fprintf(FP,"\t Lame parameter lambda:\n\t %s.lam\n\n",MFILE);
sprintf(filename,"%s.lam",MFILE);
fp_vp=fopen(filename,"r");
......@@ -194,26 +194,26 @@ void readmod(float ** rho, float ** pi, float ** u, float ** taus, float **
/* each PE writes his model to disk */
if(WAVETYPE==1||WAVETYPE==3){
if(INVMAT1==1) sprintf(filename,"%s.out.vp",MFILE);
if(INVMAT1==3) sprintf(filename,"%s.out.pi",MFILE);
if(PARAMETERIZATION==1) sprintf(filename,"%s.out.vp",MFILE);
if(PARAMETERIZATION==3) sprintf(filename,"%s.out.pi",MFILE);
writemod(filename,pi,3);
MPI_Barrier(MPI_COMM_WORLD);
if (MYID==0) mergemod(filename,3);
MPI_Barrier(MPI_COMM_WORLD);
if(INVMAT1==1) sprintf(filename,"%s.out.vp.%i.%i",MFILE,POS[1],POS[2]);
if(INVMAT1==3) sprintf(filename,"%s.out.pi.%i.%i",MFILE,POS[1],POS[2]);
if(PARAMETERIZATION==1) sprintf(filename,"%s.out.vp.%i.%i",MFILE,POS[1],POS[2]);
if(PARAMETERIZATION==3) sprintf(filename,"%s.out.pi.%i.%i",MFILE,POS[1],POS[2]);
remove(filename);
}
if(INVMAT1==1) sprintf(filename,"%s.out.vs",MFILE);
if(INVMAT1==3) sprintf(filename,"%s.out.mu",MFILE);
if(PARAMETERIZATION==1) sprintf(filename,"%s.out.vs",MFILE);
if(PARAMETERIZATION==3) sprintf(filename,"%s.out.mu",MFILE);
writemod(filename,u,3);
MPI_Barrier(MPI_COMM_WORLD);
if (MYID==0) mergemod(filename,3);
MPI_Barrier(MPI_COMM_WORLD);
if(INVMAT1==1) sprintf(filename,"%s.out.vs.%i.%i",MFILE,POS[1],POS[2]);
if(INVMAT1==3) sprintf(filename,"%s.out.mu.%i.%i",MFILE,POS[1],POS[2]);
if(PARAMETERIZATION==1) sprintf(filename,"%s.out.vs.%i.%i",MFILE,POS[1],POS[2]);
if(PARAMETERIZATION==3) sprintf(filename,"%s.out.mu.%i.%i",MFILE,POS[1],POS[2]);
remove(filename);
......
......@@ -31,7 +31,7 @@
void readmod_acoustic(float ** rho, float ** pi){
extern int NX, NY, NXG, NYG, POS[3], MYID, INVMAT1;
extern int NX, NY, NXG, NYG, POS[3], MYID, PARAMETERIZATION;
extern char MFILE[STRING_SIZE];
extern FILE *FP;
......@@ -47,7 +47,7 @@ void readmod_acoustic(float ** rho, float ** pi){
/* read density and seismic velocities */
/* ----------------------------------- */
if(INVMAT1==1){
if(PARAMETERIZATION==1){
fprintf(FP,"\t Vp:\n\t %s.vp\n\n",MFILE);
sprintf(filename,"%s.vp",MFILE);
fp_vp=fopen(filename,"r");
......
......@@ -31,7 +31,7 @@
void readmod_elastic(float ** rho, float ** pi, float ** u){
extern int NX, NY, NXG, NYG, POS[3], MYID, INVMAT1,WAVETYPE;
extern int NX, NY, NXG, NYG, POS[3], MYID, PARAMETERIZATION,WAVETYPE;
extern char MFILE[STRING_SIZE];
extern FILE *FP;
......@@ -49,7 +49,7 @@ void readmod_elastic(float ** rho, float ** pi, float ** u){
/* read density and seismic velocities */
/* ----------------------------------- */
if(INVMAT1==1){
if(PARAMETERIZATION==1){
if(WAVETYPE==1||WAVETYPE==3){
fprintf(FP,"\t Vp:\n\t %s.vp\n\n",MFILE);
......@@ -74,7 +74,7 @@ void readmod_elastic(float ** rho, float ** pi, float ** u){
/* read density and Lame parameters */
/* ----------------------------------- */
if(INVMAT1==3){
if(PARAMETERIZATION==3){
fprintf(FP,"\t Lame parameter lambda:\n\t %s.lam\n\n",MFILE);
sprintf(filename,"%s.lam",MFILE);
fp_vp=fopen(filename,"r");
......@@ -133,26 +133,26 @@ void readmod_elastic(float ** rho, float ** pi, float ** u){
/* each PE writes his model to disk */
if(WAVETYPE==1||WAVETYPE==3){
if(INVMAT1==1) sprintf(filename,"%s.out.vp",MFILE);
if(INVMAT1==3) sprintf(filename,"%s.out.pi",MFILE);
if(PARAMETERIZATION==1) sprintf(filename,"%s.out.vp",MFILE);
if(PARAMETERIZATION==3) sprintf(filename,"%s.out.pi",MFILE);
writemod(filename,pi,3);
MPI_Barrier(MPI_COMM_WORLD);
if (MYID==0) mergemod(filename,3);
MPI_Barrier(MPI_COMM_WORLD);
if(INVMAT1==1) sprintf(filename,"%s.out.vp.%i.%i",MFILE,POS[1],POS[2]);
if(INVMAT1==3) sprintf(filename,"%s.out.pi.%i.%i",MFILE,POS[1],POS[2]);
if(PARAMETERIZATION==1) sprintf(filename,"%s.out.vp.%i.%i",MFILE,POS[1],POS[2]);
if(PARAMETERIZATION==3) sprintf(filename,"%s.out.pi.%i.%i",MFILE,POS[1],POS[2]);
remove(filename);
}
if(INVMAT1==1) sprintf(filename,"%s.out.vs",MFILE);
if(INVMAT1==3) sprintf(filename,"%s.out.mu",MFILE);
if(PARAMETERIZATION==1) sprintf(filename,"%s.out.vs",MFILE);
if(PARAMETERIZATION==3) sprintf(filename,"%s.out.mu",MFILE);
writemod(filename,u,3);
MPI_Barrier(MPI_COMM_WORLD);
if (MYID==0) mergemod(filename,3);
MPI_Barrier(MPI_COMM_WORLD);
if(INVMAT1==1) sprintf(filename,"%s.out.vs.%i.%i",MFILE,POS[1],POS[2]);
if(INVMAT1==3) sprintf(filename,"%s.out.mu.%i.%i",MFILE,POS[1],POS[2]);
if(PARAMETERIZATION==1) sprintf(filename,"%s.out.vs.%i.%i",MFILE,POS[1],POS[2]);
if(PARAMETERIZATION==3) sprintf(filename,"%s.out.mu.%i.%i",MFILE,POS[1],POS[2]);
remove(filename);
......
......@@ -31,7 +31,7 @@ void saveseis_glob(FILE *fp, float **sectionvx, float **sectionvy,float **sectio
* 3== filtered measured data
*/
extern int SEISMO, SEIS_FORMAT, RUN_MULTIPLE_SHOTS, WAVETYPE, VERBOSE,INVMAT;
extern int SEISMO, SEIS_FORMAT, RUN_MULTIPLE_SHOTS, WAVETYPE, VERBOSE,FORWARD_ONLY;
extern char SEIS_FILE[STRING_SIZE];
char vxf[STRING_SIZE], vyf[STRING_SIZE],vzf[STRING_SIZE], curlf[STRING_SIZE], divf[STRING_SIZE], pf[STRING_SIZE];
......@@ -76,7 +76,7 @@ void saveseis_glob(FILE *fp, float **sectionvx, float **sectionvy,float **sectio
break;
}
if(INVMAT==10){
if(FORWARD_ONLY==1){
sprintf(vxf,"%s_vx.su.shot%d",SEIS_FILE,ishot);
sprintf(vyf,"%s_vy.su.shot%d",SEIS_FILE,ishot);
if(WAVETYPE==2