[cig-commits] r16093 - seismo/2D/SPECFEM2D/trunk

cmorency at geodynamics.org cmorency at geodynamics.org
Wed Dec 9 12:49:27 PST 2009


Author: cmorency
Date: 2009-12-09 12:49:26 -0800 (Wed, 09 Dec 2009)
New Revision: 16093

Modified:
   seismo/2D/SPECFEM2D/trunk/compute_forces_fluid.f90
   seismo/2D/SPECFEM2D/trunk/compute_forces_solid.f90
Log:
Fixed issues with adjoint sources when using several receivers located in different materials (elastic/poroelastic/acoustic).


Modified: seismo/2D/SPECFEM2D/trunk/compute_forces_fluid.f90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/compute_forces_fluid.f90	2009-12-09 06:01:14 UTC (rev 16092)
+++ seismo/2D/SPECFEM2D/trunk/compute_forces_fluid.f90	2009-12-09 20:49:26 UTC (rev 16093)
@@ -834,9 +834,10 @@
       irec_local = 0
       do irec = 1,nrec
 !   add the source (only if this proc carries the source)
-      if(myrank == which_proc_receiver(irec) .and. poroelastic(ispec_selected_rec(irec))) then
+      if(myrank == which_proc_receiver(irec)) then
 
       irec_local = irec_local + 1
+      if(poroelastic(ispec_selected_rec(irec))) then
     phil = porosity(kmato(ispec_selected_rec(irec)))
     rhol_s = density(1,kmato(ispec_selected_rec(irec)))
     rhol_f = density(2,kmato(ispec_selected_rec(irec)))
@@ -851,6 +852,7 @@
                rhol_f/rhol_bar*adj_sourcearrays(irec_local,NSTEP-it+1,3,i,j)
        enddo
       enddo
+      endif ! if element is poroelastic
 
       endif ! if this processor carries the adjoint source and the source element is poroelastic
       enddo ! irec = 1,nrec

Modified: seismo/2D/SPECFEM2D/trunk/compute_forces_solid.f90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/compute_forces_solid.f90	2009-12-09 06:01:14 UTC (rev 16092)
+++ seismo/2D/SPECFEM2D/trunk/compute_forces_solid.f90	2009-12-09 20:49:26 UTC (rev 16093)
@@ -855,9 +855,10 @@
       irec_local = 0
       do irec = 1,nrec
 !   add the source (only if this proc carries the source)
-      if(myrank == which_proc_receiver(irec) .and. poroelastic(ispec_selected_rec(irec))) then
+      if(myrank == which_proc_receiver(irec)) then
 
       irec_local = irec_local + 1
+      if(poroelastic(ispec_selected_rec(irec))) then
 ! add source array
       do j=1,NGLLZ
         do i=1,NGLLX
@@ -866,6 +867,7 @@
           accels_poroelastic(2,iglob) = accels_poroelastic(2,iglob) + adj_sourcearrays(irec_local,NSTEP-it+1,3,i,j)
         enddo
       enddo
+      endif ! if element is poroelastic
 
       endif ! if this processor carries the adjoint source and the source element is poroelastic
       enddo ! irec = 1,nrec



More information about the CIG-COMMITS mailing list