Using the OpenGL Libraries

erectboboΛογισμικό & κατασκευή λογ/κού

14 Δεκ 2013 (πριν από 3 χρόνια και 5 μήνες)

150 εμφανίσεις


387
M
WS


The Salford Fortran 95
Compiler



Steve Morgan

and Mary Thorp

September

200
6

Document 387

Computing Services Department


Contents

1

I
NTRODUCTION

2

Facilities Available

2

2

N
ETWORK
I
NSTALLATION

3

Setting the Path

3

Private Use

3

3

U
SING THE
C
OMPILER

3

Simple Use of PLATO

4

Using a DOS Window

5

Using the OpenGL Libraries

6

Using OpenGL with PLATO

6

Using OpenGL in a DOS Session

6

Using the NAG Library

6

Using the UNIRAS Libraries

6

4

Q
UICK
R
EFERENCE TO
FTN95

O
PTIONS

7

5

F
URTHER
I
NFORMATION

12

A
PPENDIX
A

13


Format Conventions

In this document the following format conventions are used:

Computer output is given in a
Courier

font.

Password

Input which is to be typed by you is in bold

a:
\
setup

Input which must be replaced by your details is given
in

bold

italics
.

LOGIN

user_name


Keys that you press are bold.

Enter

Menu options and buttons are given in an
Arial

font.

File
|

New

Notes are indicated by a bulleted book.



This is a note

Tips are indicated by a bulleted flag.



This is a tip

Warnings are in
dicated by a bulleted bomb.



This is a warning

Feedback

The Computing Services Department welcomes feedback on its documentation. If you notice any
mistakes in this document, or if you wish to make any suggestions on how the document could be
improved, p
lease contact Allyson Matthews, Information Officer. Electronic mail should be sent to the
email address
allyson@liv.ac.uk


2

1

Introduction

The University has acquired a site licence to run the Salford Software Limit
ed FTN95
compiler on the
Managed Windows

Service
.

The compiler supports the full Fortran
95 language as defined by ISO/IEC 1539:1996 Programming Language Fortran.
Fortran 95 is an interim upwards

compatible revision of the Fortran 90 standard
which, as wel
l as correcting many minor errors in the standard, includes the following
enhancements to the language:



User written ELEMENTAL/PURE procedures



Improved initialisations



Automatic de

allocation



NULL intrinsic



FORALL statement and structure



Nested WHERE

The
se and several other new features are discussed in Chapter 11 of the

FTN95
User’s Guide
.



In this document, we have given the name
c
:
\
Program Files
\
Salfod
Software
\
ftn95

for the directory where the Fortran compiler and libraries
and documentation are store
d.
At the time of writing, the current version of
ftn95 is
4.
9
0
.
You
will

find that in
some other
versions

(not yet removed
from the system)
they are stored in v:
\
ftn95vxx where vx
x

stands for
Version x.x. There are details in a later section
Setting the P
ath

on
determining wh
ere the compiler and documentation are stored.

Facilities Available

The Fortran 95 compiler is supplied with

PLATO

This provides a simple IDE (Integrated Development Environment)
for developing Fortran programs and includes a Fortran
sensitive
editor and project organiser.

CLEARWIN

The Salford library interface to the Windows SDK which can be used
for developing Graphical User Interfaces to Fortran Programs.

OPENGL

OpenGL support is included in this release and there are some simple
examples provided in the
v:
\
ftn95
v
80
\
demos
\
opengl

directory.
Please ensure that your display is set to 16/24
-
bit colour before trying
these examples.

MK32

A utility similar to the UNIX
make

utility. Full documentation is
available in the
v:
\
ftn95
v
80
\
doc

d
irectory in the PDF file format.

SDBG

A debugger.

SLIM

Salford Library Manager

These utilities are all documented in the
FTN95 User’s Guide

or
in
the online Help
pages
.


3

2

Network Installation

