
                               					20-May-1983 10:28:31	VAX-11 FORTRAN V3.2-37              Page   1
								10-May-1983 10:06:21	[GARY.STATS.SOURCE]PLOTLINE.FOR;63          

0001    !
0002    !			  COPYRIGHT (c) 1982 BY
0003    !	      MOSTEK CORPORATION, CARROLLTON TX
0004    !
0005    ! This software is furnished under a license and may be used and  copied
0006    ! only  in  accordance  with  the  terms  of  such  license and with the
0007    ! inclusion of the above copyright notice.  This software or  any  other
0008    ! copies  thereof may not be provided or otherwise made available to any
0009    ! other person.  No title to and ownership of  the  software  is  hereby
0010    ! transferred.
0011    !
0012    ! The information in this software is subject to change  without  notice
0013    ! and  should  not  be  construed  as  a commitment by MOSTEK
0014    ! CORPORATION.
0015    !
0016    ! MOSTEK assumes no responsibility for the use or  reliability  of  its
0017    ! software on equipment which is not supplied by MOSTEK.
0018    !
0019     
0020    !++
0021    ! FACILITY:
0022    !   MOSTEK CORPORATION
0023    !
0024    ! ABSTRACT: PLOT_LINE interfaces with the neccessary routines to do a
0025    !           on screen plot of the info passed to it
0026    !   
0027    !
0028    ! ENVIRONMENT: VAX/VMS unpriv
0029    !   
0030    !
0031    ! AUTHOR: Gary Smith, CREATION DATE: 9/20/1982
0032    !
0033    ! MODIFIED BY:
0034    !
0035    !--
0036    !
0037    ! TABLE OF CONTENTS:
0038    !
0039    !
0040    ! INCLUDE FILES: statsubs.for
0041    !
0042    !
0043    ! MACROS: none
0044    !
0045    !
0046    ! EQUATED SYMBOLS: NPFIT,
0047    !                  see statsubs.for
0048    !
0049    !
0050    ! EXTERNAL REFERENCES: none
0051    !
0052     
0053    !++
0054    ! FUNCTIONAL DESCRIPTION: PLOT_LINE takes the arrays of the information
0055    !                         obtained by PLOT and performs the computations
0056    !                         to interface with the plotting package for VT100
0057    !                         and all it's clones.

                               					20-May-1983 10:28:31	VAX-11 FORTRAN V3.2-37              Page   2
								10-May-1983 10:06:21	[GARY.STATS.SOURCE]PLOTLINE.FOR;63          

0058    !
0059    !
0060    !
0061    ! FORMAL PARAMETERS: X              -> Array of X values
0062    !                    Y              -> Array of Y values
0063    !                    N              -> Number of points to plot
0064    !                    XMIN           -> Smallest X value
0065    !                    XMAX           -> Biggest X value
0066    !                    YMIN           -> Smallest y value
0067    !                    YMAX           -> Biggest Y value
0068    !                    XTITLE         -> Title to appear on X axis
0069    !                    YTITLE         -> Title to appear on Y axis
0070    !                    DIF_TIME       -> The delta time between start and end
0071    !                    SINCE_MID_NITE -> Minutes since midnite this plot 
0072    !                                      began
0073    !
0074    !
0075    !
0076    ! IMPLICIT INPUTS: none
0077    !
0078    !
0079    !
0080    ! IMPLICIT OUTPUTS: a plot of Y versus X
0081    !
0082    !
0083    !
0084    ! ROUTINE VALUE and
0085    ! COMPLETION CODES: none
0086    !
0087    !
0088    !
0089    ! SIDE EFFECTS: none to date
0090    !
0091    !
0092    !
0093    !--
0094          SUBROUTINE PLOT_LINE (X, Y, N, XMIN, XMAX, YMIN, YMAX, XTITLE,
0095         .                      YTITLE, DIF_TIME, SINCE_MID_NITE )
0096     
0097          character*80 xtitle, ytitle, factor_string
0098     
0099          dimension x(n), y(n)
0100     
0101          parameter (npfit = 100)
0102     
0103          include 'statsubs.for'
0156     
0157          dimension xx(npfit+2), yy(npfit+2)
0158          dimension sa(2000), sb(2000), sc(2000)
0159     
0160          character*40  form, time_format
0161          character*7   scale_time
0162     
0163          integer dif_time, since_mid_nite
0164     
0165          data rnd /1.0005/, small/1.e-30/
0166     

