Commit 0750aa60 authored by tilman.metz's avatar tilman.metz

added documentation

parent ba2301c1
......@@ -682,6 +682,7 @@ MPI_Barrier(MPI_COMM_WORLD);
if(HESS&&READ_HESS==1) readhess(NX,NY,NZ,hessian,finv[0], iteration+1-it_group);
MPI_Barrier(MPI_COMM_WORLD);
if(METHOD==1 && EXTOBS==1){
/* Read Seismograms from external file and save them for each CPU */
for (ishot=1;ishot<=nshots;ishot++){
if(ntr_loc>0){
readseis_split(ishot, section->vx, ntr_glob, acq->rnum_loc, ns, 1);
......
......@@ -19,6 +19,7 @@
/*----------------------------------------------------------------------------
* reads seismograms from files
* and splits them in parts belonging to each CPU
-----------------------------------------------------------------------------*/
......
......@@ -116,7 +116,7 @@ void saveseis(FILE *fp, st_seismogram *section, st_acquisition *acq, int ntr, in
MPI_Barrier(MPI_COMM_WORLD);
if(MYID==0){
sprintf(outfile,"%s_vx_it%d.%s.shot%d",seisfile,iteration,file_ext,ishot);
/*fprintf(FP,"outfile:%s",outfile);*/
//fprintf(FP,"outfile:%s",outfile);
fout=fopen(outfile,"w");
buf2=vector(1,ns);
buf1=vector(1,240/sizeof(float));
......@@ -131,12 +131,12 @@ void saveseis(FILE *fp, st_seismogram *section, st_acquisition *acq, int ntr, in
else{ fprintf(FP,"attention: Error in seisfile");
l=0;
}
/*fprintf(FP,"l=%d",l);
fprintf(FP,"infile:%s,MYID=%d\n",infile,i);*/
//fprintf(FP,"l=%d",l);
//fprintf(FP,"infile:%s,MYID=%d\n",infile,i);
fseek(fin,0,SEEK_SET);
for(m=1;m<=l;m++){
/*fprintf(FP,"m=%d",m);*/
//fprintf(FP,"m=%d",m);
fread(buf1,sizeof(float),240/sizeof(float),fin);
......@@ -156,7 +156,7 @@ void saveseis(FILE *fp, st_seismogram *section, st_acquisition *acq, int ntr, in
if(MYID==0){
sprintf(outfile,"%s_vy_it%d.%s.shot%d",seisfile,iteration,file_ext,ishot);
/*fprintf(FP,"outfile:%s",outfile);*/
//fprintf(FP,"outfile:%s",outfile);
fout=fopen(outfile,"w");
buf2=vector(1,ns);
buf1=vector(1,240/sizeof(float));
......@@ -172,12 +172,12 @@ void saveseis(FILE *fp, st_seismogram *section, st_acquisition *acq, int ntr, in
else{ fprintf(FP,"attention: Error in seisfile");
l=0;
}
/*fprintf(FP,"l=%d",l);
fprintf(FP,"infile:%s,MYID=%d",infile,MYID);*/
//fprintf(FP,"l=%d",l);
//fprintf(FP,"infile:%s,MYID=%d",infile,MYID);
fseek(fin,0,SEEK_SET);
for(m=1;m<=l;m++){
/*fprintf(FP,"m=%d",m);*/
//fprintf(FP,"m=%d",m);
fread(buf1,sizeof(float),240/sizeof(float),fin);
......@@ -196,7 +196,7 @@ void saveseis(FILE *fp, st_seismogram *section, st_acquisition *acq, int ntr, in
if(MYID==0){
sprintf(outfile,"%s_vz_it%d.%s.shot%d",seisfile,iteration,file_ext,ishot);
/*fprintf(FP,"outfile:%s",outfile);*/
//fprintf(FP,"outfile:%s",outfile);
fout=fopen(outfile,"w");
buf2=vector(1,ns);
buf1=vector(1,240/sizeof(float));
......@@ -211,8 +211,8 @@ void saveseis(FILE *fp, st_seismogram *section, st_acquisition *acq, int ntr, in
else{ fprintf(FP,"attention: Error in seisfile");
l=0;
}
/*fprintf(FP,"l=%d",l);
fprintf(FP,"infile:%s,MYID=%d",infile,MYID);*/
//printf(FP,"l=%d",l);
//fprintf(FP,"infile:%s,MYID=%d",infile,MYID);
fseek(fin,0,SEEK_SET);
for(m=1;m<=l;m++){
......@@ -234,6 +234,8 @@ void saveseis(FILE *fp, st_seismogram *section, st_acquisition *acq, int ntr, in
free_matrix(srcpos1,1,7,1,1);
MPI_Barrier(MPI_COMM_WORLD);
/* Remove seismogram parts (only keep merged seismogram) only for modeled data (not obs) */
if(iteration>0&&ntr>0&&METHOD&&!obs){
sprintf(infile,"%s_vx_it%d.%s.shot%d.%d",seisfile,iteration,file_ext,ishot,MYID);
remove(infile);
......
......@@ -37,7 +37,7 @@ int **splitrec(int **recpos,int *ntr_loc, int ntr, int *rnum_loc)
b=(recpos[2][j]-1)/IENDY;
c=(recpos[3][j]-1)/IENDZ;
/*only if receiver is inside subgrid rnum_loc is set to 1 and local rewc position is saved in recpos_dummy*/
if ((POS[1]==a)&&(POS[2]==b)&&(POS[3]==c)) {
i++;
recpos_dummy[1][i] = ((recpos[1][j]-1)%IENDX)+1;
......
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