Skip to content

Commit

Permalink
fix bugs in part of PML implementation code when set PML_BOUNDARY_CON…
Browse files Browse the repository at this point in the history
…DITIONS=.false.
  • Loading branch information
xiezhinan committed Jul 7, 2012
1 parent faf0842 commit add0055
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/specfem2D/compute_forces_acoustic.f90
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ subroutine compute_forces_acoustic(nglob,nspec,nelemabs,numat,it,NSTEP, &
rhol = density(1,kmato(ispec))
endif

if(is_PML(ispec))then
if(is_PML(ispec) .and. PML_BOUNDARY_CONDITIONS)then
iPML=ibool_PML(i,j,ispec)
iglob=ibool(i,j,ispec)

Expand Down Expand Up @@ -637,7 +637,7 @@ subroutine compute_forces_acoustic(nglob,nspec,nelemabs,numat,it,NSTEP, &
(tempx1(k,j)*hprimewgll_xx(k,i) + tempx2(i,k)*hprimewgll_zz(k,j))
enddo

if(is_PML(ispec))then
if(is_PML(ispec) .and. PML_BOUNDARY_CONDITIONS)then
if (which_PML_elem(ILEFT,ispec) .or. which_PML_elem(IRIGHT,ispec)) then
ispec_PML=spec_to_PML(ispec)
iPML=ibool_PML(i,j,ispec)
Expand Down
2 changes: 1 addition & 1 deletion src/specfem2D/invert_mass_matrix.F90
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ subroutine invert_mass_matrix_init(any_elastic,any_acoustic,any_poroelastic, &
! rmass_inverse_acoustic(iglob) = rmass_inverse_acoustic(iglob) &
! + wxgll(i)*wzgll(j)*jacobian(i,j,ispec) / kappal

if (is_PML(ispec)) then
if (PML_BOUNDARY_CONDITIONS .and. is_PML(ispec)) then
iPML=ibool_PML(i,j,ispec)
rmass_inverse_acoustic(iglob) = rmass_inverse_acoustic(iglob) &
+ wxgll(i)*wzgll(j)/ kappal*jacobian(i,j,ispec) * (K_x_store(iPML) * K_z_store(iPML)&
Expand Down
4 changes: 3 additions & 1 deletion src/specfem2D/specfem2D.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2854,7 +2854,6 @@ program specfem2D
rmemory_dux_dz(:,:,:,:) = ZERO
rmemory_duz_dx(:,:,:,:) = ZERO
rmemory_duz_dz(:,:,:,:) = ZERO

rmemory_dux_dx_corner(:,:,:,:) = ZERO
rmemory_dux_dz_corner(:,:,:,:) = ZERO
rmemory_duz_dx_corner(:,:,:,:) = ZERO
Expand Down Expand Up @@ -2919,6 +2918,9 @@ program specfem2D
allocate(rmemory_displ_elastic(1,1,1,1,1))
allocate(rmemory_displ_elastic_corner(1,1,1,1,1))

allocate(rmemory_potential_acoustic(1,1,1,1))
allocate(rmemory_potential_acoustic_corner(1,1,1,1))

allocate(rmemory_acoustic_dux_dx(1,1,1,1))
allocate(rmemory_acoustic_dux_dz(1,1,1,1))

Expand Down

0 comments on commit add0055

Please sign in to comment.