Commit d6833638 authored by niklas.thiel's avatar niklas.thiel

BUGFIX in 2DFFT + change writing of pup seismograms

parent 83204c13
......@@ -1379,7 +1379,7 @@ int main(int argc, char **argv){
catseis(sectionvz, fulldata_vz, recswitch, ntr_glob, MPI_COMM_WORLD);
}
catseis(sectionp, fulldata_p, recswitch, ntr_glob, MPI_COMM_WORLD);
if (MYID==0) saveseis_glob(FP,fulldata_vx,fulldata_vy,fulldata_vz,fulldata_p,fulldata_curl,fulldata_div,recpos,recpos_loc,ntr_glob,srcpos,ishot,ns,iter,1);
if (VERBOSE==1 && MYID==0) saveseis_glob(FP,fulldata_vx,fulldata_vy,fulldata_vz,fulldata_p,fulldata_curl,fulldata_div,recpos,recpos_loc,ntr_glob,srcpos,ishot,ns,iter,1);
/* wavefield separation for forward modelling of STF*/
if (WAVESEP==1) {
......@@ -1401,6 +1401,7 @@ int main(int argc, char **argv){
h++;
}
}
if (VERBOSE==0 && MYID==0) saveseis_glob(FP,fulldata_vx,fulldata_vy,fulldata_vz,fulldata_p,fulldata_curl,fulldata_div,recpos,recpos_loc,ntr_glob,srcpos,ishot,ns,iter,1);
break;
......@@ -1933,7 +1934,8 @@ int main(int argc, char **argv){
catseis(sectionvz, fulldata_vz, recswitch, ntr_glob, MPI_COMM_WORLD);
}
catseis(sectionp, fulldata_p, recswitch, ntr_glob, MPI_COMM_WORLD);
if (MYID==0 && VERBOSE==1) saveseis_glob(FP,fulldata_vx,fulldata_vy,fulldata_vz,fulldata_p,fulldata_curl,fulldata_div,recpos,recpos_loc,ntr_glob,srcpos,ishot,ns,iter,1);
/* wavefield separation*/
if (WAVESEP==1) {
if (MYID == 0) fprintf(FP,"\n start wavefield separation...");
......@@ -1961,7 +1963,7 @@ int main(int argc, char **argv){
}
}
}
if (MYID==0) saveseis_glob(FP,fulldata_vx,fulldata_vy,fulldata_vz,fulldata_p,fulldata_curl,fulldata_div,recpos,recpos_loc,ntr_glob,srcpos,ishot,ns,iter,1);
if (MYID==0 && VERBOSE==0) saveseis_glob(FP,fulldata_vx,fulldata_vy,fulldata_vz,fulldata_p,fulldata_curl,fulldata_div,recpos,recpos_loc,ntr_glob,srcpos,ishot,ns,iter,1);
break;
} /* end of switch (SEISMO) */
......
......@@ -19,7 +19,7 @@ EXEC= ../bin
# LINUX with OpenMPI / IntelMPI and INTEL Compiler
# Use icc whenever possible, this will be much faster than gcc
CC=mpiicc
CC=mpicc
LFLAGS=-lm -lcseife -lstfinv -laff -lfourierxx -lfftw3 -lstdc++
CFLAGS=-O3
SFLAGS=-L./../contrib/libcseife -L./../contrib/bin
......
......@@ -40,7 +40,7 @@ void fft2(float **array, float **arrayim, int NYG, int NXG, int dir) {
k++;
}
forward_fft2f(C, NXG, NYG);
forward_fft2f(C, NYG, NXG);
k = 1;
......
......@@ -146,14 +146,13 @@ void pup(float **data_p, float **data_vy, int ntr_glob, int **recpos, int ishot
data_vyt[i][k]=data_vy[k][i];
}
}
fft2(data_vyt, data_vyim, ny_pot, nx_pot,1);
MPI_Recv(&data_pt[1][1], ny_pot*nx_pot, MPI_FLOAT, 1, 1, MPI_COMM_WORLD, &status);
/* write spectrum to file */
if (ishot==1 && iter==1) {
sprintf(pf2,"%s_spectrum.p.real.shot%i.it%i.bin",SEIS_FILE,ishot, iter);
if (VERBOSE==1 && ishot==1 && iter==1) {
sprintf(pf2,"%s_spectrum.p.shot%i.it%i.%i.%i.bin",SEIS_FILE,ishot, iter, ny_pot, nx_pot);
file = fopen(pf2,"wb");
for (i=1; i<=nx_pot; i++)
for (j=1; j<=ny_pot; j++) { fwrite(&data_pt[j][i],sizeof(float),1,file); }
......@@ -161,8 +160,8 @@ void pup(float **data_p, float **data_vy, int ntr_glob, int **recpos, int ishot
}
/* write spectrum to file */
if (ishot==1 && iter==1) {
sprintf(pf2,"%s_spectrum.vz.real.shot%i.it%i.bin",SEIS_FILE,ishot, iter);
if (VERBOSE==1 && ishot==1 && iter==1) {
sprintf(pf2,"%s_spectrum.vz.shot%i.it%i.%i.%i.bin",SEIS_FILE,ishot, iter, ny_pot, nx_pot);
file = fopen(pf2,"wb");
for (i=1; i<=nx_pot; i++)
......@@ -181,10 +180,9 @@ void pup(float **data_p, float **data_vy, int ntr_glob, int **recpos, int ishot
}
}
fprintf(FP,"\ntime for wavefield separation: %f s\n",t5-t3);
/* write spectrum to file */
if (ishot==1 && iter==1) {
sprintf(pf2,"%s_spectrum.pup.real.shot%i.it%i.bin",SEIS_FILE,ishot, iter);
if (VERBOSE==1 && ishot==1 && iter==1) {
sprintf(pf2,"%s_spectrum.pup.shot%i.it%i.%i.%i.bin",SEIS_FILE,ishot, iter, ny_pot, nx_pot);
file = fopen(pf2,"wb");
for (i=1; i<=nx_pot; i++)
......@@ -221,15 +219,15 @@ void pup(float **data_p, float **data_vy, int ntr_glob, int **recpos, int ishot
free_matrix(filtwk, 1,ny_pot/2,1,nx_pot/2);
free_matrix(filtwk_full, 1,ny_pot,1,nx_pot);
free_matrix(data_pim, 1,ny_pot,1,nx_pot);
free_matrix(data_vyim, 1,ny_pot,1,nx_pot);
free_matrix(data_pup, 1,ny_pot,1,nx_pot);
free_matrix(data_pupim, 1,ny_pot,1,nx_pot);
free_matrix(data_pt, 1,ny_pot,1,nx_pot);
free_matrix(data_vyt, 1,ny_pot,1,nx_pot);
free_vector(w,1,ny_pot/2);
free_vector(kx,1,ny_pot/2);
}
free_matrix(data_pim, 1,ny_pot,1,nx_pot);
free_matrix(data_pt, 1,ny_pot,1,nx_pot);
}
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