Skip to content

Commit 4e379b9

Browse files
committed
sanity check for inverse problem
1 parent 2c3e42f commit 4e379b9

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/shared/read_parameter_file.F90

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,16 @@ subroutine read_parameter_file(BROADCAST_AFTER_READ)
849849
STACEY_INSTEAD_OF_FREE_SURFACE = .false.
850850
endif
851851

852+
! inverse problem is enabled, disable USE_CMT_AND_FORCE/USE_BINARY_SOURCE_FILE
853+
if(INVERSE_FWI_FULL_PROBLEM .and. (USE_CMT_AND_FORCE_SOURCE)) then
854+
if(myrank == 0) then
855+
write(*,'(a)') 'INVERSE_FWI_FULL_PROBLEM is enabled, disabling USE_CMT_AND_FORCE_SOURCE'
856+
write(*,*)
857+
endif
858+
USE_CMT_AND_FORCE_SOURCE = .false.
859+
USE_BINARY_SOURCE_FILE = .false.
860+
endif
861+
852862
! checks parameter settings
853863
call check_simulation_parameters()
854864

src/specfem3D/setup_sources_receivers.f90

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,18 @@ subroutine setup_stf_constants()
465465
! convert the half duration for triangle STF to the one for Gaussian STF
466466
hdur_Gaussian(:) = hdur(:) / SOURCE_DECAY_MIMIC_TRIANGLE
467467

468+
! sanity check
469+
if(INVERSE_FWI_FULL_PROBLEM) then
470+
if(.not. allocated(is_POINTFORCE)) then
471+
allocate(is_POINTFORCE(NSOURCES))
472+
if(USE_FORCE_POINT_SOURCE) then
473+
is_POINTFORCE(:) = .true.
474+
else
475+
is_POINTFORCE(:) = .false.
476+
endif
477+
endif
478+
endif
479+
468480
!loop every force source to find t0
469481
t0 = 0.
470482
t0_cmt = 0

0 commit comments

Comments
 (0)