What is Fortran: Definition and 875 Discussions

Fortran (; formerly FORTRAN, derived from Formula Translation) is a general-purpose, compiled 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 subsequently dominate scientific computing. It has been in use for over six decades in computationally intensive areas such as numerical weather prediction, finite element analysis, computational fluid dynamics, geophysics, 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.Fortran has had multiple versions, each adding extensions while largely retaining compatibility with prior versions. Successive versions have added support for structured programming
and processing of character-based data (FORTRAN 77), array programming, modular programming and generic programming (Fortran 90), high performance Fortran (Fortran 95), object-oriented programming (Fortran 2003), concurrent programming (Fortran 2008), and native parallel computing capabilities (Coarray Fortran 2008/2018).
Fortran's design was the basis for many other programming languages. Among the better-known is BASIC, which is based on FORTRAN II with a number of syntax cleanups, notably better logical structures, and other changes to work more easily in an interactive environment.As of June 2021, Fortran was ranked 17th in the TIOBE index, a measure of the popularity of programming languages, climbing 17 positions from its ranking of 34th in January 2020.

View More On Wikipedia.org
  1. D

    Comp Sci Excluding characters in Fortran

    Hello! I am trying to write a code in Fortran to process the following data and write it into another file: # energy (in eV), F(E) (in particles per m^2 per s per ster) 1.81E+17 8.3443E-28 2.26E+17 2.75658E-28 ... So far, I got the code to read...
  2. A

    Fortran Learn FORTRAN: Beginner's Guide

    Guys, I need you help. Next week I'm starting a project that requires some knowledge of FORTRAN. My programming skills are pretty rusty, I was wondering if you knew a good beginner's guide to FORTRAN.
  3. M

    Fortran How can I search for a specific phrase in a sentence using FORTRAN?

    Most of the examples here are given from the following book, Michael Kupferschmid, "Classical Fortran: Programming for Engineering and Scientific Applications", Taylor & Francis Group, 2009 The generalized form of READ command is as follows, READ (unit, format) list where, the value of...
  4. M

    Fortran Error compiling in Fortran (Ubuntu)

    Hello all, I'm new to this forum, but not to Physics, I'm completing my master degree. :) I'm currently running a simulation using Minuit from CERN. I recently changed the computer I'm working on, the new computer has Ubuntu 10.10 installed (I was working on my director's Mac before). All my...
  5. D

    Comp Sci Fortran - Help with Truncated Infinite Series Calculator

    Homework Statement I have an assignment to write a program for calculating the sine (and various other functions) using the method of truncated infinite series using DO statements. The DO statement is supposed to run until the difference between the current and last iterations are less than...
  6. A

    Fortran FORTRAN - Error 112 Run-time Error

    I have strange situation where a code that generaly seems to work fine at times gives a error message. Basicly I run simulations on a lattice model, and have experience no problems for small system, but when I go to larger systems (meaning that the simulation takes aprox. 15 min) I sometimes...
  7. M

    Fortran Best fortran compiler for Windows 7?

    Due to research changes I have to switch from C++ to Fortran development. In the past I have used Microsoft development tools since they are free for students, but afaik they do not have similar software for Fortran, and the Intel software is a little too expensive for me to afford. Which...
  8. F

    Fortran Understanding Common Blocks in Fortran 77

    Hi I'm having some trouble with understanding the whole concept of the common block in Fortran 77. Here is an example: common /hmat/ a,b,c,d It means that all the variables a,b,c,d are all contained in hmat. But does hmat need to be defined previously for the above example to make...
  9. R

    Fortran [Fortran] Functions Calling in Subroutines

    There are some caveat in fortran 77 while calling functions inside subroutines? I have some weird errors while calling a function inside a subroutine, e.g. Segmentation Fault while using/writing the argument of the function (but not sooner, I can still do an "Hallo World"!) or starting a do...
  10. T

    Fortran Generating Coordinates for Silver Atoms in C and Fortran

    Hello Could anyone help me rewrite following C code to Fortran code? It generates coords for sc silver atoms. #include <stdio.h> #include <math.h> int main(void) { int i, j, k, n = 0; double A = 4.08, L_X = 20.0, L_Y = 20.0, L_Z = 15.0; int iMax = ceil(L_X/A)...
  11. G

    Fortran How can I read a 2D character array in Fortran using f90?

    Hello all, I have some data stored in character*1 array(value,value) apparently the code is in f77, i got the original reading code for the data as a text... I am working in f90, and to the extend of my knowledge (not much in fortran) I can not declare such 2D array as character...
  12. G

    Fortran Definition of a complex variable in Fortran 77

    Hello, I'm making now a simple program (in Fortran 77) to find the roots of the quadratic function. When the discriminant is negative, imaginary numbers are to be used and the solution of the function is a complex number. I'd like to define a complex variable so that: complex x...
  13. L

    Fortran Fortran Routine calling a Python Function

    I have been trying to merge some python with fortran, to build a nice interface but still be fast. I spent the last two days learning how to use f2py, buy everything would be so much easier if I could call a Python function from Fortran instead of doing the other way around. Anyone know how...
  14. Simfish

    Why do astronomers stick with old languages like IDL and FORTRAN?

    I've heard that there's some movement towards newer languages like Python. But is there some resistance to this movement? Is there a similar problem with physics departments? Do astronomers prefer their grad students to be fluent with FORTRAN or with Python? I know one professor who doesn't...
  15. Saladsamurai

    Fortran Free Fortran g90 compilers for windows xp

    I know there are tons of them out there, but I am looking for a recommendation on one. I know absolutely nothing about Fortran and very little about programming in general. I do know that I will be inheriting a bunch of code that was written in a g90 environment (if that is even the correct...
  16. Hemmer

    Fortran Parallel FORTRAN output varies with addition of arbitrary WRITE statement

    Hi there, I've been puzzling over the following code (which works in serial). It produces radically different answers if the (blank) WRITE(*,*) is included or not. Any help greatly appreciated! eps = 0.0 !$omp parallel do default(none) private(i, j, current_angle, current_energy) &...
  17. M

    Fortran How can I fix my Fortran makefile to properly calculate travel times on nodes?

    I have made and compiled a programme,but the calculations are not good,because it has somehow problems with findfiff2d.o file(calulates travel-times on nodes).May be the problem is that findiff2d calls 6 other subroutines.So main=>findiff2d=>expand,sort,pass,stensilcs2d,fnod e,fside.So how to...
  18. R

    Fortran Compiling Fortran 77 for Windows

    Can someone suggest a way to easily compile fortran 77 code so it will run on a Windows machine. For my research I need to use a computer code that was written by former students at my school several years ago in fortran. I have very little experience with this sort of thing but I really only...
  19. M

    Fortran Fortran (better suited to programming section)

    The following question pertains to programming, but I have posted it here because I want the views of mathematicians (also of physicists and engineers), not those of computer scientists (which i already know) and I do not know how many of the former category care to look into programming...
  20. F

    Romberg integration fortran code

    how to code it?...sequence? logic?..
  21. N

    Fortran Solving Fortran Input File Problem - B

    Hey guys, I am wondering if anyone could help me with a simple problem. I want to remove key parameters from the "type declaration/parameter" portion of my code and into an external input file for easy access. The problem is, many of my variables (such as arrays) can't be defined until...
  22. S

    Fortran Help with Fortran IV to Fortran77 Conversion Errors

    I have a program written in Fortran IV and tryed to run it with fortran77(g77). Nevertheless it could be not problem in fortran IV it make some errors in fortran77. I am not programmer but trying to learn some. Here is the errors that compiler fortran77 is wrote: found.f: In program...
  23. A

    Fortran Fortran reading scientific form

    Hi, I have been struggling with the Fortran IO for a while. Here is the question, any comments will be much appreciated. I output some double precision numbers with the format: write (file_id,'(6(ES17.10E3,2X))'), a,b,c,d,e,f ! say the filename is 'data.dat' It works fine. But...
  24. H

    Fortran What is the issue with this Fortran recursion problem?

    Hi everybody. I am learning Fortran on my own, and I started doing simple examples like factorials, iterations, and stuff like that. The problem comes in recursion, I'm trying to run this simple factorial program using recursion, but the outcome is completely wrong. I asked to an expert in...
  25. P

    Fortran Code for Solving Linear System w/ Least Square Method

    Dear all: For a standard linear system, y(n*1)=A(n*n)x(n*1) If y is exact and A is well-conditioned, it is easy to calculate x. However, if y has some disturbances or some errors, at the same time, A matrix is ill-conditioned. It is difficult to accurately obtain vector x...
  26. A

    Fortran Input .txt file into Fortran program

    I am trying to input a txt file into my fortran program. My txt file is a 9x2 table of integers, all I want is to display the values in the same format in my program. I tried using, program name implicit none integer :: input(9,2), I, J open (unit=20, file="values.txt") DO I =...
  27. P

    Fortran Debugging Strange Fortran Code: A Simple Delta Function

    Hi guys, I just wrote a simple code for delta function and print it out. Here it is. program main implicit none integer i real*8 del real*8,parameter:: ep=1D-2 real*8,parameter:: pi=3.1415926 do i=-10,10,1 write(*,*)...
  28. E

    Fortran How can I generate a random number between 1-10 in Fortran 90?

    I'm trying to contruct a program that will generate a different random number between 1-10. I am not sure how to make it only 1-10. PROGRAM guess USE const IMPLICIT NONE INTEGER::i REAL(kind=dp)::x call random_number(x) WRITE(*,*) 'x=',x END DO END PROGRAM...
  29. V

    Fortran Memory storage of multidimensional arrays in fortran 90

    Hello, I think i heard somewhere that a multidimensional array in fortran 90 may be stored non-contiguously in memory. Is this true? Even if it the size was known at compile time? If your answer is it depends on a compiler, what about ifort and gfortran?
  30. M

    Fortran New to programming and Fortran

    Hello all, I am new to programming and fortran, I have Intel Fortran 9.1 and using this via Microsoft Visual Studio 2005. To start with I have found a simple exmaple from the a Intel Fortran 90 book. I seem to be able to run a debug, but can't seem to create an executable? Its my first time...
  31. S

    Fortran Fortran 95 & complex numbers question

    Hi, I'm trying to compile a code (.f95, compiling using gfortran) in which I'm using a 'do' loop to set the values in a complex array; the following little piece is giving me trouble: double precision, dimension(n) :: x complex, dimension(n) :: y do i=1, n x(i) = ... end do do...
  32. T

    Fortran Comparing Fortran and Pascal: Advantages & Uses

    Hi, I heard that fortran is quite a useful language for some scientific computations, so I looked it up to see what is looks like and I was surprised that the syntax is very similar to Pascal. I know that syntax doesn't mean anything, but it seems to me that when languages have a similar syntax...
  33. A

    Fortran Read start: end of file error in fortran

    Hi all, do i = 1, 79 open(2,file=afiln(i),status='old') do k = 1,11 read(2,'(51a)')astr1 enddo do j=12,2000 read(2,22,end=23,err=23)iyr,imn,id,ih,imt,flx write(7,*)i,j obstim =...
  34. J

    Fortran Fortran Code for Calculating Second-Order Derivative | Get Help Now!

    I'm looking for a fortran code to calculate second-order derivative from a dataset. Please help me!
  35. N

    Fortran Can I Install Fortran 95 on Windows 7 for My Computer Science Class?

    I am a student who is currently enrolled in a computer science class, and the program we are using is Fortran 95. I was wondering how I could get this program/compiler onto my own computer? I have almost no experience with programming and Fortran so I really want toget this on my own system...
  36. S

    Fortran How to Fix Overflow Error in FORTRAN Matrix Program?

    hi i have over flow error in FORTRAN for a program that do some function and summation on matrix elements , then multiply them and at last find its determinant, the dimension is SET by input when it is more than 7 i have this error what should i do?
  37. Saladsamurai

    Fortran Which FORTRAN Compilers are Compatible with Windows 7 32-bit?

    Hello all, Although I am currently working on implementing FORTRAN on my Mac, I would also like to find a compiler that works well with Windows 7 32-bit. I initially had Win7 64-bit installed on my computer, but when I went to use my (really old) DIGITAL Visual Fortran install disk, it said it...
  38. Saladsamurai

    Fortran Anyone using Snow Leopard & FORTRAN?

    If so, how did you install it? I have been looking at http://gcc.gnu.org/wiki/GFortran" and apparently you have to be a rocket scientist to install the compiler. I'm a little desperate here. I really know nothing about compilers. Most compilers I have dealt with simply require me to run a...
  39. N

    Fortran Using Fortran Subarrays in f90: Passing Single Columns/Rows into a Subroutine

    Dear all, I am using f90 and trying to pass only one column/row of an array into a subroutine. So I want something like... call test(x(1,:),...) If "test" defines the first entry as a vector, will this work? Natski
  40. L

    Fortran How can I properly name and open multiple files in Fortran based on user input?

    Hello there. I've doing a program that I do not know how many files will be needed, because it'll depend on user's choice. So, how to name them? I tought that a command like, where n is a user-input number Do While (i .LE. n) Open (Unit=i, File=i'.dat') i=i+1 EndDo Would be enough, but I...
  41. B

    Fortran Fortran 95: WRITE to screen changes output to WRITE to file

    I have a short code that calculates the running median for three columns of data in an input file and writes the running medians out to three columns of data in an output file. I use Numerical Recipe subroutines and functions to compute the running median. If I include a WRITE(*,*) directly...
  42. A

    Fortran Fortran: creating array containing characters

    Hello. I'd like to create an array containing characters (basically a word stored as a 1xn array). I have no idea how to do this, however. I thought that the most obvious way to do it (yes, it would've been highly impractical for long words) was to write character, dimension(3) :: A...
  43. M

    Fortran Fortran Formatting Computational Chemistry

    Hi, I require specific formatting for a quantum chemistry calculation. But for some reason I can't seem to write using formatting. I have checked tutorials, but to no avail. Here is my toy program: program test_format implicit none real :: m write(*,*) 'Enter a number' read(*,*)...
  44. D

    Fortran How to Fix 'Undefined Symbol: G77_date_and_time_0' Error in Fortran Subroutine?

    27 Jul 10 2:35 Hello, I have an error when I try to execute my python program which uses a fortran subroutine (which call date_and_time function) : "undefined symbol: G77_date_and_time_0" Do you know how can I fix this issue? Thank you very much!
  45. M

    Comp Sci Fortran program to calculate texas hold em odds

    The instructions are to calculate the odds of winning if you are dealt King and 9 of clubs, what are the odds of winning? I am finding myself spending more time trying to figure out texas hold em (never played before) than writing the program. So far I found a list on wiki that breaks down the...
  46. L

    Fortran How to Handle Line Truncation in Fortran?

    I've made a program that uses more than 72 characters per line. When I try to compile it on gfortran, using -ffixed-line-length-n, it returns several errors, all of them derived from a line truncated at the very beggining. How can I compile it or untruncate the line? The code is as follows...
  47. M

    Fortran Quadratic fortran program help

    I am trying to write this program, it runs fine but I can't get the imaginary numbers to print correctly. I have been trying this for a few hours now and can't figure it out. Here is the code, I am running Force 2.0. Thanks in advance for the help. Program Quad Implicit None...
  48. M

    Fortran Fortran 77 - Troubleshoot Char Function Error

    I am using one progran,have problem with char function. rfile(3:4)=char(id1+48)//char(id2+48) write(6,*)rfile open(28, file=rfile, form='unformatted', status='old') I have entered write line.This is what I get: fd01.picks open: No such file or directory apparent state: unit...
  49. S

    Fortran Problem with fortran 90 Present() function

    Hi all, When I use Present(x) to check for the presence of an optional variable, I am getting TRUE even when the subroutine call clearly does NOT contain the optional variable. See here the call to test_present(a,b): program options implicit none real*8 a,b real*8 c a =...
  50. Saladsamurai

    BinariesWhat are some free Fortran compilers for Mac OSX?

    I was just wondering if anyone can recommend any free Fortran compilers for OSX on Mac? I am going to be starting some work that requires the use of Fortran and though I have a Windows machine, I would like to use my Mac since it is faster. I have Googled around, but I am really not sure...
Back
Top