Commit 15f93d09 authored by niklas.thiel's avatar niklas.thiel

BUGFIX in calculating receiver positions

parent a74b6a37
...@@ -19,7 +19,7 @@ EXEC= ../bin ...@@ -19,7 +19,7 @@ EXEC= ../bin
# LINUX with OpenMPI / IntelMPI and INTEL Compiler # LINUX with OpenMPI / IntelMPI and INTEL Compiler
# Use icc whenever possible, this will be much faster than gcc # Use icc whenever possible, this will be much faster than gcc
CC=mpiicc CC=mpicc
LFLAGS=-lm -lcseife -lstfinv -laff -lfourierxx -lfftw3 -lstdc++ LFLAGS=-lm -lcseife -lstfinv -laff -lfourierxx -lfftw3 -lstdc++
CFLAGS=-O3 CFLAGS=-O3
SFLAGS=-L./../contrib/libcseife -L./../contrib/bin SFLAGS=-L./../contrib/libcseife -L./../contrib/bin
......
...@@ -33,7 +33,7 @@ int **receiver(int *ntr, float **srcpos, int shotno){ ...@@ -33,7 +33,7 @@ int **receiver(int *ntr, float **srcpos, int shotno){
extern int MYID, VERBOSE,TRKILL; extern int MYID, VERBOSE,TRKILL;
extern FILE *FP; extern FILE *FP;
int **recpos1, **recpos = NULL, nxrec=0, nyrec=0, nzrec=0; int **recpos1, **recpos = NULL, nxrec=0, nyrec=0, nzrec=0, recdist;
int itr=1, itr1=0, itr2=0, recflag=0, c, ifw, n, i, j, ntr1=0; int itr=1, itr1=0, itr2=0, recflag=0, c, ifw, n, i, j, ntr1=0;
int nxrec1, nxrec2, nxrec3, nyrec1, nyrec2, nzrec1=1, nzrec2=1, offset, shotdist; int nxrec1, nxrec2, nxrec3, nyrec1, nyrec2, nzrec1=1, nzrec2=1, offset, shotdist;
extern float XREC1, YREC1, XREC2, YREC2; extern float XREC1, YREC1, XREC2, YREC2;
...@@ -100,12 +100,22 @@ int **receiver(int *ntr, float **srcpos, int shotno){ ...@@ -100,12 +100,22 @@ int **receiver(int *ntr, float **srcpos, int shotno){
else if (READREC==2){ else if (READREC==2){
fprintf(FP,"\n Moving streamer acquisition geometry choosen. \n"); fprintf(FP,"\n Moving streamer acquisition geometry choosen. \n");
nxrec1=iround(XREC1/DH); /* (nxrec1,nyrec1) and (nxrec2,nyrec2) are */ /* decide if XREC1 or XREC2 is the nearest receiver to shot 1 */
nyrec1=iround(YREC1/DH); /* the positions of the first and last receiver*/ if (abs(XREC1-srcpos[1][1])<abs(XREC2-srcpos[1][1])){
nxrec2=iround(XREC2/DH); /* in gridpoints */ nxrec1=iround(XREC1/DH); /* (nxrec1,nyrec1) and (nxrec2,nyrec2) are */
nyrec2=iround(YREC2/DH); nyrec1=iround(YREC1/DH); /* the positions of the first and last receiver*/
offset=iround((XREC1-srcpos[1][1])/DH); nxrec2=iround(XREC2/DH); /* in gridpoints */
shotdist=iround((srcpos[1][2]-srcpos[1][1])/DH); nyrec2=iround(YREC2/DH);
offset=iround((XREC1-srcpos[1][1])/DH);
}
else {
nxrec1=iround(XREC2/DH); /* (nxrec1,nyrec1) and (nxrec2,nyrec2) are */
nyrec1=iround(YREC2/DH); /* the positions of the first and last receiver*/
nxrec2=iround(XREC1/DH); /* in gridpoints */
nyrec2=iround(YREC1/DH);
offset=iround((XREC2-srcpos[1][1])/DH);
shotdist=iround((srcpos[1][2]-srcpos[1][1])/DH);
}
if (nyrec1 != nyrec2){ if (nyrec1 != nyrec2){
fprintf(FP,"\n\n"); fprintf(FP,"\n\n");
fprintf(FP," Warning:\n"); fprintf(FP," Warning:\n");
...@@ -113,29 +123,21 @@ int **receiver(int *ntr, float **srcpos, int shotno){ ...@@ -113,29 +123,21 @@ int **receiver(int *ntr, float **srcpos, int shotno){
fprintf(FP," Depth of all receivers is seth to %i m\n",YREC1); fprintf(FP," Depth of all receivers is seth to %i m\n",YREC1);
fprintf(FP,"\n\n"); fprintf(FP,"\n\n");
} }
if (offset<0) recdist=-NGEOPH;
*ntr=iround((nxrec2-nxrec1)/NGEOPH)+1; else recdist=NGEOPH;
*ntr=iround((nxrec2-nxrec1)/recdist)+1;
if (shotno>0) nxrec1=nxrec1+(shotdist*(shotno-1)); if (shotno>0) nxrec1=nxrec1+(shotdist*(shotno-1));
recpos=imatrix(1,3,1,*ntr); recpos=imatrix(1,3,1,*ntr);
n=0; n=0;
if (offset<0){ for (itr=1;itr<=*ntr;itr++){
for (itr=1;itr<=*ntr;itr++){ nxrec=nxrec1+(itr-1)*recdist;
nxrec=nxrec1-(itr-1)*NGEOPH; if (nxrec>FW && nxrec<(NXG-FW) && nyrec1>0 && nyrec1<(NYG-FW)){
if (nxrec>FW && nxrec<(NXG-FW) && nyrec1>0 && nyrec1<(NYG-FW)){ recpos[1][itr]=nxrec;
recpos[1][itr]=nxrec; recpos[2][itr]=nyrec1;
recpos[2][itr]=nyrec1; } else declare_error(" Receiver positions of current shot are out of model boundaries !");
} else declare_error(" Receiver positions of current shot are out of model boundaries !");
}
} else if (offset>0){
for (itr=1;itr<=*ntr;itr++){
nxrec=nxrec1+(itr-1)*NGEOPH;
if (nxrec>FW && nxrec<(NXG-FW) && nyrec1>0 && nyrec1<(NYG-FW)){
recpos[1][itr]=nxrec;
recpos[2][itr]=nyrec1;
} else declare_error(" Receiver positions of current shot are out of model boundaries !");
}
} }
if (shotno>0){ if (shotno>0){
/* write receiver positions to file */ /* write receiver positions to file */
sprintf(filename,"%s.shot%i",REC_FILE,shotno); sprintf(filename,"%s.shot%i",REC_FILE,shotno);
......
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