Development started around 1980 and ended on September 30, 2022. A copy of www.absoft.com has been made which includes documentation and installation executables from Version 11 (2014) to Version 22 (2022), but no license keys.
Continuing Bugs and Workarounds for Windows versions (and perhaps others)
2GB limit. The last bug to be fixed related to arrays larger than 2GB. However other bugs in operations on memory units larger than 2GB remain, even in code compiled for 64-bit execution. For instance, REPEAT (character, count) fails under these conditions.
Unexplained crashes in the MRWE run-time MDI user interface when clicking on a dialog-box button. A work-around is to insert a WIN32 API call to MessageBoxTimeoutA in the click handler routine. Use it to flash a brief message on the screen, such as “Processing”, which has the effect of preventing the crash.
Practical Alternative for Windows computers is Intel IFORT Fortran in the Visual Studio environment. This provides a similar GUI to Absoft’s.
I started Programming in FORTRAN in 1969 and still currently do so in 2024…. I bought an ABSOFT Compiler in the late 1990’s and later bought a newer Version of ABSOFT…. very good Compilers both versions…. I used to submit various questions to ABSOFT and worked directly with Peter Jacobsen on resolving them; not realizing he was one of the Founding Fathers of ABSOFT…. An example of primo Customer Support by ABSOFT…. I have used INTEL Compilers as well and could interchange Code between them with a minimum of Code changes required; I kept Coding as ‘Simple as possible’ with minimal usage of Compiler specific features…..
I’ve used the same ABSOFT Compiler with Windows XP, Windows 7, Windows 10, and Windows 11 Operating Systems; but some quirks occasionally emerge….. Some unexplainable ‘Machine Dependent Quirks’ have emerged as well which have been puzzling to resolve….
VIVA LA FORTRAN!!!!
This program shows the usage of the intrinsic DATE_AND_TIME procedure.
Examples:
fdate
2009-09-30 02:08:26-04:00
fdate %Y%M%D
20090930
program fdate
!
! "@(#) fdate(1) writes timestamp using specified syntax"
!
implicit none
! returned values from DATE_AND_TIME()
character(len=8) :: date
character(len=10) :: time
character(len=5) :: zone
integer,dimension(8) :: values
logical :: keyword ! flag that previous character was a % character
character(len=1) :: char ! character being looked at in format string
character(len=:),allocatable :: format
integer :: i
call get_cmd(format) ! get the format
if(format.eq.'')then
format='%Y-%M-%D %h:%m:%s%U'
else
format=format//' '
endif
select case(format(:2))
case('-h','-H')
call usage()
end select
keyword=.false.
call date_and_time(date=date,time=time,zone=zone,values=values)
! write string, when encounter a percent character do a substitution
do i=1,len(format)
char=format(i:i)
if(char.eq.'%'.and..not.keyword)then
keyword=.true.
cycle
endif
if(keyword)then
keyword=.false.
select case(char)
case('%'); write(*,'(a1)',advance='no')char
case('Y'); write(*,'(i4.4)',advance='no')values(1)
case('M'); write(*,'(i2.2)',advance='no')values(2)
case('D'); write(*,'(i2.2)',advance='no')values(3)
case('u'); write(*,'(i5.4)',advance='no')values(4)
case('U'); write(*,'(3a)', advance='no')zone(1:3),':',zone(4:5)
case('h'); write(*,'(i2.2)',advance='no')values(5)
case('m'); write(*,'(i2.2)',advance='no')values(6)
case('s'); write(*,'(i2.2)',advance='no')values(7)
case('x'); write(*,'(i3.3)',advance='no')values(8)
case default
write(*,'(a1)',advance='no')char
end select
else
write(*,'(a1)',advance='no')char
endif
enddo
write(*,*)
contains
subroutine get_cmd(command)
character(len=:),allocatable,intent(out) :: command
integer :: i, j
character(len=:),allocatable :: value
integer :: length
integer :: status
command=""
status=0
ERRORS: BLOCK
do i=1,command_argument_count()
call get_command_argument(i,length=length,status=status)
if(status.ne.0)exit ERRORS
value=repeat(' ',length)
call get_command_argument(i,value=value,status=status)
if(status /= 0)exit ERRORS
command=command//' '//value
enddo
if(len(command).gt.1) command=command(2:)
return
endblock ERRORS
write(*,'(*(g0,1x))')'*get_cmd* error obtaining argument ',i,'status=',status
stop
end subroutine get_cmd
subroutine usage()
!
! "@(#) usage(3f90) writes program help to stdout and exits
!
integer :: i
character(len=:),allocatable :: help_text(:)
help_text=[ character(len=128) :: &
'NAME ',&
' fdate(1) ',&
' ',&
'SYNOPSIS ',&
' fdate FORMAT ',&
' ',&
'DESCRIPTION ',&
' Read the FORMAT string and replace the following strings ',&
' %D -- day of month, 01 to 31 ',&
' %M -- month of year, 01 to 12 ',&
' %Y -- year, yyyy ',&
' %h -- hours, 01 to 12 ',&
' %m -- minutes, 00 to 59 ',&
' %s -- sec, 00 to 59 ',&
' %% -- % ',&
' %u -- minutes from UTC ',&
' %U -- -+hh:mm from UTC ',&
' %x -- milliseconds ',&
' Default: %Y-%M-%D %h:%m:%s%U ',&
' ',&
'EXAMPLES ',&
' ',&
' fdate The date is %Y/%M/%D %h:%m:%s ',&
' The date is 2009/08/10 00:33:48 ',&
' ',&
' fdate YEAR=%Y MONTH=%M DAY=%D HOUR=%h MINUTES=%m SECONDS=%s MILLISECONDS=%x',&
' YEAR=2009 MONTH=08 DAY=10 HOUR=01 MINUTES=18 SECONDS=44 MILLISECONDS=946 ',&
'']
write(*,'(a)') (trim(help_text(i)),i=1,size(help_text))
stop
end subroutine usage
end program fdate
An extensive module called M_time lets you print and manipulate dates in a variety of other formats.
Perhaps the simplest performance metric is to just measure the wallclock time taken by a program. This could literally be measured using a conventional clock or stopwatch. This is difficult to automate! So typically a command like the GNU/Linux or Unix command time(1) is used.
Commands such as time(1) often provide more than wallclock times too. But lets construct a wallclock timing tool of our own using standard Fortran (not even the ISO_C_Binding interface will be called upon) that will measure the run time of a command.
Once passed a command to time on the command line, it will then run it and report the wallclock time used by the program in the form D-HH:MM:SS.SSS and echo the command.
Next we create a simple program that calls the routine(s) of interest enough times to get useful timing information and time it.
So lets say we compiled up the timer program and compiled our test program using two different sets of compiler options:
f90 timer.f90 -o timer
f90 little_test.f90 -O0 -o little_test0
f90 little_test.f90 -O3 -o little_test3
Now to run the programs via our timing utility only takes a few commands:
./timer ./little_test0
Wallclock: 0-00:00:25.461 :command: ./little_test0
./timer ./little_test3
Wallclock: 0-00:00:10.274 :command: ./little_test3
program timer_exe
! @(#) given a command on the command line run the command and print wallclock time and echo command
use,intrinsic :: iso_fortran_env, only : int64
use, intrinsic :: iso_fortran_env, only : stderr=>ERROR_UNIT
implicit none
character(len=*),parameter :: all='(*(g0,1x))'
integer :: ier
character(len=:),allocatable :: command
integer(kind=int64) :: jtime(2)
call get_cmd(command,ier) ! get the command including an attempt to requote quoted strings
if(ier.eq.0)then
jtime(1)=millijulian()
if(command.ne.'')ier=run(command)
jtime(2)=millijulian()
write(*,all)'Wallclock:',millisec2days( jtime(2)-jtime(1) ),':command:',trim(adjustl(command))
else
write(*,all)'<ERROR>STATUS:',ier
endif
contains
function run(command)
! @(#) M_system run(3f) call execute_command_line as a function
character(len=*),intent(in) :: command
integer :: exitstat
integer :: cmdstat
integer :: run
character(len=256) :: cmdmsg
cmdmsg=' '
call execute_command_line(trim(command), wait=.true., exitstat=exitstat, cmdstat=cmdstat, cmdmsg=cmdmsg)
if(cmdstat.ne.0)then
write(stderr,*)trim(cmdmsg)
endif
run=cmdstat
end function run
function millisec2days(milliseconds) result(dhms)
! @(#) M_time millisec2days(3f) converts milliseconds to string showing days of form D-HH:MM:SS.SSS
integer(kind=int64),intent(in) :: milliseconds
integer(kind=int64) :: days, hours, minutes, secsleft, left
integer(kind=int64),parameter :: ONE_DAY=86400, ONE_HOUR=3600, ONE_MINUTE=60
character(len=:),allocatable :: dhms
character(len=40) :: scratch
secsleft=milliseconds/1000
left=mod(milliseconds,1000)
days=secsleft/ONE_DAY ! get whole number of days
secsleft=secsleft-days*ONE_DAY ! calculate remainder
hours=secsleft/ONE_HOUR ! get whole number of hours
secsleft=secsleft-hours*ONE_HOUR
minutes=secsleft/ONE_MINUTE ! get whole number of minutes
secsleft=secsleft-minutes*ONE_MINUTE
write(scratch,'(i0,"-",i2.2,":",i2.2,":",i2.2,".",i3.3)')days,hours,minutes,secsleft,left
dhms=trim(scratch)
end function millisec2days
subroutine get_cmd(command,status)
! @(#) compose a command from all the arguments passed to the program
character(len=*),parameter :: gen='(*(g0))'
character(len=:),allocatable,intent(out) :: command ! string of all arguments to create
integer,intent(out) :: status ! status (non-zero means error)
integer :: i, j
character(len=:),allocatable :: value,valueb ! hold individual arguments one at a time
character(len=255) :: errmsg
integer :: length ! length of individual arguments
command="" ! initialize returned output string
errmsg=""
status=0
ERRORS: BLOCK
do i=1,command_argument_count()
!call get_command_argument(i,length=length,status=status,errmsg=errmsg) ! get length of next argument
call get_command_argument(i,length=length,status=status) ! get length of next argument
if(status.ne.0)exit ERRORS
value=repeat(' ',length)
!call get_command_argument(i,value=value,status=status,errmsg=errmsg) ! get next argument
call get_command_argument(i,value=value,status=status) ! get next argument
if(status /= 0)exit ERRORS
if(length.gt.0)then ! SIMPLISTIC GUESS AT RE-QUOTING STRING
! assuming an operating system shell that strips the quotes from quoted strings on the command line.
! if argument contains a space and does not contain a double-quote
! assume this argument was quoted but that the shell stripped the quotes and add double quotes.
if(index(value,' ').ne.0.and.index(value,'"').eq.0)then
value='"'//value//'"'
elseif(index(value,'"').ne.0)then
! assume you double doublequotes to escape them and short enough that reallocating a lot not an issue
valueb=''
do j=1,len(value)
if(value(j:j)=='"') valueb=valueb//'"'
valueb=valueb//value(j:j)
enddo
value='"'//valueb//'"'
endif
command=command//' '//value ! append strings together
else
command=command//'""'
endif
enddo
return
endblock ERRORS
write(stderr,gen)'*get_cmd* error obtaining argument ',i,'errmsg=',trim(errmsg)
stop
end subroutine get_cmd
function millijulian()
! @(#)millijulian(3f): Converts proleptic Gregorian DAT date-time array to Julian Date in milliseconds in Zulu timezone
integer :: dat(8)
integer(kind=int64) :: a , y , m , jdn, utc, millijulian
call date_and_time(values=dat)
associate &
&(year=>dat(1),month=>dat(2),day=>dat(3),hour=>dat(5),minute=>dat(6),second=>dat(7),milli=>dat(8))
! You must first compute the number of years (Y) and months (M) since March 1st -4800 (March 1, 4801 BC)
a = (14_int64-month)/12_int64 ! A will be 1 for January or February, and 0 for other months, with integer truncation
y = year + 4800_int64 - a
m = month + 12_int64*a - 3_int64 ! M will be 0 for March and 11 for February
! All years in the BC era must be converted to astronomical years, so that 1BC is year 0, 2 BC is year "-1", etc.
! Convert to a negative number, then increment towards zero
! intentionally computing with integer truncation
jdn = day + (153_int64*m+2_int64)/5_int64 + 365_int64*y + y/4_int64 - y/100_int64 + y/400_int64 - 32045_int64
! Finding the Julian time in milliseconds given the JDN (Julian day number) and time of day
millijulian = (jdn*86400_int64 + hour*3600_int64 + minute*60_int64 + second)*1000_int64 + milli
end associate
utc=dat(4)*60*1000 ! Time difference with UTC in minutes converted to milliseconds
millijulian = millijulian + utc ! set all values to Zulu time
end function millijulian
end program timer_exe
program little_test
use,intrinsic :: iso_fortran_env, only : int8
implicit none
character(len=*),parameter :: original = "abcdxyz ZXYDCBA _!@"
integer,parameter :: how_many_times = 100000000
character(len=:),volatile,allocatable :: t
integer :: i
do i=1,how_many_times
t=upper(original)
t=lower(original)
enddo
contains
function upper(str) result(translated)
integer(kind=int8), parameter :: ascii_diff = abs(iachar('A',kind=int8) - iachar('a',kind=int8))
character(*), intent(in) :: str
integer :: i
character(len=len(str)) :: translated
translated=str
do i = 1, len(str)
select case(str(i:i))
case("a":"z")
translated(i:i) = achar(iachar(str(i:i))-ascii_diff)
end select
enddo
end function upper
function lower(str) result(translated)
integer(kind=int8), parameter :: ascii_diff = abs(iachar('A',kind=int8) - iachar('a',kind=int8))
character(*), intent(in) :: str
integer :: i
character(len=len(str)) :: translated
translated=str
do i = 1, len(str)
select case(str(i:i))
case("A":"Z")
translated(i:i) = achar(iachar(str(i:i))+ascii_diff)
end select
enddo
end function lower
end program little_test
Note that in many HPC environments programs are often run via a job scheduler like Slurm, LSF, PBS, Torque, … . In these environments there are usually account records of each job that provide resource usage statistics.
In-depth timing of entire applications is best suited to profiling tools such as the commonly available gprof(1) command and vendor-supplied tooling and utilities designed for that purpose.
However, instrumentation affects and compiler options required for profiling along with portability issues can make tools like gprof(1) inappropriate or overkill for some simple situations.
So for those times where do-it-yourself timing is the better choice you will find a few of the most useful standard Fortran intrinsics for basic macro-level timing are
It is not much of an overstatement to say these routines are implementation-dependent and often generally not a good choice for testing timing of short events.
On the other hand,
the calls can generally be left in the code to provide general run-time timing information when used judiciously, (IE. at a macro level).
If already using pre-processors it is usually very easy to make the calls only in development and debug versions and to selectively exclude them in production releases to assist optimization.
they are usually a great tool for timing throw-away development programs used to time different versions of a procedure you already have identified as being important to optimize.
they can be used port ably in testing frameworks to capture and identify large changes in performance between releases and different compilers and compiler switch affects.
Since they are intrinsics a big advantage is that they are available on virtually all platforms, unlike most higher-level profiling packages.
Note that calls to any procedures that call the underlying operating system such as timing routines (and even I/O and practically any call that queries the system) can have a major detrimental impact on optimization when placed in loops and can cause parallel threads to lock or sync while waiting on a system response (see “mutex” (mutually exclusive lock) calls, for example).
It is usually a good idea to run strace(1) where available on performance-critical codes that should be floating-point intensive to see if a lot of system calls are being made that can be eliminated. They very often cause locks and interrupts that slow performance.
The resolution (or even availability) of the procedures is totally dependent on the hardware they are running on, so take note the resolution available for timing varies widely. On some hardware (typically GPUs) there may not even be a user-callable clock procedure, in which case all that may be available is the date and time from the main code. Even that might not be on some specialized hardware!
But the timing routines are usually available and functional. It is still useful to package and wrap them in a module so they can easily be changed to suite different platforms. An example of such a wrapper is included here.
A simple example program calling the module illustrates using it to time a loop of calls.
program testit
use M_tictoc,only : timer, say_hello
!
! using a volatile variable usually keeps compilers from
! optimizing away a loop
real,volatile :: sum
!
! a more accurate measure comes from running repeated
! calls till at least a few seconds have passed.
! therefore this number would vary depending on the platform.
integer,parameter :: how_many_times=100000000
! create an instance of a timer
type(timer) :: clock
integer :: i
character(len=*),parameter :: all='(*(g0,1x))'
! some useful info for record keeping
call say_hello()
! initialize the clock
clock=timer()
print all, 'time sqrt(r) versus r**0.5'
print all, 'time calls to sqrt:'
sum=0.0
call clock%tic() ! <= start a timer
do i=1,how_many_times
sum=sum+sqrt(real(i))
enddo
print all, sum
call clock%toc() ! <= end the timer
call clock%print() ! <= print the timing information
print all, 'time calls to x**0.5:'
sum=0.0
call clock%tic()
do i=1,how_many_times
sum=sum+i**0.5
enddo
print all, sum
call clock%toc()
call clock%print()
end program testit
Expecting there to be no difference in timing? On a lot of platforms there will be a rather large one for 32-bit in particular. For example:
run date.....: 2024-09-18T21:09:12-04:00
program name.:./testit
compiled by..: GCC version 13.2.1 20240426
using options:
-mtune=generic
-march=x86-64
time sqrt(r) versus r**0.5
time calls to sqrt:
0.274877907E+12
Elapsed dat (sec) ::.405
Elapsed time (sec) ::.405112200
CPU time (sec) ::0.31200000000000000
Percentage :: 77.02
time calls to x**0.5:
0.274877907E+12
Elapsed dat (sec) ::2.586
Elapsed time (sec) ::2.585699600
CPU time (sec) ::1.7660000000000000
Percentage :: 68.30
So maybe there is a reason there is a redundant-looking procedure for square roots (Note some compilers will recognize the mathematical equivalency and call an optimal solution!).
Timing can be more complicated for parallel code; there is the issue of System time versus User time and Idle time; sometimes call counting might be useful in lieu of timing; and there are many many other aspects to optimizing code…. memory thrashing and high-water marks, excessive system calls, I/O layout and caching, context switching .,, .
But, a little module might be handy for the many simpler cases …
module M_tictoc
use,intrinsic :: iso_fortran_env, only : int32,int64,real32,dp=>real64
use,intrinsic :: iso_fortran_env, only : stdout=>OUTPUT_UNIT
implicit none
private
type timer
real(kind=dp) :: cpu_start
real(kind=dp) :: cpu_end
integer(kind=int64) :: clock_start
integer(kind=int64) :: clock_end
integer :: wall_start(8)
integer :: wall_end(8)
contains
procedure :: tic => clock_tic
procedure :: toc => clock_toc
procedure :: print => clock_print
procedure :: walltime => clock_walltime
procedure :: cputime => clock_cputime
procedure :: dattime => clock_dattime
end type
interface timer
procedure :: clock_new
end interface timer
! type for unix epoch time and julian days
integer,parameter,public :: realtime=dp
public :: timer
public :: say_hello
character(len=*),parameter :: gen='(*(g0))'
character(len=*),parameter :: all='(*(g0,1x))'
contains
! initialization constructor
type(timer) function clock_new(this)
type(timer),intent(in),optional :: this
call cpu_time(clock_new%cpu_start)
call system_clock(clock_new%clock_start)
call date_and_time(values=clock_new%wall_start)
clock_new%cpu_end= clock_new%cpu_start
clock_new%clock_end= clock_new%clock_start
clock_new%wall_end= clock_new%wall_start
end function clock_new
subroutine clock_tic(this)
class(timer) :: this
call cpu_time(this%cpu_start)
call system_clock(this%clock_start)
call date_and_time(values=this%wall_start)
this%cpu_end = this%cpu_start
this%clock_end = this%clock_start
this%wall_end = this%wall_start
end subroutine clock_tic
subroutine clock_toc(this)
class(timer) :: this
call cpu_time(this%cpu_end)
call system_clock(this%clock_end)
call date_and_time(values=this%wall_end)
end subroutine clock_toc
subroutine clock_print(this,string,lun)
class(timer),intent(in) :: this
character(len=*),intent(in),optional :: string
integer(kind=int32),intent(in),optional :: lun
integer(kind=int32) :: lun_
real(kind=dp) :: elapsed_time
real(kind=realtime) :: elapsed_date_and_time
real(kind=dp) :: cpu_time
character(len=105) :: biggest
integer(kind=int64) :: count_rate
if(present(lun))then
lun_=lun
else
lun_=stdout
endif
elapsed_time = this%walltime()
elapsed_date_and_time = this%dattime()
cpu_time = this%cputime()
if(present(string)) write( lun_,gen ) string
if(elapsed_date_and_time >= 0)then
write( lun_,'(a,f0.3)') 'Elapsed dat (sec) ::',elapsed_date_and_time
else
write( lun_,'(a)') 'Elapsed dat (sec) :: N/A'
endif
! try to make a reasonable format for the number of digits of precision
call system_clock(count_rate=count_rate) ! Find the time rate
write(biggest,'("(a,f0.",i0,")")')ceiling(log10(real(count_rate,kind=dp)))
write( lun_,biggest) 'Elapsed time (sec) ::',elapsed_time
write( lun_,gen) 'CPU time (sec) ::',cpu_time
write( lun_,'(a,1x,f0.2)') 'Percentage ::',(cpu_time/elapsed_time)*100
end subroutine clock_print
function clock_walltime(this) result(elapsed_time)
class(timer) :: this
integer(kind=int64) :: count_rate
real(kind=dp) :: elapsed_time
real(kind=dp) :: cpu_time
call system_clock(count_rate=count_rate)
elapsed_time = real(this%clock_end-this%clock_start,kind=dp)/real(count_rate,kind=dp)
end function clock_walltime
function clock_cputime(this) result(cpu_time)
class(timer) :: this
real(kind=dp) :: cpu_time
cpu_time = real(this%cpu_end-this%cpu_start,kind=dp)
end function clock_cputime
function clock_dattime(this) result(cpu_time)
class(timer) :: this
real(kind=dp) :: cpu_time
real(kind=realtime) :: endit,startit
integer :: ierr
call date_to_julian(this%wall_end,endit,ierr)
call date_to_julian(this%wall_start,startit,ierr)
if(ierr == 0)then
cpu_time = real((endit-startit)*86400,kind=dp)
else
cpu_time = -huge(cpu_time)
endif
end function clock_dattime
subroutine date_to_julian(dat,julian,ierr)
! @(#)M_time::date_to_julian(3f): Converts proleptic Gregorian DAT date-time array to Julian Date
! REFERENCE: From Wikipedia, the free encyclopedia 2015-12-19
! correction for time zone should or should not be included?
integer,intent(in) :: dat(8)! array like returned by DATE_AND_TIME(3f)
real(kind=realtime),intent(out) :: julian
integer,intent(out) :: ierr ! 0 =successful, -1=bad year, -4=bad date 29 Feb, non leap-year, -6 negative value -9 bad input
integer :: a , y , m , jdn
integer :: utc
utc=dat(4)*60
julian = -huge(99999) ! this is the date if an error occurs and IERR is < 0
if(any(dat == -huge(dat)))then
ierr=-9
return
endif
associate&
&(year=>dat(1),month=>dat(2),day=>dat(3),utc=>utc,hour=>dat(5),minute=>dat(6),second=>dat(7)-utc+dat(8)/1000.0d0)
if ( year==0 .or. year<-4713 ) then
ierr = -1
else
ierr=0
! You must compute first the number of years (Y) and months (M) since March 1st -4800 (March 1, 4801 BC)
a = (14-month)/12 ! A will be 1 for January or February, and 0 for other months, with integer truncation
y = year + 4800 - a
m = month + 12*a - 3 ! M will be 0 for March and 11 for February
! All years in the BC era must be converted to astronomical years, so that 1BC is year 0, 2 BC is year "-1", etc.
! Convert to a negative number, then increment towards zero
! Staring from a Gregorian calendar date
jdn = day + (153*m+2)/5 + 365*y + y/4 - y/100 + y/400 - 32045 ! with integer truncation
! Finding the Julian Calendar date given the JDN (Julian day number) and time of day
julian = jdn + (hour-12)/24.0_realtime + (minute)/1440.0_realtime + second/86400.0_realtime
ierr=merge(-6,ierr, julian<0.0_realtime ) ! Julian Day must be non-negative
endif
end associate
end subroutine date_to_julian
subroutine say_hello()
use, intrinsic :: iso_fortran_env, only : compiler_version
use, intrinsic :: iso_fortran_env, only : compiler_options
character(len=*),parameter :: all='(*(g0,1x))'
character(len=*),parameter :: chs='(*(g0))'
character(len=2) :: ch, split
integer :: argument_length, istat, posix, dos, i
character(len=:),allocatable :: progname, options
call get_command_argument(number=0,length=argument_length)
if(allocated(progname))deallocate(progname)
allocate(character(len=argument_length) :: progname)
call get_command_argument (0, progname, status=istat)
print all, 'run date.....:',iso_8601()
if (istat == 0) then
print all, "program name.:" // trim (progname)
else
print all, "Could not get the program name " // trim (progname)
endif
print all, 'compiled by..:', compiler_version()
options=' '//compiler_options()
if(options /= '')then
print all, 'using options:'
! guess which one
posix=0
dos=0
do i=2,len(options)
ch=options(i-1:i)
select case(ch)
case(' -'); posix=posix+1
case(' /'); dos=dos+1
end select
enddo
split=merge(' -',' /',posix > 0)
do i=2,len(options)
ch=options(i-1:i)
if(ch == split)then
write(*,chs,advance='no')char(10),ch
else
write(*,chs,advance='no')ch(2:2)
endif
enddo
print all
endif
print all
end subroutine say_hello
function iso_8601()
! return date using ISO 8601 format at a resolution of seconds
character(len=8) :: dt
character(len=10) :: tm
character(len=5) :: zone
character(len=25) :: iso_8601
call date_and_time(dt, tm, zone)
ISO_8601 = dt(1:4)//'-'//dt(5:6)//'-'//dt(7:8) &
& //'T'// &
& tm(1:2)//':'//tm(3:4)//':'//tm(5:6) &
& //zone(1:3)//':'//zone(4:5)
end function iso_8601
end module M_tictoc
benchmark.f- A benchmarking library for Fortran code
ftime - Basic Fortran 2003 timing routines for Fortran programs
M_stopwatch - Fortran OOP clocks that may be interrupted and resumed, named, and gathered into groups. This is a descendent of the original StopWatch package that is accessible as an fpm(1) package.
StopWatch - StopWatch is a NIST Fortran 90 module for measuring execution time of program segments. It is designed to be a portable, easy-to-use means of measuring execution time. It supports the wall clock, CPU clock, a breakdown of the CPU clock into user and system times, and returns all times in seconds. It provides a simple means of determining which clocks are available, and the precision of those clocks. It is written in a style that allows it to be used with the subset languages Elf90 and F, as well as full Fortran 90 and Fortran 95 compilers.
timer - To just measure the wallclock time a command uses without instrumenting it one can use tools like the GNU/Linux time(1) command or the Linux /proc/$PID/stat file. timer is the most basic of this class of tool. Given a command it runs it and reports how long it took.
MPI_Wtime - The MPI library comes with a set of timing procedures for timing parallel code
Beliavsky Lists - A very extensive list of Fortran code on github that can be searched for “timing”, “time”, … . Several large packages contain timing subpackages you can find here.
gprof - For large codes it can be a major task just to find where the code is spending time. Profiling tools like gprof(1) are indispensible tools for tackling large project and may job be one compiler switch away from being in your hands.
Some of the most powerful profiling tools are supplied by vendors. Check your compiler-specific documentation or think about browsing for commercial optimization tools and assistance for the big jobs. A discussion on Fortran Discourse lists a good number of them.
The Fortran Wiki is an open venue for discussing all aspects of the Fortran programming language and scientific computing. See the mission statement for more details.
You can edit this website using the Edit Page link at the bottom of each page. Feel free to use the Sandbox to experiment. The HowTo contains more information on getting started. For questions, see Fortran Wiki discussion.
General programming methods and concepts: Data structures, Object-oriented programming, Design Patterns, Generic programming, Parallelization, recursion, control constructs, Style, Error handling.
More-specific tasks: String tokenization, Timing, Stream Input Output, Generating C Interfaces, Scratch Files,
Interoperability with other languages: C, C++, C#, Julia, Lua, Matlab, Perl, Python, R, and Tcl.
El Fortran Wiki es un lugar abierto para discutir todos los aspectos del lenguaje de programación Fortran y la computación científica. Vea la declaración de la misión para más detalles.
Puede editar este sitio web utilizando el enlace Editar página en la parte inferior de cada página. Siéntase libre de usar el Sandbox para experimentar. El HowTo contiene más información sobre cómo empezar. Para preguntas, vea Fortran Wiki discusión.
Noticias - noticias y actualizaciones sobre el wiki y la Comunidad Fortran. HowTo - cómo puede contribuir al Fortran Wiki Código - cargar y descargar el código Fortran Preguntas más frecuentes sobre Fortran
This page is named “Cpp interoperability” instead of “C++ interoperability” due to restrictions on special characters in page names.
Chasm generates Fortran-C++ interfacing code.
flibcpp uses SWIG-Fortran to expose useful functionality from the C++ standard library to Fortran 2003 application developers.
FortWrap generates code to call Fortran from C++.
f2cpp converts Fortran 77 code to C++, by Victor Liu
ObjexxFCL is a C++ library that supports integration of C++ and Fortran, providing Fortran-compatible array and string support.
Shroud generates Fortran and Python wrappers for C and C++ libraries.
SWIG-Fortran generates Fortran wrappers to C and C++ libraries.
This page is named “CSharp Interoperability” instead of “C# Interoperability” due to restrictions on special characters in page names.
C# is able to call Fortran DLLs using P/Invoke.
See How to Call Fortran DLLs from C# or CSharpFortran for full examples with source code.
The following example shows how to call an Intel Fortran 12.1 DLL using a C# console application. The DLL function also features a simple call back function so that the C# application can display the progress of the Fortran method to the user. The example was adapted from xTechNotes. See also Calling FORTRAN function or subroutine in DLL from C# code
First, create a Dynamic-link Library project in Intel Fortran. The DoWork function passes a 2-D array of known size. The contents of the array are modified in the method.
Make sure to add a post-build event to copy the DLL to the C# application directory:
copy $(ProjectDir)\Debug\$(TargetName).dll $(SolutionDir)\CSharpClient\bin\Debug
Code of the module:
module FortranCallBack
implicit none
contains
subroutine DoWork(n, A, progressCallBack)
!DEC$ ATTRIBUTES DLLEXPORT :: DoWork
!DEC$ ATTRIBUTES ALIAS: 'DoWork' :: DoWork
!DEC$ ATTRIBUTES REFERENCE :: n, A, progressCallBack
external progressCallBack
integer, intent(in) :: n
real(8), dimension(n, n), intent(inout) :: A
integer :: i
do i = 1, n
write (*,*) "Fortran says: ", i
call progressCallBack(i)
A(i, i) = i**2
end do
return
end subroutine
end module
Next, make a C# console application named CSharpClient. Copy and pasted the code into the Program class.
A common mistake is failing pass the parameters to the DLL by reference (ref). Failing to do so will usually cause memory access violations.
Also make sure that you get the name of the Fortran DLL method correct. In the Fortran code we used the ALIAS attribute to override any Fortran compiler name mangling. You can verify the name of the DLL method using the DUMPBIN utility included with Visual Studio. To use DUMPBIN, open the Visual Studio Command Prompt and type DUMPBIN /EXPORTS [filename.dll].
You can step into the Fortran DLL while debugging. In the C# project properties page, go to Debug and select Enable unmanaged code debugging.
Strings can be passed from C# to Fortran using character arrays (char[]
). When converting C# strings to character arrays make sure that any unused characters are initialized to blanks.
using System;
using System.Runtime.InteropServices;
namespace CSharpClient
{
class Program
{
// Delegate type.
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void ActionRefInt(ref int progress); // Important the int is passed by ref (else we could use built-in Action<T> instead of delegate).
// Delegate variable.
public ActionRefInt callbackHandler;
public Program()
{
callbackHandler = new ActionRefInt(OnUpdateProgress);
}
static void Main(string[] args)
{
Program myProg = new Program();
int n = 10;
var A = new double[n, n];
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
A[i, j] = 0.0;
}
}
DoWork(ref n, A, myProg.callbackHandler);
for (int i = 0; i < n; i++) Console.WriteLine("A(" + (i + 1) + ", " + (i + 1) + ") = " + A[i, i]);
}
public void OnUpdateProgress(ref int progress)
{
Console.WriteLine("C# says: " + progress);
}
// Fortran DLL interface.
[DllImport("FortranCallBack.dll", EntryPoint = "DoWork", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
public static extern void DoWork(ref int n, [In, Out] double[,] A, [MarshalAs(UnmanagedType.FunctionPtr)] ActionRefInt callBack);
}
}
u == 1.4D0
produce the expected result?GFortran, G95, Open Watcom, and Silverfrost are free Fortran compilers, while Absoft, IBM, Intel, Lahey, NAG, Pathscale, PGI, and Oracle produce commercial Fortran compilers. Polyhedron Software provides compiler comparisons at https://polyhedron.com/?page_id=175. See Compilers for more information.
See the Books page.
Standard capitalization is now the preferred way to write Fortran for several reasons, most notably because that is how recent versions of the standard write it. Another reason is due to an effort to standardize the capitalization of the names of programming languages. To quote Walt Brainerd (originally from the 1997-01-03 version of Keith Bierman’s Fortran FAQ):
The rule: if you say the letters, it is all caps (APL); if you pronounce it as a word, it is not (Cobol, Fortran, Ada).
Some choose to write FORTRAN when referring to older versions of the language (prior to Fortran 90) to distinguish them from newer versions.
To build a static library libfoo.a
containing all modules and procedures in the .f90
files in the current directory on Linux:
% gfortran -c *.f90
% ar cr libfoo.a *.o
The first command builds the object files and the second archives the object files into a static archive.
To build a shared library libfoo.so
:
% gfortran -shared *.f90 -o libfoo.so -fPIC
In both cases, other compiler flags such as -O2
can be used.
u == 1.4D0
produce the expected result?This has to do with the representation of real values as (binary) floating point values.
See Floating point arithmetic.
A common Fortran 95 idiom for reading lines until the end of file is
integer :: stat
character(len=100) :: buf
open(15, file='foo.txt')
do
read(fh, iostat=stat) buf
if (stat /= 0) exit
! process buf
end do
close(15)
This example catches all conditions, not just the end of file. To specifically catch the EOF in Fortran 2003 one can use the iso_fortran_env module and replace the if
condition above with
if (stat == iostat_end) exit
See also: EOF idiom? on comp.lang.fortran.
There isn’t a portable way to do this either in Fortran or C, in short, because the terminal controls when the input is sent to your program and by default it is buffered. You must request that the terminal send each key and the method for doing so is platform-dependent.
Clive Page’s Fortran Resources has a section on “Reading single keystrokes from Fortran” which provides a couple of short C functions (sys_keyin.c) which can be called from Fortran to achieve the desired behavior on most Unix systems.
John Urban also provides a getkey function, written in C and callable from Fortran.
See also: Get Key Function? on comp.lang.fortran.
See Real precision.
There is no intrinsic procedure for converting character strings to numerical values, or vice-versa. However, this can be accomplished using internal file IO. To obtain a string representation of a numeric variable, one can perform a formatted write to a string, just as one does to a file. Similarly, a formatted read from a string can extract a numeric value. See the strnum program for an example.
open(7, form='unformatted', status='scratch')
This will create a temporary file that only lives until it is closed. It doesn’t need a filename as it will not be permanently saved to disk (although it could be stored somewhere as a temporary file). In this example, the unit number is 7.
The file will be deleted when the program terminates (but may not be deleted if the program terminates abnormally, i.e. crashes). Note that it is not permitted to prevent deletion of a scratch file by closing the file using a close statement with status='keep'
.
For more details, see scratch files.
Yes, in Fortran 2003. Declare the variable and allocate with a given length as follows:
character(LEN=:), allocatable :: str
integer :: n
n = 27
allocate(character(LEN=n) :: str)
You will be well rewarded by reading Character-handling in Fortran
A Fortran 95 solution is the iso_varying_string module, or the variable length string module in FLIBS.
Although there are no official file extensions for Fortran code, there are two widely established conventions. Some use .f
for fixed-form source and .f90
for Free form layout. The latter is a reference to the Fortran 90 standard, when Free form layout was introduced. The code contained in the file can be Fortran 95, Fortran 2003, etc. Others prefer to use file extensions that indicate the standard under which the code was written. For example, .f03
for Fortran 2003 code and .f08
for Fortran 2008 code. Unfortunately, this results in a proliferation of file extensions and some compilers may not support the newer extensions yet.
See File extensions for more discussion on these issues.
Fortran does not require short-circuiting compound conditional expressions. New short-circuiting expressions are expected to be supported in Fortran 202x; but how do you produce an equivalent in Fortran in general?
See short-circuiting.
Q: How do I create numbered file names such as out_1.txt, out_2.txt, etc.?
A: Use an “internal write” to create the file names, which is when you write into CHARACTER variables instead of files. for example
character(len=4096) :: file_name
write (file_name,"('out_',i0,'.txt')") i
The string prefix and suffix may be variables as well:
write (file_name,"(a,i0,a)") 'out_',i,'.txt'
A format descriptor such as “I0.4” could be used instead of “I0” to add leading zeros to the numeric labels up to the specified number of digits.
An extended example that generates sequentially numbered files and then deletes them is at sequential_filenames.
For a related function see File_Name_Generator.
A variable declaration can only initialize a variable, not assign a value on each procedure call. This and other issues are described in init.
By Gisela Engeln-Müllges and Frank Uhlig (2013)
Springer
This comprehensive handbook gives an informal introduction to mathematical and computational principles governing numerical analysis, as well as practical guidelines for using over 130 elaborate numerical analysis routines. It develops detailed formulas for both standard and rarely found algorithms, including many variants for linear and non-linear equation solvers, one- and two-dimensional splines of various kinds, numerical quadrature and cubature formulas of all known stable orders, and stable IVP and BVP solvers, even for stiff systems of differential equations. The descriptions of the algorithms are very detailed and focus on their implementation, giving sensible decision criteria to choose among the algorithms and describing the merits and demerits of each one. “Numerical Algorithms with Fortran” is a depository of highly useful and effective algorithms and codes for the scientist and engineer who needs to have direct access to such algorithms. The programs have been widely field tested. The enclosed CD-ROM contains all computer codes, both for Fortran 77 and compatible with Fortran 90, a compiler, and a test bed of programs and data for most algorithms. Each program includes detailed comments and describes available options, all clearly marked, with a complete list of error codes, etc.
This page is for linking to available Fortran libraries and source code repositories. See Software repositories for collections of libraries and see Library distribution for methods for packaging and distributing Fortran libraries. Modern Fortran Libraries and Awesome Fortran are other lists of libraries.
Libraries linked here are classified as follows:
When available, the above tags should link to the license page for a particular library.
Fortran Standard Library - Utilities (containers, strings, files, OS/environment integration, unit testing & assertions, logging, …) Algorithms (searching and sorting, merging, …) Mathematics (linear algebra, sparse matrices, special functions, fast Fourier transform, random numbers, statistics, ordinary differential equations, numerical integration, optimization, …)(OS: MIT)
BeFoR64 - Base64 encoding/decoding library for FoRtran poor men, is a pure Fortran (KISS) library for base64 encoding/decoding for modern (2003+) Fortran projects. (OS: GPL)
coretran - easy-to-follow library to make Fortran easier in general with wrapped interfaces, sorting routines, kD-Trees, and other algorithms to handle scientific data and concepts.
erloff - make error-handling in Fortran a bit more flexible (OS: MIT)
fdict - native Fortran 90 dictionary with hash tables for retaining any data-type in a Python-like dictionary. (OS: MPL-2)
ferror - library to assist with error handling in Fortran projects.
ffhash generic and fast hash table similar to khash in C, by Jannis Teunissen.
FGSL - Fortran interface to the GNU Scientific Library. (OS: GPL)
FIAT - Fortran Implementation of Abstract Types
flib - standard library, function library, a tridiagonal matrix solver, and code for a doubly linked list, optimization, and interpolation. (OS: GPL-3.0 License)
FLIBS - collection of Fortran modules by Arjen Markus and Michael Baudin. (OS: BSD)
flink - Flexible Fortran Modules and Subroutines for Scientific Computing. (OS: GPL-3.0 License)
Focal - modern Fortran module library which wraps calls to the OpenCL runtime API with a higher abstraction level appropriate to the Fortran language. (OS: MIT)
forpy - use Python in Fortran and vice versa. (OS:LGPL)
FortranCL - Fortran interface for OpenCL, allows to execute code on GPUs and accelerators directly from Fortran. (OS: LGPL)
FortCUDA - Fortran interface to the CUDA GPU library. Contains a Python pre-processor to parse the CUDA C headers and creates ISO_C_BINDING interfaces for the method calls. Comes with a fairly complex example. (OS: GPL)
Fortran exceptions library - provides exception handling for Fortran 2003 and later, based on the methodology of Poppe et al. 2012 (OS: MIT)
fortranlib - Collection of personal scientific routines in Fortran. (OS: BSD-2-Clause License)
Fortran-Library - Code for geometry transformations, nonlinear optimization, Fourier transforms, clustering, statistics, mathematics, linear algebra, strings, and chemistry. (OS: GPL-3.0 License)
fortran_notes - containers and advanced data structures, hash functions, and design patterns (OS: MIT)
Fortran Template Library (FTL) - generic containers, versatile algorithms, easy string manipulation, and more. (OS: GPL-3)
Fortran Template Library (FTL) - Object oriented implementation of generic containers similar to the C++ STL (Standard Template Library) in native Fortran 2003. (OS: LGPL-3)
fortran-utils - Various utilities for Fortran programs, including types, constants, sorting, saving/loading 2D arrays, meshes, cubic splines, saving/loading PPM images, Lapack interface, HDF5 interface, special functions, and optimization, by Ondrej Certik et al.
ForUtils - Fortran 2008 utility functions and reusable classes
FTObjectLibrary - provides a collection of reference counted Fortran 2003 classes to facilitate writing generic object oriented Fortran programs (OS: MIT)
functional-fortran - library for functional programming in modern Fortran. (OS: BSD)
fycollections - generic collection templates for Fortran
IMSL - most comprehensive mathematics and statistics library available. (C)
JAMS - collection of general Fortran modules offering miscellaneous functions in the categories Computational, Date and Time, Input / Output, Math / Numerics, Screening, Sensitivity Analysis and Optimising / Fitting, and Miscellaneous. Written by Matthias Cuntz, Juliane Mai and Stephan Thober. (OS: MIT)
jsonff - Fortran library for dealing with JSON data (OS: MIT)
json-fortran - Fortran 2003/2008 JSON API. (OS: BSD)
kdtree2 - kd-tree implementation in C++ (and Fortran) by Matthew B. Kennel
libGPF - General Purpose Fortran Collection. Updated at GitHub.(OS: MIT)
NAG - world’s largest collection of robust, documented, tested and maintained numerical algorithms for users of the Fortran programming language. (C)
NEC Numeric Library Collection - collection of mathematical libraries that powerfully supports the development of numerical simulation programs in a wide range of fields. The libraries are available on Vector Engine. (C)
NPY-for-Fortran allows the developer to save Fortran arrays in Numpy’s .npy format. (OS:MIT)
parff - (almost) functional style parser combinator library for Fortran (OS: MIT)
PENF - Fortran (standard 2003) module useful to achieve portable codes. The module makes available portable kind-parameters and some useful procedures to deal with them. (OS: GPL)
petaca - collection of modern Fortran modules that provide broadly useful capabilities – things that the author has found himself using repeatedly across many projects. A unifying feature of the modules is their object-oriented interfaces and implementation. (OS:MIT)
qContainers - container library for Fortran language. It enables to store any internal Fortran data type and any derived data type to the container. It implements containers for key/value pairs: tree table and hash table, and containers for objects: list and vector. (OS: BSD)
Processor - F95 compliant general purpose library version 1.8.6 with HTML documentation. Covers string/array manipulations, stacks, hashes, noise, interpolation, smoothing, physical constants, and dates. Includes wrapper modules for several OS/compiler combinations for specific system access functions.(OS: LGPL)
S-EXPTRAN - Fortran library for reading and writing S-expressions. (OS: MIT)
VectorClass Fortran 2003 dynamic memory array that functions similarly (but not identically) to the C++ Vector class, by Tyler Chang. (OS: MIT)
Fortran Character String Utilities - library of string manipulation routines by George Benthien
fortran_pcre - Fortran wrapper around the C PCRE regular expression library. (OS:MIT)
regex-fortran is a Fortran-based basic RegEx package
M_matchis a Fortran-based basic RegEx package
fortran-unix contains a RE interface
M_regex builds on the Wiki example to call Posix RE procedures
GTKcontains a RE interface
regexp provides a RE interface
iso_varying_string - implementation of the ISO standard for varying strings (OS: MIT)
M_strings - modules for processing strings. Routines for parsing, tokenizing, changing case, substituting new strings for substrings, locating strings with simple wildcard expressions, removing tabs and line terminators and other string manipulations are included. (OS)
strff - library of convenient string functions (OS: MIT)
fortran-regex is a full regex module implemented in modern Fortran, with no external dependencies. (OS: MIT)
afnl - Fortran 90 numerical library with modules for numerical types, constants, error handling, integration, optimization, linear algebra, sorting and search, special functions, statistics, polynomials, root-finding, Fourier transforms, and dates and times, by Alberto Ramos (OS: GPL-2.0 License)
ARPREC - C++/Fortran 90 library for arbitrary precision math. Includes a complete interactive high-precision arithmetic computing interpreter (“toolkit”) written in Fortran, that will integrate symbolic expressions etc. (OS: BSD)
CERNLIB - collection of FORTRAN 77 libraries and modules maintained by CERN. (OS: GPL)
datapac - Fortran 77 statistical library written by James Filliben (at NIST) (PD)
DATAPLOT - powerful and flexible program for performing scientific, engineering, statistical, mathematical, and graphical analysis. At GitHub
Emmix Fits a mixture model of multivariate normal or t-distributions to a user supplied data set via the EM algorithm. With gfortran, must be compiled with -std=legacy option.
faiNumber-Fortran - A fast, flexible, and secure numerical library for Fortran with fast number parsing as one of its features. (OS: MIT)
FMLIB - David M. Smith’s libraries for multiple precision computation. The package performs multiple-precision real, complex, and integer arithmetic, providing the intrinsic Fortran numerical functions, as well as many special functions. An existing Fortran program can be checked by converting it from double precision to FM arithmetic. (NC)
forSISL - Modern Fortran interfaces to the SINTEF Spline Library (SISL)
fundamental_constants - Fortran modules with the CODATA fundamental physical constants, generated by a Python script.
FURY - Fortran Units (environment) for Reliable phYsical math, by Stefano Zaghi
GMP Fortran library - Fortran binding for GNU Multiple Precision Arithmetic library.
HSL Mathematical Software Library - free for academic use.
lookup_table_fortran A module for linear lookup tables. Supports multiple columns and various ways to read values from the table.
MP - Fortran multiple-precision arithmetic package by Richard Brent.
MPFUN2020 - thread-safe arbitrary precision package by David H. Bailey
MPFUN90 (broken link) - a pure Fortran 90 library for arbitrary precision math. Includes a complete interactive high-precision arithmetic computing interpreter (“toolkit”) written in Fortran, that will integrate symbolic expressions etc. (OS: BSD)
Muesli - A free numerical and graphical Fortran 95 library written by Edouard Canot at Univ of Rennes (?)
National Wind Technology Center Subroutine Library - A library of general-use Fortran 2003 routines used in many NWTC computer-aided engineering tools (OS: GPL)
NumDiff - A modern Fortran numerical differentiation library by Jacob Williams (OS: BSD).
NumericalHUB - Set of modern Fortran numerical libraries covering: zeroes of Systems of Equations, Lagrange Interpolation, Finite Differences, Cauchy Problems, Boundary Value Problems, and Initial Boundary Value Problems, associated with book How to learn Applied Mathematics through modern FORTRAN
Numerical methods in Fortran - solving linear, nonlinear equations, integral, ordinary differential equations, … using numerical methods in Fortran, by Carlos Planelles Alemany
Numerical methods in Fortran - numerical analysis and statistics algorithms, by Murat Koptur.
Numerical Methods for Scientists and Engineers, code in Fortran 77 and C from book by H. M. Antia (OS: GPL-2.0 License)
Numerical Methods of Statistics, Fortran 95 code from book by John Monahan.
SLATEC - Common Mathematical Library: a comprehensive software library containing over 1400 general purpose mathematical and statistical routines written in Fortran 77. (PD)
SLATEC - Fortran 90 version by John Burkardt. (?)
SLICOT - The Control and Systems Library (GPL)
starpac, Standards Time Series and Regressions Package in Fortran 77(PD), translated to Fortran 90 here.
stspac, A Fortran 77 statistical library written by Charlie Reeves (at NIST) (PD)
TOMS - code from the journal Transactions on Mathematical Software. Many programs were translated to Fortran 90 by Alan Miller and John Burkardt
physunits - Automated Computation and Consistency Checking of Physical Dimensions and Units in Scientific Programs, by Grant Petty
quaff - A library for making math with units a lot easier and more convenient (OS: MIT)
SciFortran - A library of fortran modules and routines for scientific calculations (in a way just like scipy for python). (OS: LGPL-3.0 License)
Simfit - package for simulation, statistical analysis, curve fitting and graph plotting, using models from a compiled library or from ASCII text files supplied by the user. Source code for over two hundred NAG library subroutines called by the Academic version of the Simfit package is available.
Tensor Toolbox for Modern Fortran (ttb)(OS: MIT License)
Freely Available Software for Linear Algebra (September 2018)
arpack-ng is a collection of Fortran77 subroutines designed to solve large scale eigenvalue problems.
BLAP95 (broken link) - a Fortran 95 interface to the Level 3 BLAS routines and key LAPACK computational and driver routines. (?)
BLAS: Basic Linear Algebra Subprograms that provide standard building blocks for performing basic vector and matrix operations (PD). Also OpenBLAS
DBCSR - Distributed Block Compressed Sparse Row matrix library (OS: GPL-2.0 License)
ELPA - Eigenvalue Solvers for Petaflop Applications (OS: LGPL-3.0)
LAPACK is the standard package for numerical linear algebra. (OS: BSD)
LIBXSMM - library for specialized dense and sparse matrix operations as well as for deep learning primitives such as small convolutions.
linalg - linear algebra library that provides a user-friendly interface to several BLAS and LAPACK routines. (OS:GPL-3.0 License)
Fortran_Davidson - Modern Fortran implementation of the Davidson diagonalization algorithms. (OS:Apache-2.0 License)
fortran_lsp - Fortran routines from “Solving Least Squares Problems” by C. Lawson and R. Hanson, with improved interfaces.
JADAMILU - computes eigenvectors of large sparse symmetric matrices. Provided as a precompiled library
MUMPS - parallel sparse direct solver
NTPoly - massively parallel library for computing the functions of sparse matrices.(OS: MIT License)
PROPACK - set of functions for computing the singular value decomposition of large and sparse or structured matrices. GitHub
PSBLAS3 - Parallel Sparse Basic Linear Algebra Subroutines (OS: BSD)
qrupdate - library for fast updates of QR and Cholesky decompositions.
qr_mumps - package for the solution of sparse, linear systems on multicore computers
Sparskit - basic tool-kit for sparse matrix computations (Version 2)
UMFPACK Fortran interface - mUMFPACK module provides a Fortran-2003 implementation of the full UMFPACK interface closely corresponding to that defined in the UMFPACK User Guide.
Alan Miller’s Fortran Software for subset selection in regression, random number generation, logistic regression, linear least squares, and other topics.
apstat, a collection of subroutines (AS1 - AS319) published in the journal Applied Statistics 1968-1994. Most are Fortran. Personal favourites include AS319 and AS164. Many have been translated to Fortran 90 by John Burkardt and Alan Miller
BMSL mathematical and statistical libraries, geared toward environmental / hydrological applications, by Ben Renard.
Climate time series analysis by Manfred Mudelsee.
CONFINT - sample size calculation for confidence intervals
datapac, A Fortran 77 statistical library written by James Filliben (at NIST) (PD)
Fast Statistical Methods, by Rybicki and Press.
Fortran Programs for Global Optimization, etc programs for econometric analysis such as Non-linear Least Squares, Robust Regression, Robust Two-Stage Least Squares, Ordinal Canonical Correlation, Ordinal Principal Component Analysis, Hybridization of canonical correlation and principal component analysis, fitting origin-displaced logarithmic spiral to data, solving the nearest correlation matrix problem, completing the correlation matrix, construction of composite indices by linear aggregation, etc. some of which are based on global optimization.
Least squares approximations in Fortran 90 by J-P Moreau. Also statistical programs in Fortran
MCMC f90 library - do Markov chain Monte Carlo simulation from a posterior distribution of unknown model parameters defined by a likelihood function and prior
MISCLIB, a library of statistical and support routines, written by Barry Brown (M.D.Anderson Cancer Institute) - open source
Modified Burg Algorithms in Multivariate Subset Autoregressive Modeling by A. Alexandre Trindade
MultiNest - Bayesian inference tool which calculates the evidence and explores the parameter space which may contain multiple posterior modes and pronounced (curving) degeneracies in moderately high dimensions, by Farhan Feroz and Mike Hobson
Multiple stream Mersenne Twister pseudorandom number generator (OS: BSD)
Multitaper Spectrum Estimation Library by Germán A. Prieto.
Multivariate Data Analysis Software in Fortran (and C) by Fionn Murtagh
Nonsmooth Clustering by Napsu Karmitsa. Also codes for regression and imputation
Oak Leaf - robust statistical estimates by Filip Hroch
ParaMonte - Plain Powerful Parallel Monte Carlo and MCMC Library for Python, MATLAB, Fortran, C++, C (OS: MIT License)
Random by Richard Brent. ranut is a uniform pseudo-random number generator which uses recurrences based on primitive trinomials, or in some cases trinomials which have large primitive factors (over the field GF(2)). rannw is a Fortran 77 pseudo-random number generator which uses a variant of Chris Wallace’s method to generate normally distributed (i.e. Gaussian) numbers.
RANDLIB - routines for nonuniform random number generation
rng_fortran, Fast pseudorandom number generator based on Xoroshiro128+. Supports OpenMP.
SLICE, efficient N-Dimensional Monte Carlo inversion algorithm.
STATPACK - Fortran 95/2003 library for solving the most commonly occurring mathematical and statistical problems in the processing of (huge) climate model outputs and datasets, and more generally in data analysis
stspac, A Fortran 77 statistical library written by Charlie Reeves (at NIST) (PD)
SEQBIN - Bayesian/Frequentist Designs for Sequential/Group-Sequential Trials of a Single Binomial Parameter
STPLAN - performs power, sample size, and related calculations needed to plan frequentist studies
TIMSAC package for analysis, prediction and control of time series
Applied Statistics algorithm 298 Hybrid minimization routine using simulated annealing and a user-supplied local minimizer.
Applied Statistics algorithm 319 Variable metric unconstrained function minimization without derivatives.
cobyla.f90 Mike Powell’s routine for minimization of non-linear functions with smooth non-linear constraints, using local linear approximations to the constraints.
conmin.zip The classic CONMIN package for constrained minimization updated to Fortran 90.
CUTEst - Constrained and Unconstrained Testing Environment with safe threads for optimization software
DualSimplex Fortran 90 module for solving linear programs of the form max c^T x s.t. A x <= b where, c is a cost vector and A x <= b is a system of linear inequality constraints, by Tyler Chang.
FilterSD - Fortran 77 subroutines for solving nonlinear programming problems and linearly constrained problems in continuous optimization
GALAHAD is a library of modern Fortran modules for nonlinear optimization. (OS: lgpl-3.0)
global.f90 At Arnold Neumaier’s site, this is recommended as the most successful of the global optimization packages.
libga - genetic algorithm optimisation library by Alberto Ramos
lm.zip Levenberg-Marquardt algorithm for non-linear least squares (unconstrained). This is a translation of the MINPACK routines, LMDER & LMDIF.
minim.f90 The Nelder-Mead simplex algorithm for unconstrained minimization. It does NOT require or use derivatives.
MINPACK contains routines for solving nonlinear equations and nonlinear least squares problems. (OS: BSD)
minuit - Fortran 77 library for function minimization and error Analysis by F. James (OS: GPL-2.0)
NLopt - NLopt is a free/open-source library for nonlinear optimization, providing a common interface for a number of different free optimization routines available online as well as original implementations of various other algorithms. By Steven G. Johnson (OS: GNU LGPL)
NonSmooth Optimization (NSO) Software by Napsu Karmitsa and coworkers
Optimization codes by Andrei Neculai THREECG: A simple three-term conjugate gradient algorithm which satisfies both the descent and the conjugacy conditions. DESCON: Conjugate Gradient Algorithm with guaranteed descent and conjugacy conditions for large-scale Unconstrained Optimization. ASCALCG: Accelerated Scaled Conjugate Gradient Algorithms for Unconstrained Optimization. AHYBRIDM: Accelerated Hybrid Conjugate Gradient Algorithm with Modified Secant Condition for Unconstrained Optimization. CONMIN: Shanno Conjugate Gradient with Beale restart memoryless variable metric algorithm for Unconstrained Optimization. ASA: Anticipative Scalar Approximation of Hessian for Unconstrained Optimization. RELAXED: Relaxed Gradient Descent Method with Backtracking for Unconstrained Optimization. UNO Fortran subroutines library for unconstrained optimization using searching methods.SPENBAR Sparse PENalty BARrier package for solving general nonlinear programming problems with equality and inequality constraints and simple bounds on variables. All the constrained are penalized. Minimization of the penalty function is given by TN package of S. Nash. FIBO Fibonacci method for function minimization. MAXFUN Powell direct search method for function maximization. ZERO Simple algorithms for computing zeros of a nonlinear function of a variable in a given interval.
PCx - interior-point predictor-corrector linear programming package
pikaia - Modern Fortran Edition of the Pikaia Genetic Algorithm by Jacob Williams
Software by M. J. D. Powell and Powell’s Derivative-Free Optimization solvers (PDFO) by Zaikun Zhang
PowellOpt is a collection of derivative-free optimization algorithms by M.J.D. Powell.
qnstop suite of serial and parallel Fortran 95/2003 codes for deterministic global optimization and stochastic optimization by Layne Watson.
RALFit - non-linear least squares solver that is primarily developed by the Numerical Analysis group at STFC Rutherford Appleton Laboratory.
Roots of a real function in Fortran 90 by J-P Moreau
simulated-annealing - Simulated Annealing with Modern Fortran by Jacob Williams
tapenade - tool for automatic differentiation (forward/reverse) of Fortran and C programs
TENSOLVE contains both TOMS 739 (UNCMIN) for unconstrained minimization, and TOMS 768 (TENSOLVE) for the solution of sets of non-linear equations.
TOMS algorithm 778 solves bound-constrained optimization problems by using the compact formula of the limited memory BFGS updates.
TOMS algorithm 813 is for local minimization, with or without convex constraints. It requires the user to supply first derivatives. This version is in standard Fortran. It uses the so-called spectral projected gradient (SPG) method.
tn.zip Stephen Nash’s truncated-Newton code for the minimization of continuous functions. It can use differences instead of derivatives, and bounds may be imposed on the parameters.
tron.zip Newton’s method for large bound-constrained optimization problems by Chih-Jen Lin & Jorge More’, a MINPACK-2 project.
uobyqa.f90 Mike Powell’s package for unconstrained minimization when derivatives are not available.
VTDIRECT95: Fortran 95 implementation of D. R. Jones’ deterministic global optimization algorithm called DIRECT, which is widely used in many multidisciplinary design optimization problems
autofit is a Fortran code for fitting permutationally invariant polynomials (PIPs). (OS: Apache-2.0 License)
FortLearner - linear regression, logistic regression, stochastic gradient descent, decision trees, ensemble trees, boosting trees, and dimension reduction.
gpf - small Fortran library for Gaussian process regression. It currently implements value predictions with dense Gaussian processes, and projected-process approximate Gaussian processes. (OS: Apache-2.0 License)
neural-fortran is a parallel neural net microframework. (OS: MIT)
NN_MOD - Fortran 2008 Module/Class for training neural network regressors
accis - Fortran plotting and graphics library
cairo-fortran: Fortran bindings for libcairo. (GPL v3)
DISLIN - high-level scientific data plotting library. (NC)
EGGX/ProCALL - X11 graphics library for C and FORTRAN created to achieve extreme simplicity. Uses only (OS: GPL)
gtk-fortran - cross-platform library to build Graphical User Interfaces (GUI). It is a GTK / Fortran 2003 binding based on the ISO_C_BINDING module. (OS: GPL)
GNUFOR2 - Fortran 90 interface to Gnuplot which helps to plot graphs, surfaces, histograms and images. (?)
GnuplotFortran - Fortran Interface to Gnuplot. (OS: LGPL)
F03GL - Fortran 2003 bindings for OpenGL, GLU and GLUT (?)
F90GL - Fortran 90 bindings for OpenGL and the GL Utility Toolkit (GLUT) (PD)
ForColormap - A colormap fpm library independent of any graphical toolkit.
fortran-sdl2 - Fortran interface to Simple DirectMedia Layer 2.0 (SDL 2.0). It uses the ISO_C_BINDING module. (OS: ISC)
fortran-xlib - interface to (a subset) of Xlib. (OS: ISC)
g2 - easy to use, portable and powerful 2D graphics library. Currently supported devices: PostScript, X11, PNG and JPEG (using gd) and Win32 (xfig in development). g2 is written in C (ANSI) and has a Fortran interface. (OS: LGPL)
g95gl - alternate Fortran 95 (interop) bindings for OpenGL and the GL Utility Toolkit (GLUT)
giza - scientific plotting library for C/Fortran, meant as a replacement for pgplot, by Daniel Price
Graph2D - cross-platform scientific plotting library, backward compatible with the Tektronix “Plot 10” and “Advanced Graphing II” API. Usable in interactive and/or batch mode. (OS: LGPL V3.0)
grapheps - port of a very compact Postscript library
GrWin - Windows graphics library for FORTRAN and C.
libvogle - basic vector-based graphics library in C, but Fortran-callable
Lib_VTK_IO - pure Fortran library to write and read data conforming the VTK standard. This library is not a porting or a wrapper of the VTK code, but it is only an exporter/importer of VTK data format written in pure Fortran language (standard Fortran 2003). (OS: GPL)
MathGL - library for making high-quality scientific graphics under Linux and Windows via Qt, FLTK or OpenGL. (OS: GPL)
ogpf - object-based Fortran 2003/2008 code for 2D, 3D plotting and animation, implements an interface to gnuplot. On GitHub: ogpf (PD)
plotterf90 - graphics subroutine library producing Postscript written by Masao Kodama. (?)
pltFor - Fortran-Python interface library to plot figures directly in Fortran, by DamienMinenna
Pyplot-Fortran - simple module for generating plots from Fortran using Python’s matplotlib.pyplot.
text_viz - Text-mode 2D-Graphics for Fortran. (?)
Fortran and Matlab Codes for differential equations - from Ernst Hairer
FOODIE - Fortran Object-Oriented Differential-equations Integration Environment.
ODEPACK is a systematized collection of ODE solvers. (PD)
PETSc The Portable, Extensible Toolkit for Scientific Computation (PETSc, pronounced PET-see; the S is silent), is a suite of data structures and routines developed by Argonne National Laboratory for the scalable (parallel) solution of scientific applications modeled by partial differential equations.
PoisFFT - Free parallel fast Poisson solver.
numerical-anal boundary value problems and heat transfer.
Differential equations in Fortran by J-P Moreau
dop853 - Modern Fortran Edition of Hairer’s DOP853 ODE Solver, by Jacob Williams
ddeabm - Modern Fortran implementation of the DDEABM Adams-Bashforth algorithm, by Jacob Williams
INTEGRAL - routines for the integration of functions of various types and for integration of systems of ordinary differential equations (ODEs)
Quadrule - sets up a variety of quadrature rules, used to approximate the integral of a function over various domains in 1D, by John Burkardt. He has many other quadrature codes linked there
quadrature-fortran - Adaptive Gaussian Quadrature with Modern Fortran, by Jacob Williams
stroud - routines from the book Gaussian quadrature formulas by Stroud & Secrest (1966), translated to modern Fortran by Ivan Pribec
Fortran-parallel-sort Fortran library to perform parallel sorts using OpenMP, by Corentin Cadiou (OS: CC0-1.0 License)
hs-sort sorting routines in Fortran 77 by Houlsby & Sloan, with a modern Fortran wrappers by Ivan Pribec
ORDERPACK - library with routines for unconditional, unique, and partial ranking, sorting, and permutation. (?)
DelaunaySparse serial and parallel codes, written in FORTRAN 2003 with OpenMP 4.5, for performing interpolation in medium to high dimensions via a sparse subset of the Delaunay triangulation.
bspline-fortran - multidimensional B-spline interpolation of data on a regular grid, by Jacob Williams.
finterp - multidimensional linear interpolation with modern Fortran, by Jacob Williams.
WenOOF - WENO interpolation Object Oriented Fortran library
NIST Digital Library of Mathematical Functions has a software index for special functions
Special functions in Fortran 90 and Bessel programs in Fortran 90 by J-P Moreau
Special_Functions translated code from book “Computation of Special Functions” by Shanjie Zhang and Jian-Ming Jin to Fortran 90 by John Burkardt. Links to other codes for special functions are provided.
FFTPack provide an easily usable package of functions using FFTPack library (Fortran 77).
fftpack51 computes the Fast Fourier Transform, using double precision arithmetic, translated to Fortran 90 by John Burkardt
fortran-csv-module - read and write CSV Files using Modern Fortran.
csvio-f90, the CSVIO F90 module, is a Fortran 90 module for easily reading and writing CSV files. (OS: BSD)
WKML is based on FoX, and writes KML (Keyhole Markup Language). (OS: BSD)
xml (?)
xml-fortran (OS: BSD)
fortranposix - An implementation of some POSIX functions in Fortran 90/95. (OS: LGPL)
fortyxima/filesys - Modern Fortran wrappers around the file system interface of libc as part of the Fortyxima library: rename and remove files, recursively create and remove directories, obtain filenames in a directory, check whether a given file exists and if a directory or a symbolic link, obtain the current working directory and change to a directory, create hard links and symbolic links, resolve the target of symbolic links, canonize path names. Fortyxima/filesys replaces the old modfilesys library. (OS: BSD)
Posix90 - The Fortran 90 Posix interface project. (OS: GPLv2+)
This page is for selected links to source code for or descriptions of applications written in Fortran. These might be examples of contemporary “real-world” programs, or educational older codes. There are thousands of currently active examples across the sciences.
See Software repositories for collections of libraries and see Library distribution for methods for packaging and distributing Fortran libraries.
http://www.dmoz.org/Computers/Programming/Languages/Fortran/Source_Code/
http://gcc.gnu.org/wiki/GfortranApps Code that works with gfortran
http://g95.org/g95_status.shtml Code that works with g95
http://www.easterbrook.ca/steve/?p=1558 discusses why a lot of climate models are written in Fortran.
This is 830k LOC
http://www.metoffice.gov.uk/science/creating/daysahead/nwp/um.html
http://www.nemo-ocean.eu NEMO (Nucleus for European Modelling of the Ocean)
http://www.nemo-ocean.eu/content/download/250/1629/file/coding_rules_OPA9.pdf Their Fortran 95 Coding Rules.
http://www.giss.nasa.gov/tools/modelE/ The most recent GISS model.
http://ftp.giss.nasa.gov/pub/modelE/modelE1.tar.gz Source code.
http://igcmg.ipsl.jussieu.fr/Doc/IPSLCM4 IPSL Climate model documentation.
http://tddft.org/programs/octopus The Octopus code.
http://www.cfs.dl.ac.uk/gamess-uk/index.shtml GAMESS UK home page.
http://www.msg.chem.iastate.edu/gamess/ GAMESS US home page.
https://www.cp2k.org/ CP2K is a Fortran2003 program to perform simulations of solid state, liquid, molecular and biological systems.
OFF an Open source Finite volumes Fluid dynamics code.
GENEUS is an open-source Fortran 2008 program for simulating superconductor/ferromagnet nanostructures. It is based on the Usadel quantum diffusion equation, and supports nonequilibrium calculations, self-consistent calculations, and uses convergence acceleration algorithms to remain fast for tricky problems.
http://aa.usno.navy.mil/software/novas/novas_f/novasf_intro.phpNaval Observatory Vector Astrometry Software. Used to prepare the U.S. parts of The Astronomical Almanac.
http://www.rickadams.org/adventure/e_downloads.html Adventure.
Several versions of Zork were ported to Fortran:
http://mirror.ifarchive.org/if-archive/games/source/dungeon-2.5.6.tar.gz
And of course, Star Trek:
http://startrek-f95.sourceforge.net/
ForSudoku - A Fortran sudoku generator and solver.
PL/M Compiler. Fortran IV code that does compile using gfortran. PL/M is the language that CP/M was written in (see http://www.cpm.z80.de/source.html for more details).
“The VCU nuclear reactor simulator, Richmond Pile 3, is a classroom and research tool that emulates a large commercial pressurized water reactor (PWR).” It uses gtk-fortran.
Alam, Shahid (2014). Is Fortran Still Relevant? Comparing Fortran with Java and C++ International Journal of Software Engineering & Applications (IJSEA), Vol.5, No.3, May 2014.
Chin, L. S., D. J. Worth and C. Greenough (2006). Thoughts on using the Features of Fortran 95. Software Engineering Group Notes no. SEG-N-003.
Cohen, M. (1999). Object orientation and Fortran 2002: part II. ACM SIGPLAN Fortran Forum 18, 14–21.
Decyk, V. K., C. D. Norton, and B. K. Szymanski. (1997). Expressing Object-Oriented Concepts in Fortran 90. ACM SIGPLAN Fortran Forum 16, 13–18.
Diaz, Javier, Marco Pinna, Andrei V. Zvelindovsky, and Ignacio Pagonabarraga (2021). Parallel Hybrid Simulations of Block Copolymer Nanocomposites using Coarray Fortran. Macromolecular Theory and Simulations.
Erwig, Martin, et al. Parametric Fortran (3 papers)
Gray, M. G. and R. M. Roberts (1997). Object-based programming in Fortran 90. Computers in Physics 11, 355–361.
Haveraaen, M., et al. (2015) High-Performance Design Patterns for Modern Fortran Scientific Programming
Johnson, Seth R., Andrey Prokopenko, and Katherine J. Evans (2020). Automated Fortran–C++ Bindings for Large-Scale Scientific Applications Computing in Science & Engineering Sept.-Oct. 2020, pp. 84-94, vol. 22.
Kedward, L. et al. (2022) The State of Fortran Computing in Science & Engineering, doi: 10.1109/MCSE.2022.3159862.
Magnin, V., Alves, J., Arnoud, A., Markus, A., and Esposito Marzino, M., “Fortran… et puis quoi encore ?”, Bulletin 1024, no. 22, pp.143–161, November 2023, DOI:10.48556/SIF.1024.22.143, licence CC BY-NC-ND 4.0, also available in English: “Fortran… ok, and what’s next?” (hal-04448657 and arXiv:2402.07520).
Markus, A. (2001). Generic programming in Fortran 90. ACM SIGPLAN Fortran Forum 20(3), 20-23.
Markus, A. (2006). Design patterns and Fortran 90/95. ACM SIGPLAN Fortran Forum, 25(1), 13-29.
McCalpin, J. D. (1996). A Case Study of Some Issues in the Optimization of Fortran 90 Array Notation Scientific Programming.
McCormack, D. (2005). Generic programming in Fortran with Forpedo. ACM SIGPLAN Fortran Forum 24(2), 18-29.
McGavin, P. and R. Young (2001). A generic list implementation. ACM SIGPLAN Fortran Forum 20(1), 16-20.
Morris, K. (2015) Emulating Multiple Inheritance in Fortran 2003/2008 Scientific Programming.
Nanthaamornphong, A., and A. Leatongkam (2019) Extended ForUML for Automatic Generation of UML Sequence Diagrams from Object-Oriented Fortran Scientific Programming.
Ott, Jordan, et al. (2020). A Fortran-Keras Deep Learning Bridge for Scientific Computing Scientific Programming.
Padua, D. (2000). The Fortran I Compiler Computing in Science $ Engineering.
Poppe, K., R. Cools, and B. Vandewoestyne (2012). Error handling in Fortran 2003. Fortran Forum 31(2), 7-19. Updated article here
Pietzer, A., et al. (2008). Exposing Fortran Derived Types to C and Other Languages IEEE Explore.
Reid, J. (2003). The future of Fortran. Computing in Science & Engineering 5, 59–67.
Schonfelder, J.L. (2003) Variable Precision Arithmetic: A Fortran 95 Module Scientific Programming.
Singleterry, Robert C. (2018) Single Thread to Fortran Coarray Transition Process for the Control Algorithm in the Space Radiation Code HZETRN NASA-TP-2018-219811.
Sharma, A., and I. Moulitsas (2017) MPI to Coarray Fortran: Experiences with a CFD Solver for Unstructured Meshes Scientific Programming.
Shterenlikht, A. and L. Cebamanos (2018). Cellular automata beyond 100k cores: MPI vs Fortran coarrays Proceedings of the 25th European MPI Users’ Group Meeting.
Vanderbauwhede, Wim (2022). Making legacy Fortran code type safe through automated program transformation. The Journal of Supercomputing volume 78, pages 2988–3028.
Worth, D. J. (2008). State of the art in object oriented programming with fortran. Technical Report RAL-TR-2008-002.
Yue, S., and J. Gray (2014). SPOT: A DSL for Extending Fortran Programs with Metaprogramming Scientific Programming.
Dauptain, Antoine (2021). Screening the coding style of Large Fortran HPC Codes
Ehlert, Sebastian (2022). Using objects across language boundaries: Exploring the limits of language interoperability and consistent API design
Stulajter, Miko M., Ronald M. Caplan, and Jon A. Linker (2021). Can Fortran’s ‘do concurrent’ replace directives for accelerated computing?
Discovering and Enjoying Fortran(2023) by Simon Rowe
Why You Should Consider Using Fortran As A Data Scientist: An exploration of the benefits that Fortran can bring to Data Science and Machine Learning(2023) by Egor Howell
Why Fortran is a scientific powerhouse(2023), The Myths of Fortran(2022), and Why Fortran is Easy to Learn(2022) by Michael Wirth
Is Fortran “a dead language”? Some C++ folk seem to think so…(2022) by Jim Cownie
I enjoyed modern Fortran(2022) by Radek Gruchalski
Fast, Cheap, and Turbulent—Global Ocean Modeling With GPU Acceleration in Python(2021) by Dion Häfner, Roman Nuterman, and Markus Jochum. Discussed here
Computer Language Benchmarks Game - Which programming language is fastest?
On the Performance of GPU accelerated q-LSKUM based meshfree solvers in Fortran, C++, Python, and Julia(2021) by Nischay Ram Mamidi et al.
raytracer(2021) - raytracer benchmark in dozens of languages, by edin
Assessment of Programming Languages for Computational Numerical Dynamics(2021) by Arturo Burgos. Compares Fortran, Julia, Matlab, and Python
What Julia can and can’t replace about Fortran(2021), by Joshua Laughner
Testing Julia: Fast as Fortran, Beautiful as Python(2021) by Martin D. Maas. Code here. Also Why is Fortran still used?, Will Julia replace Fortran for high-performance computing?
What is the superiority of Fortran over alternative languages like Chapel or Julia?(2021) - discussion at Fortran Discourse
NetworkDynamics.jl – Composing and simulating complex networks in Julia(2021) by Michael Lindner et al. Discussed here. Network Dynamics Benchmarks comparing Fortran, Julia and Python here
This old programming language is suddenly getting more popular again(2021) by Liam Tung, ZDNet
Resurrecting Fortran(2021) by Ondrej Certik
Performance comparison R, Julia, Fortran for Bayesian binary probit(2021) by Dries Benoit
The Quest for Speed - An Indicative Survey in Improving Performance(2021) by Bryn Noel Ubald
A Comparative Study on the Efficiency of Compiled Languages and MATLAB/Simulink for Simulation of Highly Nonlinear Automotive Systems(2020) by Amir Hossein Pasdar, Shahram Azadi, and Reza Kazemi, Journal of Applied and Computational Mechanics. Discussed here
First year of Fortran-lang(2020) by Milan Curcic
Basic Comparison of Various Computing Languages: Python, Julia, Matlab, IDL, R, Java, Scala, C, Fortran(2020) by Jules Kouatchou and Alexander Medema
What does Fortran need in 2020 to survive?(2020) by zmiimz
The Linear Algebra Mapping Problem(2019) by Christos Psarras, et al
Programming languages and particle physics(2019) by Jim Pivarski
Why I chose C for backtesting: Lessons from a journey to build an intraday backtesting engine(2019) by M. Emmanuel
Is Julia the best language for quantitative finance?(2019) by M. Emmanuel
Why to Use Fortran For New Projects(2019) by John Pask and Ondřej Čertík
A Comparison of Programming Languages in Economics: An Update(2018) by S. Boragan Aruoba and Jesus Fernandez-Villaverde. original paper code at GitHub
The Need for Speed Part 2: C++ vs. Fortran vs. C(2018) by Avi. Part 1
Energy efficiency across programming languages: how do energy, time, and memory relate?(2017) by Rui Pereira et al.
Comparison of performance: Python NumPy and Numba, MATLAB, and Fortran(2017) by Charles Jekel
A Comparative Study of Programming Languages for Next-Generation Astrodynamics System(2016) by Helge Joachim Eichhorn, Frazer McLean, and Juan Luis Cano Rodríguez
Fortran is alive!(2016) from VORtech
Why physicists still use Fortran(2015) by Daniel C. Elton
Formula translation in Blitz++, NumPy and modern Fortran: A case study of the language choice tradeoffs(2014) by Sylwester Arabas, Dorota Jarecka, Anna Jaruga, and Maciej Fijałkowski, Scientific Programming 22 (2014) 201–222
Scientific computing’s future: Can any coding language top a 1950s behemoth? (2014) by Lee Phillips
Why (and Why Not) to Use Fortran Instead of C++, Matlab, Python etc.(2012) by Nick Maclaren
The Rise and Fall of High Performance Fortran(2011) by Ken Kennedy, Charles Koelbel, and Hans Zima, Communications of the ACM
Debunking the Myths About Fortran(2011) by Craig T. Dedo
C++ vs Fortran(2011) by lmf
C vs Fortran for scientific computing by Jannis Teunissen
The Joy of Fortran (2010) by Sam Urmy
Should Fortran be taught to Undergraduates? (2009) by Mike Croucher of NAG
Why Fortran? (2007) by Viktor K. Decyk, Charles D. Norton, and Henry J. Gardner, Computing in Science and Engineering
Scientific Programming in Fortran(2007) by W. Van Snyder, Scientific Programming 15 pp3–8
Fortran: A Modern Standard Programming Language For Parallel Scalable High Performance Technical Computing(2006) by David B. Loveman
Programming languages in economics: a comparison among Fortran77, C++, and Java(2005) by Vieira, Wilson da Cruz and Levi H. Santana de Lelis
The Importance Of Fortran In The 21st Century (2003) by Walt Brainerd, Journal of Modern Applied Statistical Methods.
Cloudy’s Journey from FORTRAN to C, Why and How(2000) - by G. J. Fernald, published in Astronomical Data Analysis Software and Systems IX, ASP Conference Proceedings, Vol. 216, edited by Nadine Manset, Christian Veillet, and Dennis Crabtree. Astronomical Society of the Pacific, ISBN 1-58381-047-1, 2000., p.32
On the Numerical Efficiency of C++ in Scientic Computing(1999) by Erlend Arge et al.
Fortran 90 subsets offer simplified environment for first-time users(1998) by Donald L. Shirer, Computers in Physics 12, 166; doi: 10.1063/1.168632
Using the F Programming Language in the Classroom(1997) by Bob Hancock
Portability and Power with the F Programming Language(1997) by Walt Brainerd, David Epstein, and Richard Hendrickson, Linux Journal.
Fortran 90 for Science Students(1995) by John Prentice
Should C Replace FORTRAN as the Language of Scientific Programming?(1995) by Linda Wharton
Retire Fortran?: a debate rekindled (1992) by David Cann. Communications of the ACM
Computing in Science: Fortran outlasts them all - While hardware technology proceeds apace, scientists still battle away with Fortran programming(1989) by Don Monro, New Scientist.
Has FORTRAN a Future?(1985) by Michael Metcalf, Computer Physics Communications Volume 38, Issue 2, October–November 1985, Pages 199-210
Why C++ will replace FORTRAN (or, at least, why it should)(1984) by Thomas Keffer, ACCU
A debate: Retire FORTRAN?: Yes. New applicative languages, based on mathematical functions rather than FORTRAN‐like statements, will enhance our ability to decompose problems for concurrent processing.(1984) by James R. McGraw, Physics Today 37, 5, 66
A debate: Retire FORTRAN?: No. Supercomputers simply need supercompilers that automatically restructure programs for concurrent processing.(1984) David J. Kuck and Michael Wolfe, Physics Today 37, 5, 67