,
a big solver that incorporates everything
that we need in the book.
Hopefully we will not need to look at solvers again for a while.
Module vrms2int
was written by Bob Clapp to get the results
in Figures 1 to 3.
Notice that he is using
solver_mod
.
module vrms2int_mod { # Transform from RMS to interval velocity
use causint
use cgstep_mod
use solver_mod
contains
subroutine vrms2int( niter, eps, weight, vrms, vint) {
integer, intent( in) :: niter # iterations
real, intent( in) :: eps # scaling parameter
real, dimension(:), intent( in out) :: vrms # RMS velocity
real, dimension(:), intent( out) :: vint # interval velocity
real, dimension(:), intent( in) :: weight # data weighting
integer :: st,it,nt
logical, dimension( size( vint)) :: mask
real, dimension( size( vrms)) :: dat ,wt
nt = size( vrms)
do it= 1, nt {
dat( it) = vrms( it) * vrms( it) * it
wt( it) = weight( it)*(1./it) # decrease weight with time
}
mask = .false.; mask( 1) = .true. # constrain first point
vint = 0. ; vint( 1) = dat( 1)
call solver_prec( causint_lop, cgstep, x= vint, dat= dat, niter= niter,
known= mask, x0= vint, wt= wt,
prec=causint_lop, eps= eps, nprec= nt)
call cgstep_close()
st = causint_lop( .false., .false., vint, dat)
do it= 1, nt
vrms( it) = sqrt( dat( it)/it)
vint = sqrt( vint)
}
}