			-------------------------------------

			THE OUTPUT-INTERPRETATION SUBROUTINES

			-------------------------------------





To make the output as user-friendly as we can manage, an out-interpretation 

program is overlaid on top of the RISE software.  The formats of output-

interpretation subroutines are highly user-dependent, every user has a 

different preference as to the output appearance.  For this reason, we like 

to explain in some detail the structure of these routines so that users with 

a different preference can change them easily.  This information is 

particularly important when itineraries are extended from the present 2-stop 

to 3- (or more) stops. It is also important for mode-specific comments that 

one wishes to include in the output. Thus airlines managers have their own 

jargons, transit authorities have theirs, and so on.  By definition, the 

description here is technical since it is intended for computer programmers 

in modifying the output interpretation routine.



Subroutine INTOUT

*****************



Functional specifications:   Subroutine INTOUT interprets the output printed 

by subroutine OUTPUT. 



Input:

  MM - the number of stops in the routing

  ICODE,LCODE,KCODE,NCITY,IY2 - all of which are defined in the source code

  all route arrays (ROUTO,ROUTl,ROUT2) and their dimensions

  arrays ISET, NSIZE, ISIZE, NFREQ, COST, REVEN, IDIST and their dimensions



Output:  none



Calls:  subroutines HEADl, PAGEl, HEAD2, NONSTP, NSTOPS



Called by:  subroutine ARCS



To modify this subroutine for additional-stop routing:  

1)  Add new route arrays and their dimensions to the argument list (ex. 

ROUT3,R0UT4,IY3,IY4).  

2)  increase column dimensions of arrays ISET, ISIZE, NFREQ, NSIZE, COST, 

IDIST and REVEN.  

3)  expand IF-THEN-ELSE structure for calling PAGEl, passing in the array 

containing the candidate routes.



ex. expand to 3-stop routing

  IF(COL.EQ.2) THEN

    CALL PAGE1(......ROUTl....)

  ELSE

    IF(COL.EQ.3) THEN  

      CALL PAGEl(......ROUT2....)

    ELSE

      CALL PAGE1)......    ROUT3....)

    ENDIF

  ENDIF



4) add new rout arrays and their dimensions to the argument list in the call 

to subroutine NSTOPS



Subroutine HEAD1

****************



Functional specifications: subroutine HEADl prints the page heading above the 

list of candidate routes.



Input:  NHEAD   (If NHEAD = 1, the heading for nonstop routing is printed.  

Otherwise the heading for NHEAD-1 stop routing is printed.)



Output:  None



Calls:  None



Called by:  INTOUT



Modifications for additional stop routing:  None



Subroutine PAGE1

****************



Functional specifications:  Subroutine PAGE1 locates the candidate routes and 

their corresponding distances.



Input:

  ICODE, LCODE, KCODE, NCITY, IY2

  Array of candidate routes to be printed and their dimensions (ARROUT(R,C))

  IDTST and its dimensions

  COL - column of IDIST that contains the route distance

  array ISIZE and its dimensions



Output:  None



Calls:  CODES, GETROW, PRINTC



Called by:  INTOUT



Modifications for additional stop routing:  None



Subroutine GETROW

*****************



Functional specifications:  Subroutine GETROW returns the row number for the 

origin-destination pair



Input:

  Origin integer code (IORIG)

  Destination integer code (IDEST)

  NCITY



Output:  Row number of the origin-destination pair (ROW)



Calls:  None



Called by:  PAGE1, PRCONN



Modifications for additional stop routing:  None



Subroutine PRINTC

*****************



Functional Specifications: Subroutine PRINTC prints the candidate route and 

its corresponding distance.



Input:

 Array LCODE, containing route destination character codes (excluding origin)

 IY2 - dimension of LCODE

 ORIG - route origin character code

 DIST - route distance

 COL - number of destination codes in LCODE  be printed

 ROUTE - route number to be printed



Output:  None



Calls:  None



Called by:  PAGE1



Modifications for additional stop routing:  1)  Add 1 to the repeat count in 

format statement 250 for each additional stop.  2)  Add 6 blanks to format 

statement 300 for each additional stop.



