a glossary - springer978-1-4471-0403-2/1.pdf · the bounds are specified with a colon, e.g. (:)....

58
398 Appendix A A Glossary actual argument A value (variable, expression or procedure) passed from a calling program unit to a sub-program unit. adjustable array An explicit shape array that is a dummy argument to a sub-program. algorithm Derived from the name of the 9 th century Persian mathematician Abu Ja'far Mo- hammed ibn Musa al-Kuwarizmi (father of Ja'far Mohammed, son of Moses, native of Kuwarizmi), corrupted through western culture as AI-Kuwarizmi. Now a se- quence of computations. allocatable array An array that has the ALLOCATABLE attribute. argument Exists in two forms; actual argument which is in the calling routine, and is one of a variable, expression or procedure, and dummy argument, which is in the called routine. argument association The process of matching up an actual argument and dummy argument during pro- gram execution. array An array is a data structure where each scalar element has the same type and kind. An array may be up to rank 7. It may be referenced by element (via subscripts), by section or as a whole. array constructor A mechanism used to initialize or give values to a one dimensional array. The RESHAPE function can then be used to handle rank 2 and above arrays. array element A scalar item of an array. An array element is picked out by a subscript. array element ordering the elements of an array, regardless of rank, form a linear sequence. The sequence is such that the subscripts along the first dimension vary most rapidly.

Upload: nguyenkhanh

Post on 29-Jun-2019

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

398 Appendix A

A Glossary

actual argument

A value (variable, expression or procedure) passed from a calling program unit to a sub-program unit.

adjustable array

An explicit shape array that is a dummy argument to a sub-program.

algorithm

Derived from the name of the 9th century Persian mathematician Abu Ja'far Mo­hammed ibn Musa al-Kuwarizmi (father of Ja'far Mohammed, son of Moses, native of Kuwarizmi), corrupted through western culture as AI-Kuwarizmi. Now a se­quence of computations.

allocatable array

An array that has the ALLOCATABLE attribute.

argument

Exists in two forms; actual argument which is in the calling routine, and is one of a variable, expression or procedure, and dummy argument, which is in the called routine.

argument association

The process of matching up an actual argument and dummy argument during pro­gram execution.

array

An array is a data structure where each scalar element has the same type and kind. An array may be up to rank 7. It may be referenced by element (via subscripts), by section or as a whole.

array constructor

A mechanism used to initialize or give values to a one dimensional array. The RESHAPE function can then be used to handle rank 2 and above arrays.

array element

A scalar item of an array. An array element is picked out by a subscript.

array element ordering

the elements of an array, regardless of rank, form a linear sequence. The sequence is such that the subscripts along the first dimension vary most rapidly.

Page 2: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

Glossary

array section

A part of an array. The actual set depends on the sUbscripts.

ASCII

American Standard Code for Information Interchange. See Appendix C.

association

399

The means by which an entity can be referenced by different names in one scoping unit, or one or more names in multiple scoping units.

assumed length dummy argument

A dummy argument that inherits the length attribute of the actual argument.

assumed shape array

A dummy argument that inherits the shape of the associated argument.

assumed size array

A dummy array whose size is inherited from the associated actual argument.

attribute

A property of a data type, and specified in a type declaration statement.

automatic array

This is an explicit shape array thatis a local variable in a sub-program unit.

bound

The bounds of an array are the upper and lower limits of the index in each dimen­sion.

character constant

A constant that is a string of one or more printable ASCII characters, enclosed in ' (apostrophe) or " (quotation mark).

character string

A sequence of one or more characters. These are contiguous.

collating sequence

The order in which a set of characters is sorted by default. The standard does not require that a processor provide the ASCII encoding, but does require intrinsic functions that convert between the processor encoding and the ASCII encoding.

Page 3: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

400 Appendix A

compilation unit

One or more source files that are compiled to form one object file.

component

Part of a derived type definition.

concatenate

join together two or more character items using the character concatenation opera­tor II.

conformable

Two arrays are said to be conformable if they have the same shape.

constant

A constant is a data object whose value cannot be changed There are two kinds in Fortran: one is obtained using the PARAMETER statement, the other is a literal constant in an expression, e.g. with the expression 4*ATAN(I) both 4 and 1 are literal constants. It may be a scalar or an array.

contiguous

Normally applied to items that are adjacent in memory, e.g. characters in a charac­ter variable.

data entity

A data object that has a specific type.

data object

a data object is a constant, variable or part of a constant or variable.

data type

For each data type there is the following: O. a name 1. a set of values from a domain; 2. a set of valid operations upon these values; 3. a display method There are five predefined data types in Fortran and these are integer, real, complex, char­acter and logical.

For integers the values are drawn from the domain of integer numbers, the valid operations are addition, subtraction, multiplication, division and exponentiation, and they are displayed as a sequence of digits.

declaration

A declaration is a non-executable statement that specifies attributes of a program element, e.g. specifying the dimension of an array, and the type of a variable.

Page 4: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

Glossary 401

default kind

The kind type parameter which is used for one of Fortran's base types (integer, real, complex, character or logical) if one is not specified.

deferred shape array

An allocatable array or an array pointer. The bounds are specified with a colon, e.g. (:).

defined

For a data object having a valid value.

derived type

A data type that is user defined and not one of the five intrinsic types.

dimension

An array can be from one to seven dimensioned inclusive. Also called the rank.

dummy argument

A variable name that appears in the bracketed or parenthesized list following the procedure name. (e.g. function or subroutine name). Dummy arguments take on the actual values of the corresponding arguments in the calling routine.

elemental

An operation that applies independently to each element in an array.

entity

Rather vague tenn covering a constant, variable, program unit, etc.

exceptional values

Nonnally restricted to real numbers and typically one of non-nonnalized numbers, infinity, not-a-number (NaN) values, etc.

explicit interface

A mechanism to make infonnation available between the calling routine and the called routine. This infonnation includes the names of the procedures, the dummy arguments, the attributes of the arguments, the attributes of functions, and the order of the arguments.

explicit shape array

A named array that has its bounds specified in each dimension.

Page 5: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

402 Appendix A

expression

An expression is a sequence of operands and operators that specifies a computation.

extent

The number of elements of one dimension of an array. Also called the size.

external subprogram

An external subprogram is one that is global to the whole program.

function

One of the two procedure mechanisms available in Fortran along with the subrou­tine. They effectively provide a way of invoking a computation by using the function name, and return a result. There is the concept of type and kind for the result.

function reference

A function is invoked by the use of its name in an expression.

function result

The result value(s) from invoking a function.

generic

Simplistically the ability of a procedure to accept arguments of more than type. This facility is taken for granted with the intrinsic procedures, and the user can now create their own generic procedures.

global

An entity that is available throughout the executable program. A global entity has global scope. See also scope and local scope.

host association

The mechanism by which a module procedure, internal procedure or derived type definition accesses entities of the host.

implicit interface

A procedure interface whose properties are not known within the scope of the call­ing routine.

inquiry function

A function whose result depends on the properties of the argument.

Page 6: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

Glossary 403

interface block

A sequence of statements starting with an INTERFACE statement and ending with an END INTERFACE statement.

interface body

The sequence of statements in an interface block between either a FUNCTION or SUBROUTINE statement and the corresponding END statement

internal procedure

A procedure that is contained within an internal subprogram. The program unit containing the internal procedure is called the host. The internal procedure is local to the host and inherits the host environment through host association.

intrinsic procedure

One of the standard supplied procedures.

kind

For each of the five Fortran types (integer, real, complex, logical and character) there is the concept of kind. For example for integers it is common to find 8 bit, 16 bit and 32-bit implementations. Each of these has an associated kind type.

For real and complex types this enables us to choose both the range and precision of the numbers we work with.

For characters we can chose between character sets, which is of considerable use for working with different languages.

kind type parameter

An integer value used to identifY the kind of one of the five base types, see above.

language extension

Most compiler implementations will provide language extensions. These are NOT part of the standard, and make porting code suites between different hardware and software platforms difficult and sometimes impossible.

linker

A program that is normally the final stage in the process of going from Fortran source to executable.

local entity

An entity that is only available within the context of a sub-program.

Page 7: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

404 Appendix A

main program

A program unit that contains a PROGRAM statement.

module

A program unit that contains specifications and definitions that other program units can access and use.

module procedure

A function or subroutine defined within a module

name

An entity with a program, e.g. constant, variable, function result, procedure, pro­gram unit, dummy argument.

name association

This provides access to the same entity (either data or a procedure) from different scoping units by the same or different name.

nesting

The placing of one entity within another, e.g. one loop within another or one sub­program within another.

nonexecutable statement

A language statement that describes program attributes, but does not cause any action when the program is executed.

object file

File created after successful compilation. Used by the linker to generate an ex­ecutable.

parameter

Term used to describe two completely different things. 1. a named constant - and hence the PARAMETER attribute. 2. more generally equivalent to argument

pointer

A data object that has the POINTER attribute.

pointer association

The association of a part of memory to a pointer by means of a target.

precision

The number of significant digits in a real number.

