
APPENDIX A FORTRAN 90 STANDARD STATEMENT KEYWORDS For a given dialect of Fortran, there is normally some sort of refer­ ence document that formally specifies the valid syntax for each variety of statement. For most categories of statements, the syntax rules dic­ tate the appearance of fixed sequences of letters, traditionally known as keywords, at specified places in the statement. In particular, most state­ ments are required to begin with a keyword made up of a sequence of letters that constitute an ordinary word in the English language. Exam­ ples of such words are DO, END, and INTEGER. Some statements begin with a pair of keywords (for example, GO TO, DOUBLE PRECISION, ELSE IF). Furthermore, the term "keyword" encompasses certain sequences of letters appearing to the left of an equal sign (=) in a parenthesized list in certain (mostly I/O) statements. Consider, for example, the following statement: READ (UNIT = 15, FMT = "(A)", lOSTAT = ios) buf Here, the initial sequence of letters READ is, of course, a keyword, but also UNIT, FMT, and 10STAT are considered to be keywords, even though FMT and 10STAT are not English words. And, there are additional situ­ ations in Fortran where a particular sequence of letters appearing in a particular context is characterized as being a keyword. In Fortran 90, the sort of sequence of letters that has traditionally been called a "keyword" has been redesignated as a statement key­ word. The modifier "statement" has been prepended to distinguish the traditional sort of keyword from the Fortran 90 "argument keyword" as described in Section 13.9. But even in a Fortran 90 context, when not preceded by the word "argument," the term "keyword" is usually taken to mean "statement keyword." Table A.1 presents a list of Fortran 90 statement keywords. The list was extracted from the syntax rules in the new standard. Of course, all FORTRAN 77 keywords are statement keywords in Fortran 90, so 449 450 A. FORTRAN 90 STANDARD STATEMENT KEYWORDS bold typeface is employed in Table A.I to highlight those statement key­ words in Fortran 90 that are not keywords in FORTRAN 77. Also, the valid contexts in which each statement keyword is permitted to appear are summarized in Table A.I, and Fortran 90 statement keyword con­ texts that are not carried over from FORTRAN 77 are indicated by bold typeface. Always bear in mind that Table A.I is based on the Fortran 90 and FORTRAN 77 standards, while popular implementations are likely to feature additional keywords and/or contexts for keywords that are not reflected in this table. From the viewpoint of a Fortran applications programmer, the dis­ tinction between a (statement) keyword and other sequences of letters that are built into the language may not be obvious. Note, however, that edit descriptors, such as A, TR, and BZ, are not considered to be key­ words. Also, operators, such as .AND. and .NOT., are not keywords, and the logical constants .TRUE. and .FALSE. are not keywords. Of course, intrinsic procedure names are not keywords, although there are a few instances where the sequence of letters in the name of an intrinsic func­ tion is the same as that of a statement keyword (for example, REAL, LEN, and SIZE). TABLE A.l Fortran 90 Standard Statement Keywords Keyword Context(s) ACCESS ACCESS= specifier in OPEN or INQUIRE statement ACTION ACTlON= specifier In OPEN or INQUIRE statement ADVANCE ADVANCE= specifier In READ or WRITE statement ALLOCATABLE Array specification ALLOCATE Dynamically allocate storage. ASSIGN Assign label (statement number) to variable. ASSIGNMENT Interface block for defined assignment PUBLIC or PRIVATE statement ONLY clause of USE statement BACKSPACE Position data file. BLANK BLANK= specifier in OPEN or INQUIRE statement BLOCK BLOCK DATA statement END BLOCK DATA statement CALL Invoke a subroutine. CASE CASE construct CHARACTER Type declaration statement CLOSE Terminate connection of a unit to an external file. COMMON Specify block of physical storage that can be accessed by separately compiled scoping units. COMPLEX Type declaration statement A. FORTRAN 90 STANDARD STATEMENT KEYWORDS 451 TABLE A.1 Continued Keyword Context(s) CONTAINS Indicates presence of internal subprograms or module subprograms CONTINUE Statement indicating no action to be performed CYCLE Curtail execution of an iteration of a DO construct. DATA DATA statement to specify initial value for variable BLOCK DATA statement END BLOCK DATA statement DEALLOCATE Release storage obtained by ALLOCATE statement. DEFAULT Case selector in a CASE construct DELIM DELlM= specifier in OPEN or INQUIRE statement DIMENSION Array specification DIRECT DIRECT= specifier in INQUIRE statement DO Indexed DO statement DO construct DOUBLE DOUBLE PRECISION specification in type declaration statement ELSE IF construct ELSEWHERE WHERE construct END IF, DO, CASE, or WHERE construct Derived-type defintion Interface block END PROGRAM, END MODULE, END SUBROUTINE, END FUNCTION, or END BLOCK DATA statement Traditional one-word END statement END= specifier in READ or WRITE statement ENDFILE Write an endfile record. ENTRY Specify entry point in subprogram. EOR EOR= specifier in READ statement EQUIVALENCE Permit two or more local names to refer to same storage area. ERR ERR= specifier in 1/0 statements EXIST EXIST= specifier in INQUIRE statement EXIT Cause termination of execution of a DO construct. EXTERNAL Identifies names of external and dummy procedures and block data program units FILE FILE= specifier in OPEN or INQUIRE statement FMT FMT= specifier in READ or WRITE statement FORM FORM= specifier in OPEN or INQUIRE statement FORMAT FORMAT statement FORMATTED FORMATTED= specifier in INQUIRE statement FUNCTION First statement of a function subprogram END FUNCTION statement GO (Unconditional) GO TO, computed GO TO, assigned GO TO statements 452 A. FORTRAN 90 STANDARD STATEMENT KEYWORDS TABLE A.1 Continued Keyword Context(s) IF IF construct, (logical) IF statement, arithmetic IF statement IMPLICIT Indicate type and kind for implicitly typed data entities whose names begin with one of the letters specified. IMPLICIT NONE statement IN INTENT specification for dummy argument INOUT INTENT specification for dummy argument INQUIRE Inquire about status and attributes of a file. INTEGER Type declaration statement INTENT Specify intended use of dummy argument. INTERFACE First statement of an interface block END INTERFACE statement INTRINSIC Identifies names of intrinsic procedures IOLENGTH IOLENGTH= specifier in INQUIRE statement 10STAT 10STAT= specifier in 1/0 statement KIND KIND= specifier in type declaration statement LEN LEN= specifier in CHARACTER type specifications LOGICAL Type declaration statement MODULE First statement of a module program unit END MODULE statement MODULE PROCEDURE statement in interface block NAME NAME= specifier in INQUIRE statement NAMED NAMED= specifier in INQUIRE statement NAMELIST Specifies names of variables to be grouped for VO NEXTREC NEXTREC= specifier in INQUIRE statement NML NML= specifier in READ or WRITE statement NONE IMPLICIT NONE statement NULLIFY Give pOinter a verifiable status of having no target. NUMBER NUMBER= specifier in INQUIRE statement ONLY USE statement OPEN Initiate or modify connection between external file and unit. OPENED OPENED= specifier in INQUIRE statement OPERATOR Interface block for defined operation PUBLIC or PRIVATE statement ONLY clause of USE statement OPTIONAL Dummy argument specification OUT INTENT specification for dummy argument PAD PAD= specifier in OPEN or INQUIRE statement PARAMETER Specify name representing a constant value. PAUSE Cease execution, but leave program in resumable state. POINTER Indicates name may refer to different storage areas at different times POSITION POSITION= specifier in OPEN or INQUIRE statement PRECISION DOUBLE PRECISION specification in type declaration statement A. FORTRAN 90 STANDARD STATEMENT KEYWORDS 4S3 TABLE A.1 Continued Keyword Context(s} PRINT Perform output to default output unit. PRIVATE Indicates names In module which are not to be accessible outside the module PROCEDURE MODULE PROCEDURE statement in interface block PROGRAM First statement in main program END PROGRAM statement PUBLIC Indicates names In module which are to be accessible outside the module READ Perform input READ=: specifier in INQUIRE statement READWRITE READWRITE= specifier in INQUIRE statement REAL Type declaration statement REC REC= specifier in READ or WRITE statement RECl RECl= specifier in OPEN or INQUIRE statement RECURSIVE FUNCTION or SUBROUTINE statement RESULT FUNCTION or ENTRY statement RETURN Complete execution of instance of a subprogram. REWIND Position a file at its intial point. SAVE Indicates local variables in a subprogram whose values and statuses are to be retained after exit from that subprogram Indicates names of common blocks whose values are to be retained after exit from subprograms specifying those named common blocks Indicates variables In a module whose values and statuses are to be retained after exit from subprograms using that module SELECT CASE construct SEQUENCE In derived-type definition to Impose a storage order for values of components of that derived type SEQUENTIAL SEQUENTIAl: specifier in INQUIRE statement SIZE SIZE: specifier In READ statement STAT STAT= specifier In ALLOCATE or DEALLOCATE statement STATUS STATUS= specifier in OPEN or CLOSE statement STOP Terminate program execution. SUBROUTINE First statement of a subroutine subprogram END SUBROUTINE statement TARGET Specifies that all or part of
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages52 Page
-
File Size-