Before installing you will need to check if your machine meet
s the following
requirement:



PC with
Pentium class

processor



Access to
Windows

2000 or to Windows XP
and to
Microsoft Internet
Explorer v5.00 or later (for the html help facility
)



7
0Mb of Hard Disk Space, for installation and for files.

For users of the
Ma
naged Windows

Service (
MWS
) the product can be installed to
the desktop via a NAL in the normal way. FTN95 is in the Programming Group.



Click on
Start | Install

| Programming



Click on
FTN95

v
4.
9
0

in the list. (The
version number

may be different).



If it
fails to install properly, then you need to verify the application. To do this,
click on
Start |
Install

| Programming
and right
-
click on
FTN95

v
4.80

in
the list.

Click
Verify

on the right
-
hand menu.



To run
Plato,

double click on the Fortan95 icon on the d
esktop or
click

Start |
Programs | Salford
Software | Salford Software FTN95 |

P
lato
3
IDE

Setting the Path

Before using FTN95 it is necessary to check the User Path variable. To do this:



Find out where
t
he
desired
Fortran compiler is stored. One way would

be to
go to
Start | Programs | Salford Software | Salford Software FTN 95

and then
right click
Plato3 IDE

and

select
Properties
. Click the
Shortcut

tab.
The Plato
executable (and hence the ftn95 executable)
might be stored in

C:
\
Program
Files
\
Salford Soft
ware
\
FTN95

or (if you are using an older version) in
v:
\
ftn95
vx
x

where vx
x stands for V
ersion x
.
x.



Go to
Start

|
Settings

|
Control Panel | System
, c
lick on the
Advanced

tab
and then on
Environment Variables
.



Scroll down the
User Variables

section and sele
ct the
Path

variable
. If

there is
no Path variable set, then click
New

and type
Path

in the Variable Name field.
Otherwise, click
Edit

to edit the Path variable.



If the current path to the Fortran compiler is not already stored in the Path
variable, then t
ype
C:
\
Program Files
\
Salford Software
\
FTN95

(
or
wherever
the Fortran compiler is stored


see above) in the
Variable value

field then click
OK

three times to exit. Remember that values for different paths have to be
separated by semi
-
colons.

Private Use

Th
e Salford F95 Compiler can not be purchased by Staff or Students of the
University under a Site Licence Agreement. Individuals can purchase personal
licences at an educational price from the
Silverfrost website
.


4

3

Using the Compiler

The compiler can be accessed via the supplied PLATO editor or via a Command
Prompt window. In the latter case a separate editor such as (DOS) EDIT or
P
rogra
mmers File Editor PFE

(available under
Network |
Utilities
) can be used.

Use of PLATO is described in the
FTN95 User Guide

available for sale and loan
from the
University Libraries
.

Some s
imple examples of the two ways of accessing the compiler are given
below.

Simple Use of PLATO

The following instructions show how a program (procedures and modules) stored in a
single file can be compiled, linked and executed.



To start the PLATO editor, double click on the Fortan95 icon on the desktop
or click
Start | Pro
grams | Salford Software | Salford Software FTN95 |
Plato 3 IDE



Click on
File | New

, choose
Free Format Fortran File

for the Type
and
type in the following program:

PROGRAM Test


PRINT *, “Hello World”

END PROGRAM



Click on
File | Save

and store the prog
ram in a suitable file with a file
extension of
.f9
5

(e.g.
testprog.f9
5
).



Click on
Build

| Compile

to compile the program.

A
new output area
will open
near the bottom
showing the
compilation results.




Click on
Build

| Build

to link the program.

T
he resul
ts of the linking process

are shown in the same output area
.



The program can then be run by clicking
Build | Start Run
.

A DOS window will be opened and the program will be run within it. The output will
appear in the DOS window.



When different parts of a

program (procedures and modules) are stored in
separate files it is necessary to create a Plato project.
File | Open

can be used
to open and edit the different files and then
File

