Misplaced Pages

Mortran

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "Mortran" – news · newspapers · books · scholar · JSTOR (February 2024) (Learn how and when to remove this message)

Mortran (More Fortran) is an extension of the Fortran programming language used for scientific computation. It introduces syntax changes, including the use of semicolons to end statements, in order to improve readability and flexibility. Mortran code is macro-processed into Fortran code for compilation.

Example:

<I=1,200; J=I;
    UNTIL M(J).EQ.0 <
        J=M(J);
    >
    IF I.NE.J <
        OUTPUT I,M(J+1); (' Chain',I4,' ends with ',A4);
    >
>

Note that Mortran, like many preprocessors, does not make a complete analysis of the Fortran source and, like many preprocessors, may not always make its assumptions/requirements explicit. Consider, for example, Mortran multiple assignment. From the Mortran User Guide:

 / I, A(I,K), J / = SQRT(X/2.0);

produces the following FORTRAN statements:

          I = SQRT(X/2.0)
          A(I,K) = SQRT(X/2.0)
          J = SQRT(X/2.0)

In this example, the produced Fortran implements the multiple assignment correctly only if X is not aliased to I or to A(I,K), assuming the multiple assignment semantics are left to right.

The MORTRAN2 processor is written in ANSI standard Fortran 66, with the only extension the ability to assign and compare character data stored in INTEGER variables.

The SKOL programming language, written by Charles Zahn in the mid-1970s, was implemented with MORTRAN macros. SKOL supported advanced features including his situation case statement, and ALGOL-W-like structured data records and references.

References

  1. Cook, A. James (1976). "Experience with extensible, portable Fortran extensions". ACM SIGPLAN Notices. 11 (9): 10–17. doi:10.1145/987500.987503.

External links

Stub icon

This programming-language-related article is a stub. You can help Misplaced Pages by expanding it.

Categories: