Given a value t, and stating value of abscissae, x, periodic with period p map t to the equivalent value in the range of x (i.e. between x(1) and x(1) + p)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(in) | :: | t | |||
real, | intent(in) | :: | x_start | |||
real, | intent(in) | :: | p |
elemental real function fitp_periodic_wrap_value(t, x_start, p) result(wrapped_value)
real, intent(in) :: t, x_start, p
integer :: nper
nper = int((t - x_start) / p)
wrapped_value = t - nper * p
if (wrapped_value < x_start) wrapped_value = wrapped_value + p
end function fitp_periodic_wrap_value