| New

Project

can be used to
create a new project. Each of the separate fil
es must be added to the project

(via
Project | Add New Item
)
.

Further information about using PLATO to create and manage projects is available in
the
FTN95 User Guide
.


5

Using a DOS Window

The compiler can also be run from the command line of a DOS window.
The
following instructions show how a program (procedures and modules) stored in a
single file can be compiled, linked and executed.



Files used to store programs
should

have the extension
.f9
5
.



Open a Command Prompt window by double
-
clicking the
Command Pr
ompt

icon on the desktop or by clicking:

Start | Programs | Accessories | Command Prompt.

It is assumed in the following that the
above example program has been stored in the
file
M:
\
testprog.f95



First, make the M: drive current by typing

M:

at the promp
t



If you need to edit the program, you can use the EDIT command in a
Command Prompt window or you can use any Windows editor such as
Programmers File Editor (PFE).

You can compile, link and run the program either in one operation or in a sequence of
separa
te commands.



To compile, link and run the program in one operation, type

FTN95 testprog.f
95

/LGO

The /LGO option (short for
Load and GO
) tells the compiler to link and run
the program following successful compilation.



Alternatively, s
eparate compile, link,

execute sequences can be
achieved
by
typing the following:

FTN95 testprog.f9
5

SLINK testprog.obj

testprog

The ftn95 command
compiles the program and creates an object code file
called
testprog.obj
.
Th
e Slink command

links the program and creates an
execut
able file called
testprog.exe

and the
last command runs the program.



It is also possible to link the program using the command

SLINK comfile

w
here the file
comfile

should contain the commands:

LOAD testprog.obj

FILE



If
comfile

is not specified with the SLI
NK command, the linker commands
should be typed in at the
$

prompt. SLINK is documented in the
Fortran 95
Users Guide
.


6



When a program is stored across several separate files it is necessary to
include LOAD commands for each file. This includes those files
that contain
Fortran
95

modules.
W
hen a file contains a module
,

the compiler generates
two files: a .MOD file containing details of the names and data in the module
and a .OBJ file containing object code for any procedures contained within the
module. The
.OBJ files so created must be made available to the linker.

Using the OpenGL Libraries



In this section, we have given the name
C:
\
Program Files
\
Salford
Software
\
FTN95
\
demo
\
opengl

for the directory where the OpenGL
examples are stored.
For the older version
s of FTN95,
they are stored in
v:
\
ftn95vxx
\
demos
\
opengl where vxx stands for Version x.x
.
There are
details in a previous section
Setting the Path

on determining wh
ere the
FTN95 files are stored.

OpenGL support is included
with Salford FTN95
and there are
some simple examples
provided in the
C:
\
Program Files
\
Salford Software
\
FTN95
\
demo
\
opengl

directory.
Yo
ur display
needs to be

set to 16/24

bit colour before trying these examples.

To enable your programs to have access to the OpenGL routines, you
should
add

the
following statement

within the main body of you program and within each subroutine
and function that will utilise an OpenGL command.

include <opengl.ins>

This file contains the interfaces between the various OpenGL libraries and Fortran.

Using OpenGL

with PLATO

This is much more straightforward now since all the Open GL libraries are accessible
via the PATH environment variable. Just compile and build your OpenGL program
like any other Fortran 95 program.

Using OpenGL in a DOS Session

Again, this is m
uch more straightforward now since all the Open GL libraries are
accessible via the PATH environment variable. Just compile and build your OpenGL
program like any other Fortran 95 program.

Using the NAG Library

Details on the installation and use of the NA
G libr
ary can be found in
Document 386

NAG Fortran Library (
MWS
)
.

Using the UNIRAS Libraries

Details on the installation and use of the UNIRAS libraries can be found in
Document
3
94

UNIRAS (
MWS
)
.


7

4

Quick Reference to FTN95
Options