ex.  Add 2 additional stops (4-stop routing).

  250   FORMAT('+',28X,3('-',A4))

  300   FORMAT('+',58X,'Distance =',I4)



Change the above to:

  250   FORMAT('+',28X,5('-',A4))

  300   FORMAT('+',58X,'Distance =',I4)



Subroutine HEAD2

****************



Functional specifications:  Subroutine HEAD2 prints the heading above the 

list of acceptable routes.



Input:  COL - If COL=1, Print the heading for nonstop routes.  Otherwise 

print the heading for COL-1 stop routes.



Output:  None



Calls:  None



Called by:  INTOUT



Modifications for additional stop routing:  None



Subroutine ORGDES

*****************



Functional specifications:  Subroutine ORGDES returns the origin-destination 

integer and character codes.



Input:

  ROW - row number of origin-destination pair

  ICODE, LCODE, KCODE, NCITY, IY2



Output:

  IORIG, IDEST - integer codes of the origin and destination respectively

  ORIG, DEST - character codes of the origin and destination respectively



Calls:  PAIRS, NSTOPS



Called by:  NONSTP, NSTOPS



Modifications for additional stop routing:  None



Subroutine NONSTP

*****************



Functional specifications:  Subroutine NONSTP prints the acceptable nonstop 

routes.



Input:

  ICODE, LCODE, KCODE, NCITY, IY2

  IDIST, ISET, NFREQ, COST, REVEN, NROW, MMYY

  COL - column of IDIST, ISET, COST, NFREQ, REVEN to be referenced.



Output:  None



Calls:  ORGDES



Called by:  INTOUT



Modifications for additional stop routes:  None



Subroutine CRINFO

*****************



Functional specifications:  Subroutine CRINFO returns the connect routing 

information (type of paths taken and the connecting point of the paths) by 

decoding the negative NSIZE entry.



Input:  CCODE - the negative NSIZE entry



Output:

  PTYPE1, PTYPE2 - type of routes used in making the connect routing 

  (1= nonstop, 2= 1-stop)

  CPOINT - connect point



Calls:  None



Called by:  NSTOPS



Modifications for additional stop routing:  None



Subroutine ROWCOL

*****************



Functional specifications:  Subroutine ROWCOL converts the one-dimensional 

pointer in PART0/PART1 to a row and column subscript.



Input:  PTR - pointer value



Output:  ROW, COL - row and column subscripts



Calls:  None



Called by:  NSTOPS, PRCONN



Modifications for additional stop routing:  None



Subroutine SWAPOD

*****************



Functional specifications:  Subroutine SWAPOD swaps the integer codes of the 

origin-destination pair.



Input/Output:  ORG, DES - the origin and destination codes respectively.



Calls:  None



Called by:  NSTOPS



Modifications for additional stop routing:  None



Subroutine GETRTE

*****************



Functional specifications:  Subroutine GETRTE returns the character codes of 

a particular route.



Input:

  IORIG - origin integer code

  RTE - route number

  COL - number of destination codes excluding the origin

  ARROUT - array containing the destination codes

  R,C - dimensions of ARROUT

  ICODE, LCODE, KCODE, NCITY, IY2



Output:

  ORIG - origin character code

  ROUTE - array of destination character codes



Calls:  CODES



Called by:  NSTOPS, PRCONN



Modifications for additional stop routing:  None



Subroutine NSTOPS

*****************



Functional specifications:  Subroutine NSTOPS prints all acceptable routes, 

excluding nonstop routes.



Input:

  NSIZE, INY, NROW, PART0, PARTl, IP0, IPl

  ICODE, KCODE, LCODE, NCITY, IY2

  ISET, IDIST, COST, REVEN, NFREQ, MMYY

  ROUT0, ROUTl, lY0, IYl

  MM - the number of stops in the routing



Output:  None



Calls:  ORGDES, CRINFO, CODES, PRCONN, PPATH, ROWCOL, PAIR, GETRTE, SWAPOD



Called by:  INTOUT



Modifications for additional stop routing:  



1) expand IF-THEN-ELSE structures for assigning a value to PTR.



ex.  Add 1 additional stop.

  IF(I2.EQ.1)  THEN

    PTR=PART0(I,J)        

  ELSE

    IF(I2.EQ.2) THEN

      PTR=PARTl(I,J)

    ELSE

      PTR=PART2(I,J)

    ENDIF

  ENDIF



