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

nlegoff at geodynamics.org nlegoff at geodynamics.org
Mon Jul 21 13:07:38 PDT 2008


Author: nlegoff
Date: 2008-07-21 13:07:38 -0700 (Mon, 21 Jul 2008)
New Revision: 12460

Modified:
   seismo/2D/SPECFEM2D/trunk/compute_forces_acoustic.f90
   seismo/2D/SPECFEM2D/trunk/compute_forces_elastic.f90
   seismo/2D/SPECFEM2D/trunk/specfem2D.F90
Log:
merged computation on inner and outer elements. Changes on CutHill McKee to invoque it only once are under way.


Modified: seismo/2D/SPECFEM2D/trunk/compute_forces_acoustic.f90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/compute_forces_acoustic.f90	2008-07-21 19:49:32 UTC (rev 12459)
+++ seismo/2D/SPECFEM2D/trunk/compute_forces_acoustic.f90	2008-07-21 20:07:38 UTC (rev 12460)
@@ -47,8 +47,7 @@
                vpext,rhoext,hprime_xx,hprimewgll_xx, &
                hprime_zz,hprimewgll_zz,wxgll,wzgll, &
                ibegin_bottom,iend_bottom,ibegin_top,iend_top, &
-               jbegin_left,jend_left,jbegin_right,jend_right, &
-               nspec_outer, we_are_in_phase_outer)
+               jbegin_left,jend_left,jbegin_right,jend_right)
 
 ! compute forces for the acoustic elements
 
@@ -82,10 +81,6 @@
   real(kind=CUSTOM_REAL), dimension(NGLLX) :: wxgll
   real(kind=CUSTOM_REAL), dimension(NGLLZ) :: wzgll
 
-! for overlapping MPI communications with computation
-  integer, intent(in)  :: nspec_outer
-  logical, intent(in)  :: we_are_in_phase_outer
-
 !---
 !--- local variables
 !---
@@ -106,13 +101,8 @@
 
   integer :: ifirstelem,ilastelem
 
-  if(we_are_in_phase_outer) then
-    ifirstelem = 1
-    ilastelem = nspec_outer
-  else
-    ifirstelem = nspec_outer + 1
-    ilastelem = nspec
-  endif
+  ifirstelem = 1
+  ilastelem = nspec
 
 ! loop over spectral elements
   do ispec = ifirstelem,ilastelem
@@ -183,9 +173,6 @@
 
     enddo ! end of loop over all spectral elements
 
-! only for the first call to compute_forces_acoustic (during computation on outer elements)
-  if ( we_are_in_phase_outer ) then
-
 !
 !--- absorbing boundaries
 !
@@ -342,7 +329,5 @@
 
   endif  ! end of absorbing boundaries
 
-  endif ! end of computation that needs to be done only once, during the first call to compute_forces_acoustic
-
   end subroutine compute_forces_acoustic
 

Modified: seismo/2D/SPECFEM2D/trunk/compute_forces_elastic.f90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/compute_forces_elastic.f90	2008-07-21 19:49:32 UTC (rev 12459)
+++ seismo/2D/SPECFEM2D/trunk/compute_forces_elastic.f90	2008-07-21 20:07:38 UTC (rev 12460)
@@ -49,7 +49,7 @@
        e13,dux_dxl_n,duz_dzl_n,duz_dxl_n,dux_dzl_n, &
        dux_dxl_np1,duz_dzl_np1,duz_dxl_np1,dux_dzl_np1,hprime_xx,hprimewgll_xx, &
        hprime_zz,hprimewgll_zz,wxgll,wzgll,inv_tau_sigma_nu1,phi_nu1,inv_tau_sigma_nu2,phi_nu2,Mu_nu1,Mu_nu2,N_SLS, &
-       nspec_outer,we_are_in_phase_outer,deltat,coord,add_Bielak_conditions, &
+       deltat,coord,add_Bielak_conditions, &
        x0_source, z0_source, A_plane, B_plane, C_plane, angleforce_refl, c_inc, c_refl, time_offset,f0, &
        v0x_left,v0z_left,v0x_right,v0z_right,v0x_bot,v0z_bot,t0x_left,t0z_left,t0x_right,t0z_right,t0x_bot,t0z_bot,&
        nleft,nright,nbot,over_critical_angle)
