Example: IF(X-Y) 10, 20, 30Īction: may be left unchanged. Two of the labels may be the same for a two-way branch. Arithmetic IFĪ three-way branch to labelled statements depending on the value of a real or integer expression: less than zero, equal to zero, greater than zero. using an if-block or select case structure. A better solution is to change the code to return an integer argument and test the value in the calling routine after the subroutine call e.g. Status: Declared obsolescent in Fortran 90, but still standard.Īction: still standard-conforming so can be left unchanged at present. code here for to handle abnormal exitĬ *N corresponds to a RETURN statement with given integer value This provides a way, when returning from a CALL statement, to jump to some other labelled point in the calling routine, typically in the event of some error condition. Status: in DEC Fortran, always non-standard.Īction: read from standard input using * as the I/O unit, e.g. The company was subsequently taken over by HP, but the Fortran division was absorbed into Intel Fortran, whose compilers are most likely to contain appropriate compatibility features. Note: reference to DEC Fortran in what follows are to the series of compilers produced by the Digital Equipment Company for its PDP-8, PDP-11, and VAX series of computers. Some code was written for a specific platform, so standard-conformance was of less importance. Limitations in earlier forms of Fortran meant that some desirable features, such as dynamic storage allocation, could not be used without resorting to extensions. Many programmers were scientists or engineers who were more concerned with code that worked on limited computers than language niceties. Compiler-specific extensions were often used, for a variety of reasons: Unfortunately many of the recent changes come from coders who are less experienced, so are not aware that they are adding unnecessary compilations. Others were dropped because they were wholly incompatible with the principles of structured programming, for example the ASSIGN statement and assigned GO TO.Ĭhanges are sometimes appropriate because old code written in Fortran 77 or Fortran 66 does not actually conform to either official standard. Some dropped features were completely unportable, for example Hollerith constants and the storage of character strings in numerical variables was dropped when the CHARACTER data type was introduced in Fortran 77. In the few cases where a feature has been dropped it is because there is a superior replacement and the original was seriously problematic. Each successive Fortran Standard has incorporated the preceding Standard as a subset, with only a few exceptions. In theory there should be few problems because the designers of Fortran have always taken trouble to retain compatibility with older forms of the language. Where the compiler produces error messages, these notes may help in finding ways to fix the offending statements. Many Fortran programs written in the early years are of continuing value, but old source code does not always work unaltered with modern compilers.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |