derstep Function

public pure function derstep(itype, k, betak, ssf, stpb, neta) result(derstepr)

Uses

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

Compute step size for center and forward difference calculations.

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) :: k

Index into beta where betak resides.

real(kind=wp), intent(in) :: betak

The k-th function parameter.

real(kind=wp), intent(in) :: ssf(k)

The scale used for the betas.

real(kind=wp), intent(in) :: stpb(k)

The relative step used for computing finite difference derivatives with respect to beta.

integer, intent(in) :: neta

Number of good digits in the function results.

Return Value real(kind=wp)


Calls

proc~~derstep~~CallsGraph proc~derstep derstep proc~dhstep dhstep proc~derstep->proc~dhstep

Called by

proc~~derstep~~CalledByGraph proc~derstep derstep proc~djaccd djaccd proc~djaccd->proc~derstep proc~djacfd djacfd proc~djacfd->proc~derstep proc~doddrv doddrv proc~doddrv->proc~derstep proc~dodmn dodmn proc~doddrv->proc~dodmn proc~devjac devjac proc~devjac->proc~djaccd proc~devjac->proc~djacfd proc~dodcnt dodcnt proc~dodcnt->proc~doddrv proc~dodmn->proc~devjac 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

Variables

Type Visibility Attributes Name Initial
real(kind=wp), public :: typj

Source Code

   real(wp) pure function derstep(itype, k, betak, ssf, stpb, neta) result(derstepr)
   !! Compute step size for center and forward difference calculations.
      ! Routines Called  DHSTEP
      ! Date Written   20040616   (YYYYMMDD)
      ! Revision Date  20040616   (YYYYMMDD)

      use odrpack_kinds, only: zero, one

      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) :: k
         !! Index into `beta` where `betak` resides.
      real(wp), intent(in) :: betak
         !! The `k`-th function parameter.
      real(wp), intent(in) :: ssf(k)
         !! The scale used for the `beta`s.
      real(wp), intent(in) :: stpb(k)
         !! The relative step used for computing finite difference derivatives with respect
         !! to `beta`.
      integer, intent(in) :: neta
         !! Number of good digits in the function results.

      ! Local scalars
      real(wp) :: typj

      ! Variable definitions (alphabetically)
      !  BETAK:   The K-th function parameter.
      !  ITYPE:   0 - calc foward difference step, 1 - calc center difference step.
      !  K:       Index into beta where BETAK resides.
      !  NETA:    Number of good digits in the function results.
      !  SSF:     The scale used for the BETA'S.
      !  STPB:    The relative step used for computing finite difference derivatives with
      !           respect to BETA.
      !  TYPJ:    The typical size of the J-th unkonwn BETA.

      if (betak == zero) then
         if (ssf(1) < zero) then
            typj = one/abs(ssf(1))
         else
            typj = one/ssf(k)
         end if
      else
         typj = abs(betak)
      end if
      derstepr = sign(one, betak)*typj*dhstep(itype, neta, 1, k, stpb, 1)

   end function derstep