Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brune and Smoothed Brune source time functions #1649

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion DATA/CMTSOLUTION
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deleting this file shouldn't occur. all the file in the root DATA/ folder are symlinks to the DATA/ files in the example EXAMPLES/applications/homogeneous_halfspace/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this PR shouldn't touch this file.

This file was deleted.

13 changes: 13 additions & 0 deletions DATA/CMTSOLUTION
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deleting this file shouldn't occur. all the file in the root DATA/ folder are symlinks to the DATA/ files in the example EXAMPLES/applications/homogeneous_halfspace/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this PR shouldn't touch this file.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
PDE 1999 01 01 00 00 00.00 67000 67000 -25000 4.2 4.2 homog_test
event name: homog_test
time shift: 0.0000
half duration: 5.0
latorUTM: 67000.0
longorUTM: 67000.0
depth: 30.0
Mrr: -7.600000e+27
Mtt: 7.700000e+27
Mpp: -2.000000e+26
Mrt: -2.500000e+28
Mrp: 4.000000e+26
Mtp: -2.500000e+27
1 change: 0 additions & 1 deletion DATA/Par_file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

This file was deleted.

398 changes: 398 additions & 0 deletions DATA/Par_file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion DATA/STATIONS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

This file was deleted.

4 changes: 4 additions & 0 deletions DATA/STATIONS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
X20 DB 67000.00 22732.14 0.0 0.0
X30 DB 67000.00 34696.43 0.0 0.0
X40 DB 67000.00 46660.71 0.0 0.0
X50 DB 67000.00 58625.00 0.0 0.0
2 changes: 1 addition & 1 deletion doc/USER_MANUAL/05_running_the_solver.tex
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ \chapter{Running the Solver \texttt{xspecfem3D}}\label{cha:Running-the-Solver}
\item \texttt{latorUTM:} Set the latitude or UTM $x$ coordinate.
\item \texttt{longorUTM:} Set the longitude or UTM $y$ coordinate.
\item \texttt{depth:} Set the depth of the source (in km).
\item \texttt{source time function:} Set the type of source-time function: 0 = Gaussian function, 1 = Ricker function, 2 = Heaviside (step) function, 3 = monochromatic function, 4 = Gaussian function as defined in \citet{Meschede2011}.
\item \texttt{source time function:} Set the type of source-time function: 0 = Gaussian function, 1 = Ricker function, 2 = Heaviside (step) function, 3 = monochromatic function, 4 = Gaussian function as defined in \citet{Meschede2011}, 5 = Brune function, and 6 = Smoothed Brune function. For the Brune and Smoothed Brune source time functions \texttt{hdurorf0} is the rise time. The Brune and Smoothed Brune functions are currently implemented only for the viscoelastic simulations.
When {\texttt{USE\_RICKER\_TIME\_FUNCTION}} is turned on in the main parameter file \texttt{DATA/Par\_file},
it will override this source time function type selection and always use a Ricker wavelet.
Note that we use the standard definition of a Ricker, for a dominant frequency $f_0$:
Expand Down
2 changes: 1 addition & 1 deletion m4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the PR shouldn't touch the m4/ folder. the content in m4/ has been updated to the most recent CIG version just recently.

Submodule m4 updated 2 files
+0 −49 cit_catch2.m4
+2 −4 cit_python.m4
52 changes: 52 additions & 0 deletions src/specfem3D/comp_source_time_function.f90
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,58 @@
!-------------------------------------------------------------------------------------------------
!

double precision function comp_source_time_function_brune(t,f0)

Check warning on line 266 in src/specfem3D/comp_source_time_function.f90

View check run for this annotation

Codecov / codecov/patch

src/specfem3D/comp_source_time_function.f90#L266

Added line #L266 was not covered by tests

use constants, only: PI

implicit none

double precision, intent(in) :: t,f0

! local variables
double precision :: ft

! Brune source-time function
if(t .lt. 0.d0)then
comp_source_time_function_brune = 0.d0

Check warning on line 279 in src/specfem3D/comp_source_time_function.f90

View check run for this annotation

Codecov / codecov/patch

src/specfem3D/comp_source_time_function.f90#L278-L279

Added lines #L278 - L279 were not covered by tests
else
ft = f0*t
comp_source_time_function_brune = 1.d0 - exp( -ft ) * (1.0d0+ft)

Check warning on line 282 in src/specfem3D/comp_source_time_function.f90

View check run for this annotation

Codecov / codecov/patch

src/specfem3D/comp_source_time_function.f90#L281-L282

Added lines #L281 - L282 were not covered by tests
endif

end function comp_source_time_function_brune

Check warning on line 285 in src/specfem3D/comp_source_time_function.f90

View check run for this annotation

Codecov / codecov/patch

src/specfem3D/comp_source_time_function.f90#L285

Added line #L285 was not covered by tests

!
!-------------------------------------------------------------------------------------------------
!

double precision function comp_source_time_function_smooth_brune(t,f0)

Check warning on line 291 in src/specfem3D/comp_source_time_function.f90

View check run for this annotation

Codecov / codecov/patch

src/specfem3D/comp_source_time_function.f90#L291

Added line #L291 was not covered by tests

implicit none

double precision, intent(in) :: t,f0

! local variables
double precision,parameter :: tau0=2.31d0
double precision :: f,ft

! Brune source-time function
ft = f0*t
if (ft .lt. 0.d0) then
comp_source_time_function_smooth_brune = 0.d0
elseif (ft .ge. 0.d0 .and. ft .lt. tau0)then

Check warning on line 305 in src/specfem3D/comp_source_time_function.f90

View check run for this annotation

Codecov / codecov/patch

src/specfem3D/comp_source_time_function.f90#L302-L305

Added lines #L302 - L305 were not covered by tests
comp_source_time_function_smooth_brune = 1.d0 - exp(-ft)*( 1.0d0 + ft + &
0.5d0*ft**2 - (1.5d0*ft**3)/tau0 + (1.5d0*ft**4)/(tau0**2) - &
(0.5d0*ft**5)/(tau0**3) )

Check warning on line 308 in src/specfem3D/comp_source_time_function.f90

View check run for this annotation

Codecov / codecov/patch

src/specfem3D/comp_source_time_function.f90#L308

Added line #L308 was not covered by tests
else ! (ft .gt. tau0)then
comp_source_time_function_smooth_brune = 1.d0 - exp( -ft ) * (1.0d0+ft)

Check warning on line 310 in src/specfem3D/comp_source_time_function.f90

View check run for this annotation

Codecov / codecov/patch

src/specfem3D/comp_source_time_function.f90#L310

Added line #L310 was not covered by tests
endif

end function comp_source_time_function_smooth_brune

Check warning on line 313 in src/specfem3D/comp_source_time_function.f90

View check run for this annotation

Codecov / codecov/patch

src/specfem3D/comp_source_time_function.f90#L313

Added line #L313 was not covered by tests

!
!-------------------------------------------------------------------------------------------------
!

double precision function comp_source_time_function_mono(t,f0)

Expand Down
15 changes: 14 additions & 1 deletion src/specfem3D/compute_add_sources_viscoelastic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@

! returns source time function value for specified time

use constants, only: USE_MONOCHROMATIC_CMT_SOURCE
use constants, only: PI,USE_MONOCHROMATIC_CMT_SOURCE

use specfem_par, only: USE_FORCE_POINT_SOURCE,USE_RICKER_TIME_FUNCTION, &
hdur,hdur_Gaussian,force_stf
Expand All @@ -857,6 +857,7 @@

double precision, external :: comp_source_time_function,comp_source_time_function_rickr, &
comp_source_time_function_gauss,comp_source_time_function_gauss_2, &
comp_source_time_function_brune,comp_source_time_function_smooth_brune, &
comp_source_time_function_mono,comp_source_time_function_ext

! external source time function
Expand Down Expand Up @@ -890,6 +891,18 @@
case (4)
! Gaussian source time function by Meschede et al. (2011)
stf = comp_source_time_function_gauss_2(time_source_dble,hdur(isource))
case (5)
! Brune source time function
! hdur is the rise time
! Frequency parameter:
f0=2.0d0*PI/hdur(isource)
Copy link
Member

@danielpeter danielpeter Nov 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to add the factor 2 PI in the source time function, similar as done above for the other functions.

stf = comp_source_time_function_brune(time_source_dble,f0)

Check warning on line 899 in src/specfem3D/compute_add_sources_viscoelastic.F90

View check run for this annotation

Codecov / codecov/patch

src/specfem3D/compute_add_sources_viscoelastic.F90#L898-L899

Added lines #L898 - L899 were not covered by tests
case (6)
! Smoothed Brune source time function
! hdur is the rise time
! Frequency parameter:
f0=2.0d0*PI/hdur(isource)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

stf = comp_source_time_function_smooth_brune(time_source_dble,f0)

Check warning on line 905 in src/specfem3D/compute_add_sources_viscoelastic.F90

View check run for this annotation

Codecov / codecov/patch

src/specfem3D/compute_add_sources_viscoelastic.F90#L904-L905

Added lines #L904 - L905 were not covered by tests
case default
stop 'unsupported force_stf value!'
end select
Expand Down
14 changes: 14 additions & 0 deletions src/specfem3D/get_force.f90
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,20 @@
! null half-duration indicates a Dirac
! replace with very short Gaussian function
if (hdur(isource) < 5. * DT ) hdur(isource) = 5. * DT
case (5)
! Brune source time function
! half-duration is the rise time
! (see constants.h: TINYVAL = 1.d-9 )
if (hdur(isource) < TINYVAL ) then
stop 'Error set force period, make sure all forces have a non-zero rise time'

Check warning on line 258 in src/specfem3D/get_force.f90

View check run for this annotation

Codecov / codecov/patch

src/specfem3D/get_force.f90#L257-L258

Added lines #L257 - L258 were not covered by tests
endif
case (6)
! Smoothed Brune source time function
! half-duration is the rise time
! (see constants.h: TINYVAL = 1.d-9 )
if (hdur(isource) < TINYVAL ) then
stop 'Error set force period, make sure all forces have a non-zero rise time'

Check warning on line 265 in src/specfem3D/get_force.f90

View check run for this annotation

Codecov / codecov/patch

src/specfem3D/get_force.f90#L264-L265

Added lines #L264 - L265 were not covered by tests
endif
case default
stop 'unsupported source time function type (force_stf) value!'
end select
Expand Down
12 changes: 12 additions & 0 deletions src/specfem3D/locate_source.F90
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,18 @@
! Gaussian by Meschede et al. (2011)
write(IMAIN,*) ' using Gaussian source time function by Meschede et al. (2011), eq.(2)'
write(IMAIN,*) ' tau: ',hdur(isource),' seconds'
case (5)
! Brune
write(IMAIN,*) ' using Brune source time function'

Check warning on line 510 in src/specfem3D/locate_source.F90

View check run for this annotation

Codecov / codecov/patch

src/specfem3D/locate_source.F90#L510

Added line #L510 was not covered by tests
! prints rise time for point forces
write(IMAIN,*)
write(IMAIN,*) ' rise time: ',hdur(isource),' seconds'

Check warning on line 513 in src/specfem3D/locate_source.F90

View check run for this annotation

Codecov / codecov/patch

src/specfem3D/locate_source.F90#L512-L513

Added lines #L512 - L513 were not covered by tests
case (6)
! Smoothed Brune
write(IMAIN,*) ' using Smoothed Brune source time function'

Check warning on line 516 in src/specfem3D/locate_source.F90

View check run for this annotation

Codecov / codecov/patch

src/specfem3D/locate_source.F90#L516

Added line #L516 was not covered by tests
! prints rise time for point forces
write(IMAIN,*)
write(IMAIN,*) ' rise time: ',hdur(isource),' seconds'

Check warning on line 519 in src/specfem3D/locate_source.F90

View check run for this annotation

Codecov / codecov/patch

src/specfem3D/locate_source.F90#L518-L519

Added lines #L518 - L519 were not covered by tests
case default
stop 'unsupported force_stf value!'
end select
Expand Down
8 changes: 8 additions & 0 deletions src/specfem3D/setup_sources_receivers.f90
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,14 @@
case (4)
! Gaussian source time function by Meschede et al. (2011)
t0 = min(t0,1.5d0 * (tshift_src(isource) - hdur(isource)))
case (5)
! Brune
! This needs to be CHECKED!!!
t0 = min(t0,1.5d0 * (tshift_src(isource) - hdur(isource)))

Check warning on line 467 in src/specfem3D/setup_sources_receivers.f90

View check run for this annotation

Codecov / codecov/patch

src/specfem3D/setup_sources_receivers.f90#L467

Added line #L467 was not covered by tests
case (6)
! Smotthed Brune
! This needs to be CHECKED!!!
t0 = min(t0,1.5d0 * (tshift_src(isource) - hdur(isource)))

Check warning on line 471 in src/specfem3D/setup_sources_receivers.f90

View check run for this annotation

Codecov / codecov/patch

src/specfem3D/setup_sources_receivers.f90#L471

Added line #L471 was not covered by tests
case default
stop 'unsupported force_stf value!'
end select
Expand Down