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){ ...@@ -1379,7 +1379,7 @@ int main(int argc, char **argv){
catseis(sectionvz, fulldata_vz, recswitch, ntr_glob, MPI_COMM_WORLD); catseis(sectionvz, fulldata_vz, recswitch, ntr_glob, MPI_COMM_WORLD);
} }
catseis(sectionp, fulldata_p, 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*/ /* wavefield separation for forward modelling of STF*/
if (WAVESEP==1) { if (WAVESEP==1) {
...@@ -1401,6 +1401,7 @@ int main(int argc, char **argv){ ...@@ -1401,6 +1401,7 @@ int main(int argc, char **argv){
h++; 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; break;
...@@ -1933,7 +1934,8 @@ int main(int argc, char **argv){ ...@@ -1933,7 +1934,8 @@ int main(int argc, char **argv){
catseis(sectionvz, fulldata_vz, recswitch, ntr_glob, MPI_COMM_WORLD); catseis(sectionvz, fulldata_vz, recswitch, ntr_glob, MPI_COMM_WORLD);
} }
catseis(sectionp, fulldata_p, 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*/ /* wavefield separation*/
if (WAVESEP==1) { if (WAVESEP==1) {
if (MYID == 0) fprintf(FP,"\n start wavefield separation..."); if (MYID == 0) fprintf(FP,"\n start wavefield separation...");
...@@ -1961,7 +1963,7 @@ int main(int argc, char **argv){ ...@@ -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; break;
} /* end of switch (SEISMO) */ } /* end of switch (SEISMO) */
......
...@@ -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
......
...@@ -40,7 +40,7 @@ void fft2(float **array, float **arrayim, int NYG, int NXG, int dir) { ...@@ -40,7 +40,7 @@ void fft2(float **array, float **arrayim, int NYG, int NXG, int dir) {
k++; k++;
} }
forward_fft2f(C, NXG, NYG); forward_fft2f(C, NYG, NXG);
k = 1; k = 1;
......
...@@ -146,14 +146,13 @@ void pup(float **data_p, float **data_vy, int ntr_glob, int **recpos, int ishot ...@@ -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]; data_vyt[i][k]=data_vy[k][i];
} }
} }
fft2(data_vyt, data_vyim, ny_pot, nx_pot,1); 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); MPI_Recv(&data_pt[1][1], ny_pot*nx_pot, MPI_FLOAT, 1, 1, MPI_COMM_WORLD, &status);
/* write spectrum to file */ /* write spectrum to file */
if (ishot==1 && iter==1) { if (VERBOSE==1 && ishot==1 && iter==1) {
sprintf(pf2,"%s_spectrum.p.real.shot%i.it%i.bin",SEIS_FILE,ishot, iter); sprintf(pf2,"%s_spectrum.p.shot%i.it%i.%i.%i.bin",SEIS_FILE,ishot, iter, ny_pot, nx_pot);
file = fopen(pf2,"wb"); file = fopen(pf2,"wb");
for (i=1; i<=nx_pot; i++) for (i=1; i<=nx_pot; i++)
for (j=1; j<=ny_pot; j++) { fwrite(&data_pt[j][i],sizeof(float),1,file); } 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 ...@@ -161,8 +160,8 @@ void pup(float **data_p, float **data_vy, int ntr_glob, int **recpos, int ishot
} }
/* write spectrum to file */ /* write spectrum to file */
if (ishot==1 && iter==1) { if (VERBOSE==1 && ishot==1 && iter==1) {
sprintf(pf2,"%s_spectrum.vz.real.shot%i.it%i.bin",SEIS_FILE,ishot, iter); sprintf(pf2,"%s_spectrum.vz.shot%i.it%i.%i.%i.bin",SEIS_FILE,ishot, iter, ny_pot, nx_pot);
file = fopen(pf2,"wb"); file = fopen(pf2,"wb");
for (i=1; i<=nx_pot; i++) 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 ...@@ -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 */ /* write spectrum to file */
if (ishot==1 && iter==1) { if (VERBOSE==1 && ishot==1 && iter==1) {
sprintf(pf2,"%s_spectrum.pup.real.shot%i.it%i.bin",SEIS_FILE,ishot, iter); sprintf(pf2,"%s_spectrum.pup.shot%i.it%i.%i.%i.bin",SEIS_FILE,ishot, iter, ny_pot, nx_pot);
file = fopen(pf2,"wb"); file = fopen(pf2,"wb");
for (i=1; i<=nx_pot; i++) 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 ...@@ -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, 1,ny_pot/2,1,nx_pot/2);
free_matrix(filtwk_full, 1,ny_pot,1,nx_pot); 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_vyim, 1,ny_pot,1,nx_pot);
free_matrix(data_pup, 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_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_matrix(data_vyt, 1,ny_pot,1,nx_pot);
free_vector(w,1,ny_pot/2); free_vector(w,1,ny_pot/2);
free_vector(kx,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