Fortran Language Educational Consultancy SYS-ED SYSED Computer Education Techniques Programming Language Educational Consultancy SYS-ED SYSED Computer Education Techniques
Fortran Programming Language - Multi Platform

Programming Language Training Sitemap

Submit Fortran Questions Knowledge Transfer Programming Language Schedule
Definition of ServiceDelivery Medium Web-based Training Services

Fortran Programming

Maintenance and Performance

Operational Challenge Module Management Fortran - IBM Mainframe Operating System
Fortran - UNIX and Linux Operating System Exercises Best Practices and Guidelines
Copyright Acknowledgement

Operational Challenge

The Fortran language is used in the scientific and engineering communities for computational physics, chemistry, and economics. Fortran applications have been developed for specialized business applications to apply real-time simulation and predictive modeling to weather and climate, animal breeding, and plant breeding. These programs have to be updated and maintained. Performance also has to be optimized.

As a module grows larger it will need to be segmented to address the issue of unnecessary global name clashes. By exposing the internal structure, modular access to private data and procedures can be realized. Independent as to the size of the module, when the subfeatures of the module are interconnected, it will be necessary to keep the code as a single module. When there is code inside a public or private module procedure, the typical use of make or a similar tool results in the recompilation of every file which accesses the module.

This can be addressed by allowing complex expression or object to be denoted by a simple symbol. Enumerators can be created which interoperate with the corresponding C enumeration type. Pointers can extend to procedures; variables use a new PROCEDURE statement.

There is interoperability between Fortran and C intrinsic types, pointer types, derived types, scalars and arrays.

Free open source compilers are available for extending the Fortran language: 1- Implementing parallel processing on standard commodity hardware computers. 2- Coding structures for optimized use of system registers. 3- Scientific libraries which can be applied to specialized applications. 4- Efficient maintenance of code.

Module Management

The increased size of a module can be addressed by allowing a module procedure to have its interface defined in a module and its body is defined in a separate program unit - submodule. A change in a submodule cannot alter an interface in the module and will not cause the recompilation of program units that use the module. A submodule can utilize host association to entities in the module and may have entities of its own in addition to providing implementations of module procedures. There are constructs for improving application management and performance.

Coarrays provide an extension to the Fortran language for parallel programming on distributed-memory and shared-memory architectures. The program is treated as if it were replicated a fixed number of times; each replication is an image. An additional set of subscripts provides access from any image to data on another image. Compilers have been optimized to execution on an image and communication between images.

The do concurrent form of the do loop provides the capability to control data dependencies between the iterations of a do loop. This serves to optimize vectorization, loop unrolling, and multi-threading and standardize directives from different compilers. The construct is for optimizations within a single image; no image control statements for synchronization between images are permitted.

When the compiler knows that an array occupies a contiguous memory block such as for an explicit-shape, assumed-size, or allocatable array and some sections of such an array, then unnecessary operations will result from the compiler being unable to determine whether a data item always will occupy contiguous memory.

Fortran - IBM Mainframe Environment

VS Fortran can be installed and run under the IBM z/OS and z/VM mainframe operating systems. Fortran on a mainframe system provides an compiler, library, and interactive debugger. Enhancements have been made to provide optimized scalar processing for high serial program performance, vector processing, automatic parallelism, explicit parallel language support, I/O data striping for execution of sequential input/output, data-in-virtual support, and extended-precision with 64-bit integers. This has lead to improved performance with Fortran programs. Flexibility is provided in creating and managing parallel programs and the ability to package program modules independently and load modules dynamically. This serves to reduce program module complexity and simplify program maintenance.

Fortran - UNIX and Linux Operating System

There are several highly rated commercial and free open source Fortran compilers. Some have associated IDEs for development and debugging. Most Linux Fortran versions are available in Fortran77, Fortran90, and Fortran95.

Exercises: Maintenance Programming and Performance Design

Code snippets, sample programs, and exercises are used to:

  • Develop maintainable and structured Fortran modules.
  • Have Fortran interact with other programming languages.
  • Thread Fortran applications for parallel performance on multi-core systems.
  • Process input/output using Fortran I/O statements.
  • Perform matrix operations.
  • Implement efficient performance Fortran compilation techniques.
  • Code the VOLATILE attribute for interacting with non-Fortran processes.
  • Use the ASYNCHRONOUS attribute for specifying that a variable may be subject to asynchronous input/output.

Best Practices and Guidelines

Fortran 66, 77, 90, 95, 2003, and 2008 have added a number of new features to utilize new hardware, lifted restrictions, and provided programmer tools.

Additions and improvements which can be applied in coding Fortran applications include:

Long integers The processor is required to support at least one kind of integer with a range of 18 decimal digits. Typically, this will be supported with 64-bit integers and is needed to ensure portability of software designed to run on machines with very large memories.
Data statement restrictions lifted Subscripts and nested implied-do limits in a data statement can be any constant expression instead of being limited to combinations of constants, implied-do variables, and intrinsic operations.
Finding a unit when opening a file In an open statement, newunit= automatically selects a unit number that does not interfere with other unit numbers selected by the program, including preconnected files.
Unlimited format item A list of edit descriptors in parentheses may be preceded by an asterisk, which has the effect of repeating the list indefinitely, as if it were replaced by a very large integer.

Copyright Acknowledgement

SYS-ED makes no representations regarding ownership and intellectual rights associated with the software that it provides training on.