hstep Function

public pure function hstep(itype, neta, i, j, stp, ldstp) result(res)

Uses

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

Set relative step size for finite difference derivatives.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: itype

Finite difference method being used. 0: Forward finite differences. 1: Central finite differences.

integer, intent(in) :: neta

Number of good digits in the function results.

integer, intent(in) :: i

Identifier for selecting user-supplied step sizes.

integer, intent(in) :: j

Identifier for selecting user-supplied step sizes.

real(kind=wp), intent(in) :: stp(ldstp,j)

Step size for the finite difference derivative.

integer, intent(in) :: ldstp

Leading dimension of array stp.

Return Value real(kind=wp)


Called by

proc~~hstep~~CalledByGraph proc~hstep hstep proc~check_jac check_jac proc~check_jac->proc~hstep proc~derstep derstep proc~derstep->proc~hstep proc~jac_cdiff jac_cdiff proc~jac_cdiff->proc~hstep proc~jac_cdiff->proc~derstep proc~jac_fwdiff jac_fwdiff proc~jac_fwdiff->proc~hstep proc~jac_fwdiff->proc~derstep proc~move_beta move_beta proc~move_beta->proc~hstep proc~print_report_initial print_report_initial proc~print_report_initial->proc~hstep proc~eval_jac eval_jac proc~eval_jac->proc~jac_cdiff proc~eval_jac->proc~jac_fwdiff proc~odr odr proc~odr->proc~check_jac proc~odr->proc~derstep proc~odr->proc~move_beta proc~odr->proc~eval_jac proc~print_reports print_reports proc~odr->proc~print_reports proc~print_reports->proc~print_report_initial 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

Source Code

   real(wp) pure function hstep(itype, neta, i, j, stp, ldstp) result(res)
   !! Set relative step size for finite difference derivatives.

      use odrpack_kinds, only: zero, two, three, ten

      integer, intent(in) :: itype
         !! Finite difference method being used.
         !! `0`: Forward finite differences.
         !! `1`: Central finite differences.
      integer, intent(in) :: neta
         !! Number of good digits in the function results.
      integer, intent(in) :: i
         !! Identifier for selecting user-supplied step sizes.
      integer, intent(in) :: j
         !! Identifier for selecting user-supplied step sizes.
      real(wp), intent(in) :: stp(ldstp, j)
         !! Step size for the finite difference derivative.
      integer, intent(in) :: ldstp
         !! Leading dimension of array `stp`.

      if (stp(1, 1) <= zero) then
         if (itype == 0) then
            ! Use default forward finite difference step size
            res = ten**(-abs(neta)/two - two)
         else
            ! Use default central finite difference step size
            res = ten**(-abs(neta)/three)
         end if
      elseif (ldstp == 1) then
         res = stp(1, j)
      else
         res = stp(i, j)
      end if

   end function hstep