The FTN95 and SLINK commands have several options which are documented in the
FTN95 User Guide
. A quick reference is given

in the table
below and

can also be
obtained by
looking in the online Help pages or by
typing
at the command prompt:

FTN95 /HELP

Usage of the compiler is of the form:

ftn95
filename

[option [option] ...]

For example,

ftn95 [/PAUSE] /HELP

Or:


ftn95 /CONFIGURE

Or:


ftn95 filena
me /CONVERT

To reset a

configured
option
, precede the option name with
'

'
.
For example,

ftn95 file.f95 /
-
ISO

switch
es

off the /ISO option, if it was currently switched on either with the
/CONFIGURE

option, or with /OPTIONS.

Note that options may be trunca
ted
. F
or example:

ftn95 file.f90 /B foo.obj /F /S

is equivalent to:

ftn95 file.f
95

/BINARY foo.obj /FIXED_FORMAT /SAVE

Any ambiguous truncated options are resolved using the first option starting with the
supplied characters

The table of v
alid compiler opt
ions
is s follows
:

/?

Gives a list of options when FTN95 is used from a command line in
a Command Prompt box.

/132

Prints error messages formatted for 132 column screens.

/ALL_WARNINGS

Prevents certain warnings from being reported only once.

/ALLOW_RECU
RSION

Allows procedure recursion when the RECURSIVE attribute has
not been specified (not recommended).

/ALT_KINDS

Allows byte size for KIND numbers. e.g. REAL(8) instead of
REAL(2); also 1.0_8 instead of 1.0_2 but 1.0_K must use the
default KIND values.

/ANSI

Old synonym for /ISO option.

/ASMBREAK

Like /BREAK but enters debugger at assembler level.

/BINARY

<filename>

Used to specify the .DBK or .OBJ file name. If this option is
omitted, the object file name is created by replacing the source file
-
name'
s suffix with .DBK or .OBJ, e.g. with FOO.F95, the object
file would be FOO.OBJ for Win32.

/BOUNDS_CHECK

Check array subscripts only (/CHECK includes
/BOUNDS_CHECK).


8

/BREAK

Implies both /CHECK and /LGO and causes a break to the
symbolic debugging facili
ty at the first executable statement.

/BRIEF

Causes all errors, warnings and comments to be output in a form
that is compatible with Borland BRIEF.

/CFPP

Invoke the C
-
style preprocessor on all input files.


Use this for #if,
#ifdef, #endif statements.

/
CHECK

Causes code to be planted in order to enable the run
-
time checking
of array bounds, overflow etc., and also to enable the use of the
source
-
level debugging facilities (/CHECK implies /DEBUG).

/CHECKMATE

A synonym for /FULL_UNDEF. /FULL_UNDEF implies

/UNDEF
which in turn implies /CHECK.

/CKC

Appends "__C" to a C_EXTERNAL alias which does not start with
a double underscore.

/COLOUR

Compiler output in a Comand Prompt box is coloured.

/CONFIG

Opens a dialog box to set
-
up installation compiler defaults
. This
must be the only option on the command
-
line.

/CONVERT

Converts fixed
-
format source into free
-
format, output to the screen.
All comments are lost and Hollerith constants replaced with strings.
This is useful for converting fixed
-
format INCLUDE files

into files
suitable for both fixed and free formats. This option implies the
/NO_BINARY option and no error checking, other than for
matching brackets and checking the fixed
-
format column rules, is
done. All other options on the command
-
line are ignored.

/DBREAK

Implies /LGO and causes a break to the symbolic de bugging
facility at the first executable statement (i.e. like /BREAK, but
/CHECK is not implied).

/DEBUG

causes FTN95 to generate symbolic information and to activate the
symbolic debugger when f
atal errors occur. /DEBUG is included in
/CHECK, /UNDEF and /CHECKMATE which are normally
preferred. /DEBUG can be used on its own in order to allow the
debugger to be used on "dirty" code, which intentionally violates
some of the rules of Fortran.

