
                               					20-May-1983 10:30:15	VAX-11 FORTRAN V3.2-37              Page   1
								10-May-1983 10:02:16	[GARY.STATS.SOURCE]MULTIPDL.FOR;26          

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: MULTI_PDL creates a PDL file for later use by a plotter package
0025    !           with multiple plot contained within it.
0026    !   
0027    !
0028    ! ENVIRONMENT: VAX/VMS unpriv
0029    !   
0030    !
0031    ! AUTHOR: Gary Smith, CREATION DATE: 11/9/1982
0032    !
0033    ! MODIFIED BY:
0034    !
0035    !--
0036    !
0037    ! TABLE OF CONTENTS:
0038    !
0039    !
0040    ! INCLUDE FILES: none
0041    !
0042    !
0043    ! MACROS: none
0044    !
0045    !
0046    ! EQUATED SYMBOLS: NPFIT
0047    !
0048    !
0049    ! EXTERNAL REFERENCES: none
0050    !
0051     
0052    !++
0053    ! FUNCTIONAL DESCRIPTION: MULTI_PDL operates in the same manner as PDL_LINE
0054    !                         does. Only MULTI_PDL creates a PDL file 
0055    !                         wit multiple plots within it.
0056    !
0057    !

                               					20-May-1983 10:30:15	VAX-11 FORTRAN V3.2-37              Page   2
								10-May-1983 10:02:16	[GARY.STATS.SOURCE]MULTIPDL.FOR;26          

0058    !
0059    ! FORMAL PARAMETERS: x              -> array of x values
0060    !                    y              -> array of y values
0061    !                    n              -> number of values
0062    !                    xmin           -> smallest x value
0063    !                    xmax           -> biggest x value
0064    !                    ymin           -> smallest y value
0065    !                    ymax           -> biggest y value
0066    !                    xtitle         -> title for the x axis
0067    !                    ytitle         -> title for the y axis
0068    !                    dif_time       -> the amount of time the plot 
0069    !                                      covers in secs
0070    !                    frame          -> which plot number this is
0071    !                    since_mid_nite -> minutes since midnite this plot
0072    !                                      begins at
0073    !
0074    !
0075    !
0076    ! IMPLICIT INPUTS: none
0077    !
0078    !
0079    !
0080    ! IMPLICIT OUTPUTS: a PDL file of the information to be plotted
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 MULTI_PDL(X, Y, N, XMIN, XMAX, YMIN, YMAX, XTITLE,
0095         .                      YTITLE, DIF_TIME, FRAME, SINCE_MID_NITE )
0096          include 'statsubs.for'
0149     
0150          parameter (npfit = 100)
0151     
0152          dimension x(n), y(n)
0153          dimension xx(npfit+2), yy(npfit+2)
0154          dimension sa(2000), sb(2000), sc(2000)
0155     
0156          character *  7  scale_time
0157          character *  9  date_buf
0158          character *  9  node_name
0159          character * 12  user_name
0160          character * 40  form, time_format
0161          character * 63  nest_file
0162          character * 80  xtitle, ytitle, factor_string
0163     
0164          logical pdl, quarter
0165     
0166          integer dif_time, pos_quote, pos_colon, status, frame

MULTI_PDL                      					20-May-1983 10:30:15	VAX-11 FORTRAN V3.2-37              Page   3
								10-May-1983 10:02:16	[GARY.STATS.SOURCE]MULTIPDL.FOR;26          

