
                               					20-May-1983 10:28:47	VAX-11 FORTRAN V3.2-37              Page   1
								10-May-1983 10:04:07	CAD$VOLSET:[GARY.STATS.SOURCE]PDLLINE.FOR;53

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: PDL_LINE creates a PDL file for later use by a plotter package
0025    !   
0026    !
0027    ! ENVIRONMENT: VAX/VMS unpriv
0028    !   
0029    !
0030    ! AUTHOR: Gary Smith, CREATION DATE: 9/20/1982
0031    !
0032    ! MODIFIED BY:
0033    !
0034    !--
0035    !
0036    ! TABLE OF CONTENTS:
0037    !
0038    !
0039    ! INCLUDE FILES: none
0040    !
0041    !
0042    ! MACROS: none
0043    !
0044    !
0045    ! EQUATED SYMBOLS: NPFIT
0046    !
0047    !
0048    ! EXTERNAL REFERENCES: none
0049    !
0050     
0051    !++
0052    ! FUNCTIONAL DESCRIPTION: PDL_LINE operates in the same manner as PLOT_LINE
0053    !                         does. Only PDL_LINE creates a PDL file instead of
0054    !                         writing  plot to the screen. 
0055    !
0056    !
0057    !

                               					20-May-1983 10:28:47	VAX-11 FORTRAN V3.2-37              Page   2
								10-May-1983 10:04:07	CAD$VOLSET:[GARY.STATS.SOURCE]PDLLINE.FOR;53

0058    ! FORMAL PARAMETERS: x              -> array of x values
0059    !                    y              -> array of y values
0060    !                    n              -> number of values
0061    !                    xmin           -> smallest x value
0062    !                    xmax           -> biggest x value
0063    !                    ymin           -> smallest y value
0064    !                    ymax           -> biggest y value
0065    !                    xtitle         -> title for the x axis
0066    !                    ytitle         -> title for the y axis
0067    !                    dif_time       -> the amount of time the plot 
0068    !                                      covers in secs
0069    !                    frame          -> which plot number this is
0070    !                    since_mid_nite -> minutes since midnite this plot
0071    !                                      begins at
0072    !
0073    !
0074    !
0075    ! IMPLICIT INPUTS: none
0076    !
0077    !
0078    !
0079    ! IMPLICIT OUTPUTS: a PDL file of the information to be plotted
0080    !
0081    !
0082    !
0083    ! ROUTINE VALUE and
0084    ! COMPLETION CODES: none
0085    !
0086    !
0087    !
0088    ! SIDE EFFECTS: none to date
0089    !
0090    !
0091    !
0092    !--
0093          SUBROUTINE PDL_LINE (X, Y, N, XMIN, XMAX, YMIN, YMAX, XTITLE,
0094         .                      YTITLE, DIF_TIME, SINCE_MID_NITE )
0095          include 'statsubs.for'
0148     
0149          character*80 xtitle, ytitle, factor_string
0150          dimension x(n), y(n)
0151          parameter (npfit = 100)
0152          dimension xx(npfit+2), yy(npfit+2)
0153          dimension sa(2000), sb(2000), sc(2000)
0154          character*40  form, time_format
0155          character*9   date_buf
0156          character * 12 user_name
0157          character * 7  scale_time
0158          character * 63 nest_file
0159          character * 9  node_name
0160          integer dif_time, pos_quote, pos_colon, status
0161          data rnd /1.0005/, small/1.e-30/
0162          logical pdl, quarter
0163          common /scal/ scale, xmn, xdl, ymn, ydl, lu, pdl,
0164         +     quarter, ixorg, iyorg
0165     
0166          common / nest_common / nest_file

PDL_LINE                       					20-May-1983 10:28:47	VAX-11 FORTRAN V3.2-37              Page   3
								10-May-1983 10:04:07	CAD$VOLSET:[GARY.STATS.SOURCE]PDLLINE.FOR;53

