Professional Documents
Culture Documents
Fortran 90 Tutorial: Michael Metcalf
Fortran 90 Tutorial: Michael Metcalf
Michael Metcalf
CN Division, CERN, CH 1211, Geneva 23, Switzerland
1 Language Elements 1
2 Expressions and Assignments 6
3 Control Statements 8
4 Program Units and Procedures 9
5 Array handling 12
6 Pointers 16
7 Specification Statements 20
8 Intrinsic Procedures 22
9 Input/Output 23
Index 25
Full details of all the items in this tutorial can be found in Fortran 90/95 Explained, by
M. Metcalf and J. Reid, (Oxford, 1996), the book upon which it has been based.
Fortran 90 contains the whole of FORTRAN 77only the new features are described in
this tutorial.
The author wishes to thank Michel Goossens (CERN/CN) for his helpful and skilful as-
sistance in preparing this tutorial.
1. Language Elements
The basic components of the Fortran language are its character set. The members are:
the letters and (which are equivalent outside a character context);
the numerals ;
the underscore and
the special characters
A@%XB>YgX%WD
indentation;
DX%lTlS@
replaced by ;
DX%l
YJXBDr5D%q 4
name added to subprogram statement; and
etc. syntax converted.
A@%XpD%qB sFZ [[ Z [ I (130.246.8.23). The direc-
tory is tI %u $ q
The source code of the program can be obtained by anonymous ftp to
and the file name is . [" G 0%ZK n
Fortran 90 Tutorial 2
Fortran has five intrinsic data types. For each there is a corresponding form of literal constant. For the three numeric intrinsic
YJXBDr%D%q
types they are:
3 64 :9: 35
Examples are:
Here, K2"
oK0aE is the kind type parameter; it can also be a default integer literal constant, like
3546 7
4
YJX%l function supplies the value of a kind type parameter:
but use of an explicit literal constant would be non-portable.
The
YJYJX%X%ll 3M
q3F
%KX2r5D"
oK0aEM
qMXr%D <35
%K2"function
and the
oK0Esupplies
the actual decimal range (so the user must make the actual mapping to bytes):
! a35%35n46 !
qD?
There are at least two real kinds the default, and one with greater precision (this replaces
lS@FWC?DTf%qDAY Y5@%X ). We might
specify
YgXBDr%D5q f%qM u DBD5q U ">= D?DA5BD%l
qMD?
YJX%l
3 :
"<>=
for at least 9 decimal digits of precision and a range of to , allowing
<3
">=
that give in turn the kind type value, the actual precision (here at least 9), and the actual range (here at least 99).
A@ u f?D
<3]U6 :
">=
This data type is built of two integer or real components:
The numeric types are based on model numbers with associated inquiry functions (whose values are independent of the values
lYFraYJB
of their arguments). These functions are important for writing portable numerical software.
Df YJ?@%X
War%D
Number of significant digits
Almost negligible compared to one (real)
u YgXDD ff@5@5XXDDXXBB
Largest number
uf%qMDAaY YF@%X
Maximum model exponent (real)
q5lY
Minimum model exponent (real)
Decimal precision (real, complex)
qXr%D
Base of the model
B>YgXe
Decimal exponent range
Smallest postive number (real)
Fortran 90 Tutorial 3
A M%qA%BD%q
The forms of literal constants for the two non-numeric data types are:
YgX%l function:
YJX%l ! AaYY !
and again the kind value is given by the
?@raY5A%?
V? D
Here, there may also be different kinds (to allow for packing into bits):
and the
YJX%l B%qWD function
operates as expected:
We can specify scalar variables corresponding to the five intrinsic types:
For derived-data types we must first define the form of the type:
BefDA Mt%q0%ZSE5A%"BD%q
q
D
? 35S^%=MJdS0 0
DX%l BefD t05Z>E5"
and then create structures of that type:
BefD t0%Z>E5"<\ho"I da0
To select components of a derived type, we use the
) qualifier:
o"I ) 5=0
and the form of a literal constant of a derived type is shown by:
(the latter an example of the syntax that allows grouping of attributes to the left of and of variables sharing those attributes
to the right), we have two arrays whose elements are in array element order (column major), but not necessarily in contiguous
storage. Elements are, for example,
j3 j#Ls>
and are scalars. The subscripts may be any scalar integer expression. Sections are
In the case of scalar characters, two old restrictions are lifted. Given
A %qMA%BD%q ; hZ0aEQI K
we can write
u @JlWBe?fD D EgKEJKZZL>LS=M=
%KoJt0 WCBqSef@JWD B>YJXD [
%K"
E5
YJXaBEDEFXL%B=J @FWE B [>
string concatenation function was shown already in part 1.
A YJXB%qMDMr%D%A%qBD%q 0<>?=DKX ` ; [E
DYJX5XlmBD%qBeVfMDA%DOEJKZL< >Y5=r%X DXaB EgKZL>=M
$ %K EE ) EgK0>Z=L>K `=M
$ %?KD X #[>[
u EJKZL>=
5KoJt0
Defined operators such as these are required for the expressions that are allowed too in structure constructors (see chapter 1):
?@raY5A% ? u
n % =\<35\ 4S
can write
DXA%D>Df%YJq?>@%XDYgXDXBr B
VV%q?M@@FA%qB>Y5@%X u @FlW?@ # EF"OL>K05=0%Z
qqDB fD AafYJXM@5Xr DXB fMAaYJXr
A%?D
3. Control Statements
The CASE construct is a replcement for the computed GOTO, but is better structured and does not require the use of statement
labels:
%A D ?DMD A%BT A%a3 D Iad 05Z && %X W u CD%q "%n KoJt0TLSK0%=0%Z
O G I0aE 0 "%2
3
Each CASE selector list may contain a list and/or range of integers, character or logical constants, whose values may not overlap
within or between selectors:
A% D 3 4 : 35 3 : 46S
A default is available:
A% DOlDV%W?B
DX%lTlS@ "ISK0%Z
where we note that loops may be named so that the EXIT and CYCLE statements may specify which loop is meant.
Many, but not all, simple loops can be replaced by array expressions and assignments, or by new intrinsic functions. For instance
SlK"%@ K L d _
DX%lTKlS"%K@ K"%K jQL>
becomes simply
W CqqSD@JW?B>YJXD "I>K0%Z
statement function:
Uo
A@%XBWSCYJqSX @JWB>YJXD
qD? o L 0%Z
o 3
DX%l DX%lWCqaW@FCWqaB>@FYJWXB>D YJ"XI>D KL05Z 05Z
& WCqS@FWB>YgXD da $ %KM"%Zo
We say that outer is the host of inner, and that inner obtains access to entities in outer by host association (e.g. to x), whereas
y is a local variable to inner. The scope of a named entity is a scoping unit, here outer less inner, and inner.
The names of program units and external procedures are global, and the names of implied-DO variables have a scope of the
statement that contains them.
Modules are used to package
$ $$$
L#>LSKMK0%Z0%ZGG G E ))h "J$2$0%
Z LS K0%))Z G "% 2M 0%E Z ii )) "%205Z
DX%l V%WX
A5L>B>KMY5@%0%XZ $$ E
IL>t5tK050%ZZ G E Itt10%Z Itt& 05V%Z WXMA%B>Y5@%X dS $ 5K"%Zo
DX%l u @FlWM?D L>K0%Z G
5ZL%K ` dM0%KL[
W D L>K05Z G
%ZL%K ` dS0%KL5[
and the simple statement
provides use association to all the modules entities. Module subprograms may, in turn, contain internal subprograms.
Fortran 90 Tutorial 10
Arguments
We may specify the intent of dummy arguments:
WCqSYJX@JWBDB>r5YJD%XqD E ` YJI>XBnDn X B0PYJ/X [%Z $ E] [%Z $ EM
YJXBDr5D%q YJXBDXB @FWB l Y 1u [D%X Z $Y5@%E X [%Z $ E [ %Z $ E && <L<" I>tKJI>tI>K K G G I I0a0aE E
Also, INOUT is possible: here the actual argument must be a variable (unlike the default case where it may be a constant).
Arguments may be optional:
WCqqSD@JW?B>YJX@%D fdSB>LY5@%X["<? / l^Y n D X Y5 @5IX tt0%Z "520%Z 05HJI L5KL0aE] L 0%HJI1 L%KL0aE]_[" G 0 EJKM%ZK
Itt05Z "%20%Z
u
Interface blocks
Any reference to an internal or module subprogram is through an interface that is explicit (that is, the compiler can see all the
details). A reference to an external (or dummy) procedure is usually implicit (the compiler assumes the details). However,
we can provide an explicit interface in this case too. It is a copy of the header, specifications and statement of the procedure
DX%l
concerned, either placed in a module or inserted directly:
& Z0%KgI>qDZJjq?TE DV%K`W? XM0iA%dSB>YJXL<Y5B@%DLFX d5XdSIaB dLGLFdF Ia Id 0T#\"% nT K ` nJ0RInJI[>1 [%KL" nJI[j L K ` 0TL>K05Z G Q\
YJXBqD%qMD V?TA%V%D WXA%BSQLY5\@%X \
q
D
? J
Y
X
B
D
X nJB I YJ[jX
DqX%DlD? X5YJlmXBD5V5qWVXA%B>A%DYF@%X nJI1[
n
n nJI[] & L G "[%KL" "%nTK ` 0 IjEF0%ZTnJI[%KML"
DX%l V%WXA5B>Y5@%X daLLFd5Id
f@aYgXBD%q and B%qSr%DB arguments (see later article), a
f@YJXBD%q function result (later) and new-style array arguments and array functions
An explicit interface is obligatory for: optional and keyword arguments,
(later). It allows full checks at compile time
between actual and dummy arguments.
Fortran 90 Tutorial 11
q
D
? $ =MDF?dDMdSA%jBD% l qD? YJX5l & $#E t0[L%nL[ JdS0On"%Z
` L%= ` t>ZM0[LaE5L"
DX%l
3F4> = JddS\
DX%l YJXBD5qVA%D
where a given set of specific names corresponding to a generic name must all be of functions or all of subroutines.
We can use existing names, e.g. SIN, and the compiler sorts out the correct association.
We have already seen the use of interface blocks for defined operators and assignment (see Part 2).
Recursion
Indirect recursion is useful for multi-dimensional integration. To calculate
G " Iada0 LSK0%=Z5K0j no o " I $ EM
we might have
qDAFW&hq Y YJpDOV5WXA%B>YF@%X L>KM0%=Z%KM0j n "I $ E
qYJXDB>D%? qMKMVL0%>=KMZA%0%D%=KMZ0i%n\KM0 nZM"Fd "I $ E3hKM" "I $ E1#4>
V%WMXqA%DB>Y5?@5X n\
D 5
X m
l 5
V
W
X %
A nB>YF @%X n
qDX%Dl? YJ XlBD5Y qu VDX A%DYF@%X #4>1 YJXBDXB YJX "<I $ E
DX%l V%WXA5B>Y5@%X L<>K0%=ZM%K0
D %
X l
DX%l
Here, we note the
qD WM?B clause and termination test.
Fortran 90 Tutorial 12
5. Array handling
Array handling is included in Fortran 90 for two main reasons:
the notational convenience it provides, bringing the code closer to the underlying mathematical form;
for the additional optimization opportunities it gives compilers (although there are plenty of opportunities for degrading
optimization too!).
At the same time, major extensions of the functionality in this area have been added.
We have already met whole arrays in Parts 1 and 2here we develop the theme.
Zero-sized arrays
lS@ L 3]
A zero-sized array is handled by Fortran 90 as a legitimate object, without special coding by the programmer. Thus, in
##L>L 3 i \ #L> T#L j 3#L\ \U L> j#L 3 L> #L>
DX%lTlS@
no special code is required for the final iteration where i = n.
We note that a zero-sized array is regarded as being defined; however, an array of shape, say, (0,2) is not conformable with one
3 > 6
of shape (0,3), whereas
Assumed-shape arrays
the corresponding dummy argument specification defines only the type and rank of the array, not its size. This information has
$
u
and this is as if da were dimensioned (11,21). However, we can specify any lower bound and the array maps accordingly. The
shape, not bounds, is passed, where the default lower bound is 1 and the default upper bound is the corresponding extent.
Automatic arrays
A partial replacement for the uses to which EQUIVALENCE is put is provided by this facility, useful for local, temporary arrays,
qD? lY uu DX YF@%X YF %D #>5 2\ %" Z% & %ZZ%o [%ZM0%K0 $ " EJK[F
2 "%Z%
Fortran 90 provides dynamic allocation of storage; it relies on a heap storage mechanism (and replaces another use of EQUIV-
Df%qSX%l@qrFDuqM@F l? WM ?lD Y u DX YF@%X ??@A%B%C?D 2"%Z%
WqDD%lui2dS"%Z%aL<
%ZZ5o
??@A5#B\D U >2M"%kZ% / ^4< U6\ BB EJK%KJI]E
l D??M@A%BD 2"%Z%
The work array can be propagated through the whole program via a USE statement in each program unit. We may specify an
lD??M@A%BD #\
explicit lower bound and allocate several entities in one statement. To free dead storage we write, for instance,
EgHZK\#S & L5E >[K Z L%jZ E5 LZM[ "nJ I$ [[%KEJLK "<+ 0 ZM 0a0FdSE#I0> KMKc a ETa%EZEFZL%=J%aoTdS"0<>sK 0[%K
In the second assignment, an intrinsic function returns an array-valued result for an array-valued argument. We can write array-
Zf%qYJXn\B # u #6> Q 3 U4 6 > QR4 U4 U4 S Z
A@5XBV%W>XYJXA5B>Y5\@%X Z
qqDD?? llYY u nDDXX #[\Y5Y5 @%@%$XX Y5 %D [\ $
nDX%l V%[ W XM$ A%uB>Y5@%X & #"%Z #E5[>"Fda 0bda "%Zn 0 IjE50%ngI nJI[%KML" "%n [ $T$
DX5lmf5qS@rFq uRKM0aEJK n
WHERE
3
N
DX%l D%qMD
Array elements
qMD? l Y u DX 5Y @5X 35 53 >
j 3]h3 . For a derived data type like
Simple case: given
we can reference a single element of as, for instance,
BefqD DKZ? L<t 0%K
q
D
?
l Y
D X F
Y %
@ X
I$ I
DX%l BefD KZMLt 0%K u #
>
6
we can declare an array of that type:
BefD KZL<t 0%K1 l Y u DX 5Y @%X < 35\ 4S MK %Z
as in
qMD? j35 3F> && t %ZK "%n "10cZM"%2
]]#L\3 h d 3 U \s>
]]##L\L\h3 6> && t2 `%Z" K c0 "%ZMn `"%"2 10R[" Iad5
]]#mL\#hm353] 3 : aU36\ U4m>h3 && Z0 G"%20%ZoRL K Z0L%GZ 0%$ Z>05E 0T0FdS"%Z0S$ Km0%Z "5nRZM"%2
]] 3] Uh43 :33 4> && G303b[%LaKM"%E Zm 0%E#I= E5 [%ZLE tSK "%KTZ05n0%Z01[0 $
Za K2M" EF0[%KL "<
Note that a vector subscript with duplicate values cannot appear on the left-hand side of an assignment as it would be ambiguous.
Thus,
m#m3] : U6\ : >T # 3]U4\h6 7 >
is illegal. Also, a section with a vector subscript must not be supplied as an actual argument to an
@FWB or YJX@FWMB dummy argu-
ment.
Arrays of arrays are not allowed:
We note that a given value in an array can be referenced both as an element and as a section:
A@FWpXB ? X IZgId 0T0%L%ZTn "5nm>Ko ZJI1G 0R I10 0R 0FdSLEi0SKK>ZJE I0L %ZZMJd5%to 0 JY V Xe U - B MDX
uu YJXp?
uuL<LFLFd5d5IaIadd GG II0T0TLL %%ZZZZ55oo
f%qSW @FlWSA%B f ZM" $ I[%Kc"%n %ZZ%o 0 0FdS0>KSE
u Id "5nm5ZZ%o 0 0JdS0>K>E
?%CS??@FWM@X%A%lBD%l ? ZZ%oT "[%KML"PEJKM%KJIjE
Array inquiry
WCS@FWMX%l
ufD%qSA r5D
Array construction
6. Pointers
Basics
Pointers are variables with the
f@aYgXBD%q attribute; they are not a distinct data type (and so no pointer arithmetic is possible):
qD? f@aYJXBD%q _G %Z
They are conceptually a descriptor listing the attributes of the objects (targets) that the pointer may point to, and the address, if
any, of a target. They have no associated storage until it is allocated or otherwise associated (by pointer assignment, see below):
??M@A%BD G % Z
and they are dereferenced automatically, so no special symbol is required. In
G %Z RG %Z 4 6
the value of the target of G %Z is used and modified. Pointers cannot be transferred via I/Othe statement
%q1YJBD \ G %Z
writes the value of the target of G %Z and not the pointer descriptor itself.
A pointer can point to other pointers, and hence to their targets, or to a static object that has the TARGET attribute:
qqDD?? fB%@aqSYJXr%DBBD%q " s0[%K
GG %Z -- " s0[%K K%Z=0%K
" s & t1"L>K05ZTaEE5L5=JadS0SK
%Z K5Z=0%K
" s
but they are strongly typed:
YJXBDr%D%q f@aYJXBD%q
G %Z - L SK
G %Z L >K
G %Z & L %0 = RKogt0aE d5IjEJKOdS5K[ `
and, similarly, for arrays the ranks as well as the type must agree.
A pointer can be a component of a derived data type:
BefqD D0>? KZo & K oJt0On"%Z E#t5Z>E50idS%KZML
G
YBJXeBfDD r%D%q IL 0 $ 0 f@aYgXBD%q
DX%l BefD #0S0SKKZZoo 0 K & 1%" K0OZ0[ISZ>E5L"
and we can define the beginning of a linked chain of such entries:
BefD Q0>KZo1 f@aYgXBD%q [ ` L
After suitable allocations and definitions, the first two entries could be addressed as
Association
A pointers association status is one of
or between a defined pointer and a defined target (which may, itself, be a pointer):
YgV @AYJBD%l /t"LSK0FZ K5Z=0%K B DX
o C AR
For intrinsic types we can sweep pointers over different sets of target data using the same code without any data movement.
Given the matrix manipulation , we can write the following code (although, in this case, the same result could be
achieved more simply by other means):
qqDD?? Bf%@aqSYJXr5DBBD%q 35 35> [j35\#35>^Z 35>hE<35\ < 35>
YJXBDMr% D%q d5I K j o\
lS @ d5YJIV K 3]U4 B DX
o d5I - K Z 3
& " $ %KidS" G 0FdS0SK
--O [
D? D -
o - E & " $ %KidS" G 0FdS0SK
DX%l YJV B- ZW?
DX%lTo lS@ u u # & ["Fdda" [ [I %KML"
For objects of derived data type we have to distinguish between pointer and normal assignment. In
BefD #0>KZo f@aYJXBD%q n L%Z>EJK [I>ZZM0>K
-
nL%Z>EgK [<I>ZZ0SK
the assignment causes first to point at current, whereas
nL%Z>EgK [<I>ZZ0SK
causes current to overwrite first and is equivalent to
Pointer arguments
If an actual argument is a pointer then, if the dummy argument is also a pointer,
If the dummy argument is not a pointer, it becomes associated with the target of the actual argument:
qD? f@YJXBD%q j
??@ A5BD #] ; \ ; >
A%?? E#I #>
WCqSqD@FW?B> YgXD E#I #[>
[j
Pointer functions
Function results may also have the
f@aYJXBD%q attribute; this is useful if the result size depends on calculations performed in the
function, as in
WqDD? $ %K
` $M 0%Z
Arrays of pointers
These do not exist as such: given
BefD Q0>KZo1 Z "%2>E1/\
then
E K
is then equivalent to the pointer assignments
E#L> ) Z - K #L> ) Z
for all components.
K5Z ) I
(as defined in chapter 5, page 15), we can use, say,
K5ZJI - K %Z ) I
to point at all the u components of tar, and subscript it as
7. Specification Statements
This part completes what we have learned so far about specification statements.
Implicit typing
The implicit typing rules of Fortran 77 still hold. However, it is good practice to explicitly type all variables, and this can be
forced by inserting the statement
Y u f?>Y5AaYJBTX@5XD
at the beginning of each prorgam unit.
PARAMETER attribute
A named constant can be specified directly by adding the
f %q u DBD%q attribute and the constant values to a type statement:
qBDef?D lY u DX Y5@%X fQ56>q fD %BqD%q u DBD%q nL0 %$T QR 3 4 S
KZL<t 0%K1 u K KZMLt 0%K U O# U U >
DATA statement
The
l B
statement can be used also for arrays and variables of derived type. It is also the only way to initialise just parts of
such objects, as well as to initialise to binary, octal or hexadecimal values:
llBefBBD KSKZ35%L<tKZ L<0%t K 0%9%K\7 K> 3] 9%O7 K#m4 h3 U4 >mg\ K4 ) I && " To "<0m["Jd5t"0<>KT"%nTK4TLL5KL L 0 $
lB 5L ZhZ%s\o\^<S3 C ! a3535a35a3 ! @ ! ::\! \! nn ! " To E50[%KML" "%n %ZZ5omL<L%KL L 0 $
Characters
There are many variations on the way character arrays may be specified. Among the shortest and longest are
AA 55qqA%A%BBD5D5qq FdSJY X50]l 7 8 J4 ? DX
S sL\ 4 > l Y u DX 5Y @5X 7 8 FdS0
Initialization expressions
The values used in
lMB f %q u DBD%q
and statements, or in specification statements with these attributes, are constant expres-
Specification expressions
It is possible to specify details of variables using any non-constant, scalar, integer expression that may also include inquiry
function references:
WCW qSD@FWB>YgXD E d h[> && [ "SKLjE `
qMqMDD?? dS " ll$ YY u DDXX Y5Y5@5@5XX W CS @JW X%l
[[
#4
>
Fortran 90 Tutorial 21
u @FlWf%q?DYJpdSBLD 0
BefqD D f%? WC?>Y5A U LaEgK
B
e
f D a
L UEJoK1 f@aYJXBD%q 0 K
DBX%elfD BefD LEJK
LaEJK KZ00
DX%l u @FlWM?D dSL10
USE statement
To gain access to entities in a module, we use the
W D statement. It has options to resolve name clashes if an imported name is
the same as a local one:
W D dSL0 "[
LaEgK - aL EJK
8. Intrinsic Procedures
We have already met most of the new intrinsic functions in previous parts of this series. Here, we deal only with their general
classification and with those that have so far been omitted.
All intrinsic procedures can be referenced using keyword arguments:
A%??clMBD
X%l
B>Y u D >B Y u D K
and many have optional arguments. They are grouped into four categories:
5C #>
q f%DqMDMAaY fD YF@%#X #> ; ;
1. elemental work on scalars or arrays, e.g. ;
2. inquiry independent of value of argument (which maybe undefined), e.g.
3.
4.
e B D Mu
A%?@A
transformational array argument with array result of different shape, e.g.
subroutines, e.g. .
Bit inquiry
C1YJB
YF%D X Iad 0%Z "%n L%K>EbL K ` i0 dS" $ 0
Bit manipulation
CMYgBDX%l B C? L%KTK0aEgKL>X%l=
AC "% =0L5Z[ L%K
Y<Y<CSCA%YJ?%B q
Y<YgCD@FqDB
L%0%KK 0 L%KK Z[%KL"
DY [ IjE5L G 0 @F@Fqq
YFY @Fq VB ?A "%=[ L Ij[E5L G 0E ` ` L%nK
XMY @%B VBA ? L%"%Z=[<LI[ % Zm["FE d5tL%n K0FdS0SK
Transfer function, as in
YgXBDr%D5q L B%qX V D%q ! [ $ ! ^> & Z0t [0aEUt5ZK "%n DFWYJp?DXA5D
Subroutines
lMp%CBDYJB
X%l
B>Y u D @A KL $ %K0T $ "%ZOKLJdS0
qMqMu X%X%lSlS@@ uM
X%WDuD%CMl D%q
q "0%tKJISLZJ0ajE Ek tjL%K>E50E I $ "%Z $ "Fd Iad 05Z>E
e BD uMuM
A%?@A
[[[[00EEEE KK"m"mE5EJo>00EJ$K0Jd [ "[F
Fortran 90 Tutorial 23
9. Input/Output
Non-advancing input/output
Normally, records of external, formatted files are positioned at their ends after a read or write operation. This can now be over-
ridden with the additional specifiers:
%Dl@FqpXA%D ! X@\! #$"tS05KnLI" Kc La E qD! e5lD !
Y55D 0"%E5ZL
0 0 "<"< oo
#"tSKL" qD5l
The next example shows how to read a record three characters at a time, and to take action if there are fewer than three left in
the record:
AYJXB%qDMr5D%A%qBD%q Q6> a0%o
qD%l /I1IL%K L5 K !h E56>L 0 ! %lMpXA%D ! X@\! FY %D 5E L 0\ D@Jq 99 US0%o
& S90%9 o LaEk"%K L "0OZ!0! ["5Z $
S 0%o\EFL 0 3
This shows how to keep the cursor positioned after a prompt:
q%qD%YJlBD ## !! Y 35 >! ! % lpXMA%D ! XM@\t>! Z LFdS! D0>
KIa05Zid 10%0Z K t>ZLFda0 Iad 0%Z !
New edit descriptors
Y edit descriptor:
C
The first three new edit descriptors are modelled on the
@ binary,
octal,
hexadecimal.
New specifiers
On the
%@ fDX and YJXFW1YqD statements there are new specifiers:
f@A%B>Y5YJBS@5XY5@%X !! q D%Y l !! !/! q%qD>YYJBJX5D l ! ! !!/qfDf%lDX55qlYJ! BD !
lfD%l?>Y u !! efD @ ! B%qS@%f MD !i!! XFWS@\@%! BD ! ! X@%XD !
and on the
YJX FWY<qD there are also
q%qD%YJlBD ! eD ! ! X@\! !/WX X@ X !
qD%l 5qYJBD
section, 14
shape, 7
significant blank, 1
special characters, 1
statements, 1
structure constructor, 3
structures, 3
subscripts, 4, 19
targets, 16
unary operator, 6
underscore, 1
upper bound, 12
USE, 21
vector multiply, 15
vector subscript, 14
WHERE, 13
zero-length strings, 5
zero-sized arrays, 12