# Fortran

Fortran is an actively used programming language created in 1957. Fortran (; formerly FORTRAN, derived from Formula Translation) is a general-purpose, imperative programming language that is especially suited to numeric computation and scientific computing. Originally developed by IBM in the 1950s for scientific and engineering applications, Fortran came to dominate this area of programming early on and has been in continuous use for over half a century in computationally intensive areas such as numerical weather prediction, finite element analysis, computational fluid dynamics, computational physics, crystallography and computational chemistry. It is a popular language for high-performance computing and is used for programs that benchmark and rank the world's fastest supercomputers. Read more on Wikipedia...

63Years Old | 150,953Users | 1,968Jobs |

- Fortran ranks in the top 1% of languages
- the Fortran wikipedia page
- Fortran first appeared in 1957
- Fortran was created by John Backus
- file extensions for Fortran include f, for, f90, f95, f03, f08, f15, f77 and fpp
- See also: speedcoding, algol-58, basic, c, chapel, cms-2, pl-i, pact-i, mumps, ratfor, assembly-language, laning-and-zierler-system, 1620sps, ucsd-pascal, watfiv, ascii, modula-2, ada, mortran, ratfiv, jcl, simscript, f
- Have a question about Fortran not answered here? Email me and let me know how I can help.

### Example code from the Hello World Collection:

C Hello World in Fortran PROGRAM HELLO WRITE (*,100) STOP 100 FORMAT (' Hello World! ' /) END

### Example code from Linguist:

! Codes/HYCOM/hycom/ATLb2.00/src_2.0.01_22_one/ real onemu, twomu data onemu/0.0098/ data twomu/1./ data threemu/0.e9/ end

### Example code from Wikipedia:

program average ! Read in some numbers and take the average ! As written, if there are no data points, an average of zero is returned ! While this may not be desired behavior, it keeps this example simple implicit none real, dimension(:), allocatable :: points integer :: number_of_points real :: average_points=0., positive_average=0., negative_average=0. write (*,*) "Input number of points to average:" read (*,*) number_of_points allocate (points(number_of_points)) write (*,*) "Enter the points to average:" read (*,*) points ! Take the average by summing points and dividing by number_of_points if (number_of_points > 0) average_points = sum(points) / number_of_points ! Now form average over positive and negative points only if (count(points > 0.) > 0) then positive_average = sum(points, points > 0.) / count(points > 0.) end if if (count(points < 0.) > 0) then negative_average = sum(points, points < 0.) / count(points < 0.) end if deallocate (points) ! Print result to terminal write (*,'(a,g12.4)') 'Average = ', average_points write (*,'(a,g12.4)') 'Average of positive points = ', positive_average write (*,'(a,g12.4)') 'Average of negative points = ', negative_average end program average

### Trending Repos

repo | stars | description |
---|---|---|

OpenBLAS | 2879 | OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version. |

E3SM | 117 | Energy Exascale Earth System Model source code. |

Last updated August 9th, 2020