This function returns value of linear function which is defined by from_time, to_time, min_factor and max_factor
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_linear_type), | intent(in) | :: | me |
temporal linear type |
||
real(kind=rk), | intent(in) | :: | t |
current time |
return value of a function
pure function temporal_linear_for( me, t ) result(res) ! -------------------------------------------------------------------------- !> temporal linear type type(tem_linear_type), intent(in) :: me !> current time real(kind=rk), intent(in) :: t !> return value of a function real(kind=rk) :: res ! -------------------------------------------------------------------------- if (t <= me%from_time) then res = me%min_factor else if (t >= me%to_time) then res = me%max_factor else res = me%min_factor + (me%max_factor - me%min_factor) & & * ( (t - me%from_time) / (me%to_time - me%from_time) ) end if end function temporal_linear_for