1. INTRODUCTION 2. I/O STREAM AND CAMERA INITIALISATION 2.1 Resetting Fortran I/0 streams in SMOG. 2.2 Changing stream numbers. 2.3 Determining the status of streams. 2.4 FRSPEC: A general initialisation routine. 2.5 FREND: An alternative termination routine. 2.6 KILLID: Suppression of ID frames on microfiche. 3. BODY CENTERED CHARACTER ROUTINES 4. WINDOWING ROUTINES 4.1 Selection of window limits. 4.2 Turning windowing off. 4.3 Windowed line drawing (absolute). 4.4 Windowed line drawing (relative). 5. GRAPH PLOTTING ROUTINES (DRPLOT) 5.1 Introduction to DRPLOT routines. 5.2 High level routines. 5.3 Low level routines. 5.4 Changing default options.
It should be noted that this document only has relevance to users of the SMOG graphics system as implemented on the IBM 360/195.
During the last few months a number of routines have become available to SMOG users. In general these have been provided to assist users with specific problems or to correct deficiencies in the SMOG implementation. Many users know of, and have been successfully using, such routines for some time but these routines have never before been formally documented. All of the routines described are on auto call in SYS1.SM0G.
The Fortran WRITE statements in SMOG have been changed to use a predefined variable as the I/0 stream number. These numbers are held in a Common Block and two routines have been provided which allow the user to change the default values for these streams and to enquire as to the status of any stream.
There are eight Fortran I/O streams in the SMOG package as implemented on the 360/195 but not all of these are used at present. These streams, their default values and purposes are described in table 1.
Associated with each of these variable stream numbers are two other variables. The first is a logical variable which is set to .TRUE. when the stream is attached to a legal device and the second holds the value returned by IDVICE (ref 1) from which the user can determine the type of device to which the stream is connected.
STREAM NAME |
DEFAULT NUMBER |
LEGAL DEVICES |
OUTPUT BY THE SMOG SYSTEM |
---|---|---|---|
IOFROP | NONE | PRINTER | For use by high level routine writers for diagnostic and information purposes. |
IOUSER | 12 | PRINTER | Output of FR80 banner, frame counts etc. |
IODIAG | 12 | PRINTER | SMOG error message and general information from the basic system. |
IOHP | NONE | PRINTER | May be used by the user for his own purposes; Reserved for Hewlett-Packard pen plotter orders. |
IOPUT | NONE | DISK TAPE |
For use in magnetic tape output from SMOG. |
IOLPS | 13 | PRINTER | Not implemented at present but may be used in the future for lineprinter graphics emulation. |
IOMUG | NONE | DISK | The stream from output from TOMUG (ref 2). |
IOPRT | 12 | PRINTER DISK |
The output stream from TOPRIN (ref 3). |
Routine SETIOS allows the user to set values of the stream variables and itself sets the logical switch (LOxxxx) and device type (IDxxx) for the stream (IOxxxx).
It has two arguments defined as follows:-
(1) The stream name (This is a 4-character string which consists of the last 4 characters of the 6-character STREAM NAME specified in table 1).
(2) The Fortran stream number.
Example CALL SETIOS ('PROP',15)
This call will initialise IOFROP to stream 15 and if this is connected to a printer will set LOFROP=.TRUE. and IDFROP=2 (ref 1). If it is desired to turn off a stream it should be set to 0 (zero).
Routine STRACT allows the user to determine the IJxxxx, IDxxxx and LOxxxx values for a named stream.
example:-
CALL STRACT('HP ',IOTYPE,IDTYPE,LOTYPE) where IOTYPE will be set equal to IOHP IDTYPE will be set equal to IDHP LOTYPE will be set equal to LOHP on exit.
An example job could be as follows:-
//jobname JOB (acct,id),user // EXEC FORTG,SYSLIB='SYS1.SMOG',REGION.G=160K //C.SYSIN DD * LOGICAL LOFROP CALL SETIOS ('FROP',17) CALL STRACT('FROP',IOFROP,IDFROP,LOPROP) CALL FRHCM . . IF(X.GT.XMAX)GO TO 1019 . . 1019 IF(LOFROP)WRITE(IOFROP,10 20) 1020 FORMAT(1X,'******** ERROR IN JOB ************') CALL ENDSPR STOP END //G.GRAPHICS DD SYSOUT=(G,,HCM) //G.FT12F001 DD SYSOUT=A,DCB=PRINTER //G.FT17F001 DD SYSOUT=A,DCB=PRINTER
In this case if the FT17F001 card had not been specified or was not connected to a printer the WRITE statement would not be executed.
Lega1 values for the 4-character name are as follows;-
FROP USER DIAG HP PUT LPG MUG PRT
See table 1 for details of the use of each stream.
Note this routine is only possible on the 360/195 since it uses JCL information.
FRSPEC is an initialisation routine which picks up the camera type from the JCL and initialises SMOG accordingly. It solves two problems; firstly the camera need only be specified once thus avoiding the possibility of a conflict between JCL and program and secondly it allows camera selection to be delayed until run time. This routine will default to hardcopy single (FRHCS) if the output is routed to disk for later use by VIEW$ (ref 4) and must not be used with user owned output tapes for subsequent FR80 plotting.
This routine has always been part of the SMOG system and many users are already using it. On the 360 it is equivalent to ENDSPR (this is not the case on the 1906A) and may be used if the user finds it easier to remember. It is only mentioned here to avoid confusion should the user ever see it in an example program.
Some users found that they wished to suppress the ID frame when using microfiche. The ID frame serves two purposes; firstly it indicates to the user how the FPR80 and film processor were performing when the job was processed and secondly it is of great help to the operators when splitting and dispatching jobs on all file types except microfiche.
For microfiche only it is the users choice whether the ID frame is output. The user may suppress this ID frame by calling the routine KILLID before calling an initialisation routine. On output types other than microfiche the routine has no effect.
Six characters of the FR80 character set have been allocated as body centered character definitions (ref 5). Many users have experienced difficulty when trying to use these characters and so two routines have been defined which move the characters down into that part of the character table which the normal text routines access and when required restore the original definitions.
The first of these two routines is BCENON.
BCENON This routine moves the six body centered characters {X,O,*,+,-,.) into the table for access by normal text routines.
When outputting a text string containing any of the above characters which have been moved into the table via CENON however, the effect is an uneven string caused because some of the characters are body centered and some are not. This has led to the inclusion of a second routine BCENOF.
BCENOF Restore normal FR80 text characters.
The user should be careful to call BCENOF before outputting a text string containing any of the above six characters if BCENON has been called previously.
Example:-
C**** AN EXAMPLE PROGRAM USING BODY CENTRED CHARACTERS C**** FIRST INITIALISE THE SYSTEM REAL*4 X(100),Y(100) CALL FRHCM CALL LIMITS(0.0,0.0,1.0,3.0,1.0,1.0) CALL CHSIZE C**** WE WILL CONSIDER A GRAPH OF Y=SIN X 0 <sX < 1 DO 1 I=1,100 X(I)=FLOAT(I) 1 Y(I)=SIN(X(I) C**** NOW DRAW THE GRAPH..WE WONT WORRY ABOUT AXES CALL BCENON DO 2 I=1,100 CALL SETXY(X(I),Y(I)) 2 CALL HPLOTS('X') C**** NOW TITLE THE GRAPHS CALL SCENOF CALL SETXY(0.0,0.0) CALL HTEXT(9,'EXAMPLE 1') C**** CLOSE THE SYSTEM DOWN CALL ENDSPR STOP END
One criticism levelled at SMOG was the lack of any windowing routines. These are very useful for graph drawing and this has led to their inclusion in SYS1.SMOG. The routines are very similar to the normal SETXY, UPDXY, RTXY and TODXY routines of SMOG though no integer equivalents exist. If windowing is not turned on then the routines will behave exactly as their non-windowing counterparts.
Routine WINDON allows the user to turn windowing on and its four arguments define the limits of the window.
CALL WINDON(X1,Y1,X2,Y2)
The above call will turn windowing on and define the window to be the area bounded by the rectangle with bottom left hand corner (X1,Y1) and top right hand corner {X2,Y2).
Routine WINDOF allows the user to turn the windowing off. Subsequent calls to any windowing line drawing routine will have the same effect as a call to its non-windowing counterpart.
When considering windowing a line must be considered to have two parts: that which lies within the window (the visible part) and that which lies outside the window (the invisible part). In the following description the term 'current point' refers to the point which the windowing routines consider to be the current point and is not necessarily the same point which the output device considers to be the current point. For this reason the user should ensure that the first plotting order generated after turning windowing on or off is an absolute 'setpoint' instruction in both X and Y.
In order to avoid tedious repetition in the remainder of this section we shall define the windowing routines current point to be (XP,YP).
WTOX(X)
Draw the visible part of the line which joins (XP,YP) to (XP, YP) and update the current point. ie. XP=X; YP unchanged.
WTOY(Y)
Draw the visible part of the line which joins (XP,YP) to (XP,Y) and update the current point. ie. XP unchanged; YP=Y.
WTOXY(X,Y)
Draw the visible part of the line which joins (XP,YP) to (X,Y) and update the current point. ie. XP=X, YP=Y.
WSETX(X)
Update the current X point. ie.XP=X;YP unchanged.
WSETY(Y)
Update the current Y point. ie. XP unchanged; YP=Y.
WSETXY(X,Y)
Update the current point. ie. XP=X; YP= Y.
The following routines generate relative draw and move orders. They are the counterparts of the UP and TOD routines of SMOG.
WTODX(X)
Draw the visible part of the line which joins (XP,YP) to (XP+X,YP) and update the current point. ie. XP=XP+X; YP unchanged.
WTODY(Y)
Draw the visible part of the line which joins (XP,YP) to (XP,YP+Y) and update the current point. ie. XP unchanged; YP=YP+Y.
WTODXY(X,Y)
Draw the visible part of the line which joins (XP,YP) to (XP+X,YP+Y) and update the current point. ie. XP =XP+X; YP=YP+Y.
WUPDX(X)
Update the current X point ie. XP=XP+X, YP unchanged.
WUPDY(Y)
Update the current Y point. ie. XP unchanged; YP=YP+Y.
WUPDXY(X,Y)
Update the current point. ie. XP=XP+X; YP=YP+Y.
DRPLOT is a collection of routines stored in SYS1.SMOG to provide higher level graph functions than those available in the basic SMOG system. These routines are written in such a way that they will produce good output on either the FR80 or on a MUGWUMP display (via view$). On the FR8O superscriptinq is done in the normal way whilst on devices lacking the necessary variable character size the 10**n notation is used.
The routines come in several distinct levels the first two of which are those of most relevance to the user.
The user has some data in arrays and requires a graph or histogram to be produced from that data. The graph histogram should be titled and the axes drawn over a suitable range.
(1) DRAXOP(IOPL,VAL)
This routine sets up options for the graph routines if the default options are not desired. See table 2 for argument types and default values. This routine is described in more detail in section 5.4.
(2) DRHIST(Y,N,SX,SY,SG,D))
This routine plots a histogram of the values contained in the array Y. The axes are drawn around the resulting histogram and labelled with the character strings specified in SX and SY. The histogram itself is titled by the character string SG. All of these strings are terminated by a delimiting character which is specified in the single character string D.
examples:- CALL DRHIST(Y,10, *'X AXIS TITLE!', *'Y AXIS TITLE!', *'HISTOGRAM TITLE!', *'!')
(3) DRPLOT(X,Y,N,SX,SY,SG,D))
This routine will plot straight lines connecting the N points specified in the arrays X and Y. The axes will be drawn and labelled with the character strings SX and SY. The entire graph will be titled by SG. The definitions for SX,SY,SG and D are identical to those for DRHIST.
(4) DREBAR(X,Y,E,N,SX,SY,SG,D))
This routine is similar to DR PLOT with the addition of a third array E which contains error bar values. The affect of the routine is to draw a graph with error bars, draw axes and title them as for DRPLOT. Error bars indicate the errors in Y, ie a bar is drawn from (x, y-e) to (x, y+e).
Example of the use of the high level routines:-
DIMENSION X(100),Y(100) C*** FIRST SET UP THE SYSTEM CALL PRSPEC CALL CINE C*** INITIALIZE Y ARRAY WITH SIN X DO 1 I=1,100 X(I) =FLOAT(I)/100.0 1 Y(I)=SIN(X(I)) C*** NOW PLOT THE GRAPH VIA DRPLOT CALL DRPLOT(X,Y,100, *'X VALUES!', *'SIN X!', *'GRAPH OF SIN X!', * '!') C*** THATS PLOTTED THE GRAPH C*** NOW CLOSE TE SYSTEM DOWN CALL ENDSPR STOP END
Should the user have a requirement which the top level routines do not cater for, it is possible that he may have to use some of the following routines instead of, or in addition to, those above. An example of this would be if it was desired to plot several graphs on the same axes.
(1) DRAXES(XMIN,YMIN,XMAX,YMAX,SX,SY,SG,D)
This is the routine which draws and labels the axes. The arguments are as follows.
XMIN,YMIN specify the minimum values which X and Y will take.
XMAX,YMAX specify the maximum values which X and Y will take.
SX,SY,SG and D are as defined for routine DRHIST.
(2) DRDASH(X,Y,N,ON1,ON2,OFF)
Should the user require a dashed line to pass through a set of points with windowing turned on then he may use the routine DRDASH
The line drawn is of the form
ON (for ON1 units), OFF (for OFF units), ON (for ON2 units), OFF (for OFF units) repeating as often as required. All units are measured in percentage of the X axis.
The line so drawn will consist of straight line segments connecting segments joining the N points specified by X and Y.
(3) DRLINE(X,Y,N)
This routine simply joins the points specified in X and Y with straight lines applying windowing to them. N is the number of points supplied.
(4) DRHIST(RLOW,DELTA,Y,N)
Most of the options which the user can set for histogram shading effect the parameters of the routine HSTGMA (ref 6), but one other type of histogram is available to the user. This type consists of only the horizontal and vertical joined lines, and is provided by routine DRSIST. This routine is useful should the user wish to superimpose several histograms on the same frame.
The arguments are as follows:-
RLOW The minimum X value DELTA The interval in the X direction Y The array of heights N The number of elements of Y given.
(5) DREBAS(X,Y,E,N)
This routine plots the values specified in arrays X and Y with error bar values specified in E. N is the number of points supplied. The limiting values for X and Y will be set by the previous call to DREBAR. The purpose of this routine is to permit the superimposition of multiple error bar graphs on one set of axes and is to DEEBAR as DRLINE is to DPLOT.
(6) DRCHLN(X,Y,N,ICODE)
This routine is similar to DRLINE with the addition of the variable ICODE.
The effect of the routine is to draw a chain line graph through the N points specified by the arrays X and Y supplied as arguments.
One of thirteen body centered characters may be plotted which one being determined by the va1ue of ICODE which should be in the range zero to twelve. A line is drawn between two consecutive points but not through them and the body centered character is positioned on the point itself.
(7) DRSDEF
Routine DRSDEF is available should the user require to reset the default options after extensive changes have been made by the use of routine DRAXOP. (see 5.4 below).
DRAXOP(IOPT,VAL)
This routine permits the user to change the default options which steer other routines in the DRPLOT system. The arguments are as follows:-
IOPT An integer in the range 1≤IOPT≤28
VAL This argument nay be INTEGER*4, REAL*4 Or LOGICAL*4 and is dependent on the option specified. For a full list of options, argument types and defaults, see table 2 below. Table 2 indicates INTEGER*4 arguments by I, REAL*4 arguments by R, and LOGICAL*4 arguments by L in the ARG TYPES column.
IOPT | ARG TYPES |
DEFAULT | DESCRIPTION | COMMENTS |
---|---|---|---|---|
1 | I,I | 4 | X axis tag mark setting | No tag marks 1 Major tags lower 2 Major tags upper 3 Major tags both 4 Major+minor lower 5 Major+minor upper 6 Major+minor both |
2 | I,I | 4 | Y axis tag mark setting | is for opt 1 |
3 | I,I | 4 | Change number of minor tags per major | Range 1≤n≤9 |
4 | I,I | 0 | Histogram shading mode | -1 joined horizontal + varticals only |
5 | I,I | 0 | Value of SEND used by HSTGMA | ref 6 |
6 | I,R | 0.25 | Value of DX used by HSTGMA | ref 6 |
7 | I,R | 0.25 | Value of DY used by HSTGMA | ref 6 |
8 | I,R | 0.0 | Change size of error bar tags | see routine DREBAR (5.2.4 |
9 | I,R | 0.0 | Minimum X value used by HSTGMA | ref 6 |
10 | I,R | 1.0 | Set interval for DRHIST | Delatx in HSTGMA and DRSIST (5.2.4) |
11 | I,R | 0.02 | Set char size on exit | |
12 | I,I | 2 | Colour for axes | Values of JCOLOR (ref 7) |
13 | I,I | 2 | Label colour | As for option 12 |
14 | I,I | 2 | Title colour | As for option 12 |
15 | I,I | 2 | Colour on exit | As for option 12 |
16 | I,R | 0.02 | Change tag size | User coordinates |
17 | I,R | 0.3 | Change relative size of minor tags | 0.0≤val≤1.0 |
18 | I,L | .TRUE. | Set mode of X=0 lines option | Specifies if lines are to be drawn when X=0 (where limits span 0.0) |
19 | I,L | .TRUE. | Set Y=0 lines option | Y version of Opt 18 |
20 | I,L | .TRUE. | Change advance frame switch | By default high level routines cause frame advances before outputting |
21 | I,L | .FALSE. | Tektronix 4002 is being used | |
22 | I,R | 224.0 | Set high intensity value | Intensity for graph 1.0≤val≤256.0 |
23 | I,R | 224.0 | Set low intensity value | Graticule intensity1.0≤val≤256.0 |
24 | I,I | 0 | Set X graticule mode | 0 no graticules 1 major graticules 2 major+minor graticules |
25 | I,I | 0 | Set Y graticule mode | Y version of opt 24 |
26 | I,R | 160.0 | Set intensity for major graticules | 1.0≤val≤256.0 |
27 | I,T | 110.0 | Set intensity for minor graticules | 1.0≤val≤256.0 |
28 | I,I | 1 | Type of scaling routine to be used | 0: LIMIT (ref 8) 1: LIMITV (ref 9) 2: LIMITR (ref 10) 3: LIMITS (ref 11) |
1 IDVICE:- CIGAR part E routine SY/23 2 TOMUG :- FR80 User Note 15 9 Feb 1976 3 TOPRIN:- SMOG manual 6.4.3 4 VIEW$ :- FR80 User Note 9 21 July 1975 5 SMOG manual 5.4.2 6 HSTGMA:- SMOG manual 9.1.13 7 JCOLOR:- SMOG manual 6.1.2 8 LIMIT :- SMOG manual 3.4.8 9 LIMITV:- SMOG manual 3.4.9 10 LIMITR:- SMOG Amendments 1. 11 LIMITS:- SMOG Amendments 1.