detect_critical Subroutine

private 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


Calls

proc~~detect_critical~~CallsGraph proc~detect_critical detect_critical proc~critical_interpol critical_interpol proc~detect_critical->proc~critical_interpol

Called by

proc~~detect_critical~~CalledByGraph proc~detect_critical detect_critical proc~px_envelope_3ph px_envelope_3ph proc~px_envelope_3ph->proc~detect_critical

Variables

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

Value at (near) critical point

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

Value of the next initialization

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

Old value of X

real(kind=pr), private :: a

Parameter for interpolation

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