Commit 7ec03a56 authored by tilman.metz's avatar tilman.metz

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;
......
This diff is collapsed.
This diff is collapsed.
......@@ -43,6 +43,7 @@ void writepar(FILE *fp, int ns){
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 int NUMPAR, BFGSNUM;
extern int VERBOSE;
extern float TESTSTEP,WATER_HESS[3], WEIGHT[3], VP0, VS0, RHO0;
/* definition of local variables */
......@@ -150,28 +151,34 @@ void writepar(FILE *fp, int ns){
if (SEISMO){
fprintf(fp," ------------------------- RECEIVER ------- -------------------\n");
if (READREC){
fprintf(fp," Reading receiver positions from file \n");
fprintf(fp,"\t%s\n\n",REC_FILE);
fprintf(fp," reference_point_for_receiver_coordinate_system:\n");
fprintf(fp," x=%f \ty=%f\t z=%f\n",REFREC[1], REFREC[3], REFREC[2]);
} else if (REC_ARRAY>0){
switch (READREC){
case 1:
fprintf(fp," Reading receiver positions from file \n");
fprintf(fp,"\t%s\n\n",REC_FILE);
fprintf(fp," reference_point_for_receiver_coordinate_system:\n");
fprintf(fp," x=%f \ty=%f\t z=%f\n",REFREC[1], REFREC[3], REFREC[2]);
break;
case 2:
fprintf(fp," Horitontal plane of receivers.\n");
fprintf(fp," Number of planes: %d \n",REC_ARRAY);
fprintf(fp," Depth of upper plane: %e m \n",REC_ARRAY_DEPTH);
fprintf(fp," Vertical increment between planes: %e m \n",REC_ARRAY_DIST);
fprintf(fp," Distance between receivers in x-direction within plane: %i \n", DRX);
fprintf(fp," Distance between receivers in y-direction within plane: %i \n", DRY);
}
else{
fprintf(fp," Receiver line: \n");
fprintf(fp," First receiver position (XREC1,YREC1,ZREC1) = (%5.3f, %5.3f, %5.3f m\n",
XREC1,ZREC1,YREC1);
fprintf(fp," Last receiver position (XREC2,YREC2,ZREC2) = (%5.3f, %5.3f, %5.3f) m\n",
XREC2,ZREC2,YREC2);
fprintf(fp,"\n Receiver Array: %i \n",REC_ARRAY);
fprintf(fp,"\n");
fprintf(fp," Distance between receivers in x-direction within plane: %i Gridpoints\n", DRX);
fprintf(fp," Distance between receivers in y-direction within plane: %i Gridpoints\n", DRY);
break;
case 0 :
fprintf(fp," Receiver line: \n");
fprintf(fp," First receiver position (XREC1,YREC1,ZREC1) = (%5.3f, %5.3f, %5.3f m\n",
XREC1,ZREC1,YREC1);
fprintf(fp," Last receiver position (XREC2,YREC2,ZREC2) = (%5.3f, %5.3f, %5.3f) m\n",
XREC2,ZREC2,YREC2);
fprintf(fp,"\n Receiver Array: %i \n",REC_ARRAY);
fprintf(fp,"\n");
break;
default :
err(" invalid READREC in write_par!");
break;
}
}
fprintf(fp," ------------------------- FREE SURFACE ------------------------\n");
......
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