Commit 5f99aa39 authored by Florian Wittkamp's avatar Florian Wittkamp

Merge second part

parent aef7f960
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
MODEL = ../genmod/1D_linear_gradient_visc.c MODEL = ../genmod/1D_linear_gradient_visc.c
MODEL_AC = ../genmod/1D_linear_gradient_ac.c MODEL_AC = ../genmod/1D_linear_gradient_ac.c
MODEL_EL = ../genmod/1D_linear_gradient_el.c MODEL_EL = ../genmod/1D_linear_gradient_el.c
MODEL_VAC = ../genmod/1D_linear_gradient_viscac.c
EXEC= ../bin EXEC= ../bin
# Description: # Description:
...@@ -18,7 +19,7 @@ EXEC= ../bin ...@@ -18,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
...@@ -101,6 +102,7 @@ DENISE= \ ...@@ -101,6 +102,7 @@ DENISE= \
$(MODEL) \ $(MODEL) \
$(MODEL_AC) \ $(MODEL_AC) \
$(MODEL_EL) \ $(MODEL_EL) \
$(MODEL_VAC) \
matcopy.c \ matcopy.c \
matcopy_elastic.c \ matcopy_elastic.c \
matcopy_acoustic.c \ matcopy_acoustic.c \
...@@ -158,6 +160,11 @@ DENISE= \ ...@@ -158,6 +160,11 @@ DENISE= \
calc_hilbert.c \ calc_hilbert.c \
eprecond.c \ eprecond.c \
eprecond1.c \ eprecond1.c \
zero_fdveps_viscac.c \
update_p_visc_PML.c \
matcopy_viscac.c \
prepare_update_p.c \
readmod_viscac.c \
filter_frequencies.c filter_frequencies.c
SNAPMERGE_OBJ = $(SNAPMERGE_SCR:%.c=%.o) SNAPMERGE_OBJ = $(SNAPMERGE_SCR:%.c=%.o)
......
...@@ -900,26 +900,32 @@ int main(int argc, char **argv){ ...@@ -900,26 +900,32 @@ int main(int argc, char **argv){
} }
/* create model grids */ /* create model grids */
if(L){ if(L){
if(!ACOUSTIC){
if (READMOD) readmod(prho,ppi,pu,ptaus,ptaup,peta);
else model(prho,ppi,pu,ptaus,ptaup,peta);
} else {
if (READMOD){
readmod_viscac(prho,ppi,ptaup,peta);
}else{
model_viscac(prho,ppi,ptaup,peta);
}
}
} else{
if(!ACOUSTIC){ if(!ACOUSTIC){
if (READMOD){ readmod_elastic(prho,ppi,pu); if (READMOD){
}else{ model_elastic(prho,ppi,pu); readmod(prho,ppi,pu,ptaus,ptaup,peta);
}else{
model(prho,ppi,pu,ptaus,ptaup,peta);
} }
}else{ }else{
if (READMOD){ readmod_acoustic(prho,ppi); if (READMOD){
}else{ model_acoustic(prho,ppi); readmod_viscac(prho,ppi,ptaup,peta);
}else{
model_viscac(prho,ppi,ptaup,peta);
}
}
}else{
if(!ACOUSTIC){
if (READMOD){
readmod_elastic(prho,ppi,pu);
}else{
model_elastic(prho,ppi,pu);
}
}else{
if (READMOD){
readmod_acoustic(prho,ppi);
}else{
model_acoustic(prho,ppi);
} }
} }
} }
...@@ -1029,12 +1035,12 @@ model_viscac(prho,ppi,ptaup,peta); ...@@ -1029,12 +1035,12 @@ model_viscac(prho,ppi,ptaup,peta);
they have to be averaged. For this, values lying at 0 and NX+1, they have to be averaged. For this, values lying at 0 and NX+1,
for example, are required on the local grid. These are now copied from the for example, are required on the local grid. These are now copied from the
neighbouring grids */ neighbouring grids */
if (L){ if (L){
if(!ACOUSTIC){ if(!ACOUSTIC){
matcopy(prho,ppi,pu,ptaus,ptaup); matcopy(prho,ppi,pu,ptaus,ptaup);
} else { } else {
matcopy_viscac(prho,ppi,ptaup); matcopy_viscac(prho,ppi,ptaup);
} }
}else{ }else{
if(!ACOUSTIC){ if(!ACOUSTIC){
matcopy_elastic(prho, ppi, pu); matcopy_elastic(prho, ppi, pu);
...@@ -1062,13 +1068,13 @@ matcopy_viscac(prho,ppi,ptaup); ...@@ -1062,13 +1068,13 @@ matcopy_viscac(prho,ppi,ptaup);
/* Preparing memory variables for update_s (viscoelastic) */ /* Preparing memory variables for update_s (viscoelastic) */
if (L) { if (L) {
if(!ACOUSTIC){ if(!ACOUSTIC){
prepare_update_s(etajm,etaip,peta,fipjp,pu,puipjp,ppi,prho,ptaus,ptaup,ptausipjp,f,g,bip,bjm,cip,cjm,dip,d,e); prepare_update_s(etajm,etaip,peta,fipjp,pu,puipjp,ppi,prho,ptaus,ptaup,ptausipjp,f,g,bip,bjm,cip,cjm,dip,d,e);
} else { } else {
prepare_update_p(etajm,peta,ppi,prho,ptaup,g,bjm,cjm,e); prepare_update_p(etajm,peta,ppi,prho,ptaup,g,bjm,cjm,e);
} }
} }
if(iter==1){ if(iter==1){
...@@ -1295,15 +1301,15 @@ prepare_update_s(etajm,etaip,peta,fipjp,pu,puipjp,ppi,prho,ptaus,ptaup,ptausipjp ...@@ -1295,15 +1301,15 @@ prepare_update_s(etajm,etaip,peta,fipjp,pu,puipjp,ppi,prho,ptaus,ptaup,ptausipjp
/* calculate wavelet for each source point */ /* calculate wavelet for each source point */
signals=NULL; signals=NULL;
signals=wavelet(srcpos_loc,nsrc_loc,ishot,0); signals=wavelet(srcpos_loc,nsrc_loc,ishot,0);
/* initialize wavefield with zero */ /* initialize wavefield with zero */
if (L){ if (L){
if(!ACOUSTIC) { if(!ACOUSTIC) {
zero_fdveps_visc(-nd+1,NY+nd,-nd+1,NX+nd,pvx,pvy,pvz,psxx,psyy,psxy,psxz,psyz,ux,uy,uxy,pvxp1,pvyp1,psi_sxx_x,psi_sxy_x,psi_sxz_x,psi_vxx,psi_vyx,psi_vzx,psi_syy_y,psi_sxy_y,psi_syz_y,psi_vyy,psi_vxy,psi_vzy,psi_vxxs,pr,pp,pq,pt,po); zero_fdveps_visc(-nd+1,NY+nd,-nd+1,NX+nd,pvx,pvy,pvz,psxx,psyy,psxy,psxz,psyz,ux,uy,uxy,pvxp1,pvyp1,psi_sxx_x,psi_sxy_x,psi_sxz_x,psi_vxx,psi_vyx,psi_vzx,psi_syy_y,psi_sxy_y,psi_syz_y,psi_vyy,psi_vxy,psi_vzy,psi_vxxs,pr,pp,pq,pt,po);
} else { } else {
zero_fdveps_viscac(-nd+1, NY+nd, -nd+1, NX+nd, pvx, pvy, psp, pvxp1, pvyp1, psi_sxx_x, psi_sxy_x, psi_vxx, psi_vyx, psi_syy_y, psi_sxy_y, psi_vyy, psi_vxy, psi_vxxs, pp); zero_fdveps_viscac(-nd+1, NY+nd, -nd+1, NX+nd, pvx, pvy, psp, pvxp1, pvyp1, psi_sxx_x, psi_sxy_x, psi_vxx, psi_vyx, psi_syy_y, psi_sxy_y, psi_vyy, psi_vxy, psi_vxxs, pp);
} }
}else{ }else{
if(!ACOUSTIC) if(!ACOUSTIC)
zero_fdveps(-nd+1,NY+nd,-nd+1,NX+nd,pvx,pvy,pvz,psxx,psyy,psxy,psxz,psyz,ux,uy,uxy,pvxp1,pvyp1,psi_sxx_x,psi_sxy_x,psi_sxz_x,psi_vxx,psi_vyx,psi_vzx,psi_syy_y,psi_sxy_y,psi_syz_y,psi_vyy,psi_vxy,psi_vzy,psi_vxxs); zero_fdveps(-nd+1,NY+nd,-nd+1,NX+nd,pvx,pvy,pvz,psxx,psyy,psxy,psxz,psyz,ux,uy,uxy,pvxp1,pvyp1,psi_sxx_x,psi_sxy_x,psi_sxz_x,psi_vxx,psi_vyx,psi_vzx,psi_syy_y,psi_sxy_y,psi_syz_y,psi_vyy,psi_vxy,psi_vzy,psi_vxxs);
...@@ -1361,11 +1367,11 @@ zero_fdveps_viscac(-nd+1, NY+nd, -nd+1, NX+nd, pvx, pvy, psp, pvxp1, pvyp1, psi_ ...@@ -1361,11 +1367,11 @@ zero_fdveps_viscac(-nd+1, NY+nd, -nd+1, NX+nd, pvx, pvy, psp, pvxp1, pvyp1, psi_
} }
if (L) { /* viscoelastic */ if (L) { /* viscoelastic */
if(!ACOUSTIC) { if(!ACOUSTIC) {
update_s_visc_PML(1, NX, 1, NY, pvx, pvy, ux, uy, uxy, uyx, psxx, psyy, psxy, ppi, pu, puipjp, prho, hc, infoout,pr, pp, pq, fipjp, f, g, bip, bjm, cip, cjm, d, e, dip,K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half, psi_vxx, psi_vyy, psi_vxy, psi_vyx); update_s_visc_PML(1, NX, 1, NY, pvx, pvy, ux, uy, uxy, uyx, psxx, psyy, psxy, ppi, pu, puipjp, prho, hc, infoout,pr, pp, pq, fipjp, f, g, bip, bjm, cip, cjm, d, e, dip,K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half, psi_vxx, psi_vyy, psi_vxy, psi_vyx);
} else { }else{
update_p_visc_PML(1, NX, 1, NY, pvx, pvy, psp, ppi, prho, hc, infoout, pp, g, bjm, cjm, e, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half, psi_vxx, psi_vyy, psi_vxy, psi_vyx); update_p_visc_PML(1, NX, 1, NY, pvx, pvy, psp, ppi, prho, hc, infoout, pp, g, bjm, cjm, e, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half, psi_vxx, psi_vyy, psi_vxy, psi_vyx);
} }
}else{ }else{
if(!ACOUSTIC) if(!ACOUSTIC)
update_s_elastic_PML(1, NX, 1, NY, pvx, pvy, ux, uy, uxy, uyx, psxx, psyy, psxy, ppi, pu, puipjp, absorb_coeff, prho, hc, infoout,K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half, psi_vxx, psi_vyy, psi_vxy, psi_vyx); update_s_elastic_PML(1, NX, 1, NY, pvx, pvy, ux, uy, uxy, uyx, psxx, psyy, psxy, ppi, pu, puipjp, absorb_coeff, prho, hc, infoout,K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half, psi_vxx, psi_vyy, psi_vxy, psi_vyx);
...@@ -1377,14 +1383,15 @@ update_p_visc_PML(1, NX, 1, NY, pvx, pvy, psp, ppi, prho, hc, infoout, pp, g, bj ...@@ -1377,14 +1383,15 @@ update_p_visc_PML(1, NX, 1, NY, pvx, pvy, psp, ppi, prho, hc, infoout, pp, g, bj
if ((!CHECKPTREAD)&&(QUELLTYP==1)) if ((!CHECKPTREAD)&&(QUELLTYP==1))
psource(nt,psxx,psyy,psp,srcpos_loc,signals,nsrc_loc,0); psource(nt,psxx,psyy,psp,srcpos_loc,signals,nsrc_loc,0);
if ((FREE_SURF) && (POS[2]==0)){ if ((FREE_SURF) && (POS[2]==0)){
if (!ACOUSTIC){ if (!ACOUSTIC){
if (L) /* viscoelastic */ if (L){ /* viscoelastic */
surface_PML(1, pvx, pvy, psxx, psyy, psxy,psyz, pp, pq, ppi, pu, prho, ptaup, ptaus, etajm, peta, hc, K_x, a_x, b_x, psi_vxxs, ux, uy, uxy); surface_PML(1, pvx, pvy, psxx, psyy, psxy,psyz, pp, pq, ppi, pu, prho, ptaup, ptaus, etajm, peta, hc, K_x, a_x, b_x, psi_vxxs, ux, uy, uxy);
else{ }else{ /* elastic */
surface_elastic_PML(1, pvx, pvy, psxx, psyy, psxy,psyz, ppi, pu, prho, hc, K_x, a_x, b_x, psi_vxxs, ux, uy, uxy,uyz,psxz,uxz); surface_elastic_PML(1, pvx, pvy, psxx, psyy, psxy,psyz, ppi, pu, prho, hc, K_x, a_x, b_x, psi_vxxs, ux, uy, uxy,uyz,psxz,uxz);
} else { }
surface_acoustic_PML(1, psp); } else { /* viscoelastic and elastic ACOUSTIC */
surface_acoustic_PML(1, psp);
} }
} }
...@@ -1435,29 +1442,29 @@ if (!ACOUSTIC){ ...@@ -1435,29 +1442,29 @@ if (!ACOUSTIC){
} else { } else {
forward_prop_x[j][i][hin]=ux[j][i]; forward_prop_x[j][i][hin]=ux[j][i];
forward_prop_y[j][i][hin]=uy[j][i];} forward_prop_y[j][i][hin]=uy[j][i];}
// forward_prop_x[imat]=ux[j][i]; // forward_prop_x[imat]=ux[j][i];
// forward_prop_y[imat]=uy[j][i];} // forward_prop_y[imat]=uy[j][i];}
// imat++; // imat++;
} }
} }
}else{ }else{
for (i=1;i<=NX;i=i+IDXI){ for (i=1;i<=NX;i=i+IDXI){
for (j=1;j<=NY;j=j+IDYI){ for (j=1;j<=NY;j=j+IDYI){
forward_prop_p[j][i][hin]=psp[j][i]; forward_prop_p[j][i][hin]=psp[j][i];
} }
} }
} }
if(!ACOUSTIC){ if(!ACOUSTIC){
for (i=1;i<=NX;i=i+IDXI){ for (i=1;i<=NX;i=i+IDXI){
for (j=1;j<=NY;j=j+IDYI){ for (j=1;j<=NY;j=j+IDYI){
if(VELOCITY==0){ if(VELOCITY==0){
forward_prop_u[j][i][hin]=psxy[j][i];} forward_prop_u[j][i][hin]=psxy[j][i];}
// forward_prop_u[imat2]=psxy[j][i];} // forward_prop_u[imat2]=psxy[j][i];}
else{ else{
forward_prop_u[j][i][hin]=uxy[j][i];} forward_prop_u[j][i][hin]=uxy[j][i];}
// forward_prop_u[imat2]=uxy[j][i];} // forward_prop_u[imat2]=uxy[j][i];}
// imat2++; // imat2++;
} }
} }
} }
...@@ -1635,12 +1642,12 @@ if (!ACOUSTIC){ ...@@ -1635,12 +1642,12 @@ if (!ACOUSTIC){
srcpos_loc = splitsrc(srcpos,&nsrc_loc, nsrc); srcpos_loc = splitsrc(srcpos,&nsrc_loc, nsrc);
} }
if(INV_STF){ if(INV_STF){
QUELLART=7; QUELLART=7;
fprintf(FP,"\n MYID=%d ***** Due to inversion of source time function QUELLART is switched to 7 ********** \n",MYID); fprintf(FP,"\n MYID=%d ***** Due to inversion of source time function QUELLART is switched to 7 ********** \n",MYID);
fprintf(FP,"\n MYID=%d ***** Using optimized source time function located in %s.shot%d ********** \n\n\n",MYID,SIGNAL_FILE,ishot); fprintf(FP,"\n MYID=%d ***** Using optimized source time function located in %s.shot%d ********** \n\n\n",MYID,SIGNAL_FILE,ishot);
} }
MPI_Barrier(MPI_COMM_WORLD); MPI_Barrier(MPI_COMM_WORLD);
/*-------------------*/ /*-------------------*/
...@@ -1722,14 +1729,14 @@ if (!ACOUSTIC){ ...@@ -1722,14 +1729,14 @@ if (!ACOUSTIC){
MPI_Barrier(MPI_COMM_WORLD); MPI_Barrier(MPI_COMM_WORLD);
if((iter>1)&&(nsrc_loc>0)&&(INV_STF==1)){
/* initialize wavefield with zero */ /* initialize wavefield with zero */
if (L){ if (L){
if(!ACOUSTIC) { if(!ACOUSTIC) {
zero_fdveps_visc(-nd+1,NY+nd,-nd+1,NX+nd,pvx,pvy,pvz,psxx,psyy,psxy,psxz,psyz,ux,uy,uxy,pvxp1,pvyp1,psi_sxx_x,psi_sxy_x,psi_sxz_x,psi_vxx,psi_vyx,psi_vzx,psi_syy_y,psi_sxy_y,psi_syz_y,psi_vyy,psi_vxy,psi_vzy,psi_vxxs,pr,pp,pq,pt,po); zero_fdveps_visc(-nd+1,NY+nd,-nd+1,NX+nd,pvx,pvy,pvz,psxx,psyy,psxy,psxz,psyz,ux,uy,uxy,pvxp1,pvyp1,psi_sxx_x,psi_sxy_x,psi_sxz_x,psi_vxx,psi_vyx,psi_vzx,psi_syy_y,psi_sxy_y,psi_syz_y,psi_vyy,psi_vxy,psi_vzy,psi_vxxs,pr,pp,pq,pt,po);
} else { } else {
zero_fdveps_viscac(-nd+1, NY+nd, -nd+1, NX+nd, pvx, pvy, psp, pvxp1, pvyp1, psi_sxx_x, psi_sxy_x, psi_vxx, psi_vyx, psi_syy_y, psi_sxy_y, psi_vyy, psi_vxy, psi_vxxs, pp); } zero_fdveps_viscac(-nd+1, NY+nd, -nd+1, NX+nd, pvx, pvy, psp, pvxp1, pvyp1, psi_sxx_x, psi_sxy_x, psi_vxx, psi_vyx, psi_syy_y, psi_sxy_y, psi_vyy, psi_vxy, psi_vxxs, pp); }
}else{ }else{
if(!ACOUSTIC) if(!ACOUSTIC)
zero_fdveps(-nd+1,NY+nd,-nd+1,NX+nd,pvx,pvy,pvz,psxx,psyy,psxy,psxz,psyz,ux,uy,uxy,pvxp1,pvyp1,psi_sxx_x,psi_sxy_x,psi_sxz_x,psi_vxx,psi_vyx,psi_vzx,psi_syy_y,psi_sxy_y,psi_syz_y,psi_vyy,psi_vxy,psi_vzy,psi_vxxs); zero_fdveps(-nd+1,NY+nd,-nd+1,NX+nd,pvx,pvy,pvz,psxx,psyy,psxy,psxz,psyz,ux,uy,uxy,pvxp1,pvyp1,psi_sxx_x,psi_sxy_x,psi_sxz_x,psi_vxx,psi_vyx,psi_vzx,psi_syy_y,psi_sxy_y,psi_syz_y,psi_vyy,psi_vxy,psi_vzy,psi_vxxs);
...@@ -1858,9 +1865,9 @@ zero_fdveps_viscac(-nd+1, NY+nd, -nd+1, NX+nd, pvx, pvy, psp, pvxp1, pvyp1, psi_ ...@@ -1858,9 +1865,9 @@ zero_fdveps_viscac(-nd+1, NY+nd, -nd+1, NX+nd, pvx, pvy, psp, pvxp1, pvyp1, psi_
if (WAVETYPE==2 || WAVETYPE==3) { if (WAVETYPE==2 || WAVETYPE==3) {
update_v_PML_SH(1, NX, 1, NY, nt, pvz, pvzp1, pvzm1, psxz, psyz,prjp, srcpos_loc, signals, signals_SH, nsrc_loc, absorb_coeff,hc,infoout,0, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half, psi_sxz_x, psi_syz_y); update_v_PML_SH(1, NX, 1, NY, nt, pvz, pvzp1, pvzm1, psxz, psyz,prjp, srcpos_loc, signals, signals_SH, nsrc_loc, absorb_coeff,hc,infoout,0, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half, psi_sxz_x, psi_syz_y);
} }
} } else {
else
update_v_acoustic_PML(1, NX, 1, NY, nt, pvx, pvxp1, pvxm1, pvy, pvyp1, pvym1, psp, prip, prjp, srcpos_loc,signals,signals,nsrc_loc,absorb_coeff,hc,infoout,0, K_x_half, a_x_half, b_x_half, K_y_half, a_y_half, b_y_half, psi_sxx_x, psi_syy_y); update_v_acoustic_PML(1, NX, 1, NY, nt, pvx, pvxp1, pvxm1, pvy, pvyp1, pvym1, psp, prip, prjp, srcpos_loc,signals,signals,nsrc_loc,absorb_coeff,hc,infoout,0, K_x_half, a_x_half, b_x_half, K_y_half, a_y_half, b_y_half, psi_sxx_x, psi_syy_y);
}
if (MYID==0){ if (MYID==0){
time4=MPI_Wtime(); time4=MPI_Wtime();
...@@ -1878,48 +1885,51 @@ zero_fdveps_viscac(-nd+1, NY+nd, -nd+1, NX+nd, pvx, pvy, psp, pvxp1, pvyp1, psi_ ...@@ -1878,48 +1885,51 @@ zero_fdveps_viscac(-nd+1, NY+nd, -nd+1, NX+nd, pvx, pvy, psp, pvxp1, pvyp1, psi_
} }
if (L) { /* viscoelastic */ if (L) { /* viscoelastic */
if (WAVETYPE==1 || WAVETYPE==3) { if (WAVETYPE==1 || WAVETYPE==3) {
if(!ACOUSTIC) { if(!ACOUSTIC) {
update_s_visc_PML(1, NX, 1, NY, pvx, pvy, ux, uy, uxy, uyx, psxx, psyy, psxy, ppi, pu, puipjp, prho, hc, infoout, pr, pp, pq, fipjp, f, g, bip, bjm, cip, cjm, d, e, dip, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half, psi_vxx, psi_vyy, psi_vxy, psi_vyx); update_s_visc_PML(1, NX, 1, NY, pvx, pvy, ux, uy, uxy, uyx, psxx, psyy, psxy, ppi, pu, puipjp, prho, hc, infoout, pr, pp, pq, fipjp, f, g, bip, bjm, cip, cjm, d, e, dip, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half, psi_vxx, psi_vyy, psi_vxy, psi_vyx);
}else{ }else{
update_p_visc_PML(1, NX, 1, NY, pvx, pvy, psp, ppi, prho, hc, infoout, pp, g, bjm, cjm, e, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half, psi_vxx, psi_vyy, psi_vxy, psi_vyx); update_p_visc_PML(1, NX, 1, NY, pvx, pvy, psp, ppi, prho, hc, infoout, pp, g, bjm, cjm, e, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half, psi_vxx, psi_vyy, psi_vxy, psi_vyx);
} }
} }
if (WAVETYPE==2 || WAVETYPE==3) { if (WAVETYPE==2 || WAVETYPE==3) {
update_s_visc_PML_SH(1, NX, 1, NY, pvz, psxz, psyz, pt, po, puip, pujp, tausip, tausjp, bip, bjm, cip, cjm, etajm, etaip, hc,infoout, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half,psi_vzx, psi_vzy); update_s_visc_PML_SH(1, NX, 1, NY, pvz, psxz, psyz, pt, po, puip, pujp, tausip, tausjp, bip, bjm, cip, cjm, etajm, etaip, hc,infoout, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half,psi_vzx, psi_vzy);
} }
} else { /* elastic */ } else { /* elastic */
if (WAVETYPE==1 || WAVETYPE==3) { if (WAVETYPE==1 || WAVETYPE==3) {
if(!ACOUSTIC) { if(!ACOUSTIC) {
update_s_elastic_PML(1, NX, 1, NY, pvx, pvy, ux, uy, uxy, uyx, psxx, psyy, psxy, ppi, pu, puipjp, absorb_coeff, prho, hc, infoout, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half, psi_vxx, psi_vyy, psi_vxy, psi_vyx); update_s_elastic_PML(1, NX, 1, NY, pvx, pvy, ux, uy, uxy, uyx, psxx, psyy, psxy, ppi, pu, puipjp, absorb_coeff, prho, hc, infoout, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half, psi_vxx, psi_vyy, psi_vxy, psi_vyx);
} else { } else {
update_p_PML(1, NX, 1, NY, pvx, pvy, psp, ppi, absorb_coeff, prho, hc, infoout, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half, psi_vxx, psi_vyy, psi_vxy, psi_vyx); update_p_PML(1, NX, 1, NY, pvx, pvy, psp, ppi, absorb_coeff, prho, hc, infoout, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half, psi_vxx, psi_vyy, psi_vxy, psi_vyx);
}
}
if (WAVETYPE==2 || WAVETYPE==3) {
update_s_elastic_PML_SH(1, NX, 1, NY, pvz,psxz,psyz,uxz,uyz,hc,infoout, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half,psi_vzx, psi_vzy,puipjp,pu,prho);
} }
} }
if (WAVETYPE==2 || WAVETYPE==3) {
update_s_elastic_PML_SH(1, NX, 1, NY, pvz,psxz,psyz,uxz,uyz,hc,infoout, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half,psi_vzx, psi_vzy,puipjp,pu,prho);
}
} }
/* explosive source */ /* explosive source */
if ((!CHECKPTREAD)&&(QUELLTYP==1)&&(WAVETYPE==1||WAVETYPE==3)) if ((!CHECKPTREAD)&&(QUELLTYP==1)&&(WAVETYPE==1||WAVETYPE==3))
psource(nt,psxx,psyy,psp,srcpos_loc,signals,nsrc_loc,0); psource(nt,psxx,psyy,psp,srcpos_loc,signals,nsrc_loc,0);
/* apply free surface */ /* apply free surface */
if ((FREE_SURF) && (POS[2]==0)){ if ((FREE_SURF) && (POS[2]==0)){
if (L) /* viscoelastic */ if (L) {
if(!ACOUSTIC) { /* viscoelastic */
surface_PML(1, pvx, pvy, psxx, psyy, psxy,psyz, pp, pq, ppi, pu, prho, ptaup, ptaus, etajm, peta, hc, K_x, a_x, b_x, psi_vxxs, ux, uy, uxy); if(!ACOUSTIC) {
}else{ surface_PML(1, pvx, pvy, psxx, psyy, psxy,psyz, pp, pq, ppi, pu, prho, ptaup, ptaus, etajm, peta, hc, K_x, a_x, b_x, psi_vxxs, ux, uy, uxy);
surface_acoustic_PML(1, psp); }else{
} surface_acoustic_PML(1, psp);
else{ }
if(!ACOUSTIC)/* elastic */ }else{
/* elastic */
if(!ACOUSTIC) {
surface_elastic_PML(1, pvx, pvy, psxx, psyy, psxy,psyz, ppi, pu, prho, hc, K_x, a_x, b_x, psi_vxxs, ux, uy, uxy,uyz, psxz,uxz); surface_elastic_PML(1, pvx, pvy, psxx, psyy, psxy,psyz, ppi, pu, prho, hc, K_x, a_x, b_x, psi_vxxs, ux, uy, uxy,uyz, psxz,uxz);
else }else{
surface_acoustic_PML(1, psp); surface_acoustic_PML(1, psp);
}
} }
} }
...@@ -2340,17 +2350,18 @@ surface_acoustic_PML(1, psp); ...@@ -2340,17 +2350,18 @@ surface_acoustic_PML(1, psp);
/*----------------------------------*/ /*----------------------------------*/
/* initialize wavefield with zero */ /* initialize wavefield with zero */
/*----------------------------------*/ /*----------------------------------*/
if (L){ if (L){
if(!ACOUSTIC) { if(!ACOUSTIC) {
zero_fdveps_visc(-nd+1,NY+nd,-nd+1,NX+nd,pvx,pvy,pvz,psxx,psyy,psxy,psxz,psyz,ux,uy,uxy,pvxp1,pvyp1,psi_sxx_x,psi_sxy_x,psi_sxz_x,psi_vxx,psi_vyx,psi_vzx,psi_syy_y,psi_sxy_y,psi_syz_y,psi_vyy,psi_vxy,psi_vzy,psi_vxxs,pr,pp,pq,pt,po); zero_fdveps_visc(-nd+1,NY+nd,-nd+1,NX+nd,pvx,pvy,pvz,psxx,psyy,psxy,psxz,psyz,ux,uy,uxy,pvxp1,pvyp1,psi_sxx_x,psi_sxy_x,psi_sxz_x,psi_vxx,psi_vyx,psi_vzx,psi_syy_y,psi_sxy_y,psi_syz_y,psi_vyy,psi_vxy,psi_vzy,psi_vxxs,pr,pp,pq,pt,po);
} else { } else {
zero_fdveps_viscac(-nd+1, NY+nd, -nd+1, NX+nd, pvx, pvy, psp, pvxp1, pvyp1, psi_sxx_x, psi_sxy_x, psi_vxx, psi_vyx, psi_syy_y, psi_sxy_y, psi_vyy, psi_vxy, psi_vxxs, pp); zero_fdveps_viscac(-nd+1, NY+nd, -nd+1, NX+nd, pvx, pvy, psp, pvxp1, pvyp1, psi_sxx_x, psi_sxy_x, psi_vxx, psi_vyx, psi_syy_y, psi_sxy_y, psi_vyy, psi_vxy, psi_vxxs, pp);
} }
}else{ }else{
if(!ACOUSTIC) if(!ACOUSTIC) {
zero_fdveps(-nd+1,NY+nd,-nd+1,NX+nd,pvx,pvy,pvz,psxx,psyy,psxy,psxz,psyz,ux,uy,uxy,pvxp1,pvyp1,psi_sxx_x,psi_sxy_x,psi_sxz_x,psi_vxx,psi_vyx,psi_vzx,psi_syy_y,psi_sxy_y,psi_syz_y,psi_vyy,psi_vxy,psi_vzy,psi_vxxs); zero_fdveps(-nd+1,NY+nd,-nd+1,NX+nd,pvx,pvy,pvz,psxx,psyy,psxy,psxz,psyz,ux,uy,uxy,pvxp1,pvyp1,psi_sxx_x,psi_sxy_x,psi_sxz_x,psi_vxx,psi_vyx,psi_vzx,psi_syy_y,psi_sxy_y,psi_syz_y,psi_vyy,psi_vxy,psi_vzy,psi_vxxs);
else }else{
zero_fdveps_ac(-nd+1,NY+nd,-nd+1,NX+nd,pvx,pvy,psp,pvxp1,pvyp1,psi_sxx_x,psi_sxy_x,psi_vxx,psi_vyx,psi_syy_y,psi_sxy_y,psi_vyy,psi_vxy,psi_vxxs); zero_fdveps_ac(-nd+1,NY+nd,-nd+1,NX+nd,pvx,pvy,psp,pvxp1,pvyp1,psi_sxx_x,psi_sxy_x,psi_vxx,psi_vyx,psi_syy_y,psi_sxy_y,psi_vyy,psi_vxy,psi_vxxs);
}
} }
lsnap=iround(TSNAP1/DT); lsnap=iround(TSNAP1/DT);
...@@ -2400,9 +2411,9 @@ zero_fdveps_viscac(-nd+1, NY+nd, -nd+1, NX+nd, pvx, pvy, psp, pvxp1, pvyp1, psi_ ...@@ -2400,9 +2411,9 @@ zero_fdveps_viscac(-nd+1, NY+nd, -nd+1, NX+nd, pvx, pvy, psp, pvxp1, pvyp1, psi_
if (WAVETYPE==2 || WAVETYPE==3) { if (WAVETYPE==2 || WAVETYPE==3) {
update_v_PML_SH(1, NX, 1, NY, nt, pvz, pvzp1, pvzm1, psxz, psyz,prjp, srcpos_loc_back, sectionvzdiff, sectionvzdiff, ntr1, absorb_coeff,hc,infoout,1, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half, psi_sxz_x, psi_syz_y); update_v_PML_SH(1, NX, 1, NY, nt, pvz, pvzp1, pvzm1, psxz, psyz,prjp, srcpos_loc_back, sectionvzdiff, sectionvzdiff, ntr1, absorb_coeff,hc,infoout,1, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half, psi_sxz_x, psi_syz_y);
} }
} } else {
else
update_v_acoustic_PML(1, NX, 1, NY, nt, pvx, pvxp1, pvxm1, pvy, pvyp1, pvym1, psp, prip, prjp, srcpos_loc_back, sectionpdiff,sectionpdiff,ntr1,absorb_coeff,hc,infoout,1, K_x_half, a_x_half, b_x_half, K_y_half, a_y_half, b_y_half, psi_sxx_x, psi_syy_y); update_v_acoustic_PML(1, NX, 1, NY, nt, pvx, pvxp1, pvxm1, pvy, pvyp1, pvym1, psp, prip, prjp, srcpos_loc_back, sectionpdiff,sectionpdiff,ntr1,absorb_coeff,hc,infoout,1, K_x_half, a_x_half, b_x_half, K_y_half, a_y_half, b_y_half, psi_sxx_x, psi_syy_y);
}
if (MYID==0){ if (MYID==0){
...@@ -2422,18 +2433,20 @@ zero_fdveps_viscac(-nd+1, NY+nd, -nd+1, NX+nd, pvx, pvy, psp, pvxp1, pvyp1, psi_ ...@@ -2422,18 +2433,20 @@ zero_fdveps_viscac(-nd+1, NY+nd, -nd+1, NX+nd, pvx, pvy, psp, pvxp1, pvyp1, psi_
/*update_s_elastic_hc(1, NX, 1, NY, pvx, pvy, ux, uy, uxy, uyx, psxx, psyy, psxy, ppi, pu, puipjp,absorb_coeff, prho, hc, infoout);*/ /*update_s_elastic_hc(1, NX, 1, NY, pvx, pvy, ux, uy, uxy, uyx, psxx, psyy, psxy, ppi, pu, puipjp,absorb_coeff, prho, hc, infoout);*/
if (L) { /* viscoelastic */ if (L) {
/* viscoelastic */
if (WAVETYPE==1 || WAVETYPE==3) { if (WAVETYPE==1 || WAVETYPE==3) {
if(!ACOUSTIC) if(!ACOUSTIC) {
update_s_visc_PML(1, NX, 1, NY, pvx, pvy, ux, uy, uxy, uyx, psxx, psyy, psxy, ppi, pu, puipjp, prho, hc, infoout,pr, pp, pq, fipjp, f, g, bip, bjm, cip, cjm, d, e, dip,K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half, psi_vxx, psi_vyy, psi_vxy, psi_vyx); update_s_visc_PML(1, NX, 1, NY, pvx, pvy, ux, uy, uxy, uyx, psxx, psyy, psxy, ppi, pu, puipjp, prho, hc, infoout,pr, pp, pq, fipjp, f, g, bip, bjm, cip, cjm, d, e, dip,K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half, psi_vxx, psi_vyy, psi_vxy, psi_vyx);
else }else{
update_p_visc_PML(1, NX, 1, NY, pvx, pvy, psp, ppi, prho, hc, infoout, pp, g, bjm, cjm, e, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half, psi_vxx, psi_vyy, psi_vxy, psi_vyx); update_p_visc_PML(1, NX, 1, NY, pvx, pvy, psp, ppi, prho, hc, infoout, pp, g, bjm, cjm, e, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half, psi_vxx, psi_vyy, psi_vxy, psi_vyx);
}
} }
if (WAVETYPE==2 || WAVETYPE==3) { if (WAVETYPE==2 || WAVETYPE==3) {
update_s_visc_PML_SH(1, NX, 1, NY, pvz, psxz, psyz, pt, po, puip, pujp, tausip, tausjp, bip, bjm, cip, cjm, etajm, etaip, hc,infoout, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half,psi_vzx, psi_vzy); update_s_visc_PML_SH(1, NX, 1, NY, pvz, psxz, psyz, pt, po, puip, pujp, tausip, tausjp, bip, bjm, cip, cjm, etajm, etaip, hc,infoout, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half,psi_vzx, psi_vzy);
} }
} } else{
else{ /* elastic */
if(!ACOUSTIC){ if(!ACOUSTIC){
if (WAVETYPE==1 || WAVETYPE==3) { if (WAVETYPE==1 || WAVETYPE==3) {
update_s_elastic_PML(1, NX, 1, NY, pvx, pvy, ux, uy, uxy, uyx, psxx, psyy, psxy, ppi, pu, puipjp, absorb_coeff, prho, hc, infoout, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half, psi_vxx, psi_vyy, psi_vxy, psi_vyx); update_s_elastic_PML(1, NX, 1, NY, pvx, pvy, ux, uy, uxy, uyx, psxx, psyy, psxy, ppi, pu, puipjp, absorb_coeff, prho, hc, infoout, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half, psi_vxx, psi_vyy, psi_vxy, psi_vyx);
...@@ -2441,9 +2454,9 @@ zero_fdveps_viscac(-nd+1, NY+nd, -nd+1, NX+nd, pvx, pvy, psp, pvxp1, pvyp1, psi_ ...@@ -2441,9 +2454,9 @@ zero_fdveps_viscac(-nd+1, NY+nd, -nd+1, NX+nd, pvx, pvy, psp, pvxp1, pvyp1, psi_
if (WAVETYPE==2 || WAVETYPE==3) { if (WAVETYPE==2 || WAVETYPE==3) {
update_s_elastic_PML_SH(1, NX, 1, NY, pvz,psxz,psyz,uxz,uyz,hc,infoout, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half,psi_vzx, psi_vzy,puipjp,pu,prho); update_s_elastic_PML_SH(1, NX, 1, NY, pvz,psxz,psyz,uxz,uyz,hc,infoout, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half,psi_vzx, psi_vzy,puipjp,pu,prho);
} }
} } else {
else
update_p_PML(1, NX, 1, NY, pvx, pvy, psp, ppi, absorb_coeff, prho, hc, infoout, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half, psi_vxx, psi_vyy, psi_vxy, psi_vyx); update_p_PML(1, NX, 1, NY, pvx, pvy, psp, ppi, absorb_coeff, prho, hc, infoout, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half, psi_vxx, psi_vyy, psi_vxy, psi_vyx);
}
} }
/* explosive source */ /* explosive source */
...@@ -2451,18 +2464,22 @@ zero_fdveps_viscac(-nd+1, NY+nd, -nd+1, NX+nd, pvx, pvy, psp, pvxp1, pvyp1, psi_ ...@@ -2451,18 +2464,22 @@ zero_fdveps_viscac(-nd+1, NY+nd, -nd+1, NX+nd, pvx, pvy, psp, pvxp1, pvyp1, psi_
psource(nt,psxx,psyy,psp,srcpos_loc_back,sectionpdiff,ntr1,1); psource(nt,psxx,psyy,psp,srcpos_loc_back,sectionpdiff,ntr1,1);
if ((FREE_SURF) && (POS[2]==0)){ if ((FREE_SURF) && (POS[2]==0)){
if (L) /* viscoelastic */ if (L) {
if (!ACOUSTIC) { /* viscoelastic */
surface_PML(1, pvx, pvy, psxx, psyy, psxy,psyz, pp, pq, ppi, pu, prho, ptaup, ptaus, etajm, peta, hc, K_x, a_x, b_x, psi_vxxs, ux, uy, uxy); if (!ACOUSTIC) {
}else{ /* acoustic */ surface_PML(1, pvx, pvy, psxx, psyy, psxy,psyz, pp, pq, ppi, pu, prho, ptaup, ptaus, etajm, peta, hc, K_x, a_x, b_x, psi_vxxs, ux, uy, uxy);
surface_acoustic_PML(1, psp); }else{
} /* acoustic */
} surface_acoustic_PML(1, psp);
else{ }
if(!ACOUSTIC)/* elastic */ }else{
/* elastic */
if(!ACOUSTIC){
surface_elastic_PML(1, pvx, pvy, psxx, psyy, psxy,psyz, ppi, pu, prho, hc, K_x, a_x, b_x, psi_vxxs, ux, uy, uxy,uyz,psxz,uxz); surface_elastic_PML(1, pvx, pvy, psxx, psyy, psxy,psyz, ppi, pu, prho, hc, K_x, a_x, b_x, psi_vxxs, ux, uy, uxy,uyz,psxz,uxz);
else /* acoustic */ }else{
/* acoustic */
surface_acoustic_PML(1, psp); surface_acoustic_PML(1, psp);
}
} }
} }
...@@ -2485,7 +2502,7 @@ if (!ACOUSTIC) { ...@@ -2485,7 +2502,7 @@ if (!ACOUSTIC) {
if (infoout) fprintf(FP," finished (real time: %4.2f s).\n",time7-time6); if (infoout) fprintf(FP," finished (real time: %4.2f s).\n",time7-time6);
} }
/*if(nt==hin1){*/ /*if(nt==hin1){*/
/*-------------------------------------------------*/ /*-------------------------------------------------*/
...@@ -2566,6 +2583,7 @@ if (!ACOUSTIC) { ...@@ -2566,6 +2583,7 @@ if (!ACOUSTIC) {
} }
} }
if((!VERBOSE)&&(MYID==0)) fprintf(FP,"\n"); if((!VERBOSE)&&(MYID==0)) fprintf(FP,"\n");
/*--------------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------------*/
/*---------------------- End loop over timesteps (backpropagation) -------------*/ /*---------------------- End loop over timesteps (backpropagation) -------------*/
...@@ -2688,9 +2706,7 @@ if (!ACOUSTIC) { ...@@ -2688,9 +2706,7 @@ if (!ACOUSTIC) {
} }
} /* end HESSIAN */ } /* end HESSIAN */
} }
/*--------------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------------*/
...@@ -3033,7 +3049,6 @@ if (!ACOUSTIC) { ...@@ -3033,7 +3049,6 @@ if (!ACOUSTIC) {
} }
} }