PUBLIC INTERFACE ~ PUBLIC DATA ~ PUBLIC ROUTINES ~ NAMELIST ~ DIAGNOSTIC FIELDS ~ ERROR MESSAGES ~ REFERENCES ~ NOTES

Module time_interp_mod

Contact:  Bruce Wyman
Reviewers: 
Change History: WebCVS Log


OVERVIEW

Computes a weight and dates/indices for linearly interpolating between two dates.

A time type is converted into two consecutive dates plus a fraction representing the distance between the dates. This information can be used to interpolate between the dates. The dates may be expressed as years, months, or days or as indices in an array.


OTHER MODULES USED

time_manager_mod
fms_mod

PUBLIC INTERFACE

Description summarizing public interface.
time_interp:
Returns a weight and dates or indices for interpolating between two dates. The interface fraction_of_year is provided for backward compatibility with the previous version.
fraction_of_year:
Wrapper for backward compatibility


PUBLIC DATA

None.


PUBLIC ROUTINES

  1. time_interp

    call time_interp ( Time, weight )
    call time_interp ( Time, weight, year1, year2 )
    call time_interp ( Time, weight, year1, year2, month1, month2 )
    call time_interp ( Time, weight, year1, year2, month1, month2, day1, day2 )
    call time_interp ( Time, Timelist, weight, index1, index2 [, modtime] )
    call time_interp ( Time, Time_beg, Time_end, Timelist, weight, index1, index2)
    DESCRIPTION
    Returns the fractional amount (between 0,1) that the input Time is into the current year. The interface fraction_of_year has the same functionality and is only provided for backward compatibility with the version.


    INPUT
    Time    The time at which the the weight is computed.
       [time_type]
       [time_type]
       [time_type]
       [time_type]
       [time_type]
       [time_type]
    Time_beg    For cyclical interpolation: Time_beg specifies the begining time of a cycle.
       [time_type]
    Time_end    For cyclical interpolation: Time_end specifies the ending time of a cycle.
       [time_type]
    Timelist    For cyclical interpolation: Timelist is an array of times between Time_beg and Time_end. Must be monotonically increasing.
       [time_type, dimension(:)]
       [time_type, dimension(:)]
    modtime   
       [integer]
    index1    Timelist(index1) = The largest value of Timelist which is less than mod(Time,Time_end-Time_beg)
    index2    Timelist(index2) = The smallest value of Timelist which is greater than mod(Time,Time_end-Time_beg)

    OUTPUT
    weight    weight = (mod(Time,Time_end-Time_beg) - Timelist(index1)) / (Timelist(index2) - Timelist(index1))
       [real]
       [real]
       [real]
       [real]
       [real]
       [real]
    year1   
       [integer]
       [integer]
       [integer]
    year2   
       [integer]
       [integer]
       [integer]
    month1   
       [integer]
       [integer]
    month2   
       [integer]
       [integer]
    day1   
       [integer]
    day2   
       [integer]
    index1   
       [real]
       [real]
    index2   
       [real]
       [real]

    NOTE
    Examples:
           Time: Jan 01 00z    weight = 0.0 
           Time: Jul 01        weight ~ 0.5 
           Time: Dec 31 23z    weight ~ 1.0


  2. fraction_of_year

    DESCRIPTION



DATA SETS

None.


ERROR MESSAGES

ERROR in time_interp
input time list not ascending order
The list of input time types must have ascending dates.
ERROR in time_interp
modulo months must have same length
The length of the current month for input Time and Time_list must be the same when using the modulo month option. The modulo month option is available but not supported.
ERROR in time_interp
invalid value for argument modtime
The optional argument modtime must have a value set by one of the public parameters: NONE, YEAR, MONTH, DAY. The MONTH and DAY options are available but not supported.
ERROR in time_interp
period of list exceeds modulo period
The difference between the last and first values in the input Time list/array exceeds the length of the modulo period.
ERROR in time_interp
time before range of list or time after range of list
The difference between the last and first values in the input These errors occur when you are not using a modulo axis and the input Time occurs before the first value in the Time list/array or after the last value in the Time list/array.
error during execution of module time_interp_mod
input time list not ascending order
The list of input time types must have ascending dates.
error during execution of module time_interp_mod
modulo months must have same length
The length of the current month for input Time and Time_list must be the same when using the modulo month option. The modulo month option is available but not supported.
error during execution of module time_interp_mod
invalid value for argument modtime
The optional argument modtime must have a value set by one of the public parameters: NONE, YEAR, MONTH, DAY. The MONTH and DAY options are available but not supported.
error during execution of module time_interp_mod
period of list exceeds modulo period
The difference between the last and first values in the input Time list/array exceeds the length of the modulo period.
error during execution of module time_interp_mod
time before range of list or time after range of list
These errors occur when you are not using a modulo axis and the input Time occurs before the first value in the Time list/array or after the last value in the Time list/array.


REFERENCES

None.


COMPILER SPECIFICS

None.


PRECOMPILER OPTIONS

None.


LOADER OPTIONS

None.


TEST PROGRAM

None.


KNOWN BUGS

None.


NOTES

For all routines in this module the calendar type in module time_manager must be set.

The following private parameters are set by this module:
           seconds per minute = 60
           minutes per hour   = 60
           hours   per day    = 24
           months  per year   = 12


FUTURE PLANS

None.


top