dhstep Function

public pure function dhstep(itype, neta, i, j, stp, ldstp) result(dhstepr)

Uses

  • proc~~dhstep~~UsesGraph proc~dhstep dhstep module~odrpack_kinds odrpack_kinds proc~dhstep->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

The finite difference method being used, where: itype = 0 indicates forward finite differences, and itype = 1 indicates central finite differences.

integer, intent(in) :: neta

The number of good digits in the function results.

integer, intent(in) :: i

An identifier for selecting user-supplied step sizes.

integer, intent(in) :: j

An identifier for selecting user-supplied step sizes.

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

The step size for the finite difference derivative.

integer, intent(in) :: ldstp

The leading dimension of array stp.

Return Value real(kind=wp)


Called by

proc~~dhstep~~CalledByGraph proc~dhstep dhstep proc~derstep derstep proc~derstep->proc~dhstep proc~djaccd djaccd proc~djaccd->proc~dhstep proc~djaccd->proc~derstep proc~djacfd djacfd proc~djacfd->proc~dhstep proc~djacfd->proc~derstep proc~djck djck proc~djck->proc~dhstep proc~dodpc1 dodpc1 proc~dodpc1->proc~dhstep proc~mbfb mbfb proc~mbfb->proc~dhstep proc~devjac devjac proc~devjac->proc~djaccd proc~devjac->proc~djacfd proc~doddrv doddrv proc~doddrv->proc~derstep proc~doddrv->proc~djck proc~doddrv->proc~mbfb proc~dodmn dodmn proc~doddrv->proc~dodmn proc~dodpcr dodpcr proc~dodpcr->proc~dodpc1 proc~dodcnt dodcnt proc~dodcnt->proc~doddrv proc~dodmn->proc~devjac proc~dodmn->proc~dodpcr proc~odr odr proc~odr->proc~dodcnt 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 dhstep(itype, neta, i, j, stp, ldstp) result(dhstepr)
   !! Set relative step size for finite difference derivatives.
      ! Routines Called  (NONE)
      ! Date Written   860529   (YYMMDD)
      ! Revision Date  920304   (YYMMDD)

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

      integer, intent(in) :: itype
         !! The finite difference method being used, where: `itype = 0` indicates forward
         !! finite differences, and `itype = 1` indicates central finite differences.
      integer, intent(in) :: neta
         !! The number of good digits in the function results.
      integer, intent(in) :: i
         !! An identifier for selecting user-supplied step sizes.
      integer, intent(in) :: j
         !! An identifier for selecting user-supplied step sizes.
      real(wp), intent(in) :: stp(ldstp, j)
         !! The step size for the finite difference derivative.
      integer, intent(in) :: ldstp
         !! The leading dimension of array `stp`.

      ! Variable Definitions (alphabetically)
      !  I:       An identifier for selecting user supplied step sizes.
      !  ITYPE:   The finite difference method being used, where
      !           ITYPE = 0 indicates forward finite differences, and
      !           ITYPE = 1 indicates central finite differences.
      !  J:       An identifier for selecting user supplied step sizes.
      !  LDSTP:   The leading dimension of array STP.
      !  NETA:    The number of good digits in the function results.
      !  STP:     The step size for the finite difference derivative.

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

      elseif (ldstp == 1) then
         dhstepr = stp(1, j)
      else
         dhstepr = stp(i, j)
      end if

   end function dhstep