/DEBUG
_SOURCE

Adds a call to DEBUG_SOURCE@ after every executable line.

/DEFINT_KIND <kind>

Sets the default INTEGER kind. Use kind=2 or 3. kind=3 is the
default.

/DEFLOG_KIND <kind>

Sets the default LOGICAL kind. Use kind=1 or 2 or 3. kind=3 is
the default.

/DEFREAL_KIND <kind>

Sets the default REAL kind. Use kind=1 or 2 or 3. kind=1 is the
default. kind=3 is for Win32 only.

/DELETE_OBJ_ON_ERROR

If /LINK or /LGO is used no permanent object

file is created.
Otherwise, by

default

an object

file will be generat
ed except

when
errors are present. /DELETE_OBJ_ON_ERROR represents

the
default and must be negated to prevent the object file from being
deleted.
.

/DO1

Causes DO loops to be executed at least once to allow certain
Fortran 66 programs to execute correctly.

/DREAL

Set the default KIND for REAL types to be 2 (DOUBLE
PRECISION).

/DUMP

Output a variable dump in listing file.

/ERROR_NUMBERS

Error messages are accompanied by their error number.

/ERRORLOG

Creates a file called <filename>.ERR containing a copy
of all error
and warning messages.

/EXPLIST

[<filename>]

Generate a listing file containing a symbolic assembler listing.
<filename> is the optional name of the .LIS file. /EXPLIST is
equivalent to /LIST but causes each source statement to be followed
by
the assembler statements corresponding to the instructions into
which it was compiled.

/F2K

Permits the use of some Fortran 200x statements as an extension.
This option is implied by /CLR.


9

/FIXED_FORMAT

Accept source code in ISO fixed source format. This

is assumed for
files with .FOR or .F suffixes. If the name of the source file on the
command line has no suffix and this option is supplied then .FOR is
assumed to be the suffix.

/FPP

Invoke the preprocessor on all input files (this is required in order
to use CIF/CELSE/CENDIF when /SPARAM and /VPARAM are
not used). This option is implied by /CLR.


/FREE_FORMAT

Accept source code in ISO free source format. If the name of the
source file on the command line has a suffix which is not .FOR and
not .F, this
option is assumed. If the name of the source file on the
command line has no suffix, .F
90

is assumed.

/FULL_DEBUG

Outputs full debugging information including PARAMETERs.

/FULL_UNDEF

Like /UNDEF but also INTENT(OUT) arguments are initialised as
undefined

on entry to a procedure

(/INHIBIT_CHECK 14

switches
this off)

and by default character variables are initialised as
undefined. The reading of an undefined value precipitates an error
condition.

/HARDFAIL

U
sed with /LGO to suppress entry into the debugger

in the event of
a run time error.

/HELP

Invokes the Windows based help system.

/IGNORE <error number>

Suppresses all errors and warnings with the given number. Error
numbers are generated using /ERROR_NUMBERS. Suppressing
error numb
e
rs is unsafe but may

be useful during debugging.

/IMPLICIT_NONE

Fault on IMPLICIT type definitions.

/IMPORT_LIB

Scans a CVF generated library, automatically creating
F_STDCALL interfaces.

/INCLUDE

<pathname>

Allows specification of list of include paths. This is appended t
o the
list of include
-
paths optionally specified in the environment
variable F95INCLUDE.

/INHIBIT_CHECK

Prevent the specified check being added with /CHECK and
/FULL_UNDEF.

/INTL

Set default KIND for type INTEGER to be 3 (this is the default).
This is eq
uivalent to /DEFINT_KIND 3.

/INTS

Set default KIND for type INTEGER to be 2. This is equivalent to
/DEFINT_KIND

2.

/ISO

