derstep Function

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

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

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

integer, intent(in) :: k

Index into beta where betak resides.

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

k-th function parameter.

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

Scale used for the betas.

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

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~hstep hstep proc~derstep->proc~hstep

Called by

proc~~derstep~~CalledByGraph proc~derstep derstep proc~jac_cdiff jac_cdiff proc~jac_cdiff->proc~derstep proc~jac_fwdiff jac_fwdiff proc~jac_fwdiff->proc~derstep proc~odr odr proc~odr->proc~derstep proc~eval_jac eval_jac proc~odr->proc~eval_jac proc~eval_jac->proc~jac_cdiff proc~eval_jac->proc~jac_fwdiff 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(res)
   !! Compute step size for center and forward difference calculations.

      use odrpack_kinds, only: zero, one

      integer, intent(in) :: itype
         !! Finite difference method being used.
         !! `0`: Forward finite differences.
         !! `1`: Central finite differences.
      integer, intent(in) :: k
         !! Index into `beta` where `betak` resides.
      real(wp), intent(in) :: betak
         !! `k`-th function parameter.
      real(wp), intent(in) :: ssf(k)
         !! Scale used for the `beta`s.
      real(wp), intent(in) :: stpb(k)
         !! 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)
      !  TYPJ:    The typical size of the J-th unkonwn BETA.

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

   end function derstep