1,570 questions
0
votes
1
answer
92
views
Fortran90 doesn't compile with gfortran
I am attempting to compile and run a Fortran 90 program using command line (bash). In the past, when I've run gfortran /path/to/file, a file a.out and a file program_name are created, and I can run ...
1
vote
0
answers
69
views
Is it possible to declare a "parameter" in a different file? [duplicate]
In Fortran, parameters are compile-time constants. Let's say I have two files, main.f90 and params.f90. Is it possible for params.f90 to define some parameters that will be used in main.f90?
E.g. in C/...
0
votes
0
answers
119
views
Can gfortran reject code that is not standard Fortran 90?
For educational purposes, I have written some Fortran 90 code that I compile with gfortran. Is there any way I can make sure that the code will not compile if I use any features not supported by ...
0
votes
0
answers
36
views
Error: Unexpected data declaration statement AND symbol has no IMPLICIT type [duplicate]
I'm an amateur in Fortran. I met a strange error when immitating youtube tutorial of FORTRAN in 100 Seconds to write a simple program:
1 program myApp
2 implicit none
3 integer :: jeff
4 jeff =...
0
votes
1
answer
229
views
Fortran 95, How to read blank (letter space) character from the end of the line?
I try to modify my program to read lines that contain blank charaters (written with space) at the end of the line. I'm using Intel compiler (Fortran 95).
In the program i'm using the command line:
...
0
votes
0
answers
322
views
How can I get MPI module to work with Fortran using Code:Blocks on Windows 10?
I have recieved some code from a colleague which is written in Fortan .f90 files, and was used before on Linux. I am trying to get the code to function on Windows 10 using Code::Blocks. The problem is ...
1
vote
1
answer
227
views
Why is this simple Fortran matrix inversion code not returning the expected value with LAPACK?
I'm trying to use the LAPACK package to compute the inverse of a matrix. For this end, I've employed the routines sgetrf and sgetri. However, when testing the code, it doesn't return the expected ...
0
votes
1
answer
97
views
Does Fortran store values in an array differently than a non-array declared variable?
program analysis
implicit none
integer i, j, k, l
double precision a, b, c, d, e
integer binb(1:20),binc(1:20),bind1(1:20),bine(1:20)
real lower(1:20),...
1
vote
1
answer
287
views
Error: 'mask' argument of 'count' intrinsic at (1) must be a logical array
I have recently tried compacting an older version of my program to make it more efficient by using the "count" function. However, when I try to compile the program, I get the error for each ...
1
vote
5
answers
830
views
find and modify highest n values in a 2D array in fortran
I have a 2D real number array and I want to locate the n highest values and assign these highest values to 1 and all others to 0.
The following code does this correctly by using MAXLOC inside a loop ...
1
vote
1
answer
244
views
Including/omitting write statement changes code output in Fortran
I am facing a difficult to debug problem in this Fortran 90 code - keeping or commenting out write(*,*) statements is changing the output of the code! Here are the details and the code (cannot ...
1
vote
3
answers
170
views
How do I nest an array of strings inside another array in Fortran
In my computational methods class, our homework problems are given as Python scripts, however my instructor said as long as we can translate them into our language of choice, we can solve them in our ...
1
vote
0
answers
99
views
Difference in Matrix operations with very small values on Eigen (C++) vs Fortran 90
Why am I getting slightly different results when I do the inverse of a matrix and multiply it by the original matrix? C++ (Eigen Library) vs Fortran (Using old Microsoft Developer Studio, Fortran ...
0
votes
1
answer
114
views
Fortran rounding decimals to .0 from netcdf file
I have a fortran 90 function that is meant to parse a time stamp in the form day as %Y%m%d.%f where %f is fraction of a day /48 and return an array with year, month, day, fraction of day.
function ...
-1
votes
1
answer
161
views
How to find minimum of each column in Fortran and sum op all elements of that column? [closed]
I have a 300x178 matrix and I want to find the minimum of each column of that matrix (1x178). Then I want that, on the location/pixel of the minimum value in each column, the sum is taken from all ...