Most voted "fortran" questions
The family of programming languages known globally as Fortran was developed from the 1950s and continues to be used today. The name is an acronym of the expression "IBM Mathematical Formula Translation System".
Learn more…27 questions
Sort by count of
-
6
votes2
answers354
viewsFinding roots of a function in Fortran
I created a code that uses 3 methods to determine the roots of a function, the direct method of kicking x, Newton-Raphson and secant values. In the direct method, I set x values close to the roots,…
-
5
votes2
answers1988
viewsA Good Fortran Random Number Generator
The GNA of FORTRAN (Rand()) seems to be bad, this because it is proved to be worse than very simple random number generators. For example, in my simulations the GNA below SUBROUTINE GNA(iiseed) USE…
-
5
votes1
answer148
viewsFortran variables 77
I got a code on Fortran 77 where there’s a line like this: DATA ZERO/0D0/,HALF/0.5D0/,ONE/1D0/,TWO/2D0/,THREE/3D0/,FOUR/4D0/ I’m transposing it to PHP. I’d like to know what D0 is after the values…
fortranasked 6 years ago Maurício Biléssimo 351 -
4
votes1
answer61
viewsFORTRAN and C interoperability
Each language has a unique character, that’s a fact! However, how to work with code C in FORTRAN and vice versa? It is possible to enter the code FORTRAN in the C with the directive # include…
-
4
votes0
answers102
viewsCreate an array/Arrays based on a TXT file
I am new to using the Fortran/95 language and want to extract some data from a txt file (http://1drv.ms/20gSNKb), are flow data available in the Hidroweb portal. Whereas they are separated by ";" as…
-
4
votes1
answer43
viewsError in calculating the average from Inmet data using a Fortran program
I’m starting at Fortran, and I’ve set up the following program to get the average of the 4th column of data from an INMET data file. Since the calculated average is 0 (zero). Could someone tell me…
-
3
votes1
answer797
viewsRead files with ";" in Fortran
I need to read an array where the data is separated/delimited for ;, but it keeps slipping. This is the file layout for reading the data:…
-
3
votes0
answers99
viewsHow do I run Fortran from Matlab?
I need to run a Fortran file from Matlab. Which is the best compiler when using windows What are the steps to create an executable file. Thanks for your help,…
-
3
votes1
answer173
viewsHow to make python only read the file when it is complete
I’m doing a program that reads a file. txt that updates itself in the execution of another program in Fortran and creates a real-time animation of the temperature map of a board, however it is…
-
2
votes1
answer220
viewsWhat the command means: gfortran -c -03 $<
Guys, I’m trying to understand a program here that I’m using in my scientific initiation, but I’m left with a doubt in a make file. # makefile for code OBJ1 = main.o derivs.o filter.o code: $(OBJ1)…
-
2
votes1
answer213
viewsCode adaptation Fortran for python [Runtimewarning: overflow encountered in double_scalars]
I tried to adapt the following code in Fortran to python: PROGRAM Escape_tent IMPLICIT NONE ! Declare local variables INTEGER :: i,j,tfinal,P,k,rede Real,dimension(0:2800) :: x,xn real, external ::…
-
2
votes1
answer92
viewsHow can I make a repeat structure here?(Fortran)
program equacao implicit none real a,b,c,q real x3,x2,x1 character s,n,read,if complex sqrt 100 print*, "Esse programa calcula equacoes do 2 grau" write (*,*) "De os valores de a, b,…
-
1
votes2
answers95
viewsproblems with graphical mode initialization
I put the address of the Fortran compiler (ifort) on .bashrc making: export PATH=/.../... But after that I could not access the graphical mode of Opensuse. The given message is the following: Could…
-
1
votes0
answers58
viewsgfortran’s path and options
Some gfortran options allow you to include paths to libraries and Fortran modules: $ gfortran -c <código fonte> [opções] Among the functions is the -J<path file .mod>, which allows to…
fortranasked 9 years, 5 months ago Alã Damasceno 353 -
1
votes1
answer99
viewsProgram with problem to compile
I created this program to calculate the BMI, but it doesn’t run completely. He asks to enter with weight and height, but returns no result. Could someone tell me what’s wrong? PROGRAM Calc IMPLICIT…
-
1
votes1
answer431
viewsWhat’s the Fortran language for?
On what occasions, nowadays, is the Fortran language used? What is its strong point and its purpose?
-
1
votes1
answer353
viewsRun Fortran code that prompts reading data in jupyter-notebook with python Restart kernel
Jupyter notebook Restart when running a Fortran code requesting data entry, as follows: note that the variable a must be provided immediately after the call from f1 .However, an error occurs and the…
-
1
votes1
answer95
viewsProblem with PRINT command in FORTRAN 95
I used a command OPEN to open a file, then I used the command WRITE to write a value to the string type file. However, when I use the command PRINT *,(with the asterisk, which should be the output…
-
1
votes0
answers77
viewsHow to use f2py using more than one . F90 file and using dassl. f?
I’m a beginner in F2PY and I’m trying to use it in a very complex Fortran program that has several subroutines in separate files and one of them is dassl.f. I believe my problem is with it. Are…
-
1
votes1
answer130
viewsGet format in which text file was written in FORTRAN
Hello, I need to make a program that reads from an input file that has lines of text written in specific formats and processes the read information in order to create an output file with some data…
-
1
votes1
answer94
viewsHow to store information in a Python (write) file?
Hello, I’m writing a program in Python with a code I have in Fortran. I have a problem writing this excerpt (from Fortran): do i=1,n write(3,350)r(i),(ener(j)*alfa,j=1,6) !meV end do I tried to…
-
1
votes1
answer82
viewslist index out of range - From Fortran to Python
I wrote a program in Fortran and now I’m trying to write it in Python. However, it’s giving an error: D[i][j+1] = - u_med[i+1]/(delta_r[i]*delta_r[i+1]) Indexerror: list index out of range I’m a…
-
1
votes2
answers81
viewsMultiplication of Matrices in Fortran
I am encountering a problem to compile a program in Fortran. The build error accuses that the Shape of the matrices are not compliant. However, I understand that it is mathematically allowed to…
-
0
votes1
answer177
viewsError to run program in Fortran
I need to calculate the Minimum common splitter in Fortran, I did the code, but when it compiles and runs, it closes after the user enters the value and I do not know what is wrong. PROGRAM Calc…
-
0
votes1
answer231
viewsHow to create a tridiagonal matrix in Python?
Hello, I would like to know how to write a tridiagonal matrix Nxn. I have three vectors that will be updated in a loop. I’m working with something semlhnante to this: Note: I would just like to know…
-
0
votes0
answers43
viewsError in condition in Fortran
Because the code: program acosseno implicit double precision(a-h,o-z) PARAMETER(n=5) dimension x(n) dimension y(n) alfa=0.6D0 k1 = 3 k2 = 5 print *, "Alfa is: ", alfa open(1,file='a.dat') x(1) =…
-
-1
votes1
answer68
viewsError in Fortran
I have this programming in Python: from time import sleep #importando biblioteca para usar a função sleep G = 6.67408 * (10 ** -11) M1 = 1.98*(10**30) Xo = 15 * (10 ** 10) Yo = 0 Voy = 2.97 * (10 **…