Skip to content

Commit 7634ebd

Browse files
committed
adds check to compute source derivatives only for CMT sources (in pure adjoint runs)
1 parent 382ee21 commit 7634ebd

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/specfem3D/compute_seismograms.f90

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ subroutine compute_seismograms_moment_adjoint()
534534
hprime_xx,hprime_yy,hprime_zz, &
535535
hxir_store,hetar_store,hgammar_store, &
536536
hpxir_store,hpetar_store,hpgammar_store, &
537-
ELASTIC_SIMULATION
537+
ELASTIC_SIMULATION,USE_FORCE_POINT_SOURCE
538538

539539
use specfem_par, only: GPU_MODE, Mesh_pointer
540540

@@ -570,6 +570,10 @@ subroutine compute_seismograms_moment_adjoint()
570570
if (SIMULATION_TYPE /= 2) return
571571
if (.not. ELASTIC_SIMULATION) return
572572

573+
! only for CMT sources
574+
if (USE_FORCE_POINT_SOURCE) return
575+
if (nrec_local == 0) return
576+
573577
! strain and moment derivatives are computed here on CPU routines,
574578
! thus transfers displacement to the CPU
575579
if (GPU_MODE) call transfer_displ_from_device(NDIM*NGLOB_AB, displ, Mesh_pointer)

src/specfem3D/save_adjoint_kernels.f90

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,13 +1282,15 @@ subroutine save_kernels_source_derivatives()
12821282
integer :: irec_local,ier
12831283
character(len=MAX_STRING_LEN) :: outputname
12841284

1285+
! only for CMT sources
1286+
if (USE_FORCE_POINT_SOURCE) return
1287+
12851288
! checks
1286-
if (ADIOS_FOR_KERNELS ) stop 'Source derivative kernels not implemented yet for ADIOS'
1289+
if (ADIOS_FOR_KERNELS) stop 'Source derivative kernels not implemented yet for ADIOS'
12871290

12881291
! writes out derivative kernels
12891292
do irec_local = 1, nrec_local
1290-
write(outputname,'(a,i6.6)') OUTPUT_FILES(1:len_trim(OUTPUT_FILES)) // &
1291-
'/src_frechet.',number_receiver_global(irec_local)
1293+
write(outputname,'(a,i6.6)') trim(OUTPUT_FILES) // '/src_frechet.',number_receiver_global(irec_local)
12921294

12931295
open(unit=IOUT,file=trim(outputname),status='unknown',iostat=ier)
12941296
if (ier /= 0) then

0 commit comments

Comments
 (0)