0167    c
0168          comlog(z) = alog10(amax1(small,abs(rnd*z)))
0169    c
0170          iscale = 10000
0171          scale = iscale
0172          ixorg = 0
0173          iyorg = 0
0174          lu = 12
0175          pdl = .true.
0176          quarter = .false.
0177          xdl = 0.1*(xmax-xmin)
0178          xmx = xmax
0179          xmn = xmin
0180          dx = (xmax-xmin)/(npfit-1)
0181          x0 = xmin - dx
0182          do 20 i = 1,npfit
0183            x0 = x0 + dx
0184            xx(i) = x0
0185    20      continue
0186          xx(npfit+1) = xmin
0187          xx(npfit+2) = xdl
0188          xmlg = amax1( comlog(rnd*xmn), comlog(rnd*xmax))
0189          iexpon = 3*(ifix(xmlg)/3)
0190          if(xmlg .lt. 0.0)  iexpon = 3*(ifix(xmlg-3.)/3)
0191          idpr = xmlg - iexpon
0192          form = '(F5.' // char(2-idpr+48) // ')'
0193          factor = 10.0**iexpon
0194          scale_time = 'MINUTES'
0195          time_factor = 1.0
0196          if ( dif_time .gt. seconds_in_hour ) then
0197              scale_time = 'HOURS'
0198              time_factor = seconds_in_minute
0199              time_format = '$HOUR'
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          write( lu, 150 ) 'H'
0216    150   format( a, a )
0217          call date( date_buf )
0218          status = MK$FILENAME( nest_file )
0219          pos_quote = index( nest_file, '"' )
0220          if ( pos_quote .eq. 0 ) then
0221             pos_colon = index( nest_file, '::' )
0222             if ( pos_colon .eq. 0 ) then
0223                status = SYS$TRNLOG( 'SYS$NODE', , node_name, , , )

PDL_LINE                       					20-May-1983 10:28:47	VAX-11 FORTRAN V3.2-37              Page   4
								10-May-1983 10:04:07	CAD$VOLSET:[GARY.STATS.SOURCE]PDLLINE.FOR;53

0224             else
0225                node_name = nest_file(1:pos_colon-1) // '::'
0226             endif
0227          else
0228             node_name = nest_file(1:pos_quote-1) // '::'
0229          endif
0230          write( lu, 150 ) ' ', node_name(1:MK$LENGTH(node_name)) //
0231         .                     ' '  // date_buf
0232          ismin = -iscale / 8
0233          ismax = 21 * iscale / 20
0234          write( lu, 160 ) 'W', ismin, ismin, ismax, ismax
0235    160   format( a, 12a4 )
0236          write( lu, 160 ) 'C', 1
0237          idelt = iscale / ifix( ( xmx - xmn ) / xdl )
0238          write( lu, 160 ) 'A', 0, 0, iscale, 120, idelt, 1, 31
0239          if ( dif_time .lt. 2.0 * seconds_in_day ) then
0240          write( lu, 160 ) ' ', since_mid_nite , time_factor * xdl / factor
0241          else
0242          write( lu, 160 ) ' ', xmn / factor , xdl / factor
0243          end if
0244          write( lu, 150 ) ' ', time_format
0245          write( lu, 160 ) 'S', ( iscale / 2 - 4500 ) , -800, 160, 0
0246          write( lu, 150 ) ' ', xtitle(1:MK$LENGTH(xtitle))
0247          if ( ymax .eq. ymin ) then
0248             ymax = 2.0 * ymax
0249             ymin = 0.0
0250          end if
0251          ydl = 0.1*(ymax-ymin)
0252          ymx = ymax
0253          ymn = ymin
0254          jj = 1
0255          do 50 j = 1,npfit
0256    50      yy(j) = seval(jj, n, xx(j), x, y, sa, sb, sc)
0257          yy(npfit+1) = ymin
0258          yy(npfit+2) = ydl
0259          ymlg = amax1( comlog(rnd*ymn), comlog(rnd*ymax))
0260          iexpon = 3*(ifix(ymlg)/3)
0261          if(ymlg .lt. 0.0)  iexpon = 3*(ifix(ymlg-3.)/3)
0262          idpr = ymlg - iexpon
0263          form = '(F5.' // char(2-idpr+48) // ')'
0264          factor = 10.0**iexpon
0265          if ( iexpon .gt. 1 ) then
0266             encode( iexpon+4, 666, factor_string ) factor
0267             ytitle = ytitle(1:MK$LENGTH(ytitle))
0268         .        // ' * ' // factor_string(1:MK$LENGTH(factor_string))
0269          endif
0270          idelt = iscale / ifix(( ymx - ymn ) / ydl)
0271          write ( lu, 160 ) 'A', 0, 0, iscale, 120, idelt, 1, 24
0272          write ( lu, 160 ) ' ', ymn / factor, ydl / factor
0273          write ( lu, 150 ) ' ', form
0274          write ( lu, 160 ) 'S', ismin+500, ( iscale / 2 - 2400 ), 200, 900
0275          write ( lu, 150 ) ' ', ytitle(1:MK$LENGTH(ytitle))
0276          call draw_line( xx, yy, npfit )
0277    c
0278          return
0279          end

