Skip to content

Commit

Permalink
writing out forces instead of acceleration
Browse files Browse the repository at this point in the history
tested in the toy mesh for Los Alamos
  • Loading branch information
elifo committed Sep 19, 2023
1 parent 8f7ceae commit 0b02c89
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/specfem3D/compute_forces_viscoelastic_calling_routine.F90
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,9 @@ subroutine compute_forces_viscoelastic_calling()
if (.not. GPU_MODE) then
! on CPU
do iglob = 1,NGLOB_AB
! Elif: assign before overwriting to write out for Los Alamos
force_losalamos(:,iglob) = accel(:,iglob)

accel(1,iglob) = accel(1,iglob)*rmassx(iglob)
accel(2,iglob) = accel(2,iglob)*rmassy(iglob)
accel(3,iglob) = accel(3,iglob)*rmassz(iglob)
Expand Down
10 changes: 8 additions & 2 deletions src/specfem3D/compute_seismograms.f90
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ subroutine compute_seismograms()
! wavefields
use specfem_par_acoustic, only: ispec_is_acoustic,potential_acoustic,potential_dot_acoustic,potential_dot_dot_acoustic, &
b_potential_acoustic,b_potential_dot_acoustic,b_potential_dot_dot_acoustic
use specfem_par_elastic, only: ispec_is_elastic,displ,veloc,accel, &
use specfem_par_elastic, only: ispec_is_elastic,displ,veloc,accel,force_losalamos, &
b_displ,b_veloc,b_accel
use specfem_par_poroelastic, only: ispec_is_poroelastic,displs_poroelastic,velocs_poroelastic,accels_poroelastic, &
b_displs_poroelastic,b_velocs_poroelastic,b_accels_poroelastic
Expand Down Expand Up @@ -118,10 +118,16 @@ subroutine compute_seismograms()
! elastic wave field
if (ispec_is_elastic(ispec)) then
! interpolates displ/veloc/accel at receiver locations
call compute_interpolated_dva_viscoelast(displ,veloc,accel,NGLOB_AB, &
!call compute_interpolated_dva_viscoelast(displ,veloc,accel,NGLOB_AB, &
! ispec,NSPEC_AB,ibool, &
! hxir,hetar,hgammar, &
! dxd,dyd,dzd,vxd,vyd,vzd,axd,ayd,azd,pd)
! Elif: write out forces instead of accel
call compute_interpolated_dva_viscoelast(displ,veloc,force_losalamos,NGLOB_AB, &
ispec,NSPEC_AB,ibool, &
hxir,hetar,hgammar, &
dxd,dyd,dzd,vxd,vyd,vzd,axd,ayd,azd,pd)

endif ! elastic

! acoustic wave field
Expand Down
4 changes: 4 additions & 0 deletions src/specfem3D/read_mesh_databases.F90
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,11 @@ subroutine read_mesh_databases()
allocate(accel(NDIM,NGLOB_AB),stat=ier)
if (ier /= 0) call exit_MPI_without_rank('error allocating array 1429')
if (ier /= 0) stop 'Error allocating array accel'
allocate(force_losalamos(NDIM,NGLOB_AB),stat=ier)
if (ier /= 0) call exit_MPI_without_rank('error allocating array 1430')
if (ier /= 0) stop 'Error allocating array force_losalamos'
displ(:,:) = 0.0_CUSTOM_REAL; veloc(:,:) = 0.0_CUSTOM_REAL; accel(:,:) = 0.0_CUSTOM_REAL
force_losalamos(:,:) = 0.0_CUSTOM_REAL

if (SIMULATION_TYPE /= 1) then
allocate(accel_adj_coupling(NDIM,NGLOB_AB),stat=ier)
Expand Down
6 changes: 5 additions & 1 deletion src/specfem3D/setup_sources_receivers.f90
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,19 @@ subroutine setup_sources_receivers()

! reads in stations file and locates receivers
call setup_receivers()
write(*,*) 'ELIF:: DEBUG:: done: setup_receivers'

! pre-compute source arrays
call setup_sources_precompute_arrays()
write(*,*) 'ELIF:: DEBUG:: done: setup_sources_precompute_arrays'

! pre-compute receiver interpolation factors
call setup_receivers_precompute_intp()
write(*,*) 'ELIF:: DEBUG:: done: setup_receivers_precompute_intp'

! write source and receiver VTK files for Paraview
call setup_sources_receivers_VTKfile()
write(*,*) 'ELIF:: DEBUG:: WRITE_SAVE_SOURCES_RECEIVERS_VTK', WRITE_SAVE_SOURCES_RECEIVERS_VTK
!if (WRITE_SAVE_SOURCES_RECEIVERS_VTK) & call setup_sources_receivers_VTKfile()

! user output
if (myrank == 0) then
Expand Down
2 changes: 1 addition & 1 deletion src/specfem3D/specfem3D_par.F90
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ module specfem_par_elastic
real(kind=CUSTOM_REAL), dimension(:,:,:,:), allocatable :: epsilon_trace_over_3

! displacement, velocity, acceleration
real(kind=CUSTOM_REAL), dimension(:,:), allocatable :: displ,veloc,accel
real(kind=CUSTOM_REAL), dimension(:,:), allocatable :: displ,veloc,accel,force_losalamos
real(kind=CUSTOM_REAL), dimension(:,:), allocatable :: accel_adj_coupling

! mass matrix
Expand Down

0 comments on commit 0b02c89

Please sign in to comment.