Commit c5f4333d authored by laura.gassner's avatar laura.gassner

adapted saving and naming of seismograms

parent dca74c11
......@@ -1339,19 +1339,18 @@ int main(int argc, char **argv){
if(LNORM==8){
calc_envelope(fulldata_vy,fulldata_vy,ns,ntr_glob);
calc_envelope(fulldata_vx,fulldata_vx,ns,ntr_glob);}
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) 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;
case 2 : /* pressure only */
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 (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;
case 3 : /* curl and div only */
catseis(sectiondiv, fulldata_div, recswitch, ntr_glob, MPI_COMM_WORLD);
catseis(sectioncurl, fulldata_curl, 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 (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;
case 4 : /* everything */
......@@ -1365,7 +1364,7 @@ int main(int argc, char **argv){
catseis(sectionp, fulldata_p, recswitch, ntr_glob, MPI_COMM_WORLD);
catseis(sectiondiv, fulldata_div, recswitch, ntr_glob, MPI_COMM_WORLD);
catseis(sectioncurl, fulldata_curl, 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 (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;
case 5 : /* everything except curl and div*/
......@@ -1377,7 +1376,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 (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;
} /* end of switch (SEISMO) */
......@@ -1871,8 +1870,7 @@ int main(int argc, char **argv){
if(LNORM==8){
calc_envelope(fulldata_vy,fulldata_vy,ns,ntr_glob);
calc_envelope(fulldata_vx,fulldata_vx,ns,ntr_glob);}
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) 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;
case 2 : /* pressure only */
......@@ -1953,8 +1951,8 @@ int main(int argc, char **argv){
}
L2=calc_res(sectionvxdata,sectionvx,sectionvxdiff,sectionvxdiffold,ntr,ns,LNORM,L2,0,1,swstestshot,ntr_glob,recpos_loc,nsrc_glob,ishot,iter,srcpos,recpos);
if(swstestshot==1){energy=calc_energy(sectionvxdata,ntr,ns,energy, ntr_glob, recpos_loc, nsrc_glob, ishot,iter,srcpos,recpos);}
L2_all_shots=calc_misfit(sectionvxdata,sectionvx,ntr,ns,LNORM,L2_all_shots,0,1,1, ntr_glob, recpos_loc, nsrc_glob, ishot,iter,srcpos,recpos);
energy_all_shots=calc_energy(sectionvxdata,ntr,ns,energy_all_shots, ntr_glob, recpos_loc, nsrc_glob, ishot,iter,srcpos,recpos);
L2_all_shots=calc_misfit(sectionvxdata,sectionvx,ntr,ns,LNORM,L2_all_shots,0,1,1, ntr_glob, recpos_loc, nsrc_glob, ishot,iter,srcpos,recpos);
/*fprintf(FP,"Energy vxdata for PE %d: %f\n\n", MYID,energy);*/
} /* end ADJOINT_TYPE */
......@@ -1976,8 +1974,8 @@ int main(int argc, char **argv){
}
L2=calc_res(sectionvydata,sectionvy,sectionvydiff,sectionvydiffold,ntr,ns,LNORM,L2,0,1,swstestshot,ntr_glob,recpos_loc,nsrc_glob,ishot,iter,srcpos,recpos);
if(swstestshot==1){energy=calc_energy(sectionvydata,ntr,ns,energy, ntr_glob, recpos_loc, nsrc_glob, ishot,iter,srcpos,recpos);}
L2_all_shots=calc_misfit(sectionvydata,sectionvy,ntr,ns,LNORM,L2_all_shots,0,1,1, ntr_glob, recpos_loc, nsrc_glob, ishot,iter,srcpos,recpos);
energy_all_shots=calc_energy(sectionvydata,ntr,ns,energy_all_shots, ntr_glob, recpos_loc, nsrc_glob, ishot,iter,srcpos,recpos);
L2_all_shots=calc_misfit(sectionvydata,sectionvy,ntr,ns,LNORM,L2_all_shots,0,1,1, ntr_glob, recpos_loc, nsrc_glob, ishot,iter,srcpos,recpos);
/*fprintf(FP,"Energy vydata for PE %d: %f\n\n", MYID,energy); */
} /* end ADJOINT_TYPE */
......@@ -1998,8 +1996,8 @@ int main(int argc, char **argv){
}
L2=calc_res(sectionpdata,sectionp,sectionpdiff,sectionpdiffold,ntr,ns,LNORM,L2,0,1,swstestshot,ntr_glob,recpos_loc,nsrc_glob,ishot,iter,srcpos,recpos);
if(swstestshot==1){energy=calc_energy(sectionpdata,ntr,ns,energy, ntr_glob, recpos_loc, nsrc_glob, ishot,iter,srcpos,recpos);}
L2_all_shots=calc_misfit(sectionpdata,sectionp,ntr,ns,LNORM,L2_all_shots,0,1,1, ntr_glob, recpos_loc, nsrc_glob, ishot,iter,srcpos,recpos);
energy_all_shots=calc_energy(sectionpdata,ntr,ns,energy_all_shots, ntr_glob, recpos_loc, nsrc_glob, ishot,iter,srcpos,recpos);
L2_all_shots=calc_misfit(sectionpdata,sectionp,ntr,ns,LNORM,L2_all_shots,0,1,1, ntr_glob, recpos_loc, nsrc_glob, ishot,iter,srcpos,recpos);
} /* end ADJOINT_TYPE */
}
......@@ -2020,8 +2018,8 @@ int main(int argc, char **argv){
}
L2_SH=calc_res(sectionvzdata,sectionvz,sectionvzdiff,sectionvzdiffold,ntr,ns,LNORM,L2_SH,0,1,swstestshot,ntr_glob,recpos_loc,nsrc_glob,ishot,iter,srcpos,recpos);
if(swstestshot==1){energy_SH=calc_energy(sectionvzdata,ntr,ns,energy_SH, ntr_glob, recpos_loc, nsrc_glob, ishot,iter,srcpos,recpos);}
L2_all_shots_SH=calc_misfit(sectionvzdata,sectionvz,ntr,ns,LNORM,L2_all_shots_SH,0,1,1, ntr_glob, recpos_loc, nsrc_glob, ishot,iter,srcpos,recpos);
energy_all_shots_SH=calc_energy(sectionvzdata,ntr,ns,energy_all_shots_SH, ntr_glob, recpos_loc, nsrc_glob, ishot,iter,srcpos,recpos);
L2_all_shots_SH=calc_misfit(sectionvzdata,sectionvz,ntr,ns,LNORM,L2_all_shots_SH,0,1,1, ntr_glob, recpos_loc, nsrc_glob, ishot,iter,srcpos,recpos);
}
// Tracekill
......
......@@ -32,21 +32,21 @@ void saveseis_glob(FILE *fp, float **sectionvx, float **sectionvy,float **sectio
extern int SEISMO, SEIS_FORMAT, RUN_MULTIPLE_SHOTS, WAVETYPE, VERBOSE,FORWARD_ONLY;
extern char SEIS_FILE[STRING_SIZE];
extern int VELOCITY;
extern int VELOCITY, WRITE_FILTERED_DATA;
char vxf[STRING_SIZE], vyf[STRING_SIZE],vzf[STRING_SIZE], curlf[STRING_SIZE], divf[STRING_SIZE], pf[STRING_SIZE];
int nsrc=1;
switch (type_switch) {
case 1:
sprintf(vxf,"%s_vx.su.shot%d.it%d",SEIS_FILE,ishot,iter);
sprintf(vyf,"%s_vy.su.shot%d.it%d",SEIS_FILE,ishot,iter);
sprintf(vxf,"%s_vx.su.syn.shot%d.it%d",SEIS_FILE,ishot,iter);
sprintf(vyf,"%s_vy.su.syn.shot%d.it%d",SEIS_FILE,ishot,iter);
if(WAVETYPE==2 || WAVETYPE==3) {
sprintf(vzf,"%s_vz.su.shot%d.it%d",SEIS_FILE,ishot,iter);
sprintf(vzf,"%s_vz.su.syn.shot%d.it%d",SEIS_FILE,ishot,iter);
}
sprintf(pf,"%s_p.su.shot%d.it%d",SEIS_FILE,ishot,iter);
sprintf(divf,"%s_div.su.shot%d.it%d",SEIS_FILE,ishot,iter);
sprintf(curlf,"%s_curl.su.shot%d.it%d",SEIS_FILE,ishot,iter);
sprintf(pf,"%s_p.su.syn.shot%d.it%d",SEIS_FILE,ishot,iter);
sprintf(divf,"%s_div.su.syn.shot%d.it%d",SEIS_FILE,ishot,iter);
sprintf(curlf,"%s_curl.su.syn.shot%d.it%d",SEIS_FILE,ishot,iter);
break;
case 2:
......@@ -61,41 +61,36 @@ void saveseis_glob(FILE *fp, float **sectionvx, float **sectionvy,float **sectio
break;
case 3:
if(VELOCITY==0){
sprintf(vxf,"%s_dx.su.obs.filtered.shot%d.it%d",SEIS_FILE,ishot,iter);
sprintf(vyf,"%s_dy.su.obs.filtered.shot%d.it%d",SEIS_FILE,ishot,iter);
if(WRITE_FILTERED_DATA==1){
sprintf(vxf,"%s_vx.su.obs.shot%d.it%d",SEIS_FILE,ishot,iter);
sprintf(vyf,"%s_vy.su.obs.shot%d.it%d",SEIS_FILE,ishot,iter);
if(WAVETYPE==2 || WAVETYPE==3) {
sprintf(vzf,"%s_dz.su.obs.filtered.shot%d.it%d",SEIS_FILE,ishot,iter);
sprintf(vzf,"%s_vz.su.obs.shot%d.it%d",SEIS_FILE,ishot,iter);
}
} else {
sprintf(vxf,"%s_vx.su.obs.filtered.shot%d.it%d",SEIS_FILE,ishot,iter);
sprintf(vyf,"%s_vy.su.obs.filtered.shot%d.it%d",SEIS_FILE,ishot,iter);
sprintf(pf,"%s_p.su.obs.shot%d.it%d",SEIS_FILE,ishot,iter);
sprintf(divf,"%s_div.su.obs.shot%d.it%d",SEIS_FILE,ishot,iter);
sprintf(curlf,"%s_curl.su.obs.shot%d.it%d",SEIS_FILE,ishot,iter);
}else if(WRITE_FILTERED_DATA==2){
sprintf(vxf,"%s_vx.su.obs.adj.shot%d.it%d",SEIS_FILE,ishot,iter);
sprintf(vyf,"%s_vy.su.obs.adj.shot%d.it%d",SEIS_FILE,ishot,iter);
if(WAVETYPE==2 || WAVETYPE==3) {
sprintf(vzf,"%s_vz.su.obs.filtered.shot%d.it%d",SEIS_FILE,ishot,iter);
sprintf(vzf,"%s_vz.su.obs.adj.shot%d.it%d",SEIS_FILE,ishot,iter);
}
sprintf(pf,"%s_p.su.obs.adj.shot%d.it%d",SEIS_FILE,ishot,iter);
sprintf(divf,"%s_div.su.obs.adj.shot%d.it%d",SEIS_FILE,ishot,iter);
sprintf(curlf,"%s_curl.su.obs.adj.shot%d.it%d",SEIS_FILE,ishot,iter);
}
sprintf(pf,"%s_p.su.obs.filtered.shot%d.it%d",SEIS_FILE,ishot,iter);
sprintf(divf,"%s_div.su.obs.filtered.shot%d.it%d",SEIS_FILE,ishot,iter);
sprintf(curlf,"%s_curl.su.obs.filtered.shot%d.it%d",SEIS_FILE,ishot,iter);
break;
case 4:
if(VELOCITY==0){
sprintf(vxf,"%s_dx.su.syn.filtered.shot%d.it%d",SEIS_FILE,ishot,iter);
sprintf(vyf,"%s_dy.su.syn.filtered.shot%d.it%d",SEIS_FILE,ishot,iter);
if(WAVETYPE==2 || WAVETYPE==3) {
sprintf(vzf,"%s_dz.su.syn.filtered.shot%d.it%d",SEIS_FILE,ishot,iter);
}
} else {
sprintf(vxf,"%s_vx.su.syn.filtered.shot%d.it%d",SEIS_FILE,ishot,iter);
sprintf(vyf,"%s_vy.su.syn.filtered.shot%d.it%d",SEIS_FILE,ishot,iter);
if(WAVETYPE==2 || WAVETYPE==3) {
sprintf(vzf,"%s_vz.su.syn.filtered.shot%d.it%d",SEIS_FILE,ishot,iter);
}
sprintf(vxf,"%s_vx.su.syn.adj.shot%d.it%d",SEIS_FILE,ishot,iter);
sprintf(vyf,"%s_vy.su.syn.adj.shot%d.it%d",SEIS_FILE,ishot,iter);
if(WAVETYPE==2 || WAVETYPE==3) {
sprintf(vzf,"%s_vz.su.syn.adj.shot%d.it%d",SEIS_FILE,ishot,iter);
}
sprintf(pf,"%s_p.su.syn.filtered.shot%d.it%d",SEIS_FILE,ishot,iter);
sprintf(divf,"%s_div.su.syn.filtered.shot%d.it%d",SEIS_FILE,ishot,iter);
sprintf(curlf,"%s_curl.su.syn.filtered.shot%d.it%d",SEIS_FILE,ishot,iter);
sprintf(pf,"%s_p.su.syn.adj.shot%d.it%d",SEIS_FILE,ishot,iter);
sprintf(divf,"%s_div.su.syn.adj.shot%d.it%d",SEIS_FILE,ishot,iter);
sprintf(curlf,"%s_curl.su.syn.adj.shot%d.it%d",SEIS_FILE,ishot,iter);
break;
default:
......
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