Commit 7ec03a56 authored by Tilman Steinweg's avatar Tilman Steinweg

several changes on input reading and processing

defined optinal parameters
READREC is now the switch for 0-receiver line / 1-from file / 2-receiver array
using only one receiver specified in the input file is now possible.
if rec array is used checkfd_ssg was checking the wrong input parameters from the .inp files
etc.
parent 690bd3bf
......@@ -25,7 +25,6 @@
"Source" : "comment",
"SOURCE_SHAPE" : "4",
"SOURCE_TYPE" : "4",
"SIGNAL_FILE" : "./STF/stf.su",
"SRCREC" : "1",
"SOURCE_FILE" : "./sources/sources_toy.dat",
"RUN_MULTIPLE_SHOTS" : "1",
......@@ -37,8 +36,6 @@
"Q-approximation" : "comment",
"L" : "0",
"FL1" : "1000.0",
"TAU" : "0.000001",
"Free Surface" : "comment",
"FREE_SURF" : "0",
......@@ -49,26 +46,13 @@
"FW" : "10",
"VPPML" : "6200.0",
"FPML" : "200.00",
"BOUNDARY" : "0",
"Snapshots" : "comment",
"SNAP" : "0",
"TSNAP1" : "0.01",
"TSNAP2" : "0.24",
"TSNAPINC" : "0.0075",
"IDX, IDY, IDZ" : "1,1,1",
"SNAP_FORMAT" : "4",
"SNAP_FILE" : "./snap/back",
"SNAP_PLANE" : "1",
"Receiver" : "comment",
"SEISMO" : "1",
"READREC" : "0",
"REC_FILE" : "./receiver/receiver.dat",
"REFRECX, REFRECY, REFRECZ" : "0.0 , 0.0, 0.0",
"XREC1, YREC1, ZREC1" : "90.0 , 90.0, 90.0",
"XREC2, YREC2, ZREC2" : "90.0 , 90.0, 90.0",
"NGEOPH" : "1",
"READREC" : "2",
"Receiver array" : "comment",
"REC_ARRAY" : "1",
......@@ -80,11 +64,12 @@
"Seismograms" : "comment",
"NDT" : "1",
"NDTSHIFT" : "0",
"SEIS_FORMAT" : "1",
"SEIS_FILE" : "./su_obs/obs_toy",
"SEIS_FILE" : "./su/cal_toy",
"VERBOSE" : "0",
"Method" : "comment",
"METHOD" : "0",
......@@ -96,15 +81,14 @@
"SEIS_OBS_FILE" : "./su_obs/obs_toy",
"EXTOBS" : "0",
"INV_FILE" : "./in_and_out/workflow_toy.dat",
"HESS_FILE" : "./hess/toy_hess",
"General" : "comment",
"ITMIN, ITMAX" : "1 , 60",
"FILT" : "0",
"FILT" : "1",
"NFMAX" : "5",
"TAST" : "100",
"VP0, VS0, RHO0" : "6200.0, 3600.0, 2800.0",
"WEIGHT" : "1.0, 1.0, 0.0",
"WEIGHT_VP,WEIGHT_VS,WEIGHT_RHO" : "1.0, 1.0, 0.0",
"Steplength estimation" : "comment",
"NSHOTS_STEP" : "4",
......@@ -115,12 +99,7 @@
"Hessian" : "comment",
"HESS" : "0",
"READ_HESS" : "0",
"REC_HESS" : "1",
"WATER_HESS_VP, WATER_HESS_VS, WATER_HESS_RHO" : "0.0192, 0.0192, 1.0e-14",
"L-BFGS" : "comment",
"LBFGS" : "0",
"NUMPAR" : "2",
"BFGSNUM" : "5"
"LBFGS" : "0"
}
......@@ -25,7 +25,6 @@
"Source" : "comment",
"SOURCE_SHAPE" : "4",
"SOURCE_TYPE" : "4",
"SIGNAL_FILE" : "./STF/stf.su",
"SRCREC" : "1",
"SOURCE_FILE" : "./sources/sources_toy.dat",
"RUN_MULTIPLE_SHOTS" : "1",
......@@ -37,38 +36,23 @@
"Q-approximation" : "comment",
"L" : "0",
"FL1" : "1000.0",
"TAU" : "0.000001",
"Free Surface" : "comment",
"FREE_SURF" : "0",
"Absorbing Boundary" : "comment",
"ABS_TYPE" : "1",
"ABS_TYPE" : "1",
"FW" : "10",
"VPPML" : "6200.0",
"FPML" : "200.00",
"BOUNDARY" : "0",
"Snapshots" : "comment",
"SNAP" : "0",
"TSNAP1" : "0.01",
"TSNAP2" : "0.24",
"TSNAPINC" : "0.0075",
"IDX, IDY, IDZ" : "1,1,1",
"SNAP_FORMAT" : "4",
"SNAP_FILE" : "./snap/back",
"SNAP_PLANE" : "1",
"Receiver" : "comment",
"SEISMO" : "1",
"READREC" : "0",
"REC_FILE" : "./receiver/receiver.dat",
"REFRECX, REFRECY, REFRECZ" : "0.0 , 0.0, 0.0",
"XREC1, YREC1, ZREC1" : "90.0 , 90.0, 90.0",
"XREC2, YREC2, ZREC2" : "90.0 , 90.0, 90.0",
"NGEOPH" : "1",
"READREC" : "2",
"Receiver array" : "comment",
"REC_ARRAY" : "1",
......@@ -80,7 +64,6 @@
"Seismograms" : "comment",
"NDT" : "1",
"NDTSHIFT" : "0",
"SEIS_FORMAT" : "1",
"SEIS_FILE" : "./su_obs/obs_toy",
......
......@@ -69,7 +69,7 @@ PARTMODEL_SCR = \
util.c
FDMPI_UTIL = \
IFOS_UTIL = \
absorb.c \
av_mat.c \
comm_ini.c \
......@@ -99,7 +99,7 @@ FDMPI_UTIL = \
writepar.c \
rwsegy.c \
FDMPI_SRC = \
IFOS_SRC = \
ifos3d.c \
comm_ini_s.c \
checkfd_ssg.c \
......@@ -146,12 +146,12 @@ FDMPI_SRC = \
lbfgs_save.c \
constant_boundary.c \
$(MODEL_SCR) \
$(FDMPI_UTIL)
$(IFOS_UTIL)
# model_gauss.c \
FDMPI_OBJ = $(FDMPI_SRC:%.c=%.o)
FDMPI_OBJ_RSG = $(FDMPI_SRC_RSG:%.c=%.o)
IFOS_OBJ = $(IFOS_SRC:%.c=%.o)
IFOS_OBJ_RSG = $(IFOS_SRC_RSG:%.c=%.o)
# FDMPI_ACOUSTIC_OBJ = $(FDMPI_ACOUSTIC_SRC:%.c=%.o)
# SNAPMERGE_OBJ = $(SNAPMERGE_SCR:%.c=%.o)
# PARTMODEL_OBJ = $(PARTMODEL_SCR:%.c=%.o)
......@@ -166,8 +166,8 @@ snapmerge: $(SNAPMERGE_OBJ)
# part_model: $(PARTMODEL_OBJ)
# $(CC) $(LFLAGS) $(PARTMODEL_OBJ) -o ../bin/partmodel
ifos3d: $(FDMPI_OBJ)
$(CC) $(SFLAGS) $(FDMPI_OBJ) $(LFLAGS) -o ../bin/ifos3d
ifos3d: $(IFOS_OBJ)
$(CC) $(SFLAGS) $(IFOS_OBJ) $(LFLAGS) -o ../bin/ifos3d
clean:
......
......@@ -590,7 +590,7 @@ float *** ptaus, float *** ptaup, float *peta, float **srcpos, int nsrc, int **r
srec_miny=ZREC1;
}
}
if (READREC==1) {
if ((READREC==1) || (READREC=2)){
/* find maximum and minimum source positions coordinate ---- from receiver file*/
for (k=1;k<=ntr;k++){
/* find maximum source positions coordinate*/
......
......@@ -145,7 +145,7 @@ int read_par(FILE *fp_in){
}
break;
case 21 :
nvarin=sscanf(cline,"%s =%s , %i , %i , %i , %i , %i , %i",s,SIGNAL_FILE,&SIGNAL_FORMAT);
nvarin=sscanf(cline,"%s =%s , %i ",s,SIGNAL_FILE,&SIGNAL_FORMAT);
switch(nvarin){
case 0:
case 1: strcpy(SIGNAL_FILE,"\0");
......@@ -192,7 +192,7 @@ int read_par(FILE *fp_in){
}
break;
case 25 :
nvarin=sscanf(cline,"%s =%i , %i , %i , %i , %i , %i , %i",s,&READMOD,&MOD_FORMAT);
nvarin=sscanf(cline,"%s =%i , %i ",s,&READMOD,&MOD_FORMAT);
switch(nvarin){
case 0:
case 1: READMOD=0;
......
......@@ -152,7 +152,7 @@ void read_par_json(FILE *fp, char *fileinp) {
} else {
if (get_int_from_objectlist("SIGNAL_FORMAT",number_readobjects,&SIGNAL_FORMAT,varname_list, value_list)) {
SIGNAL_FORMAT=1;
}
}
}
......@@ -183,16 +183,19 @@ void read_par_json(FILE *fp, char *fileinp) {
SRC_MF=0;
}
if (get_float_from_objectlist("REFSRC0",number_readobjects,&REFSRC[0],varname_list, value_list)) {
if (get_float_from_objectlist("REFSRCX",number_readobjects,&REFSRC[0],varname_list, value_list)) {
REFSRC[0]=0.0;
fprintf(fp,"Variable REFSRCX is set to default value %1f.\n",REFSRC[0]);
}
if (get_float_from_objectlist("REFSRC1",number_readobjects,&REFSRC[1],varname_list, value_list)) {
if (get_float_from_objectlist("REFSRCZ",number_readobjects,&REFSRC[1],varname_list, value_list)) {
REFSRC[1]=0.0;
fprintf(fp,"Variable REFSRCZ is set to default value %1f.\n",REFSRC[1]);
}
if (get_float_from_objectlist("REFSRC2",number_readobjects,&REFSRC[2],varname_list, value_list)) {
if (get_float_from_objectlist("REFSRCY",number_readobjects,&REFSRC[2],varname_list, value_list)) {
REFSRC[2]=0.0;
fprintf(fp,"Variable REFSRCY is set to default value %1f.\n",REFSRC[2]);
}
......@@ -238,7 +241,7 @@ void read_par_json(FILE *fp, char *fileinp) {
section general model and log parameters
=================================*/
if (get_int_from_objectlist("VERBOSE",number_readobjects,&VERBOSE,varname_list, value_list)) {
VERBOSE=0;
VERBOSE=1;
fprintf(fp,"Variable VERBOSE is set to value %d.\n",VERBOSE);
}
......@@ -279,10 +282,11 @@ void read_par_json(FILE *fp, char *fileinp) {
break;
}
if (get_float_from_objectlist("TAU",number_readobjects,&TAU,varname_list, value_list)) {
err("Variable TAU could not be retrieved from the json input file!");
if (L) {
if (get_float_from_objectlist("TAU",number_readobjects,&TAU,varname_list, value_list)) {
err("Variable TAU could not be retrieved from the json input file!");
}
}
}
/*=================================
......@@ -294,7 +298,8 @@ void read_par_json(FILE *fp, char *fileinp) {
}
if (get_int_from_objectlist("BOUNDARY",number_readobjects,&BOUNDARY,varname_list, value_list)) {
err("Variable BOUNDARY could not be retrieved from the json input file!");
BOUNDARY=0;
fprintf(fp,"Variable BOUNDARY is set to default value %d.\n",BOUNDARY);
}
if (get_int_from_objectlist("ABS_TYPE",number_readobjects,&ABS_TYPE,varname_list, value_list)) {
......@@ -326,8 +331,7 @@ void read_par_json(FILE *fp, char *fileinp) {
section snapshot parameters
=================================*/
if (get_int_from_objectlist("SNAP",number_readobjects,&SNAP,varname_list, value_list)) {
SNAP=0;
fprintf(fp,"Variable SNAP is set to default value %d.\n",SNAP);
err("Variable SNAP not be retrieved from the json input file!");
} else {
if (SNAP>0) {
......@@ -368,12 +372,12 @@ void read_par_json(FILE *fp, char *fileinp) {
if (get_int_from_objectlist("IDZ",number_readobjects,&IDY,varname_list, value_list)) {
IDY=1;
fprintf(fp,"Variable IDY is set to default value %d.\n",IDY);
fprintf(fp,"Variable IDZ is set to default value %d.\n",IDY);
}
if (get_int_from_objectlist("IDY",number_readobjects,&IDZ,varname_list, value_list)) {
IDY=1;
fprintf(fp,"Variable IDZ is set to default value %d.\n",IDY);
IDZ=1;
fprintf(fp,"Variable IDY is set to default value %d.\n",IDZ);
}
/*=================================
......@@ -389,119 +393,132 @@ void read_par_json(FILE *fp, char *fileinp) {
err("Variable SEIS_FILE could not be retrieved from the json input file!");
}
if (get_float_from_objectlist("REFRECX",number_readobjects,&REFREC[1],varname_list, value_list)) {
err("Variable REFRECX could not be retrieved from the json input file!");
}
if (get_float_from_objectlist("REFRECZ",number_readobjects,&REFREC[2],varname_list, value_list)) {
err("Variable REFRECZ could not be retrieved from the json input file!");
}
if (get_float_from_objectlist("REFRECY",number_readobjects,&REFREC[3],varname_list, value_list)) {
err("Variable REFRECY could not be retrieved from the json input file!");
}
if (get_int_from_objectlist("READREC",number_readobjects,&READREC,varname_list, value_list)) {
err("Variable READREC could not be retrieved from the json input file!");
}
else {
if (READREC==0) {
if (get_float_from_objectlist("XREC1",number_readobjects,&XREC1,varname_list, value_list)) {
err("Variable XREC1 could not be retrieved from the json input file!");
}
switch (READREC) {
case 0 : /*Receiver line*/
if (get_float_from_objectlist("XREC1",number_readobjects,&XREC1,varname_list, value_list)) {
err("Variable XREC1 could not be retrieved from the json input file!");
}
if (get_float_from_objectlist("XREC2",number_readobjects,&XREC2,varname_list, value_list)) {
err("Variable XREC2T could not be retrieved from the json input file!");
}
if (get_float_from_objectlist("XREC2",number_readobjects,&XREC2,varname_list, value_list)) {
err("Variable XREC2T could not be retrieved from the json input file!");
}
if (get_float_from_objectlist("YREC1",number_readobjects,&ZREC1,varname_list, value_list)) {
err("Variable YREC1 could not be retrieved from the json input file!");
}
if (get_float_from_objectlist("YREC1",number_readobjects,&ZREC1,varname_list, value_list)) {
err("Variable YREC1 could not be retrieved from the json input file!");
}
if (get_float_from_objectlist("YREC2",number_readobjects,&ZREC2,varname_list, value_list)) {
err("Variable YREC2 could not be retrieved from the json input file!");
}
if (get_float_from_objectlist("YREC2",number_readobjects,&ZREC2,varname_list, value_list)) {
err("Variable YREC2 could not be retrieved from the json input file!");
}
if (get_float_from_objectlist("ZREC1",number_readobjects,&YREC1,varname_list, value_list)) {
err("Variable ZREC1 could not be retrieved from the json input file!");
}
if (get_float_from_objectlist("ZREC1",number_readobjects,&YREC1,varname_list, value_list)) {
err("Variable ZREC1 could not be retrieved from the json input file!");
}
if (get_float_from_objectlist("ZREC2",number_readobjects,&YREC2,varname_list, value_list)) {
err("Variable ZREC2 could not be retrieved from the json input file!");
}
if (get_float_from_objectlist("ZREC2",number_readobjects,&YREC2,varname_list, value_list)) {
err("Variable ZREC2 could not be retrieved from the json input file!");
}
if (get_int_from_objectlist("NGEOPH",number_readobjects,&NGEOPH,varname_list, value_list)) {
err("Variable NGEOPH could not be retrieved from the json input file!");
}
if (get_int_from_objectlist("NGEOPH",number_readobjects,&NGEOPH,varname_list, value_list)) {
err("Variable NGEOPH could not be retrieved from the json input file!");
}
} else {
if (get_string_from_objectlist("REC_FILE",number_readobjects,REC_FILE,varname_list, value_list)) {
err("Variable REC_FILE could not be retrieved from the json input file!");
}
}
}
break;
if (get_int_from_objectlist("REC_ARRAY",number_readobjects,&REC_ARRAY,varname_list, value_list)) {
err("Variable REC_ARRAY could not be retrieved from the json input file!");
case 1 : /*Receiver from file*/
if (get_string_from_objectlist("REC_FILE",number_readobjects,REC_FILE,varname_list, value_list)) {
err("Variable REC_FILE could not be retrieved from the json input file!");
}
} else {
if (REC_ARRAY>0) {
if (get_float_from_objectlist("REC_ARRAY_DEPTH",number_readobjects,&REC_ARRAY_DEPTH,varname_list, value_list)) {
err("Variable REC_ARRAY_DEPTH could not be retrieved from the json input file!");
}
if (get_float_from_objectlist("REFRECX",number_readobjects,&REFREC[1],varname_list, value_list)) {
err("Variable REFRECX could not be retrieved from the json input file!");
}
if (get_float_from_objectlist("REC_ARRAY_DIST",number_readobjects,&REC_ARRAY_DIST,varname_list, value_list)) {
err("Variable REC_ARRAY_DIST could not be retrieved from the json input file!");
}
if (get_float_from_objectlist("REFRECZ",number_readobjects,&REFREC[2],varname_list, value_list)) {
err("Variable REFRECZ could not be retrieved from the json input file!");
}
if (get_int_from_objectlist("DRX",number_readobjects,&DRX,varname_list, value_list)) {
err("Variable DRX could not be retrieved from the json input file!");
}
if (get_float_from_objectlist("REFRECY",number_readobjects,&REFREC[3],varname_list, value_list)) {
err("Variable REFRECY could not be retrieved from the json input file!");
}
if (get_int_from_objectlist("DRY",number_readobjects,&DRY,varname_list, value_list)) {
err("Variable DRZ could not be retrieved from the json input file!");
}
break;
case 2: /*Receiver array*/
if (get_int_from_objectlist("REC_ARRAY",number_readobjects,&REC_ARRAY,varname_list, value_list)) {
err("Variable REC_ARRAY could not be retrieved from the json input file!");
}
}
}
if (get_float_from_objectlist("REC_ARRAY_DEPTH",number_readobjects,&REC_ARRAY_DEPTH,varname_list, value_list)) {
err("Variable REC_ARRAY_DEPTH could not be retrieved from the json input file!");
}
/* --------output ----------
*------------------------*/
if (get_float_from_objectlist("REC_ARRAY_DIST",number_readobjects,&REC_ARRAY_DIST,varname_list, value_list)) {
err("Variable REC_ARRAY_DIST could not be retrieved from the json input file!");
}
if (get_int_from_objectlist("NDT",number_readobjects,&NDT,varname_list, value_list)) {
NDT=1;
fprintf(fp,"Variable NDT is set to default value %d.\n",NDT);
}
if (get_int_from_objectlist("NDTSHIFT",number_readobjects,&NDTSHIFT,varname_list, value_list)) {
NDTSHIFT=0;
fprintf(fp,"Variable NDTSHIFT is set to default value %d.\n",NDT);
}
if (get_int_from_objectlist("DRX",number_readobjects,&DRX,varname_list, value_list)) {
err("Variable DRX could not be retrieved from the json input file!");
}
if (get_int_from_objectlist("SEIS_FORMAT",number_readobjects,&SEIS_FORMAT[0],varname_list, value_list)) {
err("Variable SEIS_FORMAT could not be retrieved from the json input file!");
if (get_int_from_objectlist("DRY",number_readobjects,&DRY,varname_list, value_list)) {
err("Variable DRZ could not be retrieved from the json input file!");
}
break;
default :
err("Please choose READREC=0 (Receiver Line) ,READREC=1 (Receiver from file) or READREC=2(Receiver Array)");
} else {
if (SEIS_FORMAT[0]==4) {
SEIS_FORMAT[0]=0;
}
if (SEIS_FORMAT[0]==5) {
SEIS_FORMAT[0]=0;
SEIS_FORMAT[1]=1;
SEIS_FORMAT[3]=1;
SEIS_FORMAT[4]=0;
SEIS_FORMAT[5]=0;
}
}
if (READREC!=1) {
REFREC[0]=0.0;
REFREC[1]=0.0;
REFREC[2]=0.0;
fprintf(fp,"Variable REFREC is set to default value (%.2f,%.2f,%.2f).\n",REFREC[0],REFREC[1],REFREC[2]);
}
}
/* --------output ----------
*------------------------*/
if (get_int_from_objectlist("NDT",number_readobjects,&NDT,varname_list, value_list)) {
NDT=1;
fprintf(fp,"Variable NDT is set to default value %d.\n",NDT);
}
}
if (get_int_from_objectlist("NDTSHIFT",number_readobjects,&NDTSHIFT,varname_list, value_list)) {
NDTSHIFT=0;
fprintf(fp,"Variable NDTSHIFT is set to default value %d.\n",NDT);
}
if (get_int_from_objectlist("SEIS_FORMAT",number_readobjects,&SEIS_FORMAT[0],varname_list, value_list)) {
err("Variable SEIS_FORMAT could not be retrieved from the json input file!");
} else {
if (SEIS_FORMAT[0]==4) {
SEIS_FORMAT[0]=0;
}
if (SEIS_FORMAT[0]==5) {
SEIS_FORMAT[0]=0;
SEIS_FORMAT[1]=1;
SEIS_FORMAT[3]=1;
SEIS_FORMAT[4]=0;
SEIS_FORMAT[5]=0;
}
}
}/*end of seismo*/
if (get_int_from_objectlist("ASCIIEBCDIC",number_readobjects,&ASCIIEBCDIC,varname_list, value_list)) {
ASCIIEBCDIC=0;
......@@ -527,33 +544,6 @@ void read_par_json(FILE *fp, char *fileinp) {
else {
if (METHOD==1) { /* FWI is calculated */
/*=================================
section In- and Output Files
=================================*/
if (get_string_from_objectlist("GRAD_FILE",number_readobjects,GRAD_FILE,varname_list, value_list)) {
err("Variable GRAD_FILE could not be retrieved from the json input file!");
}
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!");
}
if (get_string_from_objectlist("SEIS_OBS_FILE",number_readobjects,SEIS_OBS_FILE,varname_list, value_list)) {
err("Variable SEIS_OBS_FILE could not be retrieved from the json input file!");
}
if (get_int_from_objectlist("EXTOBS",number_readobjects,&EXTOBS,varname_list, value_list)) {
err("Variable EXTOBS could not be retrieved from the json input file!");
}
if (get_string_from_objectlist("INV_FILE",number_readobjects,INV_FILE,varname_list, value_list)) {
err("Variable INV_FILE could not be retrieved from the json input file!");
}
if (get_string_from_objectlist("HESS_FILE",number_readobjects,HESS_FILE,varname_list, value_list)) {
err("Variable HESS_FILE could not be retrieved from the json input file!");
}
/*=================================
section General
......@@ -579,49 +569,49 @@ void read_par_json(FILE *fp, char *fileinp) {
if (get_int_from_objectlist("TAST",number_readobjects,&TAST,varname_list, value_list)) {
err("Variable TAST could not be retrieved from the json input file!");
}
if (get_float_from_objectlist("VP0",number_readobjects,&VP0,varname_list, value_list)) {
err("Variable VP0 could not be retrieved from the json input file!");
}
if (get_float_from_objectlist("VS0",number_readobjects,&VS0,varname_list, value_list)) {
err("Variable VS0 could not be retrieved from the json input file!");
}
if (get_float_from_objectlist("RHO0",number_readobjects,&RHO0,varname_list, value_list)) {
err("Variable RHO0 could not be retrieved from the json input file!");
}
if (get_float_from_objectlist("RHO0",number_readobjects,&RHO0,varname_list, value_list)) {
err("Variable RHO0 could not be retrieved from the json input file!");
}
if (get_float_from_objectlist("WEIGHT_VP",number_readobjects,&WEIGHT[0],varname_list, value_list)) {
err("Variable WEIGHT_VP could not be retrieved from the json input file!");
}
if (get_float_from_objectlist("WEIGHT_VS",number_readobjects,&WEIGHT[1],varname_list, value_list)) {
err("Variable WEIGHT_VS could not be retrieved from the json input file!");
}
if (get_float_from_objectlist("WEIGHT_RHO",number_readobjects,&WEIGHT[2],varname_list, value_list)) {
err("Variable WEIGHT_RHO could not be retrieved from the json input file!");
}
/*=================================
section Steplength estimation + Gradient preconditioning
=================================*/
if (get_int_from_objectlist("NSHOTS_STEP",number_readobjects,&NSHOTS_STEP,varname_list, value_list)) {
err("Variable NSHOTS_STEP could not be retrieved from the json input file!");
}
if (get_float_from_objectlist("TESTSTEP",number_readobjects,&TESTSTEP,varname_list, value_list)) {
err("Variable TESTSTEP could not be retrieved from the json input file!");
}
if (get_int_from_objectlist("DAMPTYPE",number_readobjects,&DAMPTYPE,varname_list, value_list)) {
err("Variable DAMPTYPE could not be retrieved from the json input file!");
}
......@@ -629,44 +619,79 @@ void read_par_json(FILE *fp, char *fileinp) {
/*=================================
section Hessian + L-BFGS
=================================*/
if (get_int_from_objectlist("HESS",number_readobjects,&HESS,varname_list, value_list)) {
err("Variable HESS could not be retrieved from the json input file!");
} else {
if (HESS) {
if (get_int_from_objectlist("READ_HESS",number_readobjects,&READ_HESS,varname_list, value_list)) {
err("Variable READ_HESS could not be retrieved from the json input file!");
}
if (get_int_from_objectlist("REC_HESS",number_readobjects,&REC_HESS,varname_list, value_list)) {
err("Variable REC_HESS could not be retrieved from the json input file!");
}
if (get_float_from_objectlist("WATER_HESS_VP",number_readobjects,&WATER_HESS[0],varname_list, value_list)) {
err("Variable WATER_HESS_VP could not be retrieved from the json input file!");
}
if (get_float_from_objectlist("WATER_HESS_VS",number_readobjects,&WATER_HESS[1],varname_list, value_list)) {
err("Variable WATER_HESS_VS could not be retrieved from the json input file!");
}
if (get_float_from_objectlist("WATER_HESS_RHO",number_readobjects,&WATER_HESS[2],varname_list, value_list)) {
err("Variable WATER_HESS_RHO could not be retrieved from the json input file!");
}
}
}
if (get_int_from_objectlist("READ_HESS",number_readobjects,&READ_HESS,varname_list, value_list)) {
err("Variable READ_HESS could not be retrieved from the json input file!");
}
if (get_int_from_objectlist("REC_HESS",number_readobjects,&REC_HESS,varname_list, value_list)) {
err("Variable REC_HESS could not be retrieved from the json input file!");
if (get_int_from_objectlist("LBFGS",number_readobjects,&LBFGS,varname_list, value_list)) {
err("Variable LBFGS could not be retrieved from the json input file!");
} else {
if (LBFGS) {
if (get_int_from_objectlist("NUMPAR",number_readobjects,&NUMPAR,varname_list, value_list)) {
err("Variable NUMPAR could not be retrieved from the json input file!");
}
if (get_int_from_objectlist("BFGSNUM",number_readobjects,&BFGSNUM,varname_list, value_list)) {
err("Variable BFGSNUM could not be retrieved from the json input file!");
}
}
}
if (get_float_from_objectlist("WATER_HESS_VP",number_readobjects,&WATER_HESS[0],varname_list, value_list)) {
err("Variable WATER_HESS_VP could not be retrieved from the json input file!");
/*=================================
section In- and Output Files
=================================*/
if (get_string_from_objectlist("GRAD_FILE",number_readobjects,GRAD_FILE,varname_list, value_list)) {
err("Variable GRAD_FILE could not be retrieved from the json input file!");
}
if (get_float_from_objectlist("WATER_HESS_VS",number_readobjects,&WATER_HESS[1],varname_list, value_list)) {
err("Variable WATER_HESS_VS could not be retrieved from the json input file!");
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!");
}
if (get_float_from_objectlist("WATER_HESS_RHO",number_readobjects,&WATER_HESS[2],varname_list, value_list)) {
err("Variable WATER_HESS_RHO could not be retrieved from the json input file!");
if (get_string_from_objectlist("SEIS_OBS_FILE",number_readobjects,SEIS_OBS_FILE,varname_list, value_list)) {
err("Variable SEIS_OBS_FILE could not be retrieved from the json input file!");
}
if (get_int_from_objectlist("LBFGS",number_readobjects,&LBFGS,varname_list, value_list)) {
err("Variable LBFGS could not be retrieved from the json input file!");
if (get_int_from_objectlist("EXTOBS",number_readobjects,&EXTOBS,varname_list, value_list)) {
err("Variable EXTOBS could not be retrieved from the json input file!");
}
if (get_int_from_objectlist("NUMPAR",number_readobjects,&NUMPAR,varname_list, value_list)) {
err("Variable NUMPAR could not be retrieved from the json input file!");
if (get_string_from_objectlist("INV_FILE",number_readobjects,INV_FILE,varname_list, value_list)) {
err("Variable INV_FILE could not be retrieved from the json input file!");
}
if (get_int_from_objectlist("BFGSNUM",number_readobjects,&BFGSNUM,varname_list, value_list)) {
err("Variable BFGSNUM could not be retrieved from the json input file!");
if (HESS) {
if (get_string_from_objectlist("HESS_FILE",number_readobjects,HESS_FILE,varname_list, value_list)) {
err("Variable HESS_FILE could not be retrieved from the json input file!");
}
}
} /* end if (METHOD==1) */
else {/* only forward modeling is applied */
......@@ -675,8 +700,12 @@ void read_par_json(FILE *fp, char *fileinp) {
fprintf(fp,"Variable ITMIN is set to default value %d.\n",ITMIN);
ITMAX=1;