0167     
0168          data rnd /1.0005/, small/1.e-30/
0169     
0170          common /scal/ scale, xmn, xdl, ymn, ydl, lu, pdl,
0171         +     quarter, ixorg, iyorg
0172     
0173          common / nest_common / nest_file
0174    !
0175          comlog(z) = alog10(amax1(small,abs(rnd*z)))
0176    !
0177          iscale = 10000
0178          scale = iscale * 0.45
0179          ixorg = 0
0180          iyorg = 0
0181     
0182    !++
0183    ! determine which frame of the multi plot it is
0184    !--
0185     
0186          if ( 2 * ( frame / 2 ) .eq. frame ) ixorg = iscale / 2 + 600
0187          if ( frame .gt. 2 ) iyorg = iscale / 2 + 600
0188     
0189    !++
0190    ! set for the plots
0191    !--
0192     
0193          lu = 12
0194          pdl = .true.
0195          quarter = .true.
0196          xdl = 0.2*(xmax-xmin)
0197          xmx = xmax
0198          xmn = xmin
0199          dx = (xmax-xmin)/(npfit-1)
0200          x0 = xmin - dx
0201          do 20 i = 1,npfit
0202            x0 = x0 + dx
0203            xx(i) = x0
0204    20      continue
0205          xx(npfit+1) = xmin
0206          xx(npfit+2) = xdl
0207     
0208    !++
0209    ! calculate formats for numbers to appear on the x axis
0210    !--
0211          xmlg = amax1( comlog(rnd*xmn), comlog(rnd*xmax))
0212          iexpon = 3*(ifix(xmlg)/3)
0213          if(xmlg .lt. 0.0)  iexpon = 3*(ifix(xmlg-3.)/3)
0214          idpr = xmlg - iexpon
0215          form = '(F5.' // char(2-idpr+48) // ')'
0216          factor = 10.0**iexpon
0217          scale_time = 'MINUTES'
0218          time_factor = 1.0
0219     
0220    !++
0221    ! set pdl output for $hour format
0222    !--
0223     

MULTI_PDL                      					20-May-1983 10:30:15	VAX-11 FORTRAN V3.2-37              Page   4
								10-May-1983 10:02:16	[GARY.STATS.SOURCE]MULTIPDL.FOR;26          

0224          if ( dif_time .ge. seconds_in_hour ) then
0225              scale_time = 'HOURS'
0226              time_factor = seconds_in_minute
0227              time_format = '$HOUR'
0228          end if
0229     
0230    !++
0231    ! spcial casing for time about equal to one day
0232    !--
0233     
0234          if ( dif_time .gt. 2.0 * seconds_in_day ) then
0235             scale_time = 'DAYS'
0236             time_format = form
0237          end if
0238     
0239    !++
0240    ! form the complete x title
0241    !--
0242     
0243          if ( iexpon .gt. 1 ) then
0244             encode( iexpon+4, 666, factor_string ) factor
0245    666      format( f<iexpon+4>.1 )
0246             xtitle = xtitle(1:MK$LENGTH(xtitle))
0247         .        // ' (' //  scale_time(1:MK$LENGTH(scale_time)) // ')* '
0248         .        // factor_string(1:iexpon+4) // ')'
0249          else 
0250             xtitle = xtitle(1:MK$LENGTH(xtitle)) // ' ('
0251         .            // scale_time(1:MK$LENGTH(scale_time)) // ')'
0252          endif
0253          if( frame .eq. 1 ) then
0254          write( lu, 150 ) 'H'
0255    150   format( a, a )
0256          call date( date_buf )
0257     
0258    !++
0259    ! determine the node for which this plot applies
0260    !--
0261          status = MK$FILENAME( nest_file )
0262          pos_quote = index( nest_file, '"' )
0263          if ( pos_quote .eq. 0 ) then
0264             pos_colon = index( nest_file, '::' )
0265             if ( pos_colon .eq. 0 ) then
0266                status = SYS$TRNLOG( 'SYS$NODE', , node_name, , , )
0267             else
0268                node_name = nest_file(1:pos_colon-1) // '::'
0269             endif
0270          else
0271             node_name = nest_file(1:pos_quote-1) // '::'
0272          endif
0273          write( lu, 150 ) ' ', node_name(1:MK$LENGTH(node_name)) //
0274         .                     ' '  // date_buf
0275          end if
0276          ismin = -iscale / 8
0277          ismax = 21 * iscale / 20
0278          if ( frame .eq. 1 ) write( lu, 160 ) 'W', ismin, ismin, 
0279         .                    ismax, ismax
0280    160   format( a, 12a4 )

