print_report_iter Subroutine

public impure subroutine print_report_iter(ipr, lunrpt, firstitr, implicit, printpen, penalty, niter, nfev, wss, actred, prered, alpha, tau, pnorm, np, beta)

Uses

  • proc~~print_report_iter~~UsesGraph proc~print_report_iter print_report_iter module~odrpack_kinds odrpack_kinds proc~print_report_iter->module~odrpack_kinds iso_fortran_env iso_fortran_env module~odrpack_kinds->iso_fortran_env

Generate iteration reports.

Arguments

Type IntentOptional 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 (.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(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 epsilons and deltas.

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.


Called by

proc~~print_report_iter~~CalledByGraph proc~print_report_iter print_report_iter proc~print_reports print_reports proc~print_reports->proc~print_report_iter proc~odr odr proc~odr->proc~print_reports proc~odr_long_c odr_long_c proc~odr_long_c->proc~odr proc~odr_medium_c odr_medium_c proc~odr_medium_c->proc~odr proc~odr_short_c odr_short_c proc~odr_short_c->proc~odr program~example1 example1 program~example1->proc~odr program~example2 example2 program~example2->proc~odr program~example3 example3 program~example3->proc~odr program~example4 example4 program~example4->proc~odr program~example5 example5 program~example5->proc~odr

Variables

Type Visibility Attributes Name Initial
real(kind=wp), public :: ratio
integer, public :: j
integer, public :: k
integer, public :: l
character(len=3), public :: gn

Source Code

   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