detect_critical Subroutine

public subroutine detect_critical(X, dXdS, ns, S, dS)

detect_critical

Critical point detection

Description

If the values of lnK (X[:nc]) change sign then a critical point Has passed, since for this to happen all variables should pass through zero. Near critical points (lnK < 0.05) points are harder to converge, so more steps in the extrapolation vector are made to jump over the critical point. If the critical point is detected then the kind of the point is changed and the point is saved using an interpolation knowing that

With is the variables at the critical point, is the new initialization point of the method and is the parameter to interpolate the values. This subroutine finds the value of to obtain .

Arguments

Type IntentOptional Attributes Name
real(kind=pr), intent(inout) :: X(:)

Vector of variables

real(kind=pr), intent(inout) :: dXdS(:)

Variation of variables wrt S

integer, intent(inout) :: ns

Number of specified variable

real(kind=pr), intent(inout) :: S

Specification value

real(kind=pr), intent(inout) :: dS

Step in specification


Variables

Type Visibility Attributes Name Initial
real(kind=pr), public :: Xc(size(X))

Value at (near) critical point

real(kind=pr), public :: Xnew(size(X))

Value of the next initialization

real(kind=pr), public :: Xold(size(X))

Old value of X

real(kind=pr), public :: a

Parameter for interpolation

integer, public :: critical_set((size(X)-3)/2)
integer, public :: first_set((size(X)-3)/2)
logical, public :: found_critical
integer, public :: i
integer, public :: idx((size(X)-3)/2)
integer, public :: nc
integer, public :: second_set((size(X)-3)/2)
real(kind=pr), public :: step(size(X))