MULTI_PDL                      					20-May-1983 10:30:15	VAX-11 FORTRAN V3.2-37              Page   5
								10-May-1983 10:02:16	[GARY.STATS.SOURCE]MULTIPDL.FOR;26          

0281          write( lu, 160 ) 'C', 1
0282          idelt = scale / ifix( ( xmx - xmn ) / xdl )
0283          write( lu, 160 )'A', ixorg, iyorg, ifix(scale), 100, idelt, 1, 31
0284          if ( dif_time .lt. 2.0 * seconds_in_day ) then
0285          write( lu, 160 ) ' ', since_mid_nite, time_factor * xdl / factor
0286          else
0287          write( lu, 160 ) ' ', xmn / factor, xdl / factor
0288          end if
0289          write( lu, 150 ) ' ', time_format
0290          if( frame .eq. 1 ) then
0291             write( lu, 160 )'S', ( iscale/2-4500), -800, 160, 0
0292             write( lu, 150 ) ' ', xtitle(1:MK$LENGTH(xtitle))
0293          end if 
0294     
0295    !++
0296    ! now do the y axis
0297    !--
0298     
0299          if ( ymax .eq. ymin ) then
0300             ymax = 2.0 * ymax
0301             ymin = 0.0
0302          end if
0303          ydl = 0.2*(ymax-ymin)
0304          ymx = ymax
0305          ymn = ymin
0306          jj = 1
0307          do 50 j = 1,npfit
0308    50      yy(j) = seval(jj, n, xx(j), x, y, sa, sb, sc)
0309          yy(npfit+1) = ymin
0310          yy(npfit+2) = ydl
0311     
0312    !++
0313    ! figure out format for y values and the multiplier if needed
0314    !--
0315     
0316          ymlg = amax1( comlog(rnd*ymn), comlog(rnd*ymax))
0317          iexpon = 3*(ifix(ymlg)/3)
0318          if(ymlg .lt. 0.0)  iexpon = 3*(ifix(ymlg-3.)/3)
0319          idpr = ymlg - iexpon
0320          form = '(F5.' // char(2-idpr+48) // ')'
0321          factor = 10.0**iexpon
0322          if ( iexpon .gt. 1 ) then
0323             encode( iexpon+4, 666, factor_string ) factor
0324             ytitle = ytitle(1:MK$LENGTH(ytitle))
0325         .        // ' * ' // factor_string(1:MK$LENGTH(factor_string))
0326          endif
0327          idelt = scale / ifix(( ymx - ymn ) / ydl)
0328          write ( lu, 160 )'A', ixorg, iyorg, ifix(scale), 100, idelt, 1, 24
0329          write ( lu, 160 ) ' ', ymn / factor , ydl / factor
0330          write ( lu, 150 ) ' ', form
0331          write ( lu, 160 ) 'S', (ixorg-550), (ifix(0.2*scale)
0332         .                  -950+iyorg), 130, 900
0333          write ( lu, 150 ) ' ', ytitle(1:MK$LENGTH(ytitle))
0334          call draw_line( xx, yy, npfit )
0335    c
0336          return
0337          end

MULTI_PDL                      					20-May-1983 10:30:15	VAX-11 FORTRAN V3.2-37              Page   6
								10-May-1983 10:02:16	[GARY.STATS.SOURCE]MULTIPDL.FOR;26          

PROGRAM SECTIONS

    Name				 Bytes   Attributes

  0 $CODE                                 2644   PIC CON REL LCL   SHR   EXE   RD NOWRT LONG
  1 $PDATA                                 100   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                28359


ENTRY POINTS

    Address  Type  Name                                        References

  0-00000000       MULTI_PDL                                      94     


STATEMENT FUNCTIONS

    Address  Type  Name                                        References

  0-00000A2B  R*4  COMLOG                                        175#      211(2)    316(2)  


