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

walter at geodynamics.org walter at geodynamics.org
Fri Dec 7 15:57:26 PST 2007


Author: walter
Date: 2007-12-07 15:57:25 -0800 (Fri, 07 Dec 2007)
New Revision: 8571

Modified:
   seismo/2D/SPECFEM2D/trunk/compute_forces_elastic.f90
Log:
fixed small bug introduced by Nicolas Le Goff: "if" statement not correctly included in another "if" statement


Modified: seismo/2D/SPECFEM2D/trunk/compute_forces_elastic.f90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/compute_forces_elastic.f90	2007-08-29 14:16:52 UTC (rev 8570)
+++ seismo/2D/SPECFEM2D/trunk/compute_forces_elastic.f90	2007-12-07 23:57:25 UTC (rev 8571)
@@ -452,24 +452,22 @@
 
   endif  ! end of absorbing boundaries
 
-
 ! --- add the source
   if(.not. initialfield) then
 
-     if ( is_proc_source == 1 ) then
+! if this processor carries the source and the source element is elastic
+     if (is_proc_source == 1 .and. elastic(ispec_selected_source)) then
+
 ! collocated force
 ! beware, for acoustic medium, source is a potential, therefore source time function
 ! gives shape of velocity, not displacement
         if(source_type == 1) then
-           if(elastic(ispec_selected_source)) then
-              accel_elastic(1,iglob_source) = accel_elastic(1,iglob_source) - sin(angleforce)*source_time_function(it)
-              accel_elastic(2,iglob_source) = accel_elastic(2,iglob_source) + cos(angleforce)*source_time_function(it)
-           endif
 
+          accel_elastic(1,iglob_source) = accel_elastic(1,iglob_source) - sin(angleforce)*source_time_function(it)
+          accel_elastic(2,iglob_source) = accel_elastic(2,iglob_source) + cos(angleforce)*source_time_function(it)
+
 ! moment tensor
         else if(source_type == 2) then
-
-           if(elastic(ispec_selected_source)) then
 ! add source array
               do j=1,NGLLZ
                  do i=1,NGLLX
@@ -477,15 +475,15 @@
                     accel_elastic(:,iglob) = accel_elastic(:,iglob) + sourcearray(:,i,j)*source_time_function(it)
                  enddo
               enddo
-           endif
 
+        else
+          call exit_MPI('wrong source type in elastic element')
         endif
-     endif
 
-  else
-     call exit_MPI('wrong source type')
-  endif
+     endif ! if this processor carries the source and the source element is elastic
 
+  endif ! if not using an initial field
+
 ! implement attenuation
   if(TURN_ATTENUATION_ON) then
 



More information about the cig-commits mailing list