PDL_LINE                       					20-May-1983 10:28:47	VAX-11 FORTRAN V3.2-37              Page   5
								10-May-1983 10:04:07	CAD$VOLSET:[GARY.STATS.SOURCE]PDLLINE.FOR;53

PROGRAM SECTIONS

    Name				 Bytes   Attributes

  0 $CODE                                 2503   PIC CON REL LCL   SHR   EXE   RD NOWRT LONG
  1 $PDATA                                 104   PIC CON REL LCL   SHR NOEXE   RD NOWRT LONG
  2 $LOCAL                               25512   PIC CON REL LCL NOSHR NOEXE   RD   WRT LONG
  3 SCAL                                    40   PIC OVR REL GBL   SHR NOEXE   RD   WRT LONG
  4 NEST_COMMON                             63   PIC OVR REL GBL   SHR NOEXE   RD   WRT LONG

    Total Space Allocated                28222


ENTRY POINTS

    Address  Type  Name                                        References

  0-00000000       PDL_LINE                                       93     


STATEMENT FUNCTIONS

    Address  Type  Name                                        References

  0-0000099E  R*4  COMLOG                                        168#      188(2)    259(2)  


VARIABLES

    Address  Type  Name                            Attributes  References

  2-00006190  CHAR DATE_BUF                                      155       217A      230     
 AP-00000028@ I*4  DIF_TIME                                       93       160       196       201       239     
  2-000061D4  R*4  DX                                            180=      181       183     
  2-000061EC  R*4  FACTOR                                        193=      206       240       242(2)    264=      266     
							         272(2)  
  2-000060F0  CHAR FACTOR_STRING                                 149       206       208       266       267(2)A 

  2-00006140  CHAR FORM                                          154       192=      203       263=      273     
  2-000061DC  I*4  I                                             182=      184     
  2-000061FC  I*4  IDELT                                         237=      238       270=      271     
  2-000061E8  I*4  IDPR                                          191=      192       262=      263     
  2-000061E4  I*4  IEXPON                                        189=      190=      191       193       205       206     
							         207       208       260=      261=      262       264     
							         265       266     

  2-000061CC  I*4  ISCALE                                        170=      171       232       233       237       238     
							         245       270       271       274     
  2-000061F8  I*4  ISMAX                                         233=      234(2)  
  2-000061F4  I*4  ISMIN                                         232=      234(2)    274     
  3-00000020  I*4  IXORG                           COMM          163       172=    
  3-00000024  I*4  IYORG                           COMM          163       173=    

  2-00006208  I*4  J                                             255=      256(2)  
  2-00006204  I*4  JJ                                            254=      256A    
  3-00000014  I*4  LU                              COMM          163       174=      215       230       234       236     
							         238       240       242       244       245       246     

PDL_LINE                       					20-May-1983 10:28:47	VAX-11 FORTRAN V3.2-37              Page   6
								10-May-1983 10:04:07	CAD$VOLSET:[GARY.STATS.SOURCE]PDLLINE.FOR;53

							         271       272       273       274       275     
 AP-0000000C@ I*4  N                                              93       150(2)    256A    
  4-00000000  CHAR NEST_FILE                       COMM          158       166       218A      219       221       225     
							         228     

  2-000061AC  CHAR NODE_NAME                                     159       223A      225=      228=      230(2)A 
  3-00000018  L*4  PDL                             COMM          162       163       175=    
  2-000061BC  I*4  POS_COLON                                     160       221=      222       225     
  2-000061B8  I*4  POS_QUOTE                                     160       219=      220       228     
  3-0000001C  L*4  QUARTER                         COMM          162       163       176=    

  2-000061C4  R*4  RND                                           161D      168       188(2)    259(2)  
  3-00000000  R*4  SCALE                           COMM          163       171=    
  2-000061A5  CHAR SCALE_TIME                                    157       194=      197=      202=      208(2)A   212(2)A 
 AP-0000002C@ R*4  SINCE_MID_NITE                                 93       240     
  2-000061C8  R*4  SMALL                                         161D      168     

  2-000061C0  I*4  STATUS                                        160       218=      223=    
  2-000061F0  R*4  TIME_FACTOR                                   195=      198=      240     
  2-00006168  CHAR TIME_FORMAT                                   154       199=      203=      244     
  2-00006199  CHAR USER_NAME                                     156     
  2-000061D8  R*4  X0                                            181=      183(2)=   184     

  3-00000008  R*4  XDL                             COMM          163       177=      187       237       240       242     
 AP-00000014@ R*4  XMAX                                           93       177       178       180       188     
 AP-00000010@ R*4  XMIN                                           93       177       179       180       181       186     
  2-000061E0  R*4  XMLG                                          188=      189       190(2)    191     
  3-00000004  R*4  XMN                             COMM          163       179=      188       237       242     

  2-000061D0  R*4  XMX                                           178=      237     
 AP-00000020@ CHAR XTITLE                                         93       149       208(3)=A            212(3)=A          
							         246(2)A 
  3-00000010  R*4  YDL                             COMM          163       251=      258       270       272     
 AP-0000001C@ R*4  YMAX                                           93       247       248(2)=   251       252       259     
 AP-00000018@ R*4  YMIN                                           93       247       249=      251       253       257     

  2-0000620C  R*4  YMLG                                          259=      260       261(2)    262     
  3-0000000C  R*4  YMN                             COMM          163       253=      259       270       272     
  2-00006200  R*4  YMX                                           252=      270     
 AP-00000024@ CHAR YTITLE                                         93       149       267(3)=A            275(2)A 
 AP-00000004@ R*4  Z                                             168(2)  



