Generate iteration reports.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | ipr |
Value indicating the report to be printed. |
||
integer, | intent(in) | :: | lunrpt |
Logical unit number used for computation reports. |
||
logical, | intent(in) | :: | firstitr |
Variable designating whether this is the first iteration ( |
||
logical, | intent(in) | :: | implicit |
Variable designating whether the solution is by implicit ODR ( |
||
logical, | intent(in) | :: | printpen |
Variable designating whether the penalty parameter is to be printed in the
iteration report ( |
||
real(kind=wp), | intent(in) | :: | penalty |
Penalty parameter for an implicit model. |
||
integer, | intent(in) | :: | niter |
Number of iterations. |
||
integer, | intent(in) | :: | nfev |
Number of function evaluations. |
||
real(kind=wp), | intent(in) | :: | wss |
Sum-of-squares of the weighted |
||
real(kind=wp), | intent(in) | :: | actred |
Actual relative reduction in the sum-of-squares. |
||
real(kind=wp), | intent(in) | :: | prered |
Predicted relative reduction in the sum-of-squares. |
||
real(kind=wp), | intent(in) | :: | alpha |
Levenberg-Marquardt parameter. |
||
real(kind=wp), | intent(in) | :: | tau |
Trust region diameter. |
||
real(kind=wp), | intent(in) | :: | pnorm |
Norm of the scaled estimated parameters. |
||
integer, | intent(in) | :: | np |
Number of function parameters. |
||
real(kind=wp), | intent(in) | :: | beta(np) |
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 print_report_iter & (ipr, lunrpt, firstitr, implicit, printpen, & penalty, & niter, nfev, wss, actred, prered, alpha, tau, pnorm, np, beta) !! Generate iteration reports. use odrpack_kinds, only: zero integer, intent(in) :: ipr !! Value indicating the report to be printed. integer, intent(in) :: lunrpt !! Logical unit number used for computation reports. logical, intent(in) :: firstitr !! Variable designating whether this is the first iteration (`.true.`) or !! not (`.false.`). logical, intent(in) :: implicit !! Variable designating whether the solution is by implicit ODR (`.true.`) !! or explicit ODR (`.false.`). logical, intent(in) :: printpen !! Variable designating whether the penalty parameter is to be printed in the !! iteration report (`.true.`) or not (`.false.`). real(wp), intent(in) :: penalty !! Penalty parameter for an implicit model. integer, intent(in) :: niter !! Number of iterations. integer, intent(in) :: nfev !! Number of function evaluations. real(wp), intent(in) :: wss !! Sum-of-squares of the weighted `epsilon`s and `deltas`. real(wp), intent(in) :: actred !! Actual relative reduction in the sum-of-squares. real(wp), intent(in) :: prered !! Predicted relative reduction in the sum-of-squares. real(wp), intent(in) :: alpha !! Levenberg-Marquardt parameter. real(wp), intent(in) :: tau !! Trust region diameter. real(wp), intent(in) :: pnorm !! Norm of the scaled estimated parameters. integer, intent(in) :: np !! Number of function parameters. real(wp), intent(in) :: beta(np) !! Function parameters. ! Local scalars real(wp) :: ratio integer :: j, k, l character(len=3) :: gn ! Variable Definitions (alphabetically) ! GN: The CHARACTER*3 variable indicating whether a Gauss-Newton step was taken. ! J: An indexing variable. ! K: An indexing variable. ! L: An indexing variable. ! RATIO: The ratio of TAU to PNORM. if (firstitr) then if (ipr == 1) then if (implicit) then write (lunrpt, 1121) else write (lunrpt, 1122) end if else if (implicit) then write (lunrpt, 1131) else write (lunrpt, 1132) end if end if end if if (printpen) then write (lunrpt, 1133) penalty 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 print_report_iter