

This is straightforward: Module onemod defines subroutineĪddone. Module onemod implicit none contains subroutine addone ( msg, n ) character ( len = :), allocatable, intent ( inout ) :: msg integer, intent ( inout ) :: n msg = msg // "1" if ( n > 1 ) then n = n - 1 end if end subroutine addone end module onemod Implementation, and ii) prevent circular dependencies betweenĬonsider module one contained in source file one.f90: Submodules are: i) separate the interface of a module from its Recently fixed important submodule-related bugs).

Only recently implemented in modern Fortran compilers (this is earlyĢ019, gfortran has had them for a long time and ifort has only Works for all Fortran standards from F77 up to the latest.įortran submodules were introduced in the 2008 Fortran standard and Includes that include modules and submodules. Packing more than one module and submodule inside the same file. Using modules, submodules, and includes with arbitrary dependenciesĪmong them, even across different subdirectories in the project Parallelization using with make’s -j or -l command-line options. With a few restrictions, this solution permits:
#Simply fortran 2008 how to#
These notes show how to write portable Makefiles for large modern

#Simply fortran 2008 mod#

Multiple modules and submodules in the same file.Handling several different file extensions.Compiling across directories and hiding.performing numerical linear algebra on digital computers.example in Fortran 77 was published in 2008 which includes a discussion of how to initialise : DOUBLE PRECISION FUNCTION ACORNJ XDUMMY C C Fortran implementation.The EXTENDED PRECISION compiler option card tells the FORTRAN compiler to use 40 bits instead of 16 - bit words, with the extra space simply ignored.Many early programming languages, including Fortran Cobol and the various IBM assembler languages, used only the first 72 specify this statement: descendants of ALGOL use for while descendants of Fortran use do There are other possibilities, for example COBOL which uses PERFORM.
#Simply fortran 2008 code#
The Fortran code below is DOALL, and can be auto - parallelized by a compiler because