PLOT_LINE                      					20-May-1983 10:28:31	VAX-11 FORTRAN V3.2-37              Page   3
								10-May-1983 10:06:21	[GARY.STATS.SOURCE]PLOTLINE.FOR;63          

0167          logical pdl, quarter
0168     
0169          common /scal/ scale, xmn, xdl, ymn, ydl, lu, pdl,
0170         +     quarter, ixorg, iyorg
0171    c
0172          comlog(z) = alog10(amax1(small,abs(rnd*z)))
0173    c
0174          ixorg = 0
0175          iyorg = 0
0176          lu = 12
0177          pdl = .false.
0178          quarter = .false.
0179          xdl = 0.1*(xmax-xmin)
0180          xmn = xmin
0181          dx = (xmax-xmin)/(npfit-1)
0182          x0 = xmin - dx
0183          do 20 i = 1,npfit
0184            x0 = x0 + dx
0185            xx(i) = x0
0186    20      continue
0187          xx(npfit+1) = xmin
0188          xx(npfit+2) = xdl
0189          xmlg = amax1( comlog(rnd*xmn), comlog(rnd*xmax))
0190          iexpon = 3*(ifix(xmlg)/3)
0191          if(xmlg .lt. 0.0)  iexpon = 3*(ifix(xmlg-3.)/3)
0192          idpr = xmlg - iexpon
0193          form = '(F5.' // char(2-idpr+48) // ')'
0194          factor = 10.0**iexpon
0195          time_factor = 1.0
0196          time_format = '$HOUR'
0197          scale_time = 'HOURS'
0198          if ( dif_time .ge. seconds_in_hour ) then
0199             time_factor = seconds_in_minute
0200          end if
0201          if ( dif_time .gt. 2.0 * seconds_in_day ) then
0202             scale_time = 'DAYS'
0203             time_format = form
0204          end if
0205          if ( iexpon .gt. 1 ) then
0206             encode( iexpon+4, 666, factor_string ) factor
0207    666      format( f<iexpon+4>.1 )
0208             xtitle = xtitle(1:MK$LENGTH(xtitle))
0209         .        // ' (' //  scale_time(1:MK$LENGTH(scale_time)) // ')* '
0210         .        // factor_string(1:iexpon+4) // ')'
0211          else 
0212             xtitle = xtitle(1:MK$LENGTH(xtitle)) // ' ('
0213         .            // scale_time(1:MK$LENGTH(scale_time)) // ')'
0214          endif
0215          call crt_init
0216          call crt_origin (1.,1.)
0217     
0218    !++
0219    ! special case for time less than 2 days
0220    !--
0221     
0222          if ( dif_time .le. 2.0 * seconds_in_day  ) then
0223             call crt_axis (0., 0., xtitle, 10.0, 'H',

PLOT_LINE                      					20-May-1983 10:28:31	VAX-11 FORTRAN V3.2-37              Page   4
								10-May-1983 10:06:21	[GARY.STATS.SOURCE]PLOTLINE.FOR;63          

0224         +            since_mid_nite, time_factor * xdl / factor,
0225         .            time_format )
0226          else 
0227             call crt_axis (0., 0., xtitle, 10.0, 'H',
0228         +            xx(npfit+1)/factor, xx(npfit+2)/factor, form)
0229    c
0230          end if
0231     
0232          if ( ymax .eq. ymin ) then
0233             ymax = 2.0 * ymax
0234             ymin = 0.0
0235          end if
0236          ydl = 0.1*(ymax-ymin)
0237          ymn = ymin
0238          jj = 1
0239          do 50 j = 1,npfit
0240    50      yy(j) = seval(jj, n, xx(j), x, y, sa, sb, sc)
0241          yy(npfit+1) = ymin
0242          yy(npfit+2) = ydl
0243          ymlg = amax1( comlog(rnd*ymn), comlog(rnd*ymax))
0244          iexpon = 3*(ifix(ymlg)/3)
0245          if(ymlg .lt. 0.0)  iexpon = 3*(ifix(ymlg-3.)/3)
0246          idpr = ymlg - iexpon
0247          form = '(F5.' // char(2-idpr+48) // ')'
0248          factor = 10.0**iexpon
0249          if ( iexpon .gt. 1 ) then
0250             encode( iexpon+4, 666, factor_string ) factor
0251             ytitle = ytitle(1:MK$LENGTH(ytitle))
0252         .        // ' * ' // factor_string
0253          endif
0254          call crt_axis (0., 0., ytitle, 10., 'V',
0255         +            yy(npfit+1)/factor, yy(npfit+2)/factor, form)
0256          call draw_line (xx, yy, npfit)
0257          call crt_end_job (.true.)
0258    c
0259          return
0260          end