Page 8: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

Glossary 405

procedure

A function or subroutine.

procedure interface

The statements that specify the name of a procedure, the characteristics of that procedure, the name of the dummy arguments, the attributes of the dummy argu­ments the generic identifier (optional) for the procedure.

program

A program is an entity that can be compiled and executed on its own. There must be at least a declaration block and execution block.

program unit

A main program or a subprogram. The subprogram can be a function, subroutine or module.

rank

The rank of an array is the number of dimensions.

recursion

A property of a function or subroutine, and it means that the function or subroutine references itself directly or indirectly.

reference

a data object reference is the appearance of a named entity in an executable state­ment requiring the value of the object.

relational expression

An expression containing one or more of the relational operators and operands of numeric or character type.

scalar

A single data object of any type. A scalar has a rank of zero.

scalar variable

A variable of scalar type.

scope and scoping unit

The part of a program in which a name has a defined meaning. The name may be a named constant, a variable, a function, a procedure, or dummy argument. The part of the program is one of a program unit or subprogram, a derived type defmition or

Page 9: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

406 Appendix A

a procedure interface body. Scoping units cannot overlap, but one scoping unit may be contained in another. In the latter case we have an example of host association.

shape

The rank and extents of an array.

shape conformance

Generally means that two or more arrays have the same rank and extent.

size

The total number of elements in an array - the product of the extents.

source file

A file known to the operating system that contains the Fortran statements.

statement

An instruction in a programming language, and they are normally classified as ex­ecutable and nonexecutable.

stride

The increment in subscript triplet.

structure

Either a scalar data object of derived type or a composite entity containing one or more subcomponents.

subprogram

A user written or supplied function or subroutine.

subroutine

A user subprogram that is invoked with the CALL statement. It can return one value, many values or no value at all to the calling program through the arguments.

subscript

a scalar integer expression used to select an element of an array

substring

a contiguous set of characters in a string.

target

A named data object associated with a pointer.

Page 10: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

Glossary

transformational function

An intrinsic function that is not elemental or inquiry.

truncation

407

For real numbers the approximation obtained by chopping off the fractional part of the number and working with the integer part.

For character variables removing one or more characters from a string.

type declaration

One of the nonexecutable statements in Fortran, and one of INTEGER, REAL, COMPLEX, CHARACTER, LOGICAL or TYPE.

underflow

A condition where the result of an arithmetic expression is smaller than the mini­mum value in the range for that data type.

user-defined type

A data type that is defined by the user and not one of the intrinsic types.

variable

A data object that has an associated memory location, whose value can be changed during program execution. A variable may be a scalar or an array.

Page 11: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

408 Appendix B

B Sample Program Examples There is a coverage of the standard that applies, where appropriate. For the more curious and inquisitive user they may be interested in the information held at:

www.iso.ch

which is the International Standards Organisations world wide web page.

Ada: ISOIIEC 8652:1995 WITH TEXT_IOiUSE TEXT_IOi PROCEDURE Add IS

Xl X2 Sum

BEGIN

FLOATi FLOATi FLOAT:=O.Oi

PACKAGE FLT_IO IS NEW FLOAT_IO(FLOAT)i USE FLT_IOi

PUT (" Type in the two numbers") i

GET(X1)i GET(X2)i Sum: =X1 + X2 i

NEW_LINE (1) i

PUT(Xl)i PUT (" + ,,) i

PUT (X2) ; PUT (" = ,,) i

PUT (Sum) ; END Addi

Algol: Was ISO 1538, but this has been withdrawn.

Algol 68: No standard, but the major definition is in the Revised Report.

Api: ISO 8485:1989

Basic: ISOIIEC 10279:1991, Full Standard; ISO 6373:1984, Minimal Conformance. 100 PRINT " Type in two numbers" 200 INPUT A, B 300 C = A + B 400 PRINT A I " +" B I " =" C

Page 12: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

Sample Program Examples

C: ISOIIEC 9899:1990 # include <stdio.h> main () { float a, b, sum;

printf (" Type in two numbers "); scanf ("%f", &a) ; scanf ("%f" ,&b) ; sum=a+b; printf("%f",a) ; printf (" + "); printf ("%f", b) ; printf(" = "); printf("%f",sum); printf ("\n"); }

C++: 1997-1998 #include <iostream.hxx> #include <math.h> int main () { float a,b, sum;

sum=O.O; cout < " Type in two numbers cin > a > b ; sum = a + b

"

cout < a < " + " < b < " return (0); }

" < sum < "\n"

Cobol: ISOIIEC 1989:1985

Fortran 90: ISOIIEC 1539:1990 PROGRAM Example IMPLICIT NONE REAL .. A REAL :: B

REAL :: Sum=O. 0 PRINT * , Type in two numbers' READ * , A,B Sum = A + B PRINT * , A " +, B,

END PROGRAM Example = ' Sum

409

Page 13: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

410

ICON: No standard.

Lisp

Logo: No standard.

Modula 2: ISOIIEC Draft 10514 MODULE Example;

Appendix B

FROM InOut IMPORT Write,WriteLn,WriteString; FROM InOut IMPORT ReadReal,WriteReal; VAR

A,B Sum

BEGIN

REAL; REAL;

Sum : = 0.0; wri teS tring (" Type in two numbers ") ; WriteLn; ReadReal (A) ; ReadReal (B) ; Sum := A + B; WriteReal(A,lO) ; WriteString(1I + "); WriteReal(B,lO); WriteString(1I = "); WriteReal(Sum,lO) ; WriteLn;

END Example.

Oberon: No standard.

Pascal: Pascal- ISO 7185:1990; Extended Pascal- ISOIIEC 10206: 1991 PROGRAM Example (INPUT, OUTPUT) ; VAR

A : REAL; B : REAL; Sum : REAL;

BEGIN WRITELN(' Type in two numbers'); READLN (A, B) ; Sum := A + B; WRITELN(A, , + ' , B , Sum)

END.

Page 14: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

Sample Program Examples

Postscript:

Prolog: ISOIIEC Draft 13211-1

SQL: ISO 9075:1992(E)

Simula: No international standard, but a Swedish one does exist.

Smalltalk:

Snobol:

411

Page 15: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

412 Appendix C

C ASCII Character Set

0 nul 32 64 @ 96 soh 33 65 A 97 a

2 stx 34 66 B 98 b 3 etx 35 # 67 C 99 c 4 eot 36 $ 68 D 100 d 5 enq 37 % 69 E 101 e 6 ack 38 & 70 F 102 f 7 bel 39 71 G 103 g 8 bs 40 ( 72 H 104 h 9 ht 41 ) 73 105 10 If 42 * 74 J 106 j 11 vt 43 + 75 K 107 k 12 ff 44 76 L 108 1 13 cr 45 77 M 109 m 14 so 46 78 N 110 n 15 SI 47 / 79 0 III 0

16 dIe 48 0 80 P 112 P 17 del 49 81 Q 113 q 18 dc2 50 2 82 R 114 r 19 dc3 51 3 83 S 115 s 20 dc4 52 4 84 T 116 21 nak 53 5 85 U 117 u 22 syn 54 6 86 V 118 v

23 etb 55 7 87 W 119 w 24 can 56 8 88 X 120 x 25 em 57 9 89 Y 121 Y 26 sub 58 90 Z 122 z 27 esc 59 91 [ 123 {

28 fs 60 < 92 124 I 29 gs 61 = 93 125 }

30 rs 62 > 94 1\ 126 31 us 63 ? 1 95 127 del

Page 16: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

Intrinsic Functions and Procedures 413

D Intrinsic Functions and Procedures

The following abbreviations and typographic conventions are used in this appendix.

Argument type and result type:

I Integer

R Real

C Complex

N Numeric (any of integer, real, complex)

L Logical

P Pointer

T Target

DP Double precision

Char Character, length = 1.

S Character

Class

E elemental function

I inquiry function

T transformational function

S subroutine

See Chapter 14 for more infonnation on these classifications.

Arguments in italics

ALL(Mask,Dim)

are optional arguments, i.e. Dim may be omitted in the example above.

Double precision

Before Fortran 90 if you required real variables to have greater precision than the default real then the only option available was to declare them as double precision. With the introduction of kind types with Fortran 90 the use of double precision declarations is not recommended, and instead real entities with a kind type offering more than the default precision should be used.

Page 17: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

414 Appendix D

Kind optional argument

There are several functions that have an optional argument Kind, e.g. AINT(A,Kind). If Kind is absent the result is the same kind type as the first argu­ment, in this case A. If Kind is present the result has the kind type specified by this argument.

Result type

When the result type is as argument type then the result is not just the same type as the argument but also the same kind.

Miscellaneous rules

When the argument is Back it is of logical type.

When the argument is CounCRate, CounCMax, Dim, Kind, Len, Order, N_Copies, Shape, Shift, Values it is of integer type.

When the argument is Mask it is of logical type.

When the argument is Target it is of pointer or target type.

ABS(A)

Yields the absolute value unless A is complex, see below.

Argument: A

Result: As argument

Type: N

Class: E

Note: If A is complex (x,y) then the functions returns."j x2 + l Example: Rl=ABS(A)

ACHAR(I)

Returns character in the ASCII character set.

Argument: I

Result: Char

Example: C=ACHAR(I)

ACOS(X)

Arccosine (inverse cosine).

Argument: X

Result: As argument

Note: I x I :s; 1

Type: I

Class: E

Type: R

Class: E

Page 18: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

Intrinsic Functions and Procedures

Example: Y=ACOS(X)

ADJUSTL(String)

Adjust string left, removing leading blanks and inserting trailing blanks.

Argument: String Type: S

Result: As argument

Example: S=ADJUSTL(S)

ADJUSTR(String)

Class: E

Adjust string right, removing trailing blanks and inserting leading blanks.

Argument: String Type: S

Result: As argument

Example: S=ADJUSTR(S)

AIMAG(Z)

Class: E

Imaginary part of complex argument.

Argument: Z Type: C

Result: As argument

Example: Y=AIMAG(Z)

AINT(A,Kind)

Truncation.

Class: E

Argument: A Type: R

Result: As A Class: E

Argument: Kind Type: I

415

Example: Y=AINT(Z) and when Z=O.3 Y=O, when Z=2.73 Y=2.0, when Z=-2.73 Y=-2.0

ALL(Mask,Dim)

Determines whether all values are true in Mask along dimension Dim.

Argument: Mask Type: L

Result: L Class: T

Page 19: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

416 Appendix D

Note: Dim must be a scalar in the range 1 :s; Dim:S; n where n is the rank of Mask. The result is scalar if Dim is absent or Mask has rank 1. Otherwise it works on the dimension Dim of Mask and the result is an array of rank n-l.

Example: T=ALL(M)

ALLOCATED(Array)

Returns true if array is allocated.

Argument: Array Type: Any

Result: L Class: I

Note: Array must be declared with the ALLOCATABLE attribute.

Example: IF (ALLOCATED(Array» THEN ...

ANINT(A,Kind)

Rounds reals, i.e. returns nearest whole number.

Argument: A

Result: As A

Type: R

Class: E

Example: Z=ANINT(A), if A = 5.63 Z = 6, if A=-5.7 Z = -.6.0

ANY(Mask,Dim)

Determines whether any value is true in Mask along dimension Dim.

Argument: Mask

Result: L

Type:L

Class: T

Note: Mask must be an array. The result is a scalar if Dim is absent or if Mask is of rank I. Otherwise it works on the dimension Dim of Mask and the result is an array of rank n-I.

Example: T=ANY(A)

ASIN(X)

Arcsine.

Argument: X

Result: As argument

Example: Z=ASIN(X)

Type: R

Class: E

Page 20: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

Intrinsic Functions and Procedures

ASSOCIA TED (Pointer, Target)

Returns the association status of the pointer.

Argument: Pointer

Result: L

Note:

Type: P

Class: I

417

1. If Target is absent then the result is true if POINTER is associated with a target, otherwise false. 2. If Target is present and is a target, the result is true if Pointer is currently associ­ated with Target and false if it is not. 3. If Target is present and is a pointer, the result is true if both Pointer and Target are currently associated with the same target, and is false otherwise. If either Pointer or Target is disassociated the result is false.

Example: T=ASSOCIATED(P)

ATAN(X)

Arctangent.

Argument: X

Result: As argument

Example: Z=AT AN(X)

ATAN2(y,X)

Arctangent of Y / X.

Argument: Y

Result: As arguments

Example: Z=ATAN2(Y,X)

BIT_SIZE(I)

Type: R

Class: E

Type: R

Class: E

Returns the number of bits, as defined by the numeric model for integer numbers in Chapter 8.

Argument: I

Result: As argument

Example: N_Bits=SIZE(I)

Type: I

Class: I

Page 21: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

418 Appendix D

BTEST(I,Pos)

Returns true if the bit is set in the integer argument at the position given by the second argument.

Argument: I

Result: L

Example: T=BTEST(I,Pos)

CEILING(A,Kind)

Type: I

Class: E

Returns the smallest integer greater than or equal to the argument.

Argument: A

Result: I

Note:

Type: R

Class: E

If kind is present the result has the kind type parameter Kind.

Otherwise the result of type default integer.

Example: I=CEILING(A) If A=12.21 then 1=13, if A=-3.16 then 1=-3

CHAR(I,Kind)

Returns the character in a given position in the processor collating sequence associ­ated with the specified kind type parameter. Normally ASCII.

Argument: I

Result: CHAR

Type: I

Class: E

Example: C=CHAR(65) and for the ASCII character set C=' A'.

CMPLX(X,Y,Kind)

Converts to complex from integer, real and complex.

Argument: X

Result: C

Note:

Type: N

Class: E

1. If X is complex and Y is absent it is as if Y were present with the value AI­MAG(X). 2. If X is not complex and Y is absent, it is as if Y were present with the value o. Example: Z=CMPLX(X,Y)

Page 22: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

Intrinsic Functions and Procedures

CONJG(Z)

Conjugate of a complex argument.

Argument: Z

Result: As Z

Example: Zl=CONJG(Z)

COS(X)

Cosine.

Argument: X

Result: As argument

Type:C

Class: E

Type: R, C

Class: E

419

Note: The arguments of all trigonometric functions should be in radians, not de­grees.

Example: A=COS(X)

COSH(X)

Hyperbolic cosine.

Argument: X

Result: As argument

Example: Z=COSH(X)

COUNT(Mask,Dim)

Type: R

Class: E

Returns the number of true elements in Mask along dimension Dim.

Argument: Mask

Result: I

Type: L

Class: T

Note: Dim must be a scalar in the range 1 ~ Dim ~ n where n is the rank of Mask. The result is scalar if Dim is absent or Mask has rank 1. Otherwise it works on the dimension Dim of Mask and the result is an array of rank n-l.

Example: N=COUNT(A)

CPU_TIME(Time)

Returns the processor time.

Argument: Time

Result: N/A

Type: R

Class: S

Page 23: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

420 Appendix D

Example: CALL CPU_TIME(Time)

CSHIFT(Array,Shift,Dim)

Circular shift on a rank one array or rank one sections of higher rank arrays.

Argument: Array

Result: As Array

Type: Any

Class: T

Note: Array must be an array, Shift must be a scalar if Array has rank one, other­wise it is an array of rank n-l, where n is the rank of Array. Dim must be a scalar with a value in the range 1 ~ Dim ~ n.

Example: Array=CSHIFT(Array,lO)

DATE_AND_TIME(Date, Time,Zone, Values)

Returns the current date and time (compatible with ISO 8601: 1988).

Argument: Date

Result: N/A

Time and Zone are of type S.

Note:

Type:S

Class: S

1. Date is optional and must be scalar and of length 8 characters in order to return the complete value of the form CCYYMMDD where CC is the century, YY is the year, MM is the month and DD is the day. It is INTENT(OUT). 2. Time is optional and must be scalar and of length 10 characters in order to return the complete value of the form hhmmss.sss where hh is the hour, mm is the minutes and ss.sss is the seconds and milliseconds. It is INTENT(OUT). 3. Zone is optional and must be scalar and must be of length 5 characters in order to return the complete value of the form ±hhmm where hh and mm are the time differences with respect to Coordinated Universal Time in hours and minutes. It is INTENT(OUT). 4. Values is optional and a rank one array of size 8. It is INTENT(OUT). The values returned are as follows: Values( I) = the year Values(2) = the month Values(3) = the day Values(4) = the time with respect to Coordinated Universal Time in minutes. Values(5) = the hour (24 hour clock) Values(6) = the minutes Values(7) = the seconds Values(8) = the milliseconds in the range ~999.

Page 24: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

Intrinsic Functions and Procedures

Example: CALL DATE_TIME(D,T,Z,V)

DBLE(A)

Converts to double precision from integer, real, and complex

Argument: A

Result: DP

Example: D=DBLE(A)

DIGITS(X)

Type: N

Class: E

421

Returns the number of significant digits of the argument as defined in the numeric models for integer and reals in Chapter 8.

Argument: X

Result: I

Example: I=DIGITS(X)

DIM(X,Y)

Type: I,R

Class: I

Returns first argument minus minimum of the two arguments: X -MIN(X,Y).

Argument: X

Result: As arguments

Type: I

Class: E

Example: Z=DIM(X,Y)

DOT_PRODUCT(Vector_l,Vector_2)

Performs the mathematical dot product of two rank one arrays.

Argument: Vector_l

Result: As arguments

Vector_2 is as Vectocl.

Note:

Type: Nt

Class: T

l. If Vectocl is of type integer or real the result has the value SUM(Vec­tor_l *Vector_2). 2. If Vectocl is complex the result has the value SUM(CONJG(Vectocl)*Vec­toC2). 3. IfVectocl is logical the result has the value ANY(Vectocl .AND. Vectoc2).

Example: A=DOT_PRODUCT(X,Y)

Page 25: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

422 Appendix D

DPROD(X,y)

Double precision product of two reals.

Argument: X

Result: DP

Type: R

Class: E

Example: D=DPROD(X,Y)

EOSHIFT(Array ,Shift,Boundary,Dim)

End off shift of a rank 1 array or rank one section of a higher rank array.

Argument: Array

Result: As Array

Boundary is as Array.

Type: Any

Class: T

Note: Array must be an array, Shift must be a scalar if Array has rank one, other­wise it is an array of rank n-l, where n is the rank of Array. Boundary must be scalar if Array has rank one, otherwise it must be either scalar or of rank n-l. Dim must be a scalar with a value in the range 1 ::s; Dim::S; n.

Example: A=EOSHIFT(A,Shift)

EPSILON (X)

Smallest difference between two reals of that kind. See Chapter 8 and real numeric model.

Argument: X

Result: As argument

Example: Tiny=EPSILON(X)

EXP(X)

Exponential, eX.

Argument: X

Result: As argument

Example: Y=EXP(X)

EXPONENT(X)

Type: R

Class: I

Type: R, C

Class: E

Returns the exponent component of the argument. See Chapter 8 and the real nu­meric model.

Argument: X Type: R

Page 26: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

Intrinsic Functions and Procedures

Result: I

Example: I=EXPONENT(X)

FLOOR(A, Kind).

Class: E

Returns the greatest integer less than or equal to the argument

Argument: A

Result: I

Note:

Type: R

Class: E

If kind is present the result has the kind type parameter Kind.

Otherwise the result of type default integer.

423

Example: I=FLOOR(A) and when A=5.2 I has the value 5, when A=-9.7 I has the value -10

FRACTION(X)

Returns the fractional part of the real numeric model of the argument See Chapter 8 and the real numeric model.

Argument: X

Result: As X

Example: F=FRACTION(X)

HUGE(X)

Type: R

Class: E

Returns the largest number for the kind type of the argument. See Chapter 8 and the real and integer numeric models.

Argument: X

Result: As argument

Example: H=HUGE(X)

IACHAR(C)

Type: I,R

Class: I

Returns the position of the character argument in the ASCII collating sequence.

Argument: C

Result: I

Type: Char

Class: E

Example: I=IACHARC A') returns the value 65.

Page 27: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

424 Appendix D

IAND(I,J)

Performs a logical AND on the arguments.

Argument: I

Result: As arguments

Example: K=IAND(I,J)

IBCLR(I,Pos)

Type: I

Class: E

Clears one bit of the argument to zero.

Argument: I

Result: As I

Note: 05, Pos < BILSIZE(l)

Example: I=IBCLR(I,Pos)

IBITS(I,Pos,Len)

Returns a sequence of bits.

Argument: I

Result: As I

Type: I

Class: E

Type: I

Class: E

Note: 05, Pos and (pos+Len) 5, BILSIZE(l) and Len ~ o. Example: Slice=IBITS(I,Pos,Len)

IBSET(I,Pos)

Sets one bit of the argument to one.

Argument: I

Result: As I

Note: 05, Pos < BIT_SIZE(l).

Example: I=IBSET(I,Pos)

ICHAR(C)

Type: I

Class: E

Returns the position of a character in the processor collating sequence associated with the kind type parameter of the argument. Normally the position in the ASCII collating sequence.

Argument: C

Result: I

Type: CHAR

Class: E

Page 28: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

Intrinsic Functions and Procedures

Example: I=ICHAR(, A') would return the value 65 for the ASCII character set.

IEOR(I,J)

Performs an exclusive OR on the arguments.

Argument: I

Result: As I

Example: I=IEOR(I,J)

INDEX(String,Substring,Back)

Type: I

Class: E

425

Locates one substring in another, i.e. returns position of Substring in character ex­pression String.

Argument: String

Result: I

Substring is of type S.

Note:

Type: S

Class: E

1. If Back is absent or present with the value .F ALSE. then the function returns the start position of the first occurrence of the SUbstring. If LEN(Substring) = 0 then one is returned. 2. If Back is present with the value .TRUE. then the function returns the start position of the last occurrence of the substring. If LEN(Substring) = 0 then the value (LEN(String) + 1) is returned. 3. If the substring is not found the result is zero. 4. If LEN (String) < LEN(Substring) the result is zero.

Example: Where=INDEX(, Hello world Hello','Hello') The result 2 is returned. Where=INDEX(' Hello world Hello' ,'Hello' ,.TRUE.) The result 14 is returned.

INT(A,Kind)

Converts to integer from integer, real, and complex.

Argument: A

Result: I

Example: I=INT(F)

IOR(I,J)

Type: N

Class: E

Performs an inclusive OR on the arguments.

Page 29: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

426

Argument: I

Result: As I

Example: I=IOR(I,J)

ISHFT(I,Shift)

Appendix D

Type: I

Class: E

Performs a logical shift. The bits of I are shifted by Shift positions.

Argument: I

Result: As I

Note: I Shiftl ~ BIT_SIZE( I)

Example: I=ISHIFT(I,Shift).

ISHFTC(I,Shift,size)

Type: I

Class: E

Performs a circular shift of the rightmost bits. The Size rightmost bits of I are circularly shifted by Shift positions.

Argument: I

Result: I

Note: I Shift I ~ Size o ~ Size ~ BICSIZE(/).

Type: I

Class: E

If Size is absent it is as if it were present with the value of BIT_SIZE(I). If Shift is positive the shift is to the left. If Shift is negative the shift is to the right. If Shift is zero no shift is performed.

Example: I=ISHFTC(I,Shift,Size)

KIND(X)

Returns the KIND type parameter of the argument.

Argument: X

Result: I

Example: I=KIND(X)

LBOUND(Array ,Dim)

Type: Any

Class: I

Returns the lower bounds for each dimension of the array argument or a specified lower bound.

Argument: Array Type: Any

Page 30: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

Result: I

Note:

Intrinsic Functions and Procedures

Class: I

427

I S Dim S n where n is the rank of Array. The result is scalar if Dim is present otherwise the result is an array of rank one and size n. The result is scalar if Dim is present otherwise a rank one array and size n.

Example: I=LBOUND(Array)

LEN (String)

Length of a character entity.

Argument: String

Result: I

Example: I=LEN(String)

LEN_TRIM(String)

Type: S

Class: I

Length of character argument less the number of trailing blanks.

Argument: String

Result: I

Example: I=LEN_TRIM(String)

LGE(String...J,Strin~2)

Type: S

Class: E

Lexically greater than or equal and this is based on the ASCII collating sequence.

Argument: String.J

Result: L

String .. .2 is of type S.

Example: L=LGE(Sl,S2)

LGT(Strin~1,Strin~2)

Type: S

Class: E

Lexically greater than and this is based on the ASCII collating sequence.

Argument: String.J

Result: L

Example: L=LGT(SI,S2)

LLE(Strin~1,Strin~2)

Type: S

Class: E

Lexically less than or equal and this is based on the ASCII collating sequence.

Page 31: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

428

Argument: String.J

Result: L

Strin&-2 is of type S.

Example: L=LLE(SI,S2)

LL T(StrinIL1,StrinIL2)

Appendix D

Type: S

Class: E

Lexically less than and this is based on the ASCII collating sequence.

Argument: Strin&-I Type: S

Result: L

Example: L=LL T(S I ,S2)

LOG(X)

Natural logarithm, loge x.

Argument: X

Result: As argument

Example: Y=LOG(X)

LOGIO(X)

Common logarithm, 10glO.

Argument: X

Result: As argument

Example: Y=LOG lO(X)

LOGICAL(L,Kind)

Class: E

Type: R, C

Class: E

Type: R

Class: E

Converts between different logical kind types, i.e. performs a type cast.

Argument: L Type: L

Result: L Class: E

Example: L=LOGICAL(K,Kind)

MA TMUL(Matrix_l,Matrix_2)

Performs mathematical matrix multiplication of the array arguments.

Argument: Matrix_l Type: N,L

Result: As arguments Class: T

Page 32: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

Intrinsic Functions and Procedures

Matrix_2 is as Matrix_I.

Note:

429

I. Matrix_I and Matrix_2 must be arrays of rank one or two. If Matrix_I is of numeric type so must Matrix_2. 2. If Matrix_I has rank one, Matrix_2 must have rank two. 3. If Matrix_2 has rank one, Matrix_l must have rank two. 4. The size of the first dimension of Matrix_2 must equal the size of the last dimen­sion of Matrix_I. 5. If Matrix_I has shape (n,m) and Matrix_2 has shape (m,k) the result has shape (n,k). 6. If Matrix_I has shape (m) and Matrix_2 has shape (m,k) the result has shape (k). 7. If Matrix_I has shape (n,m) and Matrix_2 has shape (m) the result has shape (n).

Example: R=MATMUL(M_I,M_2)

MAX(Al,A2,A3, ... )

Returns the largest value.

Argument: A I

Result: As arguments

A2, A3, .. are as AI.

Type: I,R

Class: E

Example: A=MAX(AI,A2,A3,A4)

MAXEPONENT(X)

Returns the maximum exponent. See Chapter 8 and numeric models.

Argument: X

Result: I

Example: I=MAXEXPONENT(X)

MAXLOC(ARRA Y ,Dim,Mask)

Type: R

Class: I

Determine the location of the first element of Array having the maximum value of the elements identified by Mask if present.

Argument: Array

Result: I

Note:

Type: I,R

Class: T

O. Normally in Fortran 95 if you omit an optional argument you must use keywords for the rest. This intrinsic breaks this rule and DIM can be omitted and it is not necessary to use a keyword with Mask.

Page 33: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

430 Appendix D

1. Array must be an array. 2. Mask must be confonnable with Array 3. The result is an array of rank one and of size equal to the rank of Array. 4. If DIM is present the result is an array of the rank of Array reduced by one and with the shape of Array without the dimension DIM.

Example:

A=(/5,6,7,81)

I=MAXLOC(A)

is (4), which is the subscript of the location of the first occurrence of the maximum value in the rank-one array.

( 1 8 5 I If A = 9 3 6 I

l4 2 7 )

1= MAXLOC(A,dim=l)

is (2,1,3) returning the position of the largest in each column.

I = MAXLOC(A,dim=2)

is (2,1,3) returning the position of the largest in each row ~

MAXV AL(Array,Dim,Mask)

Returns the maximum value of the elements of Array along dimension Dim corre­sponding to the true elements of Mask.

Argument: Array

Result: As argument

Note:

Type: I,R

Class: T

1 s Dim s n where n is the rank of Array. The result is scalar if Dim is absent, or Array has rank one. Otherwise the result is an array of rank n-l. If Array has size zero then the result is the largest negative number supported by the processor for the corresponding type and kind of Array.

Example:

MAXV AL«I1,2,31) returns the value 3.

MAXVAL(C,MASK=C < 0.0) returns the maximum of the negative elements ofe.

For B= 246 (135)

MAXVAL(B,DIM=I) returns (2,4,6)

Page 34: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

Intrinsic Functions and Procedures

MAXV AL(B,DIM=2) returns (5,6)

MERGE(True,False,Mask)

Chooses alternative values according to the value of a mask.

Argument: True

Result: As True

Example: for

Type: Any

Class: E

For True = 4 8 12 ' False = 3 7 II and Mask= F T F (2 6 10) (I 5 9) (T F T)

The result IS 3 8 II .(2510) MIN(Al,A2,A3 .... )

Chooses the smallest value.

Argument: A I

Result: As arguments

Type: I, R

Class: E

Example: Y=MIN(XI,X2,X3,X4,X5)

MINEXPONENT(X)

Returns the minimum exponent. See Chapter 8 and numeric models.

Argument: X

Result: I

Example: I=MINEXPONENT(X)

MINLOqArray,Dim.Mask)

Type: R

Class: I

431

Determine the location of the first element of Array having the minimum value of the elements identified by Mask.

Argument: Array

Result: I

Note:

Type: I,R

Class: T

O. Normally in Fortran 95 if you omit an optional argument you must use keywords for the rest. This intrinsic breaks this rule and dim can be omitted and it is not necessary to use a keyword with Mask. \. Array must be an array. 2. Mask much be conformable with Array. 3. The result is an array of rank one and of size equal to the rank of Array.

Page 35: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

432 Appendix D

4. If DIM is present the result is an array of the rank of Array reduced by one and with the shape of Array without the dimension DIM.

Example: I=MINLOC(Array)

In the above example if Array is a rank two array of shape (5,10) and the smallest value is in position (2, I) then the result is the rank one array I with shape (2) and 1(1)=2 and 1(2)=1.

See MAXLOC for further examples.

MINV AL(Array,Dim,Mask)

Returns the minimum value of the elements of Array along dimension Dim corre­sponding to the true elements of Mask.

Argument: Array

Result: As Array

Type: I,R

Class: T

Note: 1 ~ Dim ~ n where n is the rank of Array. The result is scalar if Dim is absent, or Array has rank one. Otherwise the result is an array of rank n-I. If Array has size zero then the result is the largest negative number supported by the processor for the corresponding type and kind of Array.

Example:

MINAL«/1,2,3/) returns the value 1.

MINV AL(C,MASK=C > 0.0) returns the minimum of the positive elements of C.

For B=(~!~) MINV AL(B,DIM= I) returns (1,3,5).

MINVAL(B,DIM=2) returns (1,2).

MOD(A,B)

Returns the remainder when first argument divided by second.

Argument: A

Result: As arguments

Type: I, R

Class: E

Note: If B=O the result is processor dependent. For B ':1= 0 the result is A - INT(A/B) * B.

Example: R=MOD(A,B) If A=8 and B=5 then R=3 If A=-8 and B=5 then R=-3

Page 36: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

Intrinsic Functions and Procedures

If A=8 and B=-5 then R=3 If A=-8 and B=-5 then R=-3

MODULO(A,B)

Returns the modulo of the arguments.

Argument: A

Result: As A

Note:

Type: I,R

Class: E

1. If B=O then the result is processor dependent. 2. Integer A The result is R where A= Q * B + Rand Q is integer

for B>O, ° ~ R < B for B < 0, B < R ~O 3. Real A The result is A - FLOOR(AIB) * B.

Example: R=MODULO(A,B) If A=8 and B=5 then R=3 If A=-8 and B=5 then R=2 If A=8 and B=-5 then R=-2 If A=-8 and B=-5 then R=-3

MVBITS(From,F _Pos,Len,To, T_Pos)

Copies a sequence of bits from one data object to another.

Argument: From

Result: N/A

All arguments are of integer type.

Note: From must be INTENT(IN).

Type: I

Class: S

F _Pos must be INTENT(IN), F _Pos ~ 0, F _Pos+Len ~ BIT_SIZE(From). Len must be INTENT(IN), Len ~ 0. To must be INTENT(INOUT). T_Pos must be INTENT(IN), T_Pos ~ 0, T_Pos + Len ~ BIT_SIZE(To).

Example: CALL MVBITS(F,FP,L,T,TP)

NEAREST(X,Next)

Returtls the nearest different number. See Chapter 8 and the real numeric model.

Argument: X Type: R

433

Page 37: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

434

Result: As X

Next is of type R.

Example: N=NEAREST(X,Next).

NINT(A,Kind)

Yields nearest integer.

Argument: A

Result: I

Note: I. A > 0, the result is INT(A+O.5). 2. A ;5; 0, the result is INT(A-O.5).

Example: I=NINT(X)

NOT(I)

Appendix D

Class: E

Type:RI

Class: E

Returns the logical complement of the argument.

Argument: I

Result: As I

Example: I=NOT(I)

NULL(Mold)

Returns a disassociated pointer.

Argument: Mold

Result: As argument

Note:

Type: I

Class: E

Type: P

Class: T

If the argument Mold is present the result is the same as Mold.

Otherwise it is determined by context.

Example: REAL, POINTER:: P=>NULLO

P ACK(Array ,Mask, Vector)

Packs an array into an array of rank one, under the control of a mask.

Argument: Array

Result: As Array

Type: Any

Class: T

Page 38: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

Intrinsic Functions and Procedures 435

Note: l. Array must be an array. 2. Mask be conformable with Array. 3. Vector must have rank one and have at least as many elements as there are TRUE elements in Mask. 4. If Mask is scalar with the value TRUE. Vector must have at least as many elements as there are in Array. 5. The result is an array of rank one. 6. If Vector is present the result size is that of Vector. 7. If Vector is not present the result size is t, the number of TRUE elements in Mask, unless Mask is scalar with a value TRUE in which case the result size is the size of Array.

Example: R=PACK(A,M)

PRECISION(X)

Returns the decimal precision of the argument. See Chapter 8 and numeric models.

Argument: X

Result: I

Example: I=PRECISION(X)

PRESENT(A)

Type: R, C

Class: I

Returns whether an optional argument is present.

Argument: A

Result: L

Type: Any

Class: I

Note: A must be an optional argument of the procedure in which the PRESENT function reference appears.

Example: IF (PRESENT(X» THEN ...

PRODUCT(Array,Dim,Mask)

The product of all of the elements of Array along the dimension Dim corresponding to the TRUE elements of Mask.

Argument: Array

Result: As Array

Note: l. Array must be an array.

Type: N

Class: T

2. I ::; Dim::; n where n is the rank of Array.

Page 39: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

436 Appendix D

3. Mask must be confonnable with Array. 4. Result is scalar if Dim is absent, or Array has rank one, otherwise the result is an array of rank n-l.

Example: 1. PRODUCT((II,2,31)) the result is 6. 2. PRODUCT(C,Mask=C > 0.0) fonns the product of the positive elements of C.

3. If B = (~ ~ ~I PRODU6T(B,~M=I) is (2,12,30) and PRODUCT(B,DIM=2) is (15,48)

RADIX(X)

Returns the base of the numeric argument. See Chapter 8 and numeric models.

Argument: X

Result: I

Example: Base=RADIX(X)

RANDOM_NUMBER(X)

Type: I,R

Class: I

Returns one pseudo-random number or an array of pseudo-random numbers from the unifonn distribution over the range 0 :0:::: x < I

Argument: X

Result: N/A

Note: X is INTENT(OUT).

Type: R

Class: S

Example: CALL RANDOM_NUMBER(X)

RANDOM_SEED(Size,Put, Get)

Restarts (seeds) or queries the pseudo-random generator used by RANDOM_NUM­BER.

Argument: Size

Result: N/A

All arguments are of integer type.

Note:

Type: I

Class: S

I. Size is INTENT(OUT). It is set to the number N of integers that the processor uses to hold the value of the seed. 2. Put is INTENT(IN). It is an array of rank one and size ~ N. It is used by the processor to set the seed value.

Page 40: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

Intrinsic Functions and Procedures 437

3. Get is INTENT(OUT). It is an array of rank one and size ~ N. It is set by the processor to the current value of the seed.

Example: CALL RANDOM_SEED

RANGE(X)

Returns the decimal exponent range of the real argument. See Chapter 8 and the numeric model representing the argument.

Argument: X

Result: I

Example: I==RANGE(N)

REAL(A,Kind)

Type: N

Class: I

Converts to real from integer, real or complex.

Argument: A

Result: R

Example: X==REAL(A)

REPEA T(String,N_Copies)

Type: N

Class: E

Concatenates several copies of a string.

Argument: String

Result: S

Type: S

Class: T

Example: New_S==REPEAT(S, 10)

RESHAPE(Source,Shape,Pad, Order)

Constructs an array of a specified shape from the elements of a given array.

Argument: Source

Result: As Source

Note:

Type: Any

Class: T

1. Source must be an array. If Pad is absent or of size zero the size of Source must be ~ PRODUCT(Shape). 2. Shape must be a rank one array and 0 :;;; size < 8. 3. Pad must be an array. 4. Order must have the same shape as Shape and its value must be a permutation of (1,2, ... ,n) where n is the size of Shape. If absent it is as if it were present with the

Page 41: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

438 Appendix D

value (I ,2, ... ,n). S. The result is an array of shape, Shape.

Example:

RESHAPE«11,2,3,4,S,6/),(12,3/) has the value (~ ~ ~)

RESHAPE( (11,2,3,4,S,6/) , (f2,4/) , (fO,O/) , (f2,1/) ) has the value U ~ ~ 6) RRSPACING(X)

Returns the reciprocal of the relative spacing of model numbers near the argument value. See Chapter 8 and the real numeric model.

Argument: X

Result: As X

Example: Z=RRSPACING(X)

SCALE(X,I)

Type: R

Class: E

Returns X * bI where b is the base in the model representation of X See Chapter 8 and the real numeric model.

Argument: X

Result: As X

I is of integer type.

Example: Z=SCALE(X,I)

SCAN(String,Set,Back)

Type: R

Class: E

Scans a string for anyone of the characters in a set of characters.

Argument: String

Result: I

Note:

Type: S

Class: E

I. The default is to scan from the left, and will only be from the right when Back is present and has the value TRUE. 2. Zero is returned if the scan fails.

Example: W=SCAN(String,Set)

SELECTED_INT_KIND(R)

Returns a value of the kind type parameter of an integer data type that represents all integer values n with _lOR < n < lOR

Page 42: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

Argument: R

Result: I

Note: R must be scalar.

Intrinsic Functions and Procedures

Type: I

Class: T

If a kind type parameter is not available then the value -1 is returned.

Example: I=SELECTED_INT_KIND(2)

SELECTED_REAL_KIND(P,R)

439

Returns a value of the kind type parameter of a real data type with decimal preci­sion of at least P digits and a decimal exponent range of at least R.

Argument: P and R

Result: I

Note: 1. P and R must be scalar.

Type: I

Class: T

2. The value -1 is returned if the precision is not available, the value -2 if the exponent range is not available, and -3 if neither is available.

Example: I=SELECTED_REAL_KIND(P,R)

SET_EXPONENT(X,I)

Returns the model number whose fractional part is the fractional part of the model representation of X and whose exponent part is I.

Argument: X

Result: As X

I is of integer type.

Type: R

Class: E

Example: Exp_Part=SET_EXPONENT(X,I)

SHAPE(Source)

Returns the shape of the array argument or scalar.

Argument: Source

Result: I

Note:

Type: Any

Class: I

1. Source may be array valued or scalar. It must not be a pointer that is disassoci­ated or an allocatable array that is not allocated. It must not be an assumed size array. 2. The result is an array of rank one whose size is equal to the rank of Source.

Page 43: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

440 Appendix D

Example: S=SHAPE(A(2:5,-1:1)) yields S=(4,3)

SIGN(A,B)

Absolute value of A times the sign of B.

Argument: A

Result: As A

Note:

Type: I, R

Class: E

In the special case where B is zero normally the result would have the value ABS(A), but if B is one of the real kind types and the processor is able to distin­guish between plus zero and minus zero then the result is ABS(A) if B is plus zero and the result is - ABS(A) if B is minus zero.

B is as A.

Example: A=SIGN(A,B)

SIN(X)

Sine.

Argument: X

Result: As argument

Note: The argument is in radians.

Example: Z=SIN(X)

SINH(X)

Hyperbolic sine.

Argument: X

Result: As argument

Example: Z=SINH(X)

SIZE(Array,Dim)

Type: R, C

Class: E

Type: R

Class: E

Returns the extent of an array along a specified dimension or the total number of elements in an array.

Argument: Array

Result: I

Note:

Type: Any

Class: I

I. Array must be an array. It must not be a pointer that is disassociated or an

Page 44: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

Intrinsic Functions and Procedures 441

allocatable array that is not allocated. If Array is an assumed size array Dim must be present with a value less than the rank of Array. 2. Dim must be scalar and in the range I ~ Dim ~ n where n is the rank of Array. 3. Result is equal to the extent of dimension Dim of Array, or if Dim is absent, the total number of elements of Array.

Example: A=SIZE(Array)

SPACING(X)

Returns the absolute spacing of model numbers near the argument value. See Chap­ter 8 and the real numeric model.

Argument: X

Result: As X

Example: S=SPACING(X)

SPREAD(Source,Dim,N~Copies)

Type: R

Class: E

Creates an array with an additional dimension, replicating the values in the original array.

Argument: Source

Result: As Source

Note:

Type: Any

Class: T

I. Source may be array valued or scalar, with rank less than 7. 2. Dim must be scalar and in the range I ~ Dim ~ n+ I where n is the rank of Source. 3. N_Copies must be scalar. 4. The result is an array of rank n+ I.

Example: If A is the array (2,3,4) then SPREAD(A,DIM=I,NCOPIES=3) then the result is the

(2 3 4\ array 12 3 41

l2 3 4)

SQRT(X)

Square root.

Argument: X

Result: As argument

Example A=SQRT(B)

Type: R, C

Class: E

Page 45: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

442 Appendix D

SUM(Array,Dim,Mask)

Returns the sum of all elements of Array along the dimension Dim corresponding to the true elements of Mask.

Argument: Array

Result: As Array

Note: 1. Array must be an array.

Type: N

Class: T

2. 1 :::; Dim:::; n where n is the rank of Array. 3. Mask must be conformable with Array. 4. Result is scalar if Dim is absent, or Array has rank one, otherwise the result is an array of rank n-1.

Example: 1. SUM«/l,2,3/) the result is 6. 2. SUM(C,Mask==C > 0.0) forms the arithmetic sum of the positive elements of C.

3. If B == (~ ! ~) SUM(B,6im==l) is (3,7,11) SUM(B,Dim==2) is (9,12)

SYSTEM_CLOCK( Count, CouncRate, CounCMax)

Returns integer data from a real time clock.

Argument: Count

Result: N/A

Note:

Type: I

Class: S

I. Count is INTENT(OUT) and is set to a processor dependent value based on the current value of the processor clock or to -HUGE(O) if there is no clock. 0 :::; Count :::;CounCMax. 2. CounCRate is INTENT(OUT) and it is set to the number of processor clock counts per second, or zero if there is no clock. 3. CounCmax is INTENT(OUT) and is set to the maximum value that Count can have or to zero if there is no clock.

Example: CALL SYSTEM_CLOCK(C,R,M)

TAN(X)

Tangent.

Argument: X Type: R

Page 46: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

Intrinsic Functions and Procedures

Result: As argument

Note: X must be in radians.

Example: Y=T AN(X)

TANH(X)

Hyperbolic tangent.

Argument: X

Result: As argument

Example: Y=TANH(X)

TINY(X)

Class: E

Type: R

Class: E

443

Returns the smallest positive number in the model representing numbers of the same type and kind type parameter as the argument.

Argument: X

Result: As X

Example: T=TINY(X)

TRANSFER(Source,Mold,Size)

Type: R

Class: I

Returns a result with a physical representation identical to that of Source, but inter­preted with the type and type parameters of Mold.

Argument: Source

Result: As Mold

Type: Any

Class: T

Warning: A thorough understanding of the implementation specific internal repre­sentation of the data types involved is necessary for successful use of this function. Consult the documentation that accompanies the compiler that you work with be­fore using this function.

TRANSPOSE(Matrix)

Transposes an array of rank two.

Argument: Matrix

Result: As argument

Type: Any

Class: T

Note: Matrix must be of rank two. If its shape is (n.m) then the resultant matrix has shape (m.n)

Page 47: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

444 Appendix D

( 1 2 31 (1 4 71 Example: For A = 4 5 6 I TRANSPOSE(A) yields 2 5 8 I

l7 8 9) l3 6 9)

TRIM(String)

Returns the argument with trailing blanks removed.

Argument: String

Result: As String

Note: String must be a scalar.

Example: T_S=TRIM(S)

UBOUND(Array,Dim)

Type: S

Class: T

Returns all the upper bounds of an array or a specified upper bound.

Argument: Array

Result: I

Note:

Type: Any

Class: I

1 :s; Dim :s; n where n is the rank of Array. The result is scalar if Dim is present otherwise the result is an array of rank one and size n. Result is a scalar if Dim is present otherwise is an array of rank one, and size n.

Example: Z=UBOUND(A)

UNPACK(V ector ,Mask,Field)

Unpacks an array of rank one into an array under the control of a mask.

Argument: Vector

Result: As Vector

Note:

Type: Any

Class: T

1. Vector must have rank one. Its size must be at least t, where t is the number of true elements in Mask. 2. Mask must be array valued. 3. Field must be conformable with Mask. Result is an array with the same shape as Mask.

Example:

(F T Fl (I ° 01 With Vector = (1,2,3) and Mask = T F F I and Field= I 0 I 0 I

lFFT) lOOI)

Page 48: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

(1 2 01 The result is 11 1 0 I

lO 0 3)

Intrinsic Functions and Procedures

VERIFY(String,Set,Back)

445

Verify that a set of characters contains all the characters in a string by identifying the position of the first character in a string of characters that does not appear in a given set of characters.

Argument: String

Result: I

Note:

Type: S

Class: E

1. The default is to scan from the left, and will only be from the right when Back is present and has the value TRUE. 2. The value of the result is zero if each character in String is in Set, or if String has zero length.

Example: I=VERlFY(String,Set)

Page 49: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

446 Appendix E

E English and Latin Texts YET IF HE SHOULD GIVE UP WHAT HE HAS BEGUN, AND AGREE TO MAKE US OR OUR KINGDOM SUBJECT TO THE KING OF ENGLAND OR THE ENGLISH, WE SHOULD EXERT OURSELVES AT ONCE TO DRIVE HIM OUT AS OUR ENEMY AND A SUBVERTER OF HIS OWN RIGHTS AND OURS, AND MAKE SOME OTHER MAN WHO WAS ABLE TO DE­FEND US OUR KING; FOR, AS LONG AS BUT A HUNDRED OF US REMAIN ALIVE, NEVER WILL WE ON ANY CONDITIONS BE BROUGHT UNDER ENGLISH RULE. IT IS IN TRUTH NOT FOR GLORY, NOR RICHES, NOR HONOURS THAT WE ARE FIGHTING, BUT FOR FREEDOM - FOR THAT ALONE, WHICH NO HONEST MAN GIVES UP BUT WITH LIFE IT­SELF.

QUEM SI AB INCEPTIS DIESISTERET, REGI ANGLORUM AUT ANGLICIS NOS AUT REGNUM NOSTRUM VOLENS SUBICERE, TANQUAM IN­IMICUM NOSTRUM ET SUI NOSTRIQUE JURIS SUBUERSOREM STATIM EXPELLERE NITEREMUR ET ALlUM REGEM NOSTRUM QUI AD DEFEN­SIONEM NOSTRAM SUFFICERET F ACEREMUS. QUIA QUANDIU CENTUM EX NOBIS VIUI REMANSERINT, NUCQUAM ANGLORUM DOMINIO ALIQUATENUS VOLUMUS SUBIUGARI. NON ENIM PROPTER GLORIAM, DIUICIAS AUT HONORES PUGNAMUS SET PROPTER LIBERA TEM SOLUMMODO QUAM NEMO BONUS NISI SIMUL CUM VITA AMITTIT.

from 'The Declaration of Arbroath ' c.1320. The English translation is by Sir James Fergusson.

Page 50: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

Coded Text Extract 447

F Coded Text Extract

OH YABY NSFOUN, YAN DUBZY LZ DBUYLTUBFAJ BYYBOHNX GPDA FNUZNDYOLH Y ABY Y AN SBF LZ B GOHTMN FUL WOHDN DL WNUNX Y AN GFBDN LZ BH NHYOUN DOYJ, BHX Y AN SBF LZ Y AN NSFOUN OYGNMZ BH NHYOUN FULWOHDN. OH YAN DLPUGN LZ YOSN, Y ANGN NKYNHGOWN SBFG VNUN ZLPHX GLSNAL V VBHYOHT, BHX GL YAN DLMMNTN LZ DBUYLTUBFANUG NWLMWNX B SBF LZ YAN NSFOUN Y ABY VBG Y AN GBSN GDBMN BG Y AN NSFOUN BHX Y ABY DLOHDOXNX VOY A OY FLOHY ZLU FLOHY. MNGG BYYNHYOWN YL Y AN GYPXJ LZ DBUYL TUBFAJ, GPDDNNXOHT TNHNUBYOLHG DBSN YL RPXTN B SBF LZ GPDA SBTHOYPXN DPSENUGLSN, BHX, HLY VOY­ALPY OUUNWNUNHDN, Y ANJ BEBHXLHNX OY YL Y AN UOTLPUG LZ GPH BHX UBOH. OH Y AN VNGYNUH XNGNUYG, YBYYNUNX ZUBTSNHYG LZ Y AN SBF BUN GYOMM YL EN ZLPHX, GANMYNUOHT BH LDDBGOLHBM ENBGY LU ENTTBU; OH Y AN V ALMN HBYOLH, HL LYANU UNMOD OG MNZY LZ YAN XOGDOFMOHN LZ TNLTUBFAJ.

Page 51: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

448

A

A edit descriptor 208 Abstraction, stepwise refinement and modules 40 Accuracy 77, 316, 319 ACM (Association for Computer Ma­chinery)

TOMS (Transaction on Mathematical Software 395

Ada 41,49-51,53,303,315,420 Addition 69-96 Algol 36-37 Algol 68 38 Algorithm 26 ALLOCATABLE arrays 127 ALLOCATABLE attribute 128 Allocatable

dummy arrays 390 function results 395 structure components 397

ALLOCATE statement 128 Alphanumeric or character format, A 141,208 Analysis 28-30 APL 39 Argument 168, 182, 319, 425-457

actual 267 array 273-274 association 398 assumed length 276, 283, 399 assumed shape 285, 399 assumed size 375, 399 character 276 deferred shape 275,401 dummy argument 275,401 dummy procedure argument 356 keyword and optional ? PRESENT intrinsic function 435

Arithmetic 69-96 Arithmetic IF 386

Index

Array constructor 130-131, 398 element ordering 129-130,398 element ordering and physical and virtual memory 130 functions 175 sections 127

Arrays 97-134 and DO Loops allocatable 127 as parameters 273, 274 assumed shape 285, 399 assumed size, 375, 399 automatic 355 bounds 124 constructor 130-131, 398 conformable 124,400 declaration 100 deferred shape 128, 40 I element 101 element ordering 129, 130,398 explicit shape dummy arrays 283 extent 124, 402 index 101 masked assignment 131 rank 124, 405 section 127 shape 124, size 124 whole array manipulation 124

Arrays of pointers 249 Artificial language 25 ASCII character set 412 Assignment 54, 125 Association 399

USE association 339 Assumed length dummy argument 276, 399 Assumed shape arrays 285, 399 Attribute specification 357 Automatic arrays 355, 399

Page 52: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

Index 449

B

Base conversion 3 16, 3 19 Basic 39 Bit data type and representation model 83 Blanks 161 Blanks, nulls and zeros 161 Block 189- I 93 Bottom-up 26 Bounds 124, 399 Bus 10

c C 39 C and IEEE 754 332 C++ 45 CALL statement 267 CASE statement 194 Central Processor Unit 10 Character 205-2 I 6

A edit descriptor 208 concatenation 208-209 constants 400 functions 21 I input 208 operators 208 sets, ASCII 207, 4 I 2 string 399 sub-strings 2 I 0 trailing blanks 209

CHARACTER type statement 60, 207 Chomsky and program language devel­opment 37 CLOSE statement 163, 257 Cobol 35 Collating sequence 213,399 Comments 60 Commercial numerical and statistical subroutine 292

Common mistakes 142 Complex 217-220 Complex and kind type 220 COMPLEX type statement 2 I 8 Computational functions 175 Concatenate 208, 400 Conformable 124,400 Constant 400 CONTAINS statement 191,348 Control Structures 187-204 Converting from Fortran 77 373-376 CYCLE and EXIT 198 CYCLE statement 198

D

Data description statements 59 Data entity 400 Data processing statements 59 Data structures

dynamic 233-254 user defined 227-232

DEALLOCATE statement 236 Declaration 400 Deferred shape arrays 128,401 Defining a subroutine 267 Deleted features 374 Derived type definition 343 DIMENSION attribute 100 Division 70 DO construct 119 DO IF EXIT construct 198, 199 DO loop 102, 103

construct 1 19 statement 103 syntax 117 variable 119

DO WHILE construct 196-197 DOUBLE PRECISION 375 Double precision floating point format 319

Page 53: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

450

Dummy arguments assumed length 276, 399 assumed shape 285,399 character 276 explicit shape 274 procedures as 356

Dynamic behaviour 61 Dynamic Data Structures 233-254

ASSOCIATED function 240, NULLIFY statement 239, POINTER attribute 234 pointers 234

E

singly linked list 237-240 TARGET attribute 234 trees 241-244

E edit descriptor 138-140 Editors 13, 20 Efficiency, space time trade off 394 Elemental 401

constraints 370 functions 170 function example 369 subroutine example 371

Elements of a programming language 58 Elf 387 ELSE block 190 ELSE IF 191 ELSEWHERE block 132 END DO statement 103 END FUNCTION statement 177 END PROGRAM statement 61, 64 END SELECT statement 194 Entities 336,401 Errors when reading 164 Evaluation of arithmetic expressions 72-73 Evaluation and testing 29

Index

Exception handling 320,321 Executable construct 345 Executable statements 335 EXIT statement 198 Explicit shape dummy arrays 283 Exponent 84 Exponentiation operator 70 Extent 124 External subprograms 402

F

F edit descriptor 137-138 Feasibility study and fact finding 29 File manipulation 163 FlLE= specifier 256 Files 20, 255-262 Files in Fortran 256 Fixed fields on input 158 FMT= specifier 143, 144 FORM= specifier 258 FORMAT statement 135-154 Formatting for a line-printer 151 Fortran character set 66 Fortran standards 378 Function syntax 176-177 Functions 167-186,413-445

arguments 177 array 175,363 computational 175 elemental 170, 175, 182, 369 generic 169,356 inquiry 174 internal 182 intrinsic 174-175,413-445 pure 182, 368 recursive 178 rules and restrictions 184, supplying your own 176 transfer and conversion 174

Page 54: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

Index 451

G

transfonnational 170 user defined 176-183

Gaussian elimination 304 GCD - greater common divisor 176-178,180-181 General support enquiry functions 324 Generating a new line, on both line­printers and tenninals 153 Generic 169,356 Generic functions 169, 356 Generic procedures 368 Good programming guidelines 65 GOTO statement 345,376, 393

H

Hardware sources 330 High Perfonnance Fortran 47-48, 386 Higher dimension arrays 110 Hoare's Quick Sort algorithm 277, 301, 378 HPF 47-48, 386

I

I edit descriptor 136, 158 110 (Input/Output) 135-156, 157-166 ICON 48 IEEE 754 313-332 IEEE datatype selection 334 IF statement 189-193

ELSE block 190 ELSE IF 191

IMPLICIT NONE statement 60 Implied DO loops 148

Inner product of two sparse vectors 245 Inquiry functions 174 Integer 62-64 Integer data type and representation model 84 Integers, I fonnat 136, 158 Intent 269 INTENT attribute 283 Interface 268

blocks 268" 344 mandatory 282-283

Internal functions 182 procedure 334, 403 subroutine 284

and scope 284 Intrinsic functions and procedures 167-186, 413-445 ISO TR 15580 IEEE Arithmetic 313-332 ISO TR 15581 Enhanced Data Types 378-386

J

Java and IEEE 754 331

K

Keyword and optional arguments 340-342 Kind 81-83 Kind type parameters 82-83,414

L

LaTeX 43 LINP ACK 306, 311

Page 55: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

452 Index

Lisp 37 Local variables 178, 269, 284 Local variables and the SAVE attribute 269 Logical 221-226

expression 189 L edit descriptor 225 operators 190 variables 221-226

Logo 42

M

Main program 342, 404 Masked array assignment and the where statement 131 Memory leak 250 Mixed type output in a FORMAT state­ment 142 Modula and Modula 2 41 Modular programming 27 Modules 293-312,343

and packaging 366 and scope 339 containing procedures 302 for defining kind type

parameters 295, 309 for derived data types 297 for explicit procedures

interfaces 300 for global data 294 PUBLIC and PRlV A TE

attributes 339 usage and compilation 310 USE ONLY and rename 340

MPI 386 Multiple statements 64 Multi-user systems 21

N

Natural language 24-25 Nested user defined types 230 Nesting 404 Netlib 396 Notations 25 NULLIFY statement 239,243,345 Numeric precision 77-79 Numerical software sources 395-396

o Oberon and Oberon 2 44-45 Object oriented programming 28, 44 Obsolescent features 374 OPEN statement 143-144, 163-164, 256-259 Openmp 387 Operator and assignment overloading 364-365 Operators 70

hierarchy 223-224 Optional arguments 340-342 Ordinary differential equations 348 Output 135-156

p

Parallel programming and high perform­ance computing 388 Parameter 267,404 PARAMETER attribute 76 Pascal 38-39 PAUSE Statement 375 PUI 38 PUI and Algol 68 38 Pointer(s) 234-254

assignment 235-236 dynamic variables 236-237

Page 56: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

Index 453

POINTER attribute 234 states 236-237

Positional number systems 83 Postscript, TeX and LaTeX 43 Precision 65, 404 Precision and size of numbers 77 Pre-defined subroutines 175 Pretty print 395 PRINT statement 65, 136 PRIV ATE attribute 339 Problem definition 28 Procedure - function or subroutine 334

as argument 356 ending 343 generic 356 heading 343 interface 405 internal 343

Program development and software en­gineering 390 Program testing 394 Program units 334 Programming style 397 Prolog 43 PUBLIC and PRIVATE attributes 339 Pure constraints 369 Pure function example 368-369 Pure functions 182 PVM 386-387

R

Rank 124 READ statement 163 Reading from the terminal versus read­ing from files 158 Reading in Data 157-166 Real data type 62 Real and double precision do control variables 374

Real data type and representation model 84 Reals, E format 138 Reals, F format 137 Record 146, 228 Recursion 393, 405 Recursion and problem solving 186 Recursive functions 178 Referencing a subroutine 267 Relational expressions 405 Relational operators 190 Rename 340 REPEAT UNTIL loop 196 RETURN statement 191 REWIND 346 Rounding and truncation 73-74 Rounding directions 320 Rounding modes 325 Rounding precisions 320 Runge Kutta Merson algorithm 348-349

s SAVE attribute 269 Scalar variable 405 Scope

and association 337-338 variables 178, 269-270

Scoping unit 405 Second generation languages 38 Selecting different INTEGER kinds 81-82 Selecting different REAL kinds 82 Selection between courses of action 188 Shape of an array 124 Simple debugging techniques 394 Simula 38 Singly linked list 237 Skipping spaces and lines on input 162

Page 57: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

454 Index

Smalltalk 45 Snobol 38 Software engineering 396-397 Software testing 397 Software tools 395 Source form 56 Spaces in output 140 Specification construct 343 Specification statement 344 Specifying kind types for literal integer and real constants 82-83 SQL 43,50 Standardization 40-41 Statement 59-60, 406 Statement ordering 335-336 Stepwise refinement 29 STOP statement 346 Structured programming 40, 393 Structured programming and the goto statement 393 Subprogram 342, 406 Subroutine 263-292

actual arguments 267 arrays as parameters 274-275 assumed shape arrays 285-288 automatic arrays 355 dummy arguments 267 dummy procedure arguments 356 external 402 interface blocks 268-269, 282-283 internal 284 internal and scope 284 INTENT attribute 269,283 keyword and optional

arguments 340-342 local variables 269

SA VE attribute 269 rank two and higher arrays as

parameters 287 recursive 283-284

Substring 406 Supplying your own functions 176

Systems analysis and design 28, 31-32

T

Tables of data 99 Target 243,406 TARGET attribute 234 TeX 43,52 TOMS 395 Top-down 29 Transfer and conversion functions 174 Transformational functions 170-171 Trees 240-244 Truncation 73-74 Two classes of extended floating point formats 319 Type declaration 63-64 Type definition 228-229 Type, name and value 61

u

Underflow 320, 321 USE 294,296 USE, ONLY and Rename 340 User defined

v

component 228-229 nested 230 type definition 228-229 types 227-232 variable definition 229

Variable status 91 Variable(s) 61-62 Vector 97, 100,444

Page 58: A Glossary - Springer978-1-4471-0403-2/1.pdf · The bounds are specified with a colon, e.g. (:). defined ... The placing of one entity within another, e.g. one loop within another

w

WHERE statement 131-132 WHILE loop 196-197,200-201 Whole array manipulation 121-127 WRITE statement 143-144, 154

x X edit descriptor 140

Index 455