@@ -99,9 +99,6 @@
   real(kind=CUSTOM_REAL), dimension(NGLLX) :: wxgll
   real(kind=CUSTOM_REAL), dimension(NGLLZ) :: wzgll
 
-! for overlapping MPI communications with computation
-  integer, intent(in) :: nspec_outer
-  logical, intent(in) :: we_are_in_phase_outer
 
 !---
 !--- local variables
@@ -142,20 +139,12 @@
 
   integer :: ifirstelem,ilastelem
 
-! only for the first call to compute_forces_elastic (during computation on outer elements)
-  if ( we_are_in_phase_outer ) then
 ! compute Grad(displ_elastic) at time step n for attenuation
   if(TURN_ATTENUATION_ON) call compute_gradient_attenuation(displ_elastic,dux_dxl_n,duz_dxl_n, &
       dux_dzl_n,duz_dzl_n,xix,xiz,gammax,gammaz,ibool,elastic,hprime_xx,hprime_zz,nspec,npoin)
-  endif
 
-  if(we_are_in_phase_outer) then
-    ifirstelem = 1
-    ilastelem = nspec_outer
-  else
-    ifirstelem = nspec_outer + 1
-    ilastelem = nspec
-  endif
+  ifirstelem = 1
+  ilastelem = nspec
 
 ! loop over spectral elements
   do ispec = ifirstelem,ilastelem
@@ -303,9 +292,6 @@
 
     enddo ! end of loop over all spectral elements
 
-! only for the first call to compute_forces_elastic (during computation on outer elements)
-  if ( we_are_in_phase_outer ) then
-
 !
 !--- absorbing boundaries
 !
@@ -628,8 +614,6 @@
 
   endif ! if not using an initial field
 
-  else
-
 ! implement attenuation
   if(TURN_ATTENUATION_ON) then
 
@@ -700,7 +684,5 @@
 
   endif ! end of test on attenuation
 
-  endif ! end of test on attenuation
-
   end subroutine compute_forces_elastic
 

Modified: seismo/2D/SPECFEM2D/trunk/specfem2D.F90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/specfem2D.F90	2008-07-21 19:49:32 UTC (rev 12459)
+++ seismo/2D/SPECFEM2D/trunk/specfem2D.F90	2008-07-21 20:07:38 UTC (rev 12460)
@@ -2357,7 +2357,6 @@
 ! ************* compute forces for the acoustic elements
 ! *********************************************************
 
-! first call, computation on outer elements, absorbing conditions and source
     call compute_forces_acoustic(npoin,nspec,nelemabs,numat, &
                anyabs,assign_external_model,ibool,kmato,numabs, &
                elastic,codeabs,potential_dot_dot_acoustic,potential_dot_acoustic, &
@@ -2365,8 +2364,7 @@
                vpext,rhoext,hprime_xx,hprimewgll_xx, &
                hprime_zz,hprimewgll_zz,wxgll,wzgll, &
                ibegin_bottom,iend_bottom,ibegin_top,iend_top, &
-               jbegin_left,jend_left,jbegin_right,jend_right, &
-               nspec_outer, .true.)
+               jbegin_left,jend_left,jbegin_right,jend_right)
 
  endif ! end of test if any acoustic element
 
@@ -2436,19 +2434,6 @@
 
    endif
 
-! second call, computation on inner elements
-  if(any_acoustic) then
-    call compute_forces_acoustic(npoin,nspec,nelemabs,numat, &
-               anyabs,assign_external_model,ibool,kmato,numabs, &
-               elastic,codeabs,potential_dot_dot_acoustic,potential_dot_acoustic, &
-               potential_acoustic,density,elastcoef,xix,xiz,gammax,gammaz,jacobian, &
-               vpext,rhoext,hprime_xx,hprimewgll_xx, &
-               hprime_zz,hprimewgll_zz,wxgll,wzgll, &
-               ibegin_bottom,iend_bottom,ibegin_top,iend_top, &
-               jbegin_left,jend_left,jbegin_right,jend_right, &
-               nspec_outer, .false.)
-   endif
-
 ! assembling potential_dot_dot for acoustic elements
 #ifdef USE_MPI
   if ( nproc > 1 .and. any_acoustic .and. ninterface_acoustic > 0) then
