Appendix D:
keep them around (rather than compiling source directly to an executable each time), you
must add rules to your makefile's to treat them correctly. The makefile example in Section D.2
contains the correct rules. Note also that the .j suffix must be included on the" .SUFFIXES:"
line.
D.4 Warnings on Using FORTRAN Types
Calls to the IRIS Graphics Library often use small numbers as parameters (i.e.,
one- or two-byte integers). When calling the IRIS Graphics Library from C,
such parameters are converted automatically when the call is made. This is not
true in FORTRAN, as the data is passed as a pointer (reference parameter),
rather than as a value. Thus, it is imperative that the caller specify the correct
type for each parameter in each call to a graphics routine from FORTRAN.
Commonly used constants have been placed in the common blocks GL and
DEVICE in the include files described previously, and initialized correctly (in the
block data routine GLDATA in the file fgldat.j) for convenience. Care must be
exercised when using user-defined variables as parameters to graphics routines,
so that the parameter types are correct.
A particularly troublesome case is the use of numeric constants as parameters.
For example, it is tempting to call a routine such as curveit (CURVEI in FORTRAN)
with a numeric constant:
call curvei (4)
This will not produce the desired result. The definition for CURVEI in
FORTRAN is
subroutine curvei(count)
integer*2 count
The numeric constant '4' will be passed by FORTRAN as an integer*4 , and the
IRIS Graphics Library will receive the constant zero (0), not 4. In cases like this,
the user must place the constant 4 in a variable of type integer*2. The following
code sequence gives the desired result:
integer*2 s4
data s4/4/
...
call curvei (s4)
...
One further confusing situation occurs when using the type logical. The IRIS
Graphics Library expects this type to occupy a single byte of storage, and when
it returns such a value, only the least significant byte of the result is valid. The
FORTRAN compiler expects a function of type logical to return a four-byte
quantity. The definitions of graphics routines of type logical have been altered
in the include file /usr/include/fgl.h to be of type logical*1 to alleviate this
problem. So long as this include file is used, the problem should not occur.
Version 1.0
IRIS WORKSTATION GUIDE
85
Need help?
Do you have a question about the IRIS Workstation and is the answer not in the manual?
Questions and answers