Commit bd997067 authored by laura.gassner's avatar laura.gassner

re-add parameters and changes that got lost during merging

parent 09f6740a
......@@ -78,7 +78,7 @@ int main(int argc, char **argv){
** sectionvydiff=NULL, ** sectionpn=NULL, ** sectionread=NULL, ** sectionvy_conv=NULL, ** sectionvy_obs=NULL, ** sectionvx_conv=NULL,** sectionvx_obs=NULL, ** sectionvz_conv=NULL,** sectionvz_obs=NULL,
** sectionp_conv=NULL,** sectionp_obs=NULL, * source_time_function=NULL;
float ** absorb_coeff, ** taper_coeff, * epst1, * epst2, * epst3, * picked_times;
float ** srcpos=NULL, **srcpos_loc=NULL, ** srcpos1=NULL, **srcpos_loc_back=NULL, ** signals=NULL,** signals_SH=NULL, ** signals_rec=NULL, *hc=NULL, ** dsignals=NULL;
float ** srcpos=NULL, **srcpos_loc=NULL, ** srcpos1=NULL, **srcpos_loc_back=NULL, ** signals=NULL,** signals_SH=NULL, ** signals_rec=NULL, *hc=NULL;
int ** recpos=NULL, ** recpos_loc=NULL;
/*int ** tracekill=NULL, TRKILL, DTRKILL;*/
int * DTINV_help;
......@@ -4285,7 +4285,6 @@ int main(int argc, char **argv){
if (nsrc_loc>0){
free_matrix(signals,1,nsrc_loc,1,NT);
if(INV_STF==1) free_matrix(dsignals,1,nsrc_loc,1,NT);
free_matrix(srcpos_loc,1,8,1,nsrc_loc);
free_matrix(srcpos_loc_back,1,6,1,nsrc_loc);
}
......
......@@ -72,7 +72,8 @@ void exchange_par(void){
extern float PRO;
extern int TRKILL, TRKILL_STF;
extern char TRKILL_FILE[STRING_SIZE], TRKILL_FILE_STF[STRING_SIZE];
extern int TIMEWIN, NORMALIZE;
extern int TAPER_STF;
extern int TIMEWIN, NORMALIZE, TW_IND;
extern float TWLENGTH_PLUS, TWLENGTH_MINUS, GAMMA;
extern char PICKS_FILE[STRING_SIZE];
extern char MISFIT_LOG_FILE[STRING_SIZE];
......@@ -349,6 +350,9 @@ void exchange_par(void){
idum[110]=WRITE_FILTERED_DATA;
idum[111]=TAPER_STF;
idum[112]=TW_IND;
} /** if (MYID == 0) **/
if (MYID != 0) FL=vector(1,L);
......@@ -619,6 +623,10 @@ void exchange_par(void){
WRITE_FILTERED_DATA=idum[110];
TAPER_STF=idum[111];
TW_IND=idum[112];
MPI_Bcast(&FL[1],L,MPI_FLOAT,0,MPI_COMM_WORLD);
}
......@@ -52,8 +52,8 @@ float ** srcpos_loc, float ** signals, int nsrc, int sw){
// amp = signals[l][nt]; //unscaled explosive source
if(!ACOUSTIC){
sxx[j][i]+=amp;
syy[j][i]+=amp;
sxx[j][i]+=0.5*amp;
syy[j][i]+=0.5*amp;
}else
sp[j][i]+=amp;
}}
......@@ -67,8 +67,8 @@ float ** srcpos_loc, float ** signals, int nsrc, int sw){
amp = signals[l][nt];
if(!ACOUSTIC){
sxx[j][i]+=amp;
syy[j][i]+=amp;
sxx[j][i]+=0.5*amp;
syy[j][i]+=0.5*amp;
}else
sp[j][i]+=amp;
}
......
......@@ -80,8 +80,10 @@ void read_par_json(FILE *fp, char *fileinp){
extern int TRKILL_STF;
extern char TRKILL_FILE_STF[STRING_SIZE];
extern int TAPER_STF;
extern int TIMEWIN, NORMALIZE;
extern int TIMEWIN, NORMALIZE, TW_IND;
extern float TWLENGTH_PLUS, TWLENGTH_MINUS, GAMMA;
extern char PICKS_FILE[STRING_SIZE];
......@@ -413,12 +415,6 @@ void read_par_json(FILE *fp, char *fileinp){
if (get_int_from_objectlist("ACOUSTIC",number_readobjects,&ACOUSTIC,varname_list, value_list)){
ACOUSTIC=0;
fprintf(fp,"Variable ACOUSTIC is set to default value %d.\n",ACOUSTIC);}
else if(ACOUSTIC==1){
FDORDER=2;
fprintf(fp,"For acoustic modelling only FDORDER=%d possible.\n",FDORDER);
if(L)
err("No viscoacoustic modelling implemented yet");
} else if(ACOUSTIC>1) err("Only ACOUSTIC=0 ((visco-)elastic Modelling and Inversion) or ACOUSTIC=1 (acoustic Modelling and Inversion) possible");
/*=================================
......@@ -572,8 +568,10 @@ void read_par_json(FILE *fp, char *fileinp){
if (SWS_TAPER_FILE==1){
if (get_string_from_objectlist("TAPER_FILE_NAME",number_readobjects,TAPER_FILE_NAME,varname_list, value_list))
err("Variable TAPER_FILE_NAME could not be retrieved from the json input file!");
if (get_string_from_objectlist("TAPER_FILE_NAME_U",number_readobjects,TAPER_FILE_NAME_U,varname_list, value_list))
err("Variable TAPER_FILE_NAME_U could not be retrieved from the json input file!");
if(!ACOUSTIC){
if (get_string_from_objectlist("TAPER_FILE_NAME_U",number_readobjects,TAPER_FILE_NAME_U,varname_list, value_list))
err("Variable TAPER_FILE_NAME_U could not be retrieved from the json input file!");
}
if (get_string_from_objectlist("TAPER_FILE_NAME_RHO",number_readobjects,TAPER_FILE_NAME_RHO,varname_list, value_list))
err("Variable TAPER_FILE_NAME_RHO could not be retrieved from the json input file!");}
if (get_int_from_objectlist("SWS_TAPER_FILE_PER_SHOT",number_readobjects,&SWS_TAPER_FILE_PER_SHOT,varname_list, value_list)){
......@@ -757,19 +755,23 @@ void read_par_json(FILE *fp, char *fileinp){
}
}
/* Trace killing STF */
if (get_int_from_objectlist("TRKILL_STF",number_readobjects,&TRKILL_STF,varname_list, value_list)){
TRKILL_STF=0;
fprintf(fp,"Variable TRKILL_STF is set to default value %d.\n",TRKILL_STF);}
else {
if (TRKILL_STF==1) {
if (get_string_from_objectlist("TRKILL_FILE_STF",number_readobjects,TRKILL_FILE_STF,varname_list, value_list))
err("Variable TRKILL_FILE_STF could not be retrieved from the json input file!");
if(INV_STF){
/* Trace killing STF */
if (get_int_from_objectlist("TRKILL_STF",number_readobjects,&TRKILL_STF,varname_list, value_list)){
TRKILL_STF=0;
fprintf(fp,"Variable TRKILL_STF is set to default value %d.\n",TRKILL_STF);}
else {
if (TRKILL_STF==1) {
if (get_string_from_objectlist("TRKILL_FILE_STF",number_readobjects,TRKILL_FILE_STF,varname_list, value_list))
err("Variable TRKILL_FILE_STF could not be retrieved from the json input file!");
}
}
/* Taper STF */
if (get_int_from_objectlist("TAPER_STF",number_readobjects,&TAPER_STF,varname_list, value_list)){
TAPER_STF=0;
fprintf(fp,"Variable TAPER_STF is set to default value %d.\n",TAPER_STF);}
}
/* Frequency filtering during inversion */
if (get_int_from_objectlist("TIME_FILT",number_readobjects,&TIME_FILT,varname_list, value_list)){
TIME_FILT=0;
......@@ -856,6 +858,9 @@ void read_par_json(FILE *fp, char *fileinp){
fprintf(fp,"Variable TIMEWIN is set to default value %d.\n",TIMEWIN);}
else {
if (TIMEWIN==1){
if (get_int_from_objectlist("TW_IND",number_readobjects,&TW_IND,varname_list, value_list)){
TW_IND=0;
fprintf(fp,"Variable TW_IND is set to default value %d.\n",TW_IND);}
if (get_string_from_objectlist("PICKS_FILE",number_readobjects,PICKS_FILE,varname_list, value_list))
err("Variable PICKS_FILE could not be retrieved from the json input file!");
if (get_float_from_objectlist("TWLENGTH_PLUS",number_readobjects,&TWLENGTH_PLUS,varname_list, value_list))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment