SPACClass Module



Derived Types

type, public ::  SPAC_

Components

Type Visibility Attributes Name Initial
character(len=:), public, allocatable :: csv_wave_file
character(len=:), public, allocatable :: json_metadata_file
character(len=:), public, allocatable :: wave_data_format
real(kind=real64), public :: sampling_Hz
real(kind=real64), public :: radius
integer(kind=int32), public :: num_logger

= fint(f

integer(kind=int32), public :: fft_size

= fint(f

real(kind=real64), public :: Maximum_phase_velocity
integer(kind=int32), public :: Maximum_itr

= fint(f

integer(kind=int32), public :: num_smoothing

= fint(f

real(kind=real64), public :: cutoff_sd
integer(kind=int32), public :: taper_percent

= fint(f

real(kind=real32), public :: bandpass_low
real(kind=real32), public :: bandpass_high
real(kind=real64), public, allocatable :: observation(:,:)
logical, public :: initialized = .false.
logical, public :: inversion_is_done = .false.
character(len=:), public, allocatable :: d_unit
character(len=:), public, allocatable :: Rayleigh_Dispersion
character(len=:), public, allocatable :: best_1
character(len=:), public, allocatable :: best_2
character(len=:), public, allocatable :: best_3
character(len=:), public, allocatable :: best_4
character(len=:), public, allocatable :: best_5
character(len=:), public, allocatable :: best_1_HoverV
character(len=:), public, allocatable :: best_2_HoverV
character(len=:), public, allocatable :: best_3_HoverV
character(len=:), public, allocatable :: best_4_HoverV
character(len=:), public, allocatable :: best_5_HoverV
character(len=:), public, allocatable :: best_1_layer_csv
character(len=:), public, allocatable :: best_2_layer_csv
character(len=:), public, allocatable :: best_3_layer_csv
character(len=:), public, allocatable :: best_4_layer_csv
character(len=:), public, allocatable :: best_5_layer_csv
real(kind=real64), public, allocatable :: best_1_Vs(:)
real(kind=real64), public, allocatable :: best_1_Vp(:)
real(kind=real64), public, allocatable :: best_1_Density(:)
real(kind=real64), public, allocatable :: best_1_Thickness(:)
real(kind=real64), public, allocatable :: best_2_Vs(:)
real(kind=real64), public, allocatable :: best_2_Vp(:)
real(kind=real64), public, allocatable :: best_2_Density(:)
real(kind=real64), public, allocatable :: best_2_Thickness(:)
real(kind=real64), public, allocatable :: best_3_Vs(:)
real(kind=real64), public, allocatable :: best_3_Vp(:)
real(kind=real64), public, allocatable :: best_3_Density(:)
real(kind=real64), public, allocatable :: best_3_Thickness(:)
real(kind=real64), public, allocatable :: best_4_Vs(:)
real(kind=real64), public, allocatable :: best_4_Vp(:)
real(kind=real64), public, allocatable :: best_4_Density(:)
real(kind=real64), public, allocatable :: best_4_Thickness(:)
real(kind=real64), public, allocatable :: best_5_Vs(:)
real(kind=real64), public, allocatable :: best_5_Vp(:)
real(kind=real64), public, allocatable :: best_5_Density(:)
real(kind=real64), public, allocatable :: best_5_Thickness(:)

Type-Bound Procedures

procedure, public :: init => init_SPAC
procedure, public :: run => run_SPAC
procedure, public :: pdf => pdf_SPAC
procedure, public :: inversion => inversion_SPAC

Functions

public function to_FOURIER_SPECTRUM(A, frequency, FFT_SIZE, log, num_block, taper_percent, NUM_MOVING_AVERAGE, delta_f) result(FourierSpectrum)

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: A(:)
real(kind=real64), intent(in) :: frequency(:)
integer(kind=int32), intent(in) :: FFT_SIZE
character(len=*), intent(in), optional :: log
integer(kind=int32), intent(inout), optional :: num_block
integer(kind=int32), intent(in), optional :: taper_percent
integer(kind=int32), intent(in), optional :: NUM_MOVING_AVERAGE
real(kind=real64), intent(in), optional :: delta_f

Return Value real(kind=real64), allocatable, (:)

public function to_HoverV_spectra(H, V, FFT_SIZE, frequency, taper_percent) result(HoverV)

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: H(:)
real(kind=real64), intent(in) :: V(:)
integer(kind=int32), intent(in) :: FFT_SIZE
real(kind=real64), intent(in) :: frequency(:)
integer(kind=int32), intent(in), optional :: taper_percent

Return Value real(kind=real64), allocatable, (:)

public function to_CROSS_SPECTRUM(A, B, FFT_SIZE) result(Cross_Spectrum)

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: A(:)
real(kind=real64), intent(in) :: B(:)
integer(kind=int32), intent(in) :: FFT_SIZE

Return Value complex(kind=real64), allocatable, (:)

public function to_CCF(A, B, FFT_SIZE) result(CCF)

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: A(:)
real(kind=real64), intent(in) :: B(:)
integer(kind=int32), intent(in) :: FFT_SIZE

Return Value complex(kind=real64), allocatable, (:)

public function to_SPAC_COEFF(Center_x, Circle_x, FFT_SIZE) result(rho)

!$OMP parallel do default(shared) reduction(+:rho) !$OMP end parallel do

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: Center_x(:)
real(kind=real64), intent(in) :: Circle_x(:,:)
integer(kind=int32), intent(in) :: FFT_SIZE

Return Value real(kind=real64), allocatable, (:)

public function to_phase_velocity(Center_x, Circle_x, FFT_SIZE, radius, sampling_Hz, debug, max_c, max_itr, wave_type, num_smoothing) result(c)

$OMP parallel do default(shared) private(itr,ctr,residual,k_i,tr0)

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: Center_x(:)
real(kind=real64), intent(in) :: Circle_x(:,:)
integer(kind=int32), intent(in) :: FFT_SIZE
real(kind=real64), intent(in) :: radius
integer(kind=int32), intent(in) :: sampling_Hz
logical, intent(in), optional :: debug
real(kind=real64), intent(in) :: max_c
integer(kind=int32), intent(in) :: max_itr
character(len=*), intent(in), optional :: wave_type
integer(kind=int32), intent(in) :: num_smoothing

Return Value real(kind=real64), allocatable, (:)

public function residual_from_bessel_SPAC_function(x, params) result(ret)

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: x
real(kind=real64), intent(in) :: params(:)

Return Value real(kind=real64)

public function to_frequency_axis(FFT_SIZE, sampling_Hz) result(f_axis)

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: FFT_SIZE
integer(kind=int32), intent(in) :: sampling_Hz

Return Value real(kind=real64), allocatable, (:)

public function to_time_axis(sampling_Hz, NUM_SAMPLE) result(t_axis)

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: sampling_Hz
integer(kind=int32), intent(in) :: NUM_SAMPLE

Return Value real(kind=real64), allocatable, (:)

public recursive function moving_average(indata, num) result(outdata)

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: indata(:)
integer(kind=int32), intent(in), optional :: num

Return Value real(kind=real64), allocatable, (:)


Subroutines

public subroutine init_SPAC(this, csv_wave_file, json_metadata_file)

Arguments

Type IntentOptional Attributes Name
class(SPAC_), intent(inout) :: this
character(len=*), intent(in) :: csv_wave_file
character(len=*), intent(in) :: json_metadata_file

public subroutine run_SPAC(this, only_FFT, only_summary)

Arguments

Type IntentOptional Attributes Name
class(SPAC_), intent(inout) :: this
logical, intent(in), optional :: only_FFT
logical, intent(in), optional :: only_summary

public subroutine pdf_SPAC(this, name)

Arguments

Type IntentOptional Attributes Name
class(SPAC_), intent(in) :: this
character(len=*), intent(in) :: name

public subroutine inversion_SPAC(this, db, db_shape, frequency_scope, name)

$OMP parallel do default(shared) private(buf,line,f,chk,trial_value,id,my_filepath,proc_id) $OMP end parallel do

Arguments

Type IntentOptional Attributes Name
class(SPAC_), intent(inout) :: this
character(len=*), intent(in) :: db
integer(kind=int32), intent(in) :: db_shape(1:2)
real(kind=real64), intent(in) :: frequency_scope(1:2)
character(len=*), intent(in) :: name