Complex-step differentiation routines.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=wp), | intent(in) | :: | x |
Compute the first derivative using the complex-step method. This is Equation 6 from Reference [1].
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
procedure(func) | :: | f | ||||
complex(kind=wp), | intent(in) | :: | x | |||
real(kind=wp), | intent(in) | :: | h | |||
real(kind=wp), | intent(out) | :: | dfdx |
Compute the first derivative using a forward difference. This is Equation 1 from Reference [1].
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
procedure(func) | :: | f | ||||
complex(kind=wp), | intent(in) | :: | x | |||
real(kind=wp), | intent(in) | :: | h | |||
real(kind=wp), | intent(out) | :: | dfdx |
Compute the first derivative using a 2-point central difference [-h,h].
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
procedure(func) | :: | f | ||||
complex(kind=wp), | intent(in) | :: | x | |||
real(kind=wp), | intent(in) | :: | h | |||
real(kind=wp), | intent(out) | :: | dfdx |
Compute the first derivative using a 4-point central difference [-2h,-h,h,2h].
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
procedure(func) | :: | f | ||||
complex(kind=wp), | intent(in) | :: | x | |||
real(kind=wp), | intent(in) | :: | h | |||
real(kind=wp), | intent(out) | :: | dfdx |
Unit test for the complex_step module.