Fortran 90 Reference Card Page 2

ADVERTISEMENT

4.2 Arrays and Matrices
len_trim(s)
length of s, w/ trailing blanks
5.3 I/O Specifiers
(open)
scan(s, setd, from_back)
search for any char in set
allocated(a)
check if array is allocated
iostat=integer-variable
save iocode (error) to variable
verify(s, set, from_back)
check for presence of set-chars
lbound(a, dim), ubound(a,dim)
lowest/highest index in array
err=label
label to jump to on error
len(string)
length of string
shape(a)
shape (dimensions) of array
file='filename'
name of file to open
repeat(string, n)
concat n copies of string
size(array, dim)
extent of array along dim
status='old' 'new' 'replace'
status of input file
4.6 Bit Functions
(on integers)
all(mask, dim), any(mask, dim) check boolean array
'scratch' 'unknown'
count(mask, dim)
number of true elements
btest(i,pos)
test bit of integer value
access='sequential' 'direct'
access method
maxval(a,d,m), minval(a,d,m)
iand(i,j), ieor(i,j), ior(i,j) and, xor, or of bit in 2 integers
form='formatted' 'unformatted' formatted/unformatted I/O
find max/min in masked array
recl=integer
length of record
product(a, dim, mask)
product along masked dimen.
ibclr(i,pos), ibset(i, pos)
set bit of integer to 0 / 1
sum(array, dim, mask)
sum along masked dimension
ishft(i, sh), ishftc(i, sh, s) shift bits in i
blank='null' 'zero'
ignore blanks/treat them as 0
merge(tsource, fsource, mask)
combine arrays as mask says
position='asis''rewind'
position, if sequential I/O
not(i)
bit-reverse integer
'append'
pack(array, mask, vector)
packs masked array into vect.
4.7 Misc Intrinsic Subroutines
action='read' 'write'
read/write mode
unpack(vector, mask , field)
unpack vect. into masked field
date_and_time(d, t, z, v)
put current time in d,t,z,v
'readwrite'
spread(source, dim, n)
extend source array into dim.
mvbits(f, fpos, len, t, tpos)
copy bits between int vars
delim='quote' 'apostrophe'
delimiter for char constants
reshape(src,shape,pad,order)
make array of shape from src
random_number(harvest)
fill harvest randomly
'none'
cshift(a,s,d),eoshift(a,s,b,d) (circular) shift
random_seed(size, put, get)
restart/query random generator
pad='yes' 'no'
pad with blanks
transpose(matrix)
transpose a matrix
system_clock(c, cr, cm)
get processor clock info
close-specifiers: iostat, err, status='keep' 'delete'
maxloc(a,mask), minloc(a,mask) find pos. of max/min in array
inquire-specifiers: access, action, blank, delim, direct,
4.3 Computation Functions
5 Input/Output
exist, form, formatted, iostat, name, named, nextrec,
ceiling(a), floor(a)
to next higher/lower int
5.1 Format Statements
number, opened, pad, position, read, readwrite, recl,
conj(z)
complex conjugate
sequential, unformatted, write, iolength
fmt = "(F10.3, A, ES14.7)"
format string
dim(x,y)
max(x-y, 0)
backspace-, endfile-, rewind-specifiers: iostat, err
Iw Iw.m
integer form
max(a1, a2, a3..), min(a1, ..) maximum/minimum
Bw.m Ow.m Zw.m
binary, octal, hex integer form
dprod(a,b)
dp product of sp a, b
5.4 Data-Transfer Specifiers
(read, write)
Fw.d
decimal form real format
mod(a,p)
a mod p
iostat=integer-variable
save iocode (error) to variable
Ew.d
exponential form (0.12..E-11)
modulo(a,p)
modulo with sign of a/p
advance='yes' 'no'
(non-)advancing data transfer
Ew.dEe
specified exponent length
sign(a,b)
make sign of a = sign of b
err=label
label to jump to on error
ESw.d ESw.dEe
scientific form (1.2...E-10)
matmul(m1, m2)
matrix multiplication
end=label
label to jump to on end of file
ENw.d ENw.dEe
engineer. form (123.4...E-12)
dot_product(a,b)
dot product of vectors
eor=label
label for end of record
Gw.d
generalized form
more: sin, cos, tan, acos, asin, atan, atan2, sinh,
rec=integer
record number to read or write
Gw.dEe
generalized exponent form
cosh, tanh, exp, log, log10, sqrt
size=integer-variable
number of characters read
Lw
logical format (T, F)
4.4 Numeric Inquiry and Manipulation Functions
A Aw
characters format
kind(x)
kind-parameter of variable x
nX
horizontal positioning (skip)
digits(x)
significant digits in model
Tc TLc TRc
move (absolute, left, right)
bit_size(i)
number of bits for int in model
r/
vert. positioning (skip lines)
epsilon(x)
small pos. number in model
r(...)
grouping / repetition
huge(x)
largest number in model
:
format scanning control
minexponent(x)
smallest exponent in model
S SP SS
sign control
maxexponent(x)
largest exponent in model
BN BZ
blank control (blanks as zeros)
precision(x)
decimal precision for reals in
w full length, m minimum digits, d decimal places, e exponent length,
radix(x)
base of the model
n positions to skip, c positions to move, r repetitions
range(x)
dec. exponent range in model
5.2 Reading from and Writing to Files
tiny(x)
smallest positive number
call getarg(2, var)
put 2
nd
CLI-argument in var
exponent(x)
exponent part of x in model
print '(i10)', 2
print to stdout with format
fraction(x)
fractional part of x in model
print *, “Hello World”
list-directed I/O
nearest(x)
nearest machine number
write(unit, fmt, spec) list
write list to unit
rrspacing(x)
reciprocal of relative spacing
read(unit, fmt, spec) list
read list from unit
scale(x,i)
x b**i
open(unit, specifiers)
open file
set_exponent(x,i)
x b**(i-e)
close(unit, specifiers)
close file
spacing(x)
absolute spacing of model
inquire(unit, spec)
inquiry by unit
4.5 String Functions
inquire(file=filename, spec)
inquiry by filename
lge(s1,s2), lgt, lle, llt
string comparison
inquire(iolength=iol) outlist
inquiry by output item list
adjustl(s), adjustr(s)
left- or right-justify string
backspace(unit, spec)
go back one record
index(s, sub, from_back)
find substr. in string (or 0)
endfile(unit, spec)
write eof record
trim(s)
s without trailing blanks
rewind(unit, spec)
jump to beginning of file

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education
Go
Page of 2