VARIABLES

    Address  Type  Name                            Attributes  References

  2-000060F7  CHAR DATE_BUF                                      157       256A      273     
 AP-00000028@ I*4  DIF_TIME                                       94       166       224       234       284     
  2-000061D4  R*4  DX                                            199=      200       202     
  2-000061EC  R*4  FACTOR                                        216=      244       285       287(2)    321=      323     
							         329(2)  
  2-00006165  CHAR FACTOR_STRING                                 162       244       246       323       324(2)A 

  2-00006115  CHAR FORM                                          160       215=      236       320=      330     
 AP-0000002C@ I*4  FRAME                                          94       166       186(2)    187       253       278     
							         290     
  2-000061DC  I*4  I                                             201=      203     
  2-000061FC  I*4  IDELT                                         282=      283       327=      328     
  2-000061E8  I*4  IDPR                                          214=      215       319=      320     

  2-000061E4  I*4  IEXPON                                        212=      213=      214       216       243       244     
							         245       246       317=      318=      319       321     
							         322       323     
  2-000061CC  I*4  ISCALE                                        177=      178       186       187       276       277     
							         291     
  2-000061F8  I*4  ISMAX                                         277=      278(2)  
  2-000061F4  I*4  ISMIN                                         276=      278(2)  
  3-00000020  I*4  IXORG                           COMM          170       179=      186=      283       328       331     

  3-00000024  I*4  IYORG                           COMM          170       180=      187=      283       328       331     
  2-00006208  I*4  J                                             307=      308(2)  
  2-00006204  I*4  JJ                                            306=      308A    

MULTI_PDL                      					20-May-1983 10:30:15	VAX-11 FORTRAN V3.2-37              Page   7
								10-May-1983 10:02:16	[GARY.STATS.SOURCE]MULTIPDL.FOR;26          

  3-00000014  I*4  LU                              COMM          170       193=      254       273       278       281     
							         283       285       287       289       291       292     
							         328       329       330       331       333     
 AP-0000000C@ I*4  N                                              94       152(2)    308A    

  4-00000000  CHAR NEST_FILE                       COMM          161       173       261A      262       264       268     
							         271     
  2-00006100  CHAR NODE_NAME                                     158       266A      268=      271=      273(2)A 
  3-00000018  L*4  PDL                             COMM          164       170       194=    
  2-000061BC  I*4  POS_COLON                                     166       264=      265       268     
  2-000061B8  I*4  POS_QUOTE                                     166       262=      263       271     

  3-0000001C  L*4  QUARTER                         COMM          164       170       195=    
  2-000061C4  R*4  RND                                           168D      175       211(2)    316(2)  
  3-00000000  R*4  SCALE                           COMM          170       178=      282       283       327       328     
							         331     
  2-000060F0  CHAR SCALE_TIME                                    156       217=      225=      235=      246(2)A   250(2)A 
 AP-00000030@ R*4  SINCE_MID_NITE                                 94       285     

  2-000061C8  R*4  SMALL                                         168D      175     
  2-000061C0  I*4  STATUS                                        166       261=      266=    
  2-000061F0  R*4  TIME_FACTOR                                   218=      226=      285     
  2-0000613D  CHAR TIME_FORMAT                                   160       227=      236=      289     
  2-00006109  CHAR USER_NAME                                     159     

  2-000061D8  R*4  X0                                            200=      202(2)=   203     
  3-00000008  R*4  XDL                             COMM          170       196=      206       282       285       287     
 AP-00000014@ R*4  XMAX                                           94       196       197       199       211     
 AP-00000010@ R*4  XMIN                                           94       196       198       199       200       205     
  2-000061E0  R*4  XMLG                                          211=      212       213(2)    214     

  3-00000004  R*4  XMN                             COMM          170       198=      211       282       287     
  2-000061D0  R*4  XMX                                           197=      282     
 AP-00000020@ CHAR XTITLE                                         94       162       246(3)=A            250(3)=A          
							         292(2)A 
  3-00000010  R*4  YDL                             COMM          170       303=      310       327       329     
 AP-0000001C@ R*4  YMAX                                           94       299       300(2)=   303       304       316     

 AP-00000018@ R*4  YMIN                                           94       299       301=      303       305       309     
  2-0000620C  R*4  YMLG                                          316=      317       318(2)    319     
  3-0000000C  R*4  YMN                             COMM          170       305=      316       327       329     
  2-00006200  R*4  YMX                                           304=      327     
 AP-00000024@ CHAR YTITLE                                         94       162       324(3)=A            333(2)A 

 AP-00000004@ R*4  Z                                             175(2)  