PLOT_LINE                      					20-May-1983 10:28:31	VAX-11 FORTRAN V3.2-37              Page   5
								10-May-1983 10:06:21	[GARY.STATS.SOURCE]PLOTLINE.FOR;63          

PROGRAM SECTIONS

    Name				 Bytes   Attributes

  0 $CODE                                 1235   PIC CON REL LCL   SHR   EXE   RD NOWRT LONG
  1 $PDATA                                  52   PIC CON REL LCL   SHR NOEXE   RD NOWRT LONG
  2 $LOCAL                               25392   PIC CON REL LCL NOSHR NOEXE   RD   WRT LONG
  3 SCAL                                    40   PIC OVR REL GBL   SHR NOEXE   RD   WRT LONG

    Total Space Allocated                26719


ENTRY POINTS

    Address  Type  Name                                        References

  0-00000000       PLOT_LINE                                      94     


STATEMENT FUNCTIONS

    Address  Type  Name                                        References

  0-000004AB  R*4  COMLOG                                        172#      189(2)    243(2)  


VARIABLES

    Address  Type  Name                            Attributes  References

 AP-00000028@ I*4  DIF_TIME                                       94       163       198       201       222     
  2-000061A0  R*4  DX                                            181=      182       184     
  2-000061B8  R*4  FACTOR                                        194=      206       223       227(2)    248=      250     
							         254(2)  
  2-000060F0  CHAR FACTOR_STRING                                  97       206       208       250       251     
  2-00006140  CHAR FORM                                          160       193=      203       227A      247=      254A    

  2-000061A8  I*4  I                                             183=      185     
  2-000061B4  I*4  IDPR                                          192=      193       246=      247     
  2-000061B0  I*4  IEXPON                                        190=      191=      192       194       205       206     
							         207       208       244=      245=      246       248     
							         249       250     
  3-00000020  I*4  IXORG                           COMM          169       174=    
  3-00000024  I*4  IYORG                           COMM          169       175=    

  2-000061C4  I*4  J                                             239=      240(2)  
  2-000061C0  I*4  JJ                                            238=      240A    
  3-00000014  I*4  LU                              COMM          169       176=    
 AP-0000000C@ I*4  N                                              94        99(2)    240A    
  3-00000018  L*4  PDL                             COMM          167       169       177=    

  3-0000001C  L*4  QUARTER                         COMM          167       169       178=    
  2-00006198  R*4  RND                                           165D      172       189(2)    243(2)  
  3-00000000  R*4  SCALE                           COMM          169     
  2-00006190  CHAR SCALE_TIME                                    161       197=      202=      208(2)A   212(2)A 
 AP-0000002C@ I*4  SINCE_MID_NITE                                 94       163       223A    


PLOT_LINE                      					20-May-1983 10:28:31	VAX-11 FORTRAN V3.2-37              Page   6
								10-May-1983 10:06:21	[GARY.STATS.SOURCE]PLOTLINE.FOR;63          

  2-0000619C  R*4  SMALL                                         165D      172     
  2-000061BC  R*4  TIME_FACTOR                                   195=      199=      223     
  2-00006168  CHAR TIME_FORMAT                                   160       196=      203=      223A    
  2-000061A4  R*4  X0                                            182=      184(2)=   185     
  3-00000008  R*4  XDL                             COMM          169       179=      188       223     

 AP-00000014@ R*4  XMAX                                           94       179       181       189     
 AP-00000010@ R*4  XMIN                                           94       179       180       181       182       187     
  2-000061AC  R*4  XMLG                                          189=      190       191(2)    192     
  3-00000004  R*4  XMN                             COMM          169       180=      189     
 AP-00000020@ CHAR XTITLE                                         94        97       208(3)=A            212(3)=A          
							         223A      227A    

  3-00000010  R*4  YDL                             COMM          169       236=      242     
 AP-0000001C@ R*4  YMAX                                           94       232       233(2)=   236       243     
 AP-00000018@ R*4  YMIN                                           94       232       234=      236       237       241     
  2-000061C8  R*4  YMLG                                          243=      244       245(2)    246     
  3-0000000C  R*4  YMN                             COMM          169       237=      243     

 AP-00000024@ CHAR YTITLE                                         94        97       251(3)=A            254A    
 AP-00000004@ R*4  Z                                             172(2)  


