Generate iteration reports.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | ipr |
The value indicating the report to be printed. |
||
integer, | intent(in) | :: | lunrpt |
The logical unit number used for computation reports. |
||
logical, | intent(in) | :: | fstitr |
The variable designating whether this is the first iteration ( |
||
logical, | intent(in) | :: | implct |
The variable designating whether the solution is by implicit ODR ( |
||
logical, | intent(in) | :: | prtpen |
The variable designating whether the penalty parameter is to be printed in the
iteration report ( |
||
real(kind=wp), | intent(in) | :: | pnlty |
The penalty parameter for an implicit model. |
||
integer, | intent(in) | :: | niter |
The number of iterations. |
||
integer, | intent(in) | :: | nfev |
The number of function evaluations. |
||
real(kind=wp), | intent(in) | :: | wss |
The sum-of-squares of the weighted |
||
real(kind=wp), | intent(in) | :: | actred |
The actual relative reduction in the sum-of-squares. |
||
real(kind=wp), | intent(in) | :: | prered |
The predicted relative reduction in the sum-of-squares. |
||
real(kind=wp), | intent(in) | :: | alpha |
The Levenberg-Marquardt parameter. |
||
real(kind=wp), | intent(in) | :: | tau |
The trust region diameter. |
||
real(kind=wp), | intent(in) | :: | pnorm |
The norm of the scaled estimated parameters. |
||
integer, | intent(in) | :: | np |
The number of function parameters. |
||
real(kind=wp), | intent(in) | :: | beta(np) |
The function parameters. |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=wp), | public | :: | ratio | ||||
integer, | public | :: | j | ||||
integer, | public | :: | k | ||||
integer, | public | :: | l | ||||
character(len=3), | public | :: | gn |
impure subroutine dodpc2 & (ipr, lunrpt, fstitr, implct, prtpen, & pnlty, & niter, nfev, wss, actred, prered, alpha, tau, pnorm, np, beta) !! Generate iteration reports. ! Routines Called (NONE) ! Date Written 860529 (YYMMDD) ! Revision Date 920304 (YYMMDD) use odrpack_kinds, only: zero integer, intent(in) :: ipr !! The value indicating the report to be printed. integer, intent(in) :: lunrpt !! The logical unit number used for computation reports. logical, intent(in) :: fstitr !! The variable designating whether this is the first iteration (`fstitr = .true.`) or !! not (`fstitr = .false.`). logical, intent(in) :: implct !! The variable designating whether the solution is by implicit ODR (`implct = .true.`) !! or explicit ODR (`implct = .false.`). logical, intent(in) :: prtpen !! The variable designating whether the penalty parameter is to be printed in the !! iteration report (`prtpen = .true.`) or not (`prtpen = .false.`). real(wp), intent(in) :: pnlty !! The penalty parameter for an implicit model. integer, intent(in) :: niter !! The number of iterations. integer, intent(in) :: nfev !! The number of function evaluations. real(wp), intent(in) :: wss !! The sum-of-squares of the weighted `epsilon`s and `deltas`. real(wp), intent(in) :: actred !! The actual relative reduction in the sum-of-squares. real(wp), intent(in) :: prered !! The predicted relative reduction in the sum-of-squares. real(wp), intent(in) :: alpha !! The Levenberg-Marquardt parameter. real(wp), intent(in) :: tau !! The trust region diameter. real(wp), intent(in) :: pnorm !! The norm of the scaled estimated parameters. integer, intent(in) :: np !! The number of function parameters. real(wp), intent(in) :: beta(np) !! The function parameters. ! Local scalars real(wp) :: ratio integer :: j, k, l character(len=3) :: gn ! Variable Definitions (alphabetically) ! ACTRED: The actual relative reduction in the sum-of-squares. ! ALPHA: The Levenberg-Marquardt parameter. ! BETA: The function parameters. ! FSTITR: The variable designating whether this is the first iteration (FSTITR=.TRUE.) ! or not (FSTITR=.FALSE.). ! GN: The CHARACTER*3 variable indicating whether a Gauss-Newton step was taken. ! IMPLCT: The variable designating whether the solution is by implicit ODR (IMPLCT=TRUE) ! or explicit ODR (IMPLCT=FALSE). ! IPR: The value indicating the report to be printed. ! J: An indexing variable. ! K: An indexing variable. ! L: An indexing variable. ! LUNRPT: The logical unit number used for computation reports. ! NFEV: The number of function evaluations. ! NITER: The number of iterations. ! NP: The number of function parameters. ! PNLTY: The penalty parameter for an implicit model. ! PNORM: The norm of the scaled estimated parameters. ! PRERED: The predicted relative reduction in the sum-of-squares. ! PRTPEN: The variable designating whether the penalty parameter is to be printed in ! the iteration report (PRTPEN=TRUE) or not (PRTPEN=FALSE). ! RATIO: The ratio of TAU to PNORM. ! TAU: The trust region diameter. ! WSS: The sum-of-squares of the weighted EPSILONS and DELTAS. if (fstitr) then if (ipr == 1) then if (implct) then write (lunrpt, 1121) else write (lunrpt, 1122) end if else if (implct) then write (lunrpt, 1131) else write (lunrpt, 1132) end if end if end if if (prtpen) then write (lunrpt, 1133) pnlty end if if (alpha == zero) then gn = 'YES' else gn = ' NO' end if if (pnorm /= zero) then ratio = tau/pnorm else ratio = zero end if if (ipr == 1) then write (lunrpt, 1141) niter, nfev, wss, actred, prered, & ratio, gn else j = 1 k = min(3, np) if (j == k) then write (lunrpt, 1141) niter, nfev, wss, actred, prered, & ratio, gn, j, beta(j) else write (lunrpt, 1142) niter, nfev, wss, actred, prered, & ratio, gn, j, k, (beta(l), l=j, k) end if if (np > 3) then do j = 4, np, 3 k = min(j + 2, np) if (j == k) then write (lunrpt, 1151) j, beta(j) else write (lunrpt, 1152) j, k, (beta(l), l=j, k) end if end do end if end if ! Format statements 1121 format & (// & ' Cum. Penalty Act. Rel. Pred. Rel.'/ & ' It. No. FN Function Sum-of-Sqs Sum-of-Sqs', & ' G-N'/ & ' Num. Evals Value Reduction Reduction', & ' TAU/PNORM Step'/ & ' ---- ------ ----------- ----------- -----------', & ' --------- ----') 1122 format & (// & ' Cum. Act. Rel. Pred. Rel.'/ & ' It. No. FN Weighted Sum-of-Sqs Sum-of-Sqs', & ' G-N'/ & ' Num. Evals Sum-of-Sqs Reduction Reduction', & ' TAU/PNORM Step'/ & ' ---- ------ ----------- ----------- -----------', & ' --------- ----'/) 1131 format & (// & ' Cum. Penalty Act. Rel. Pred. Rel.'/ & ' It. No. FN Function Sum-of-Sqs Sum-of-Sqs', & ' G-N BETA -------------->'/ & ' Num. Evals Value Reduction Reduction', & ' TAU/PNORM Step Index Value'/ & ' ---- ------ ----------- ----------- -----------', & ' --------- ---- ----- -----') 1132 format & (// & ' Cum. Act. Rel. Pred. Rel.'/ & ' It. No. FN Weighted Sum-of-Sqs Sum-of-Sqs', & ' G-N BETA -------------->'/ & ' Num. Evals Sum-of-Sqs Reduction Reduction', & ' TAU/PNORM Step Index Value'/ & ' ---- ------ ----------- ----------- -----------', & ' --------- ---- ----- -----'/) 1133 format & (/' Penalty Parameter Value = ', 1P, E10.1) 1141 format & (1X, I4, I8, 1X, 1P, E12.5, 2E13.4, E11.3, 3X, A3, 7X, I3, 3E16.8) 1142 format & (1X, I4, I8, 1X, 1P, E12.5, 2E13.4, E11.3, 3X, A3, 1X, I3, ' To', I3, 3E16.8) 1151 format & (76X, I3, 1P, E16.8) 1152 format & (70X, I3, ' To', I3, 1P, 3E16.8) end subroutine dodpc2