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 @@ ...@@ -25,7 +25,6 @@
"Source" : "comment", "Source" : "comment",
"SOURCE_SHAPE" : "4", "SOURCE_SHAPE" : "4",
"SOURCE_TYPE" : "4", "SOURCE_TYPE" : "4",
"SIGNAL_FILE" : "./STF/stf.su",
"SRCREC" : "1", "SRCREC" : "1",
"SOURCE_FILE" : "./sources/sources_toy.dat", "SOURCE_FILE" : "./sources/sources_toy.dat",
"RUN_MULTIPLE_SHOTS" : "1", "RUN_MULTIPLE_SHOTS" : "1",
...@@ -37,8 +36,6 @@ ...@@ -37,8 +36,6 @@
"Q-approximation" : "comment", "Q-approximation" : "comment",
"L" : "0", "L" : "0",
"FL1" : "1000.0",
"TAU" : "0.000001",
"Free Surface" : "comment", "Free Surface" : "comment",
"FREE_SURF" : "0", "FREE_SURF" : "0",
...@@ -49,26 +46,13 @@ ...@@ -49,26 +46,13 @@
"FW" : "10", "FW" : "10",
"VPPML" : "6200.0", "VPPML" : "6200.0",
"FPML" : "200.00", "FPML" : "200.00",
"BOUNDARY" : "0",
"Snapshots" : "comment", "Snapshots" : "comment",
"SNAP" : "0", "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", "Receiver" : "comment",
"SEISMO" : "1", "SEISMO" : "1",
"READREC" : "0", "READREC" : "2",
"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",
"Receiver array" : "comment", "Receiver array" : "comment",
"REC_ARRAY" : "1", "REC_ARRAY" : "1",
...@@ -80,11 +64,12 @@ ...@@ -80,11 +64,12 @@
"Seismograms" : "comment", "Seismograms" : "comment",
"NDT" : "1", "NDT" : "1",
"NDTSHIFT" : "0",
"SEIS_FORMAT" : "1", "SEIS_FORMAT" : "1",
"SEIS_FILE" : "./su_obs/obs_toy", "SEIS_FILE" : "./su/cal_toy",
"VERBOSE" : "0",
"Method" : "comment", "Method" : "comment",
"METHOD" : "0", "METHOD" : "0",
...@@ -96,15 +81,14 @@ ...@@ -96,15 +81,14 @@
"SEIS_OBS_FILE" : "./su_obs/obs_toy", "SEIS_OBS_FILE" : "./su_obs/obs_toy",
"EXTOBS" : "0", "EXTOBS" : "0",
"INV_FILE" : "./in_and_out/workflow_toy.dat", "INV_FILE" : "./in_and_out/workflow_toy.dat",
"HESS_FILE" : "./hess/toy_hess",
"General" : "comment", "General" : "comment",
"ITMIN, ITMAX" : "1 , 60", "ITMIN, ITMAX" : "1 , 60",
"FILT" : "0", "FILT" : "1",
"NFMAX" : "5", "NFMAX" : "5",
"TAST" : "100", "TAST" : "100",
"VP0, VS0, RHO0" : "6200.0, 3600.0, 2800.0", "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", "Steplength estimation" : "comment",
"NSHOTS_STEP" : "4", "NSHOTS_STEP" : "4",
...@@ -115,12 +99,7 @@ ...@@ -115,12 +99,7 @@
"Hessian" : "comment", "Hessian" : "comment",
"HESS" : "0", "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", "L-BFGS" : "comment",
"LBFGS" : "0", "LBFGS" : "0"
"NUMPAR" : "2",
"BFGSNUM" : "5"
} }
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
"Source" : "comment", "Source" : "comment",
"SOURCE_SHAPE" : "4", "SOURCE_SHAPE" : "4",
"SOURCE_TYPE" : "4", "SOURCE_TYPE" : "4",
"SIGNAL_FILE" : "./STF/stf.su",
"SRCREC" : "1", "SRCREC" : "1",
"SOURCE_FILE" : "./sources/sources_toy.dat", "SOURCE_FILE" : "./sources/sources_toy.dat",
"RUN_MULTIPLE_SHOTS" : "1", "RUN_MULTIPLE_SHOTS" : "1",
...@@ -37,38 +36,23 @@ ...@@ -37,38 +36,23 @@
"Q-approximation" : "comment", "Q-approximation" : "comment",
"L" : "0", "L" : "0",
"FL1" : "1000.0",
"TAU" : "0.000001",
"Free Surface" : "comment", "Free Surface" : "comment",
"FREE_SURF" : "0", "FREE_SURF" : "0",
"Absorbing Boundary" : "comment", "Absorbing Boundary" : "comment",
"ABS_TYPE" : "1", "ABS_TYPE" : "1",
"FW" : "10", "FW" : "10",
"VPPML" : "6200.0", "VPPML" : "6200.0",
"FPML" : "200.00", "FPML" : "200.00",
"BOUNDARY" : "0",
"Snapshots" : "comment", "Snapshots" : "comment",
"SNAP" : "0", "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", "Receiver" : "comment",
"SEISMO" : "1", "SEISMO" : "1",
"READREC" : "0", "READREC" : "2",
"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",
"Receiver array" : "comment", "Receiver array" : "comment",
"REC_ARRAY" : "1", "REC_ARRAY" : "1",
...@@ -80,7 +64,6 @@ ...@@ -80,7 +64,6 @@
"Seismograms" : "comment", "Seismograms" : "comment",
"NDT" : "1", "NDT" : "1",
"NDTSHIFT" : "0",
"SEIS_FORMAT" : "1", "SEIS_FORMAT" : "1",
"SEIS_FILE" : "./su_obs/obs_toy", "SEIS_FILE" : "./su_obs/obs_toy",
......
...@@ -69,7 +69,7 @@ PARTMODEL_SCR = \ ...@@ -69,7 +69,7 @@ PARTMODEL_SCR = \
util.c util.c
FDMPI_UTIL = \ IFOS_UTIL = \
absorb.c \ absorb.c \
av_mat.c \ av_mat.c \
comm_ini.c \ comm_ini.c \
...@@ -99,7 +99,7 @@ FDMPI_UTIL = \ ...@@ -99,7 +99,7 @@ FDMPI_UTIL = \
writepar.c \ writepar.c \
rwsegy.c \ rwsegy.c \
FDMPI_SRC = \ IFOS_SRC = \
ifos3d.c \ ifos3d.c \
comm_ini_s.c \ comm_ini_s.c \
checkfd_ssg.c \ checkfd_ssg.c \
...@@ -146,12 +146,12 @@ FDMPI_SRC = \ ...@@ -146,12 +146,12 @@ FDMPI_SRC = \
lbfgs_save.c \ lbfgs_save.c \
constant_boundary.c \ constant_boundary.c \
$(MODEL_SCR) \ $(MODEL_SCR) \
$(FDMPI_UTIL) $(IFOS_UTIL)
# model_gauss.c \ # model_gauss.c \
FDMPI_OBJ = $(FDMPI_SRC:%.c=%.o) IFOS_OBJ = $(IFOS_SRC:%.c=%.o)
FDMPI_OBJ_RSG = $(FDMPI_SRC_RSG:%.c=%.o) IFOS_OBJ_RSG = $(IFOS_SRC_RSG:%.c=%.o)
# FDMPI_ACOUSTIC_OBJ = $(FDMPI_ACOUSTIC_SRC:%.c=%.o) # FDMPI_ACOUSTIC_OBJ = $(FDMPI_ACOUSTIC_SRC:%.c=%.o)
# SNAPMERGE_OBJ = $(SNAPMERGE_SCR:%.c=%.o) # SNAPMERGE_OBJ = $(SNAPMERGE_SCR:%.c=%.o)
# PARTMODEL_OBJ = $(PARTMODEL_SCR:%.c=%.o) # PARTMODEL_OBJ = $(PARTMODEL_SCR:%.c=%.o)
...@@ -166,8 +166,8 @@ snapmerge: $(SNAPMERGE_OBJ) ...@@ -166,8 +166,8 @@ snapmerge: $(SNAPMERGE_OBJ)
# part_model: $(PARTMODEL_OBJ) # part_model: $(PARTMODEL_OBJ)
# $(CC) $(LFLAGS) $(PARTMODEL_OBJ) -o ../bin/partmodel # $(CC) $(LFLAGS) $(PARTMODEL_OBJ) -o ../bin/partmodel
ifos3d: $(FDMPI_OBJ) ifos3d: $(IFOS_OBJ)
$(CC) $(SFLAGS) $(FDMPI_OBJ) $(LFLAGS) -o ../bin/ifos3d $(CC) $(SFLAGS) $(IFOS_OBJ) $(LFLAGS) -o ../bin/ifos3d
clean: clean:
......
...@@ -590,7 +590,7 @@ float *** ptaus, float *** ptaup, float *peta, float **srcpos, int nsrc, int **r ...@@ -590,7 +590,7 @@ float *** ptaus, float *** ptaup, float *peta, float **srcpos, int nsrc, int **r
srec_miny=ZREC1; srec_miny=ZREC1;
} }
} }
if (READREC==1) { if ((READREC==1) || (READREC=2)){
/* find maximum and minimum source positions coordinate ---- from receiver file*/ /* find maximum and minimum source positions coordinate ---- from receiver file*/
for (k=1;k<=ntr;k++){ for (k=1;k<=ntr;k++){
/* find maximum source positions coordinate*/ /* find maximum source positions coordinate*/
......
...@@ -145,7 +145,7 @@ int read_par(FILE *fp_in){ ...@@ -145,7 +145,7 @@ int read_par(FILE *fp_in){
} }
break; break;
case 21 : 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){ switch(nvarin){
case 0: case 0:
case 1: strcpy(SIGNAL_FILE,"\0"); case 1: strcpy(SIGNAL_FILE,"\0");
...@@ -192,7 +192,7 @@ int read_par(FILE *fp_in){ ...@@ -192,7 +192,7 @@ int read_par(FILE *fp_in){
} }
break; break;
case 25 : 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){ switch(nvarin){
case 0: case 0:
case 1: READMOD=0; case 1: READMOD=0;
......
This diff is collapsed.
This diff is collapsed.
...@@ -43,6 +43,7 @@ void writepar(FILE *fp, int ns){ ...@@ -43,6 +43,7 @@ void writepar(FILE *fp, int ns){
extern int NP, NPROCX, NPROCY, NPROCZ, MYID; 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 ITMIN, ITMAX, FILT, NFMAX, TAST, NSHOTS_STEP, DAMPTYPE, HESS, READ_HESS, REC_HESS, LBFGS,EXTOBS;
extern int NUMPAR, BFGSNUM; extern int NUMPAR, BFGSNUM;
extern int VERBOSE;
extern float TESTSTEP,WATER_HESS[3], WEIGHT[3], VP0, VS0, RHO0; extern float TESTSTEP,WATER_HESS[3], WEIGHT[3], VP0, VS0, RHO0;
/* definition of local variables */ /* definition of local variables */
...@@ -150,28 +151,34 @@ void writepar(FILE *fp, int ns){ ...@@ -150,28 +151,34 @@ void writepar(FILE *fp, int ns){
if (SEISMO){ if (SEISMO){
fprintf(fp," ------------------------- RECEIVER ------- -------------------\n"); fprintf(fp," ------------------------- RECEIVER ------- -------------------\n");
if (READREC){ switch (READREC){
fprintf(fp," Reading receiver positions from file \n"); case 1:
fprintf(fp,"\t%s\n\n",REC_FILE); fprintf(fp," Reading receiver positions from file \n");
fprintf(fp," reference_point_for_receiver_coordinate_system:\n"); fprintf(fp,"\t%s\n\n",REC_FILE);
fprintf(fp," x=%f \ty=%f\t z=%f\n",REFREC[1], REFREC[3], REFREC[2]); 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){ break;
case 2:
fprintf(fp," Horitontal plane of receivers.\n"); fprintf(fp," Horitontal plane of receivers.\n");
fprintf(fp," Number of planes: %d \n",REC_ARRAY); fprintf(fp," Number of planes: %d \n",REC_ARRAY);
fprintf(fp," Depth of upper plane: %e m \n",REC_ARRAY_DEPTH); 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," 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 x-direction within plane: %i Gridpoints\n", DRX);
fprintf(fp," Distance between receivers in y-direction within plane: %i \n", DRY); fprintf(fp," Distance between receivers in y-direction within plane: %i Gridpoints\n", DRY);
} break;
else{ case 0 :
fprintf(fp," Receiver line: \n"); fprintf(fp," Receiver line: \n");
fprintf(fp," First receiver position (XREC1,YREC1,ZREC1) = (%5.3f, %5.3f, %5.3f m\n", fprintf(fp," First receiver position (XREC1,YREC1,ZREC1) = (%5.3f, %5.3f, %5.3f m\n",
XREC1,ZREC1,YREC1); XREC1,ZREC1,YREC1);
fprintf(fp," Last receiver position (XREC2,YREC2,ZREC2) = (%5.3f, %5.3f, %5.3f) m\n", fprintf(fp," Last receiver position (XREC2,YREC2,ZREC2) = (%5.3f, %5.3f, %5.3f) m\n",
XREC2,ZREC2,YREC2); XREC2,ZREC2,YREC2);
fprintf(fp,"\n Receiver Array: %i \n",REC_ARRAY); fprintf(fp,"\n Receiver Array: %i \n",REC_ARRAY);
fprintf(fp,"\n"); fprintf(fp,"\n");
break;
default :
err(" invalid READREC in write_par!");
break;
} }
} }
fprintf(fp," ------------------------- FREE SURFACE ------------------------\n"); 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