dlhin(3f) - [M_odepack] compute step size H0 to be attempted on the first step, when the user supplied value is absent
subroutine dlhin(Neq,N,T0,Y0,Ydot,f,Tout,Uround,Ewt,Itol,Atol,Y,Temp,H0,Niter,Ier)
integer :: Neq(*)
integer :: N
real(kind=dp),intent(in) :: T0
real(kind=dp) :: Y0(*)
real(kind=dp),intent(in) :: Ydot(*)
external :: f
real(kind=dp),intent(in) :: Tout
real(kind=dp),intent(in) :: Uround
real(kind=dp) :: Ewt(*)
integer,intent(in) :: Itol
real(kind=dp),intent(in) :: Atol(*)
real(kind=dp) :: Y(*)
real(kind=dp) :: Temp(*)
real(kind=dp),intent(inout) :: H0
integer, intent(out) :: Niter
integer, intent(out) :: Ier
This routine computes the step size, H0, to be attempted on the first step, when the user has not supplied a value for this.
First we check that TOUT - T0 differs significantly from zero. Then an iteration is done to approximate the initial second derivative and this is used to define H from WRMS-norm(H**2 * yddot / 2) = 1. A bias factor of 1/2 is applied to the resulting h. The sign of H0 is inferred from the initial values of TOUT and T0.
Communication with DLHIN is done with the following variables:
Call DLHIN(NEQ,N,T0,Y0,YDOT,F,TOUT,UROUND,EWT,ITOL,ATOL,Y,TEMP & & H0,NITER,IER
Subroutines called by DLHIN: F Function routines called by DLHIN: DVNORM
NEQ array of solver, passed to F.
size of ODE system, input.
initial value of independent variable, input.
vector of initial conditions, input.
vector of initial first derivatives, input.
name of subroutine for right-hand side f(t,y), input.
first output value of independent variable
machine unit roundoff
error weights and tolerance parameters as described in the driver routine, input.
work arrays of length N.
step size to be attempted, output.
number of iterations (and of f evaluations) to compute H0, output.
the error flag, returned with the value IER = 0 if no trouble occurred, or IER = -1 if TOUT and t0 are considered too close to proceed.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer | :: | Neq(*) | ||||
integer | :: | N | ||||
real(kind=dp), | intent(in) | :: | T0 | |||
real(kind=dp) | :: | Y0(*) | ||||
real(kind=dp), | intent(in) | :: | Ydot(*) | |||
real | :: | f | ||||
real(kind=dp), | intent(in) | :: | Tout | |||
real(kind=dp), | intent(in) | :: | Uround | |||
real(kind=dp) | :: | Ewt(*) | ||||
integer, | intent(in) | :: | Itol | |||
real(kind=dp), | intent(in) | :: | Atol(*) | |||
real(kind=dp) | :: | Y(*) | ||||
real(kind=dp) | :: | Temp(*) | ||||
real(kind=dp), | intent(inout) | :: | H0 | |||
integer, | intent(out) | :: | Niter | |||
integer, | intent(out) | :: | Ier |