Systems Reference Library IBM 1130/1800 Basic FORTRAN IV

Systems Reference Library IBM 1130/1800 Basic FORTRAN IV

File No. 1130/1800·25 Order No. GC26·3715·8 Systems Reference Library IBM 1130/1800 Basic FORTRAN IV Language Page of GC26-371S-8 Revised February 1974 By TNL GN34-0181 PREFACE This publication provides the programmer of an 1130 Suggested Reading or 1800 system with the specifications required to write programs in the basic FOR TRAN IV language. IBM 1130 publications: The basic FOR TRAN IV language can be used with the minimum machine configurations of the following Subroutine Library, GC26-5929 systems, with the one noted exception: Disk Monitor System, Version 2, Programmer's , and Operator's Guide, GC26-3717 • IBM 1130 Disk Monitor System, Version 2 (DM2) Disk Monitor System (Version 1), Reference Manual, GC26-3750 • IBM 1130 Disk Monitor System, Version 1 (DM1) Card/Paper Tape Programming System Operator's Guide, GC26-3629 • IBM 1130 Card/Paper Tape (C/PT) Programming System IBM 1800 Multiprogramming Executive Operating System publications: • IBM 1800 Multiprogramming Executive (MPX) Operating System Subroutine Library, GC26-3724 Operating Procedures, GC26-3725 • IBM 1800 Time-Sharing Executive (TSX) Operating Programmer's Guide, GC26-3720 System IBM 1800 Time-Sharing Executive Operating • IBM 1800 Card/Paper Tape (C/PT) Programming System with an IBM 1053 Printer, an IBM 1443 System publications: Printer, or an IBM 1816 Printer-Keyboard Subroutine Library, GC26-3723 Each of these programming systems includes a Operating Procedures, GC26-3754 FOR TRAN Compiler that converts a source program Concepts and Techniques, GC26-3703 written in the 1130/1800 basic FORTRAN IV language into an object program for use by that system. IBM 1800 Card/Paper Tape Programming System This' publication is a reference source (not a self­ publications: study text) and describes the coding form, compilation messages, error codes, and the use of constants, vari­ Subroutine Library, GC26-5880 ables, arithmetic operators, FORTRAN statements, Operator's Guide, GC26-3751 and statement numbers used in writing an 1130/1800 basic FORTRAN IV program. Ninth Edition (January 1973) This is II reprint of GC26-3715-7 incorporating changes released in the following Technical Newsletters: GN34-0085 (dated May 1972) and GN34-0111 (dated October 1972). This edition applies to Version 1, Modification 8, and to Version 2, Modification 12, of IBM 1130 Disk Monitor System; to 1130 Card/Paper Tape System containing either Version 1, Modification 2, of 1130-FO-OOl, or Version 1, Modification 3, of 1130-FO-002; to 1800 Card/Paper Tape System containing Version 1, Modification 3, of 1800-FO-007/008; to IBM 1800 Time-Sharing Executive Operating System containing Version 3, Modification 9, of 1800·0S-001; to IBM 1800 Multiprogram­ ming Executive Operating System containing Version 3, Modification 4, of 1800-0S-010; and to all subsequent modifications of the above systems until otherwise indicated in new editions or Technical Newsletters. Changes are occasionally made to the specifications herein; before using this publication in connection with the operation of IBM systems, consult the latest SRL Newsletter, Order No. GN26-1130 or GN26-1800, for the editions that are applicable and current. Requests for copies of IBM publications should be made to your IBM representative or to the IBM branch office serving your locality. A form is provided at the back of this publication for readers' comments. If the form has been removed, coments may be addressed to IBM Corporation, Systems Publications, Department 27T, P., O. Box 1328, Boca Raton, Florida 33432. Comments become the property of IBM. ©International Business Machines Corporation 1967,1968, 1969, 1970, 1971 ii CONTENTS INTRODUCTION Unformatted I/O Statements • 20 CODING FORM . 2 Indexing I/O Lists 20 How the Columns Are Used 2 Manipulative I/O Statements • • • 21 FOR TRAN Statements 2 Logical Unit Numbers • ~ 22 Statement Numbers • 2 FORMA T Statement· • • • • • • 22 Program Identification, Sequencing 2 SpeCification Statements • 29 Comments 2 Type Statements (REAL, INTEGER) • • 29 Blank Records 2 EXTERNAL Statement ••• 30 Blank Columns 2 DIMENSION Statement • •••• 30 COMMON Statement· • • • 30 CONSTANTS, VARIABLES, AND ARRAYS 3 EQUIVALENCE Statement. 32 Constants . • 3 DA TA Statement • • • • 33 Integer Constants 3 DEFINE FILE Statement 34 Real Constants . 3 Subprogram Statements • 35 Variables 4 Subprogrilm Names • • 36 Variable Names 4 Functions • • 36 Variable Types 4 SUBROUTINE Subprogram • • 39 Subscripted Variables 5 END and RETURN Statements in Subprograms 40 Arrays and Subscripts . 5 Subprograms Written in Assembler Language • 40 Arrangement of Arrays in Storage 5 Subscript Forms ' .. 6 ARITHMETIC EXPRESSIONS 7 COMPILA TION MESSAGES ••••••••••••• 42 Definition • . • . • • • 7 The Arithmetic Operation Symbols 7 Computational Modes, Integer and Real 7 APPENDIX A. SYSTEM/STATEMENT CROSS- The Mode of an Expression • . • . • 7 REFERENCE TABLE· . • • • • . • • • 45 Integer and Real Mode ExpreSSions 7 Mixed Expressions 7 8 Aritlunetic Operation Symbols • APPENDIX B. COMPARISON OF USA STANDARD Use of Parentheses 8 FOR TRAN AND IBM 1130/1800 FORTRAN Order of Operations 8 LANGUAGES • • . • . • • • . • • • • 46 STATEMENTS' .. 9 Arithmetic Statements . 9 APPENDIX C. 1130/1800 FORTRAN SOURCE Control Statements • . 9 PROGRAM CHARACTER CODES' ••••• 49 Unconditional GO TO Statement 10 Computed GO TO Statement . 10 IF Statement 10 APPENDIX D. IMPLEMENTATION RESTRICTIONS' • • • • 50 ·DO Statement 10 CONTINUE Statement 12 PAUSE Statement • 13 APPENDIX E. SOURCE PROGRAM STATEMENTS STOP Statement 13 AND SEQUENCING . • • • • • • • . • • 51 END Statement '13 CALL Statement '13 SpeCial CALL Statements • 14 APPENDIX F. ERROR CODES • • • • . • • • . • • 52 Machine and Program Indicator Tests' 15 Input/Output Statements . • 16 Non-disk I/O Statements • 17 INDEX . • . • . • • • • • • • • • • • • • • • 55 Disk I/O Statements . • • 18 iii INTRODUCTION FOR TRAN (FORmula TRANslation) is a language that able for execution under each respective program­ closely resembles the language of mathematics: It ming system. The translated program is known as is designed primarily for scientific and engineering the object program. computations. Since the language is problem­ oriented rather than machine-oriented, it provides The FORTRAN Compiler detects certain errors in scientists and engineers with a method of communi­ the source program and writes appropriate messages cation with a computer that is more familiar, easier on the typewriter or printer. At the user's option, to learn, and easier to use than the system pro­ the compiler also produces a listing of the source gramming (Assembler) language. program and storage allocations. The elements of the FORTRAN Language are con­ Exact results of the calculations should not always stants, variables, arrays, arithmetic operators, be expected because some computations are subject FORTRAN Statements and statement numbers. to "round-off" errors. The elementary rules of expression of these elements in a FORTRAN program of 1130/1800 systems are given in the chapters that follow. The 1130/1800 FORTRAN language contains all of the features defined in American Standard Basic The IBM 1130 and 1800 Programming Systems FORTRAN, X3.10-1966, with significant extensions provide a FORTRAN Compiler, a program that beyond this standard. These extensions are listed translates a FORTRAN program into a form suit- in Appendix B. Introduction 1 Page of GC26-3715-7 Revised May 1972 By TNL GN34-0085 CODING FORM The statements of a FORTRAN source program therefore, be avoided. Statement numbers on specifica­ are normally written on a standard FORTRAN cod­ tion statements and continuation lines are ignored. ing sheet (Form No. X28-7327). See Figure 1. PROGRAM IDENTIFICATION, SEQUENCING HOW THE COLUMNS ARE USED Columns 73-80 are not used by the FORTRAN Compiler and may, therefore, be used for program The 80 columns of the FORTRAN Coding Sheet identification, sequencing, or any other purpose. are used as follows: COMMENTS FORTRAN STATEMENTS Comments to explain the program may be written FORTRAN statements are written one to a line in in columns 2-72 if the character C is placed in columns 7-72. If a statement is too long for one column 1. Comment lines may appear anywhere line, it may be continued on a maximum of five except before a continuation line or after an END successive lines by placing any character other than statement. Comments are not processed by the a blank or a zero in column 6 of each continuation FORTRAN Compiler. line. In the first line of a statement, column 6 BLANK RECORDS ;;USt be either blankor zero. Blank records in a source program are ignored STATEMENT NUMBERS by the Compiler. Some FORTRAN statements are identified with BLANK COLUMNS statement numbers in columns 1-5 inclusive. A statement number must be one of the digits in Blanks may be used freely to improve the read­ ability of a FORTRAN program listing. For the range 1 to 99999 inclusive. It must be placed example, the following statements have a valid in the statement number field, but may be placed format: anywhere in that field; leading blanks or zeros, and trailing blanks are ignored by the compiler. GObTO(1, 2, 3,4), I Note: Superfluous statement numbers may de­ GObTObb(1, 2,3,4), bbI crease efficiency during compilation and should, where b represents a blank. IBM FORTRAN Coding Form t-:N()GUM-:--_____________..-- ____---lI'UNCtlINC CI<\l'HiC I I I I I ...,"'_. 0'" 1'"''''''''°"' tv"'" I I I I I su."""''''' IO(NllfIC4T10N ........ ~ FORTRAN STATEMENT UQUfNCE , J 7" 10 1I111)1'IS"" 1,19101' i' ·.··[7 :•.. kl( 1··'1 l 1 !I ! 1;1\ [11 II I I 1<lf I I···· L k lip~~ ~~ ~@ IIi ~ I um If I" .............. i .. Ii··.·.· til I > I :1 i I" .. ... :: ••• I' F i .••• 1·'·1 .. ..... I I· .. I I I ••••• I Tl III Figure 1. FORTRAN Coding Sheet 2 CONSTANTS, VARIABLES AND ARRAYS CONSTANTS REAL CONSTANTS In FORTRAN, any number which is not a state­ Any constant which contains a decimal point is ment number, appearing in a source statement, called a real constant. Real constants may contain is called a constant. For example, in the state­ up to six or up to nine significant digits depending ment J = 3 + K, the 3 is a constant.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    66 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us