@@ -2500,7 +2485,6 @@
 ! ************* main solver for the elastic elements
 ! *********************************************************
 
-! first call, computation on outer elements, absorbing conditions and source
  if(any_elastic) &
     call compute_forces_elastic(npoin,nspec,nelemabs,numat, &
                ispec_selected_source,is_proc_source,source_type,it,NSTEP,anyabs,assign_external_model, &
@@ -2511,7 +2495,7 @@
                e1,e11,e13,dux_dxl_n,duz_dzl_n,duz_dxl_n,dux_dzl_n, &
                dux_dxl_np1,duz_dzl_np1,duz_dxl_np1,dux_dzl_np1,hprime_xx,hprimewgll_xx, &
                hprime_zz,hprimewgll_zz,wxgll,wzgll,inv_tau_sigma_nu1,phi_nu1,inv_tau_sigma_nu2,phi_nu2,Mu_nu1,Mu_nu2,N_SLS, &
-               nspec_outer, .true.,deltat,coord,add_Bielak_conditions, x0_source, z0_source, &
+               deltat,coord,add_Bielak_conditions, x0_source, z0_source, &
                A_plane, B_plane, C_plane, angleforce_refl, c_inc, c_refl, time_offset, f0,&
                v0x_left(1,it),v0z_left(1,it),v0x_right(1,it),v0z_right(1,it),v0x_bot(1,it),v0z_bot(1,it), &
                t0x_left(1,it),t0z_left(1,it),t0x_right(1,it),t0z_right(1,it),t0x_bot(1,it),t0z_bot(1,it), &
@@ -2581,23 +2565,6 @@
 
     endif
 
-! second call, computation on inner elements and update
-  if(any_elastic) &
-    call compute_forces_elastic(npoin,nspec,nelemabs,numat, &
-               ispec_selected_source,is_proc_source,source_type,it,NSTEP,anyabs,assign_external_model, &
-               initialfield,TURN_ATTENUATION_ON,TURN_ANISOTROPY_ON,angleforce,deltatcube, &
-               deltatfourth,twelvedeltat,fourdeltatsquare,ibool,kmato,numabs,elastic,codeabs, &
-               accel_elastic,veloc_elastic,displ_elastic,density,elastcoef,xix,xiz,gammax,gammaz, &
-               jacobian,vpext,vsext,rhoext,source_time_function,sourcearray, &
-               e1,e11,e13,dux_dxl_n,duz_dzl_n,duz_dxl_n,dux_dzl_n, &
-               dux_dxl_np1,duz_dzl_np1,duz_dxl_np1,dux_dzl_np1,hprime_xx,hprimewgll_xx, &
-               hprime_zz,hprimewgll_zz,wxgll,wzgll,inv_tau_sigma_nu1,phi_nu1,inv_tau_sigma_nu2,phi_nu2,Mu_nu1,Mu_nu2,N_SLS, &
-               nspec_outer,.false.,deltat,coord,add_Bielak_conditions, x0_source, z0_source, &
-               A_plane, B_plane, C_plane, angleforce_refl, c_inc, c_refl, time_offset, f0,&
-               v0x_left(1,it),v0z_left(1,it),v0x_right(1,it),v0z_right(1,it),v0x_bot(1,it),v0z_bot(1,it), &
-               t0x_left(1,it),t0z_left(1,it),t0x_right(1,it),t0z_right(1,it),t0x_bot(1,it),t0z_bot(1,it), &
-               count_left,count_right,count_bot,over_critical_angle)
-
 ! assembling accel_elastic for elastic elements
 #ifdef USE_MPI
   if (nproc > 1 .and. any_elastic .and. ninterface_elastic > 0) then



More information about the cig-commits mailing list