@@ -387,7 +387,7 @@ subroutine print_stf_file()
387387
388388 use specfem_par, only: NSTEP,NSOURCES,source_time_function,time_function_type,factor, &
389389 tshift_src,t0,DT,time_stepping_scheme, &
390- myrank,islice_selected_source
390+ myrank,islice_selected_source,NOISE_TOMOGRAPHY
391391
392392 implicit none
393393
@@ -398,6 +398,9 @@ subroutine print_stf_file()
398398 integer :: isource,i_stage
399399 character (len= MAX_STRING_LEN) :: plot_file
400400
401+ ! only plot for non-noise simulations
402+ if (NOISE_TOMOGRAPHY > 0 ) return
403+
401404 ! user output
402405 if (myrank == 0 ) then
403406 write (IMAIN,* ) ' saving the source time function in a text file...'
@@ -473,6 +476,9 @@ subroutine print_stf_file()
473476 ! note that the array source_time_function(..) has been scaled when calling this print routine.
474477 ! thus, to print out the original value, we divide by the amplification factor.
475478
479+ ! to avoid division by zero
480+ if (factor(isource) == 0.d0 ) cycle
481+
476482 ! format: #time #used_STF #initial_source_function_value
477483 write (55 ,* ) t_used, stf_used, stf_used / factor(isource)
478484
0 commit comments