ARRAYS

    Address  Type  Name          Attributes        Bytes  Dimensions       References

  2-00000330  R*4  SA                              8000  (2000)            154       308A    
  2-00002270  R*4  SB                              8000  (2000)            154       308A    
  2-000041B0  R*4  SC                              8000  (2000)            154       308A    
 AP-00000004@ R*4  X                                 **  (*)                94       152       308A    
  2-00000000  R*4  XX                               408  (102)             153       203=      205=      206=      308A    
									   334A    

MULTI_PDL                      					20-May-1983 10:30:15	VAX-11 FORTRAN V3.2-37              Page   8
								10-May-1983 10:02:16	[GARY.STATS.SOURCE]MULTIPDL.FOR;26          


 AP-00000008@ R*4  Y                                 **  (*)                94       152       308A    
  2-00000198  R*4  YY                               408  (102)             153       308=      309=      310=      334A    


PARAMETER CONSTANTS

  Type  Name                                                   References

   I*2  EOF                                                      148#    
   I*2  EQUAL                                                    123#    
   I*2  FAILURE                                                  108#    
   I*2  GREATER                                                  124#    
   I*2  KEYED_READ                                               114#    

   I*2  LESS                                                     122#    
   I*4  MAXINT                                                   147#    
   I*2  MAX_CAT                                                  130#    
   I*2  MAX_ENT                                                  131#    
   R*4  MINUTES_IN_DAY                                           141#    

   R*4  MINUTES_IN_HOUR                                          138#    
   I*2  NEST_CLOSE                                               116#    
   I*2  NEST_OPEN                                                113#    
   I*4  NPFIT                                                    150#      153(2)    199       201       205       206     
							         307       309       310       334     
   R*4  SECONDS_IN_DAY                                           140#      234       284     

   R*4  SECONDS_IN_HOUR                                          139#      224     
   R*4  SECONDS_IN_MINUTE                                        137#      226     
   I*2  SEQ_READ                                                 115#    
   CHAR STANDARD_HELP_LIB                                        101       102#    
   I*2  SUCCESS                                                  107#    



LABELS

    Address   Label                                            References

  0-000000FC  20                                                 201       204#    
  0-000006F5  50                                                 307       308#    
  1-00000040  150'                                               254       255#      273       289       292       330     
							         333     
  1-00000043  160'                                               278       280#      281       283       285       287     
							         291       328       329       331     
  1-00000038  666'                                               244       245#      323     



FUNCTIONS AND SUBROUTINES REFERENCED

  Type  Name                                                   References

        DRAW_LINE                                                334     
        FOR$DATE_T_DS                                            256     
   I*4  LIB$INDEX                                                262       264     

MULTI_PDL                      					20-May-1983 10:30:15	VAX-11 FORTRAN V3.2-37              Page   9
								10-May-1983 10:02:16	[GARY.STATS.SOURCE]MULTIPDL.FOR;26          

   I*4  MK$FILENAME                                              261     
   I*4  MK$LENGTH                                                246(2)    250(2)    273       292       324(2)    333     

   R*4  MTH$ALOG10                                               175     
   R*4  SEVAL                                                    308     
   R*4  SYS$TRNLOG                                               266     


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

  /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.86 seconds
  Elapsed Time:       22.25 seconds
  Page Faults:        481
  Dynamic Memory:     892 pages
