dlhin Subroutine

public subroutine dlhin(Neq, N, T0, Y0, Ydot, f, Tout, Uround, Ewt, Itol, Atol, Y, Temp, H0, Niter, Ier)

Name

dlhin(3f) - [M_odepack] compute step size H0 to be attempted on the first step, when the user supplied value is absent

Synopsis

    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

Description

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

INPUT OPTIONS

NEQ

NEQ array of solver, passed to F.

N

size of ODE system, input.

T0

initial value of independent variable, input.

Y0

vector of initial conditions, input.

YDOT

vector of initial first derivatives, input.

F

name of subroutine for right-hand side f(t,y), input.

TOUT

first output value of independent variable

UROUND

machine unit roundoff

EWT, ITOL, ATOL

error weights and tolerance parameters as described in the driver routine, input.

Y, TEMP

work arrays of length N.

RETURNS

H0

step size to be attempted, output.

NITER

number of iterations (and of f evaluations) to compute H0, output.

IER

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.

Arguments

Type IntentOptional 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

Calls

proc~~dlhin~~CallsGraph proc~dlhin M_odepack::dlhin proc~dvnorm~2 M_odepack::dvnorm proc~dlhin->proc~dvnorm~2

Called by

proc~~dlhin~~CalledByGraph proc~dlhin M_odepack::dlhin proc~dlsodkr~2 M_odepack::dlsodkr proc~dlsodkr~2->proc~dlhin