Skip to content

Commit

Permalink
updates source locations w/ coupling
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpeter committed Dec 19, 2024
1 parent 80ed4cc commit 917e4e0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/specfem3D/locate_source.F90
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,14 @@ subroutine locate_source()

enddo ! end of loop on all the sources

! coupling
if (COUPLE_WITH_INJECTION_TECHNIQUE) then
! no sources needed as wavefield will be injected
! set ficticious sources locations to first element in slice 0 (to avoid indexing issues later on)
islice_selected_source(:) = 0
ispec_selected_source(:) = 1
endif

! bcast from main process
call bcast_all_i(islice_selected_source,NSOURCES)
call bcast_all_i(idomain,NSOURCES)
Expand Down Expand Up @@ -316,6 +324,7 @@ subroutine locate_source()
endif
! sets flag if source element in PML
is_CPML_source(:) = .false.
is_CPML_source_all(:) = .false.
do isource = 1,NSOURCES
if (islice_selected_source(isource) == myrank) then
ispec = ispec_selected_source(isource)
Expand Down
3 changes: 2 additions & 1 deletion src/specfem3D/setup_sources_receivers.f90
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,8 @@ subroutine setup_stf_constants()
! checks if CMT source time function is a Heaviside
! (high-frequency oscillations don't look good in movies)
if (.not. USE_FORCE_POINT_SOURCE .and. &
.not. USE_EXTERNAL_SOURCE_FILE) then
.not. USE_EXTERNAL_SOURCE_FILE .and. &
.not. COUPLE_WITH_INJECTION_TECHNIQUE) then
if (minval(hdur(:)) < TINYVAL) &
stop 'Error hdur too small for movie creation, movies do not make sense for Heaviside source'
endif
Expand Down

0 comments on commit 917e4e0

Please sign in to comment.