ARRAYS

    Address  Type  Name          Attributes        Bytes  Dimensions       References

  2-00000330  R*4  SA                              8000  (2000)            158       240A    
  2-00002270  R*4  SB                              8000  (2000)            158       240A    
  2-000041B0  R*4  SC                              8000  (2000)            158       240A    
 AP-00000004@ R*4  X                                 **  (*)                94        99       240A    
  2-00000000  R*4  XX                               408  (102)             157       185=      187=      188=      227(2)  
									   240A      256A    

 AP-00000008@ R*4  Y                                 **  (*)                94        99       240A    
  2-00000198  R*4  YY                               408  (102)             157       240=      241=      242=      254(2)  
									   256A    


PARAMETER CONSTANTS

  Type  Name                                                   References

   I*2  EOF                                                      155#    
   I*2  EQUAL                                                    130#    
   I*2  FAILURE                                                  115#    
   I*2  GREATER                                                  131#    
   I*2  KEYED_READ                                               121#    

   I*2  LESS                                                     129#    
   I*4  MAXINT                                                   154#    
   I*2  MAX_CAT                                                  137#    
   I*2  MAX_ENT                                                  138#    
   R*4  MINUTES_IN_DAY                                           148#    

   R*4  MINUTES_IN_HOUR                                          145#    
   I*2  NEST_CLOSE                                               123#    

PLOT_LINE                      					20-May-1983 10:28:31	VAX-11 FORTRAN V3.2-37              Page   7
								10-May-1983 10:06:21	[GARY.STATS.SOURCE]PLOTLINE.FOR;63          

   I*2  NEST_OPEN                                                120#    
   I*4  NPFIT                                                    101#      157(2)    181       183       187       188     
							         227(2)    239       241       242       254(2)    256     
   R*4  SECONDS_IN_DAY                                           147#      201       222     

   R*4  SECONDS_IN_HOUR                                          146#      198     
   R*4  SECONDS_IN_MINUTE                                        144#      199     
   I*2  SEQ_READ                                                 122#    
   CHAR STANDARD_HELP_LIB                                        108       109#    
   I*2  SUCCESS                                                  114#    



LABELS

    Address   Label                                            References

  0-000000A7  20                                                 183       186#    
  0-00000320  50                                                 239       240#    
  1-00000018  666'                                               206       207#      250     


FUNCTIONS AND SUBROUTINES REFERENCED

  Type  Name                                                   References

        CRT_AXIS                                                 223       227       254     
        CRT_END_JOB                                              257     
        CRT_INIT                                                 215     
        CRT_ORIGIN                                               216     
        DRAW_LINE                                                256     

   I*4  MK$LENGTH                                                208(2)    212(2)    251     
   R*4  MTH$ALOG10                                               172     
   R*4  SEVAL                                                    240     


  +----------------------------------------------+
  |           KEY TO REFERENCE FLAGS             |
  |   =   - Value Modified                       |
  |   #   - Defining Reference                   |
  |   A   - Actual Argument, possibly modified   |
  |   D   - Data Initialization                  |
  |  (n)  - Number of occurrences on line        |
  +----------------------------------------------+



COMMAND QUALIFIERS

  FORTRAN /DEBUG/OBJECT=OBJ:PLOTLINE/LIST=LIS:PLOTLINE/CONT=99/CROSS/NOOPT SRC:PLOTLINE

  /CHECK=(NOBOUNDS,OVERFLOW,NOUNDERFLOW)
  /DEBUG=(SYMBOLS,TRACEBACK)
  /STANDARD=(NOSYNTAX,NOSOURCE_FORM)
  /SHOW=(NOPREPROCESSOR,NOINCLUDE,MAP)
  /F77  /NOG_FLOATING  /I4  /NOOPTIMIZE  /WARNINGS  /NOD_LINES  /CROSS_REFERENCE  /NOMACHINE_CODE  /CONTINUATIONS=99

PLOT_LINE                      					20-May-1983 10:28:31	VAX-11 FORTRAN V3.2-37              Page   8
								10-May-1983 10:06:21	[GARY.STATS.SOURCE]PLOTLINE.FOR;63          

COMPILATION STATISTICS

  Run Time:           4.21 seconds
  Elapsed Time:       8.97 seconds
  Page Faults:        515
  Dynamic Memory:     864 pages