Ensures that all constructs used in a program conform to the Fortran
95 ISO Standard. The /ISO option also informs the FTN95 run
-
time
system that ISO
-
conformity is required. This means that, for
example, non
-
standard use of format descriptors (such as business
editing in a run
-
time format) causes a run
-
time failure.

/LGO

Compile, load and execute.

/LIBRARY

<filename>

Specification of r
elocatable binary library and input files when
using /LGO or /LINK.

/LINK

[<filename>]

Generates an executable file, DLL or relocatable library. If
<filename> is not provided, the name is created by using the source
file name. For example, FOO.F95 would
generate a Win32
executable called FOO.EXE.

/LIST

[<filename>]

Produces a source listing file. If <filename> is not provided, the
name is created by replacing the source
-
suffix with .LIS, e.g. with
FOO.F
95
, the map file would be FOO.LIS.

/LIST_INSERT_FIL
ES

Used with /LIST to include INCLUDE files in listing.

/LOGL

Use LOGICAL (KIND=3) as default LOGICAL type (this is the
default). This is equivalent to /DEFLOG_KIND 3.

/LOGS

Use LOGICAL (KIND=2) as default LOGICAL type. This is
equivalent to /DEFLOG_KIND

2.

/MAC_EOL

Specifies that the source code uses Apple Macintosh end
-
of
-
line
characters.

/MAP

[<filename>]

Produces a linker map. If <filename> is not provided, the name is
created by replacing the source
-
suffix with .MAP, e.g. with

10

FOO.F
95
, the map file

would be FOO.MAP.

/MESSAGE_SET_TO_COMMENT

Sets all compiler diagnostic messages to comment severity.

/MESSAGE_SET_TO_ERROR

Sets all compiler diagnostic messages to error severity.

/MESSAGE_SET_TO_FATAL

Sets all compiler diagnostic messages to fatal sev
erity.

/MESSAGE_SET_TO_SUPPRESS

Applies /IGNORE to all error numbers.

/MKLIB

Generates a static library containing a separate object for each
function or subroutine.

/MKLIB causes FTN95 to call

the Salford library manager called
SLIM. Objects in

the resu
lting static

library may

work correctly
with the debugger SDBG. The use of SLIM objects with SDBG is
not supported.

/MOD_PATH

<pathname>

Sets alternative path for module files. More than one /MOD_PATH
is permitted. This is appended on to the path containe
d in the
optional environment variable MOD_PATH.

/NO_BANNER

Suppress compilation logos.

/NO_BINARY

or

/NO_CODE

Suppresses the creation of an object file.

/NO_COMMENT

Suppress compiler comments, but not warnings and errors.

/NO_FAIL

Synonym for /PERSIST
.

/NO_MODULE_MEMMAP

Use standard Win32 I/O for .MOD files (only required when
creating .MOD files on a network drive where the server is a
Windows 9x machine).

/NO_OBSOLETE

Suppress reports of obsolete and extension warning messages after
the first has b
een displayed.

/NO_OFFSETS

Suppresses the output of address offsets in the source listing.

/NO_QUIT

Suppresses the simulated quit after a bad compilation. This
normally simulates a ^C to halt a batch
-
file compilation. With this
option set


IF ERRORLEVEL
1


must be use to test for compilation failure in a batch file if this
option is set, or alternatively


IF NOT EXIST <file>.OBJ


if the /DELETE_OBJ_ON_ERROR option is also used.

/NO_SCALAR_TO_ARRAY

Treats the assignment of a whole array to a scalar value
as an error.

/NO_SCREEN_MESSAGES

Suppresses messages when using /LIST.

/NO_WARN_
W
IDE

Suppresses warnings for characters appearing in columns 133 (free
format) or 73 (fixed format) and beyond in the source file.

/NON_STANDARD

Suppresses compiler messages

that warn of syntax that is permitted
by the FTN95 compiler but does not conform to the Fortran 95
standard. Such warnings will be converted to errors if /IOS is used.
/NON_STANDARD is switched on by default.

/OLD_ARRAYS

