-------------------------------------------------------
Set Time Window for Returning Station Records (MSETWIN)
-------------------------------------------------------

A calling program selects the nominal time of the data to be returned when using
MADIS routines to read observations and station information.  (The nominal time 
is set when calling M*STA for the desired dataset.)

Time "windowing" is used so that the MADIS routines will know how close in time 
each station's observation time needs to be to the nominal time in order to be 
included, and whether or not duplicate records from the same station that are 
within the time window should be included.  The time window is specified with 
the MSETWIN subroutine, which allows the user to select the number of minutes 
before and after the nominal time to be used for the window, and how duplicates 
should be handled.  

If MSETWIN is never called all records will be returned (including multiple 
reports from the same station) from the file containing the nominal time (see
note 4).

MSETWIN can be called anytime after the first MINIT call has been made, and the 
settings will remain in effect for all datasets until a subsequent call to 
MSETWIN.


USAGE:    CALL MSETWIN (MINBCK,MINFWD,RECWIN,STATUS)

  INPUT ARGUMENT LIST:

    MINBCK   - Integer   Number of minutes relative to nominal time
                         at which to start time window

    MINFWD   - Integer   Number of minutes relative to nominal time
                         at which to end time window

    RECWIN   - Integer   0 - Return all records within *file*
                         1 - Return one record per fixed station,
                             closest in time to nominal time
                         2 - Return one record per fixed station,
                             closest in time to start of window
                         3 - Return one record per fixed station,
                             closest in time to end of window
                         4 - Return all records within *window*
 
  OUTPUT ARGUMENT LIST:

    STATUS   - Integer   0 - success, or error code
                

ERRORS:

  Error code       Error message
  -----------      -------------

    3005           No MADIS subsystem initialized

       1           Invalid time window (MINFWD < MINBCK)

       2           Time window too large (more than 3h)

       3           Invalid window record type


NOTES:

1.  The maximum time window is 180 minutes.

2.  The window is inclusive, that is, MINBCK and MINFWD are both included.  
    For example, if the nominal time is 12:00, MINBCK = -30 and MINFWD = 30, 
    then observations with times of 11:30 - 12:30 will be returned.

3.  The nominal time doesn't have to be on an hour boundary.

4.  If MSETWIN is never called, or if it is called with a RECWIN value of 0, all 
    records will be returned (including multiple reports from the same station) 
    from the file containing the nominal time.  This default range of time is a 
    function of dataset.  All files are time-stamped on the hour.  Using 12:00 as 
    an example, here's the time range in the files:
  
    - Surface (non-mesonet)     11:45 - 12:44
    - Surface (mesonet)         12:00 - 12:59
    - Hydro                     12:00 - 12:59
    - ACARS                     12:00 - 12:59
    - Radiosonde                12:00 - 12:59
    - NOAA Profiler Network     12:00