ARRAYS

    Address  Type  Name          Attributes        Bytes  Dimensions       References

  2-00000330  R*4  SA                              8000  (2000)            153       256A    
  2-00002270  R*4  SB                              8000  (2000)            153       256A    
  2-000041B0  R*4  SC                              8000  (2000)            153       256A    
 AP-00000004@ R*4  X                                 **  (*)                93       150       256A    
  2-00000000  R*4  XX                               408  (102)             152       184=      186=      187=      256A    
									   276A    

 AP-00000008@ R*4  Y                                 **  (*)                93       150       256A    
  2-00000198  R*4  YY                               408  (102)             152       256=      257=      258=      276A    

PDL_LINE                       					20-May-1983 10:28:47	VAX-11 FORTRAN V3.2-37              Page   7
								10-May-1983 10:04:07	CAD$VOLSET:[GARY.STATS.SOURCE]PDLLINE.FOR;53

PARAMETER CONSTANTS

  Type  Name                                                   References

   I*2  EOF                                                      147#    
   I*2  EQUAL                                                    122#    
   I*2  FAILURE                                                  107#    
   I*2  GREATER                                                  123#    
   I*2  KEYED_READ                                               113#    

   I*2  LESS                                                     121#    
   I*4  MAXINT                                                   146#    
   I*2  MAX_CAT                                                  129#    
   I*2  MAX_ENT                                                  130#    
   R*4  MINUTES_IN_DAY                                           140#    

   R*4  MINUTES_IN_HOUR                                          137#    
   I*2  NEST_CLOSE                                               115#    
   I*2  NEST_OPEN                                                112#    
   I*4  NPFIT                                                    151#      152(2)    180       182       186       187     
							         255       257       258       276     
   R*4  SECONDS_IN_DAY                                           139#      201       239     

   R*4  SECONDS_IN_HOUR                                          138#      196     
   R*4  SECONDS_IN_MINUTE                                        136#      198     
   I*2  SEQ_READ                                                 114#    
   CHAR STANDARD_HELP_LIB                                        100       101#    
   I*2  SUCCESS                                                  106#    



LABELS

    Address   Label                                            References

  0-000000BD  20                                                 182       185#    
  0-00000688  50                                                 255       256#    
  1-00000044  150'                                               215       216#      230       244       246       273     
							         275     
  1-00000047  160'                                               234       235#      236       238       240       242     
							         245       271       272       274     
  1-0000003C  666'                                               206       207#      266     



FUNCTIONS AND SUBROUTINES REFERENCED

  Type  Name                                                   References

        DRAW_LINE                                                276     
        FOR$DATE_T_DS                                            217     
   I*4  LIB$INDEX                                                219       221     
   I*4  MK$FILENAME                                              218     
   I*4  MK$LENGTH                                                208(2)    212(2)    230       246       267(2)    275     

   R*4  MTH$ALOG10                                               168     
   R*4  SEVAL                                                    256     

PDL_LINE                       					20-May-1983 10:28:47	VAX-11 FORTRAN V3.2-37              Page   8
								10-May-1983 10:04:07	CAD$VOLSET:[GARY.STATS.SOURCE]PDLLINE.FOR;53

   R*4  SYS$TRNLOG                                               223     


  +----------------------------------------------+
  |           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:PDLLINE/LIST=LIS:PDLLINE/CONT=99/CROSS/NOOPT SRC:PDLLINE

  /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


COMPILATION STATISTICS

  Run Time:           6.03 seconds
  Elapsed Time:       13.90 seconds
  Page Faults:        577
  Dynamic Memory:     884 pages