2)  add additional 'PART' arrays and their dimensions to the argument list of 

NSTOPS, INTOUT, ARCS, and PRCONN. Also add them to the corresponding calls of 

these routines.



3) expand IF-THEN-ELSE structures for calling GETRTE.



ex. add one additional stop

  IF(MM.EQ.1) THEN

    CALL GETRTE(.......... ROUTl,NCITY,IY1.... }

  ELSE

    IF(MM.EQ.2) THEN

      CALL GETRTE(....ROUT2,NCITY,IY2.... )

    ELSE

      CALL GETRTE(....ROUT3,NCITY,IY3.... )

    ENDIF

  ENDIF



4) add 1 for each additional stop to the repeat count in format statement 

600.



ex. add two additional stops

  format 600 becomes: 600   FORMAT('+',l5X,5('-',A4))



Subroutine PRCONN

*****************



Functional specifications:  Subroutine PRCONN prints a connecting route used 

in the connect routine and returns this route to subroutine NSTOPS.



Input:

  RNUM - number of route to be printed (1 or 2)

  IORIG, IDEST - inter codes of the o-d pair

  TYPE - type of route to be printed (1 = nonstop within 1-stop, 2 = 1-stop 

     route)

  PART0, PART1, NROW, IP0, IP1, ROUT0, ROUT1, ROUT2, ABBE, IY1, lY2

  ICODE, LCODE, KCODE, NCITY

  ISET, IFREQ, MMYY



Output: 

  ROUTE - array of destination codes of connecting route

  NDEST - number  of codes in array ROUTE?

  RORIG - character code or route origin

  RROW - row number of connecting route



Calls:  ROWCOL, PAIR, GETRTE



Called by:  NSTOPS



Modifications for additional stop routing:  



1) Expand IF-THEN-ELSE structure for assigning value to PTR.



ex. expand structure to allow 3 stop routes

  IF(TYPE.EQ.1) THEN

    PTR.PART0(RROW,1)

  ELSE

    IF(TYPE.EQ.2) THEN

      PTR=PARTl(RROW,1)

    ELSE

      PTR=PART2(RROW,1)

    ENDIF

  ENDIF



2) Expand IF-THEN-ELSE structures that call GETRE.



ex.  expand structure to allow 4 stop routes

  IF(TYPE.EQ.1) THEN

    DEST=2

    CALL GETRTE(.......  ROUTl,NCITY,IY1,...   )

    TYPE.EQ.2) THEN

    NDEST=3

    CALL GETRTE(.....   ROUT2,NCITY,IY2...)

  ELSE

    IF(TYPE.EQ.3) THEN

      NDEST=4

      CALL GETRTE(....  ROUT3,NCITY,IY3,...    )

    ELSE

      NDEST=5

      CALL GETRTE(.....ROUT4,NCITY,IY4,....)

    ENDIF

  ENDIF



3) add 1 to the repeat count in format number 150 or each additional stop.  

Add 6 blanks to format number 200 for each additional stop.



ex. add two additional stops.  Format statement 150 and 200 become:

  150   FORMAT('+', 25X,5('-',A4))

  200   FORMAT('+',59X,'Freq =',I2)



Subroutine PPATH

****************



Functional specifications:  Subroutine PPATH prints the path taken in the 

connect routing, the route containing this path and the distance, cost and 

revenue of or produced by the route.



Input:

  IORIG, IDEST - origin and destination integer codes of the path taken in 

	the connecting route.

  ORIG - character code of the connecting route origin.

  ROUTE - array of connecting route dest. character codes

  NDEST - number of characters codes in array ROUTE 

  TYPE - path type

  ROW - row number of route

  MM - number of stops in the connect routing

  ICODE, LCODE, KCODE, NCITY, IY2

  IDIST, COST, REVEN, NROW, MMYY



Output:  None



Calls:  CODES



Called by:  NSTOPS



Modifications for additional stop routing: 



1) Add 1 to the repeat count of format statement 35 for each additional stop.



ex. add 2 additional stops

Format statement 35 becomes:

  35    FORMAT('+',15X,5('-',A4))

