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. I

    Fortran How to deal with small numbers in Fortran 95?

    Hi I am doing a program using gfortran compiler. I feed angle theta in degrees to the program. Program is supposed to calculate the value of tan(theta) using values of sine and cosine of theta. the program should give warning of division-by-zero if magnitude of cosine theta is less than...
  2. G

    Fortran Why is C Preferred for Numerical Analysis over Fortran?

    I am a graduate geology student and have been using MATLAB for about a year now. I began learning C a while back to have a broader tool-set to work with but found that it just got in the way of learning material more specific to my major. Besides, MATLAB does everything I need anyway. That...
  3. F

    Fortran Fortran Troubleshooting - Get Help with Codeblocks Issues

    Hello everyone, I'm new here and i have a question: I did this fortran code and isn't work, but i think the problem is my codeblocks Someone can execute the code and if they presents some errors help me also?
  4. T

    Fortran Creating 2-d array from a text file in fortran

    I have a text file of the format x1 y1 x2 y2 . . . . . . I need to read this into an array. How is this done in Fortran?
  5. S

    Fortran Error when reading list, Fortran 77

    Hello, I'm trying to run a simulation program, written in Fortran 77 for the g77 compiler ( I use gcc version 3.4.6). I get the following error message when running the program: invalid number: incomprehensible list input apparent state: unit 3 named combin.fig last format: list io...
  6. S

    Fortran Solving FORTRAN Compiler Issues with Different Outputs

    Hi all ! This is a weird problem. A simple program to read a file and display it works differently when compiled with different versions of the same compiler. When I compile it as: garbageij@garbageij:~/NMA$ mpif90 exp4.f90 and run it, it gives the correct output. But when I compile it as...
  7. S

    Fortran FORTRAN- How to read a non-uniformly formatted text file

    Hi all ! I am a little new to FORTRAN and I am sorry if the title is confusing but I couldn't come up with anything better. I have a file of which I am showing a snippet below: *>>>>>>>>CHARMM22 All-Hydrogen Topology File for Proteins <<<<<<< *>>>>>>>>>>>>>>>>>>>> and Nucleic Acids...
  8. B

    Fortran Fortran on ubuntu using f95 code help

    I have the following code with error- I want this general flow. Errors I get are missing ')' at the do while line, syntax error on the line started with ****(not part of program added after fact) and expecting END Program statement at line end do counter=1 user_reaction =3 do while (counter...
  9. M

    Fortran Fortran quassiclassical trajectory help

    Hello All, This is my first post on any forum so I will try not to get too fancy. I have been writing in fortran for about two months now and it is my first programming experience. First, I wrote a classical dynamics program for a particle moving toward a potential barrier. Then, I wrote a...
  10. L

    Fortran Learn Fortran: Best Way, Textbooks & Resources

    I've recently found myself in a situation where I need to know Fortran at a fairly decent level. A professor has asked me to translate a large amount of his old Fortran code into C++, and knowing no Fortran at all I excepted the task. I do however consider myself a competent C++ programer. So my...
  11. F

    Fortran Solving FORTRAN Array Error w/ Code Sample

    Hi, I am beginning to learn FORTRAN and am a bit confused with the error i am getting. Here is my code: program main IMPLICIT NONE integer :: limit WRITE(*,*) "Please enter limit: " READ(*,*) limit integer :: allnums(limit) ! ! do i=1,limit ! ! allnums(i) = 0 ! ! end do...
  12. M

    MATLAB Fortran alternative to Matlab 'system' command

    Hi, I have been trying to run a linux executable (written in fortran77) into my another code (also in fortran77). In Matlab, I did it with "system('./<filename>')". But I am not able to do it in fortran script as './' is not simply working for me. I will really appreciate if anyone could...
  13. L

    Fortran Include statement in Fortran

    hi all ! I want to ask about Include Statement in fortran example: Include 'D:\XXX.f' in my XXX.f have some subroutines and want to call these subroutine in Main program but i show error . someone does like me can share me some experience !
  14. B

    Comp Sci Fortran Help with Complex Variables - Values Blowing Up

    Homework Statement The Fortran 90 code shown below was written to solve a Crank-Nicholson algorithm that describes the motion of a quantum particle (hence the need for complex numbers). Probably not that crucial to know the details of the math/physics, just the code... The problem is that...
  15. A

    Setting Up G95 Fortran Compiler for Cygwin

    I was given a CD with fortran files as part of my senior year project (biology major here), that said in order to compile the code (using cygwin), to install 'cygwin' and 'g95' Fortran compiler. I think i got the 'cygwin' succesfully installed (after watching numerous youtube videos) on my...
  16. H

    Fortran Reading a file in FORTRAN 90 or 95

    Hi everybody, I need your help guys. I am using FORTRAN 90(or 95) and try to read a text file. The file contains many lines for instance something like this CS DIRECT 1.2 2.5 3.6 1.6 -2.3 2.9 .... .... .... I need to put each line inside a string variable for example A="CS"...
  17. N

    Fortran Symbolic math calculations with Fortran 95

    Hi all I am struggling to work symbolic math calculations with Fotran 95 in the Silverfrost ftn 95 plataform. Say you want to calculate c=a+b but without initializing "a" or "b" to get a value "c", but rather print out or obtain the actual generic expresion "a+b" I have tried to solve...
  18. S

    Fortran Fortran error: Big array size, solution?

    Hi everybody; I'm not programmer or computer expert, but during working with my thesis got serious problem with my program seemingly about big size of matrices. I'm working with meshes and using Fortran to analyze entire of my mesh including nodes and elements. The biggest size of my matrix has...
  19. G

    Fortran Different Colored Words in FORTRAN Output?

    Hello all FORTRAN geeks and geekettes, I was wondering if there is a way to get different colors for each word in a print/write statement? For example: WRITE(*,*)'This is my test sentence' Can I get each word in this write statement to appear as a different color in the terminal...
  20. T

    Fortran Solving the Fortran LAPACK DSYEV Error with a 3x3 Matrix

    Hello I am a beginner in programming with Fortran and I want to use the LAPACK DSYEV in my program. I am an example to determine the eigenvalues ​​of a matrix (3x3) after I use it in my program but when I compile I get this error "" "" "** One entry to DSYEV parameter number 5 Had an illegal...
  21. C

    Fortran Weird fortran problem (Assigned variable value doesn't match up with output)

    I ran into a kind of strange thing today while coding. I needed Pi in a program, so I used 2*accos(0.0) to pull it out, but my answers were slightly off. I checked the Pi calculated and it was off after a few decimal places. "Odd", I thought, and just decided to put in Pi as an assigned number...
  22. A

    Fortran Data I/O problems in FORTRAN 77

    Hello, every one: I have a piece of data like this: 1999 1 1 0.0 1 1.0000000e+00 -9.9900000e+02 4.8646021e-01 0 1999 1 1 0.5 1 1.0208334e+00 -9.9900000e+02 4.9180925e-01 0 1999 1 1 1.0 1 1.0416666e+00 -9.9900000e+02 3.7898308e-01 0 1999 1 1...
  23. I

    Fortran Can I Use Fortran to Open Multiple Files Using a List of File Names?

    Hello oeveryone i've got many txt files each with a different name, such as filename1.txt filename2.txt ... i've got another txt in which I've got the list of the name of the files i want to allocate in a vector of characters che name of the files and use this to open all files...
  24. L

    Fortran Write File in Fortran: Tips & Tricks

    Hi all I want to write data to file after each loop in fortran. Have you some experience ?
  25. J

    Fortran Solving System of Equations with Fortran Code

    we have to write a code to solve system of equations by writing them in matricies (tridiagonal matrix) form ... the first step is to enter the coefficients of the variables (r1,r2,r3,...) and then the answers to the equations (b1,b2,b3,...) by using array , and print the equations in the form...
  26. A

    Fortran Saving Data in FORTRAN Arrays: A Guide

    Dear Sir, I am using FORTRAN. I have little experience and i am facing one problem. I want to store data (i.e. X and Y values) in an array (A(900),B(900)) in such a way that at first I used only 30 elements of each array for storage 30 initial values of X and Y and then I have some...
  27. J

    Fortran Fortran: Solving System of Equations with Tridiagonal Matrix

    hi I am just start learning fortran and i have aproblem with my homework: we have to write a code to solve system of equations by writing them in matricies (tridiagonal matrix) form the first step is to enter the coefficients of the variables (r1,r2,r3,...) and then the answers to the...
  28. S

    Fortran Fortran: inner loop dependence on outer loop

    Hello, I want to write an inner loop which takes values based on the variable values of the outer loop. For outer loop, m=1, Nmax and for inner loop, I want n to take values from 1 to Nmax-m. But I am not sure if I can directly specify n = 1, Nmax-m. Also I want to use Nmax-m value for one of...
  29. S

    Fortran Fortran, why do i suddenly get new errors?

    Do subroutines return values only? Sorry for the wrong title! I currently have a subroutine which should return y like (the actual formula is a bit more complex): y=cos(t) When i call the subroutine and then make a do-loop to test y for different t, it gives 1 value only. Does the subroutine...
  30. L

    Fortran Transfer data between 2 individual program fortran

    hi all i try to transfer data between 2 individual program fortran . I've ever tranferred data between 2 subroutine by using common block, but 2 program make so confused. Have you ever done like me can share some experience ? thank you
  31. M

    Fortran Compiling a Fortran 77 Code on Ubuntu

    Hi, I have a fortran 77 code, I compiled it on cygwin in windows 7 by using f77 and gfortran, and it has been working correctly. I should use this code on Ubuntu, so I installed f77, gfortran and gcc compiler. I tried to comile that code by using f77 but it gave me the following error: > f77...
  32. J

    Fortran What is the purpose of the Fortran 77 DECK statement?

    Hi all. I am using some Fortran 77 code that was originally written in the early 90s, and some of the subroutines start with DECK or *DECK. I have tried searching the internet but cannot find anything relevant. As an example, say the main program calls two subroutines SUBONE and SUBTWO. One...
  33. L

    Fortran Fortran - Allocate array in subroutine

    I try to write a small program to allocate a variable in small subroutine and I've passed it, now i allocate array in a loop or many loops but i don't have any ideas about it. Has anyone done like me , can share some experiences ??
  34. A

    Fortran Fortran 90: giving the variable's value on the execution of a program

    Hello I wondered if in Fortran 90 I can define a variable whose value will be given only while executing the program, in the same line as the execution command, for example like this: ./exe 100 I know one can use the "read" command, but that way you only enter the variable's value once...
  35. B

    Fortran Fortran: help with arguments to a pre-built software

    There are two functions that I need help with: http://www.maths.uq.edu.au/expokit/fortran/dgpadm.f http://www.maths.uq.edu.au/expokit/fortran/dgchbv.f The problem I'm having is that the arguments on the line DGPADM(...) don't match identically with the explanation. For example, H, ldh...
  36. R

    Fortran Why am I getting a Segmentation fault: 11 when running my Fortran code?

    I'm getting a "Segmentation fault: 11" when running at line 72: IF (h_temp == blayer) THEN However, the line above it: PRINT *,h_temp==blayer runs just fine. Needless to say, I'm clueless. Here's my entire code. PROGRAM bunkers IMPLICIT NONE REAL, DIMENSION(5) ...
  37. S

    Fortran Having problem to understand kind notation in fortran 90

    hi all, i have codes for 1d fdtd maxwell equation. the problem i am facing right now is some error regarding the kind notation. !1d fdtd Simulation in free space subroutine fd1d01(f0,miu,delta,S,E0) implicit none real :: f0 real :: miu real :: delta real...
  38. P

    Learning a language fairly fast (Fortran)

    I'm going to be using Fortran for research this summer (three weeks) and the one problem is I don't know Fortran. Obviously, I know I can't learn everything in three weeks but I assume it is possible to get a strong base. I already have a textbook on Fortran by Etter but possibly there are...
  39. xaratustra

    Fortran Best Fortran Library for FFT - FFTPACK Example

    I am new to Fortran. Is there an ultimate best library for FFT for Fortran (95)? I found this one FFTPACK. I am not sure if this is the best one. Is there anywhere a simple example how to use it? I have huge time files (260 MB each) that I like to read in Fortran and perform FFT and...
  40. T

    Fortran Fortran passing parameters to a function of one variable

    Hi all! I have a question about fortran. So far in my coding, if i wanted to define a function ( say f(x) ) I would manually set a grid for x, and then define f for each x value, so that i would have a vector for f and a vector for x. However, I'd now like to use the 'function' command, so i can...
  41. L

    Fortran Gauss-Seidel Fortran 90/95

    Hi, I have to program using Fortran 90/95 simultaneous linear equations. My question is, is it possible to program this? First I did the inverse matrix to find the values of the solution of a 4X4 and 3X3 matrix. I set up [A][X] = [X]' and did the inverse matrix to find the values for [X]. So...
  42. D

    Comp Sci Fortran help: high precision intrinsic functions (kind = 16)

    Fortran help: high precision intrinsic functions (kind = 16)... Homework Statement Dear Everyone, I am using Fortran G95 compiler in windows 7 with SciTE as text editor. I have successfully compiled many programs (so there is no problem with my installations). I am having problems with...
  43. gluons

    Fortran Fortran: Writes to screen, not to file

    I've never had this issue before. My code will create the file and also output anything to terminal. But if I change the output from terminal to file, it does nothing. For example, this line write(*,*) "ist1, ist2 =",ist1,ist2 outputs my two indices in every loop iteration. But...
  44. T

    Comp Sci Power series with subprograms Fortran 77 HELP

    Homework Statement The power series 1 + x + (X^2)/2! + (x^3)/3! +...(to infinity)= (x^k)/k! converges to e^x for all values of x. Write a function subprogram that uses this series to calculate values for e^x to five-decimal-place accuracy (i.e. using terms up to the first one that is less...
  45. N

    Fortran Fortran code error: forrtl: severe (66)

    Hi everybody, I have old Fortran code, originally written in the mid 1970's for an Elmer system. The code has been adapted through the years, last run successfully in 2009. The code has now landed on my lap after having been "retired" due to obsolescence. I am a pure Fortran beginner...
  46. T

    Fortran FORTRAN Programming Error: Incomparable ranks 0 at and 1 in assignment.

    Hi guys having a problem with my code, FORTRAN keeps stating: lambda(k+1)=(newsum/oldsum) Error: Incomparable ranks 0 at and 1 in assignment. The code is below: subroutine powerit(a,b,c,E,n) implicit none real, intent(in) :: E real, intent(inout) ...
  47. xaratustra

    Fortran Fortran complex array assignment

    I have a an array of type complex. I am trying to assign a value to it in a loop, but I get a strange error "Unclassifiable statement at (1)". I really don't understand why. do t = 1, count real(in(t)) = cos(2 * pi * f0 * t) aimag(in(t))=sin(2 * pi * f0 * t) end do thanks.
  48. P

    Fortran Fortran: printing the Printing the Hex contents of a character variable

    Given a character variable character*10 name write (6,111) name 111 format (?) what do I put in the format statement to print the hexadecimal contents of name?
  49. S

    Fortran Fortran: all lines of the code are not being read

    hello, i'm a beginner in programming. i wrote a program to calculate velocity correlation function. i do not get any compilation errors but the lines after line number 42 are not being read. could someone tell me what is it that I'm doing wrong? thanks a lot! svartak !program to...
  50. B

    Comp Sci Fortran Program for Least Squares Fit of Data

    (The usual format doesn't really fit this question, so I hope you won't mind if I set it up slightly differently) The task is to make a Fortran program that will read in a given set of data from a file, stopping when it reaches the end, and calculate the gradient and intercept of a best fit...
Back
Top