INTEGER A(1) implies INTEGER A(*)

when declaring procedure
arguments.

/OPTIMISE

Invoke the peephole and tree optimisers. /CHECK, /UNDEF,
/DEBUG and their variants are incompatible with this option.

/OPTIONS

<filename>

Specifies a file containing additional compiler options.

/P6

Uses so
me instructions which are only available on a Pentium Pro
(P6) (or better) processor.

/PARAMS

<param
-
list>

Used with /LGO or /BREAK to pass options to the program rather
than the compiler. This must be the last FTN95 option on the
command line.

/PAUSE_ON
_ERROR

Outputs error/warning/comment messages one at a time and waits
for a key press after each message.

/PENTIUM

Outputs code for Pentium or above processors (produces a slower
executable on 386 or 486).

/PERSIST

By default compilations with errors wil
l terminate as if control

11

break had been pressed. When the command appears in a batch file,
the batch process will then be interrupted. If /PERSIST is used, the
control break is suppressed and processing of the batch file will
continue even when compilatio
n errors have occurred.

/PROFILE

Inserts code to record how many times each line is executed.

/QUICK_BOUNDS

Outputs code to do a quick check on array bounds. Only checks
total bound size. This gives some protection against array
-
bounds
being exceeded wit
hout the run
-
time expense of /CHECK.

/RESTRICT_SYNTAX

Increases compiler strictness to reject dubious code.

/RUNTRACE

Adds a call to RUN_TRACE@ after every executable line.

/SAVE

Do not use the stack for storage of local variables and arrays.
Otherwise
dynamic storage is used for all local variables and
arrays. This has the effect of a blank Fortran SAVE statement in
each subprogram. Its use should normally be avoided.

/SEARCH_INCLUDE_FILES

Searches through INCLUDE files for CONTAINS. Switch this on
onl
y if an INCLUDE file contains executable statements. This
option is set by /ISO. When compiling typical Fortran 77 programs
containing many INCLUDE statements, this will speed
compilation.

/SET_ERROR_LEVEL <code>
<number>

Changes the severity of a compile
r diagnostic. <code> is Suppress,
Comment, Warning, Restricted, Error, or Fatal. <number> is the
error number reported by using /ERROR_NUMBERS.

/SILENT

Suppress warning and comment messages. Also when /SILENT is
used, the message that is output on the scr
een at the end of the
compilation of a program unit does not include the numbers of
warning and comment messages.

/SINGLE_LINE

Only prints the first line of an error message, ignoring any
continuations. This is ignored if /BRIEF is specified. Without this

option, when an error is reported, the offending line is output
together with any continued lines.

/SPARAM

<integer>

Gets the value of all SPECIAL PARAMATERs.

/STANDARD_ERROR_REPORTING

Suppress windowed diagnostic information.

/STATISTICS

Print the num
ber of lines compiled and the compilation speed on
the screen.

/SUPPRESS_ARG_CHECK

Suppresses /CHECK mode checking for argument constistency
across routines.

/TIMING

Plants code to do per
-
routine timing (see
/TIMING
).

/UNDEF

Implies /CHECK and also causes code to be planted in order to do
run
-
time checking for any undefined variables or array elements.

/UNDERFLOW

Used

to trap underflow.

/UNLIMITED_ERRORS

Carry on compiling even

after 12 error messages.

/VERSION

Display version information.

/VPARAM

<name>

<integer>

Like /SPARAM but allows the user to define a SPECIAL
PARAMETER by name, instead of having all the same value (over
-
rides SPARAM).

/WARN_FATAL

All warnings and comme
nts become errors.

/WIDE_SOURCE

Line
-
truncation at the 132nd (or 72nd) column is suppressed.

/WINDOWS

Program is compiled for use with ClearWin+.

/WRAP

Source lines are wrapped rather than truncated when an error or
warning is output.

/XREAL

