FCNRM is no longer an argument, as it needs to be calculated from the residual, which isn't known until a little way into this routine. It could be calculated by the calling routine, but that would mean doing the calculation twice.
step = vector of length n, (trial) step.
eta = relative residual reduction factor.
f = name of user-supplied subroutine for evaluating the function the zero of which is sought; this routine has the form
subroutine f(n, xcur, fcur, rpar, ipar, itrmf) where xcur is the array containing the current x value, fcur is f(xcur) on output, rpar and ipar are, respectively, real and integer parameter/work arrays for use by the subroutine, and itrmf is an integer termination flag. The meaning of itrmf is as follows: 0 => normal termination; desired function value calculated. 1 => failure to produce f(xcur).
jacv = name of user-supplied subroutine for evaluating Jv or P(inverse)v, where J is the Jacobian of f and P is a right preconditioning operator. If neither analytic Jv evaluations nor right preconditioning is used, this can be a dummy subroutine; if right preconditioning is used but not analytic Jv evaluations, this need only evaluate P(inverse)*v. The form is
subroutine jacv(n, xcur, fcur, ijob, v, z, rpar, ipar, itrmjv) where xcur and fcur are vectors of length n containing the current x and f values, ijob is an integer flag indicating which product is desired, v is a vector of length n to be multiplied, z is a vector of length n containing the desired product on output, rpar and ipar are, respectively, real and integer parameter/work arrays for use by the subroutine, and itrmjv is an integer termination flag. The meaning of ijob is as follows: 0 => z = J*v 1 => z = P(inverse)*v The meaning of itrmjv is as follows: 0 => normal termination; desired product evaluated. 1 => failure to produce J*v. 2 => failure to produce P(inverse)*v. This subroutine is called only from nitjv, and is always called with v .ne. z.
rpar = real parameter/work array passed to the f and jacv routines.
ipar = integer parameter/work array passed to the f and jacv routines.
ijacv = flag for determining method of J*v evaluation. 0 => finite-difference evaluation (default). 1 => analytic evaluation.
irpre = flag for right preconditioning. 0 => no right preconditioning 1 => right preconditioning
iksmax = maximum allowable number of TFQMR iterations.
ifdord = order of the finite-difference formula used in BiCGSTAB when J*v products are evaluated using finite-differences. When ijacv = 0 on input to nitsol, ifdord is set to 1, 2, or 4 in nitsol; otherwise, it is irrelevant. When ijacv = 0 on input to this subroutine, ifdord determines the order of the finite-difference formula used at each BiCGSTAB iteration (default 1). In this case, ijacv is set to -1 below to signal to nitjv that the order of the finite-difference formula is to be determined by ifdord. The original value ijacv = 0 is restored on return.
nfe = number of function evaluations.
njve = number of J*v evaluations.
nrpre = number of P(inverse)*v evaluations.
nli = number of linear iterations.
r = residual vector (for the QMR process)
rcgs = residual vector (of the underlying CGS process)
rtil = 'shadow' residual vector used in bi-orthogonalization
d = vector used in TFQMR
p = vector used in TFQMR
q = vector used in TFQMR
u = vector used in TFQMR
v = vector used in TFQMR
y = vector used in TFQMR
rwork1 = work vector, passed on to nitjv
rwork2 = work vector, passed on to nitjv
rsnrm = TFQMR residual norm on return.
dinpr = inner-product routine, either user-supplied or blas ddot.
dnorm = norm routine, either user-supplied or blas dnrm2.
itrmks = termination flag; values have the following meanings: 0 => normal termination: acceptable step found. 1 => Jv failure in nitjv. 2 => P(inverse)v failure in nitjv. 3 => acceptable step not found in iksmax TFQMR iterations. 4 => TFQMR breakdown. 5 => floating point error (the underlying CGS iteration has probably blown up)
Note: On return, nitsol terminates if itrmks is 1 or 2. If itrmks is 3 or 4, nitsol may terminate or continue. In this event, the step returned is a meaningful inexact Newton step only if the residual norm has been reduced. A decision on termination/continuation is made in nitdrv according to whether there is sufficient residual norm reduction, even though the desired inexact Newton condition may not hold.
<<<<<<<<<<<<<<<<<<<<< TAKEN FROM nitprint.h
>>>>>>>>>>>>>>>>>>>>>>>>>
Include these declaratinos and common blocks directly so that the include files are not needed in isoft.
Do not set the step to 0, as it contains an initial guess at the solution.
C do 10 i = 1, n C step(i) = zero C 10 continue
Because the initial step is not zero, the residual must include an evaluation of the left-hand-side..
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer | :: | n | ||||
double precision | :: | xcur(n) | ||||
double precision | :: | fcur(n) | ||||
double precision | :: | step(n) | ||||
double precision | :: | eta | ||||
real | :: | f | ||||
integer | :: | jacv | ||||
double precision | :: | rpar(*) | ||||
integer | :: | ipar(*) | ||||
integer | :: | ijacv | ||||
integer | :: | irpre | ||||
integer | :: | iksmax | ||||
integer | :: | ifdord | ||||
integer | :: | nfe | ||||
integer | :: | njve | ||||
integer | :: | nrpre | ||||
integer | :: | nli | ||||
double precision | :: | r(n) | ||||
double precision | :: | rcgs(n) | ||||
double precision | :: | rtil(n) | ||||
double precision | :: | d(n) | ||||
double precision | :: | p(n) | ||||
double precision | :: | q(n) | ||||
double precision | :: | u(n) | ||||
double precision | :: | v(n) | ||||
double precision | :: | y(n) | ||||
double precision | :: | rwork1(n) | ||||
double precision | :: | rwork2(n) | ||||
double precision | :: | rsnrm | ||||
double precision | :: | dinpr | ||||
double precision | :: | dnorm | ||||
integer | :: | itrmks |
If diagnostic information is desired, include this common block in the main program and set iplvl and ipunit according to the following:
iplvl = 0 => no printout = 1 => iteration numbers and F-norms = 2 => ... + some stats, step norms, and linear model norms = 3 => ... + some Krylov solver and backtrack information = 4 => ... + more Krylov solver and backtrack information ipunit = printout unit number.
Type | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|
integer | :: | iplvl | ||||
integer | :: | ipunit |