Sets the d
efault KIND for REAL types to be 3.

/XREF

[<filename>]

Generates a cross
-
reference .XRF file. If <filename> is specified,
the file name is created by replacing the source file
-
name's suffix
with .XRF, e.g. with FOO.F
95
, the resulting name would be
FOO.XRF
.

/ZEROISE

All static variables and arrays set to zero at start of execution



12

5

Further Information

The following manuals are available for reference, loan or purchase from the
University Libraries.

FTN95 User Guide


Complete reference to FTN95, SLINK,
and PLATO

Clearwin User Guide


Guide to the Clearwin library for writing Windows
applications using FTN95.

FTN95 Library Reference


A reference to the Fortran 95 intrinsic functions
and other Salford specific system service routines.

You can obtain help
from the online Help pages also.

The following documents are available online from the Computing Services
Documentation page:

http://www.liv.ac.uk/CSD/acuk_html/index.html

Document 3
86

NAG Fort
ran Library(
MWS
)

Document 394

UNIRAS (
MWS
)


13

Appendix A

C An OpenGL Program


! *****************************************************

! * *

! * Modified from depthcue.c *

! * (c) Copyright 1993, Silicon Graphics, Inc. *

! * (c) Copyright 1998, Salford Software Ltd. *

! * *

! *****************************************************


! *********
***************************************************

! * *

! * depthcue.for *

! * This program draws a wireframe model, which uses *

!

* intensity (brightness) to give clues to distance. *

! * Fog is used to achieve this effect. *

! * *

! ****************************************************
********



subroutine myinit()


include <opengl.ins>


real fogColor(4)


data fogColor /0.0, 0.0, 0.0, 1.0/


! Initialize linear fog for depth cueing.


call glMatrixMode (GL_MODELVIEW)


call glEnable(GL_FOG)


call g
lFogi (GL_FOG_MODE, GL_LINEAR)


call glHint (GL_FOG_HINT, GL_NICEST) ! /* per pixel */


call glFogf (GL_FOG_START, 3.0)


call glFogf (GL_FOG_END, 5.0)


call glFogfv (GL_FOG_COLOR, fogColor)


call glClearColor(0.0, 0.0
, 0.0, 1.0)


call glDepthFunc(GL_LESS)


call glEnable(GL_DEPTH_TEST)


call glShadeModel(GL_FLAT)


end



subroutine display()


include <opengl.ins>



call glClear(OR(GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT))


c
all glColor3f (1.0, 1.0, 1.0)


call auxWireIcosahedron(1d0)


call glFlush()



end



subroutine myReshape(w,h)


include <opengl.ins>


integer w,h


double precision aspect_ratio


if (h.ne.0) then



aspect_rati
o=dble(w)/h


call glViewport(0, 0, w, h)


call glMatrixMode(GL_PROJECTION)


call glLoadIdentity()


14


call gluPerspective (45d0, aspect_ratio, 3d0, 5d0)


call glMatrixMode(GL_MODELVIEW)


call glLoadIdentit
y ()


call glTranslatef (0.0, 0.0,
-
4.0) ! move object into view


call glViewport(0,0,w,h)



end if


end



integer function opengl_proc()


include <clearwin.ins>


integer w,h


character*256 reas
on


reason=clearwin_string@('CALL_BACK_REASON')


if(reason.eq.'SETUP')then


call myinit()


else if(reason.eq.'RESIZE')then


w=clearwin_info@('OPENGL_WIDTH')


h=clearwin_info@('OPENGL_DEPTH')


call myReshape(w,h)



else if(reason.eq.'DIRTY')then


call display()


end if


opengl_proc=2


end



program depthcue


include <clearwin.ins>


integer i


integer opengl_proc


external opengl_proc


i=winio@('%es%ca[Dist
ance Using Fog]&')


i=winio@('%sp%ww[no_border]%pv%^og[depth16]',&


0,0,400,400,opengl_proc)

end