Linked Questions
77 questions linked to/from Fortran: integer*4 vs integer(4) vs integer(kind=4)
3
votes
0
answers
342
views
What is the standard for precision specification in Fortran? [duplicate]
Let's say if I want a double-precision real, what is the correct way to set the precision of the variable? But not just limited to double precision. I am trying to teach myself Fortran. I have been ...
0
votes
0
answers
170
views
How can we calculate a large number in fortran 95 [duplicate]
I'm using silverfrost 95 to coding fortran. I want to calculate large numbers for example 5^5432854
but it errors "integer overflow", I tried kind 8 but it errors "error 600 - The KIND ...
0
votes
0
answers
53
views
gfortran variable declaration to store 32-bit integer netcdf [duplicate]
I'm having problems to understand what's going on with my fortran subroutine (2003 standard) to read netCDF-4 data. The compiler I'm using is gfortran.
I have to read a 32-bit integer from a netCDF ...
0
votes
0
answers
40
views
real*8 vs double precision type declaration in Fortran [duplicate]
I have a large old code I am cleaning up and updating. Comparing my new version to the old version I have noticed that the final result, given as a double precision float, is never precisely the same, ...
56
votes
6
answers
80k
views
Fortran 90 kind parameter
I am having trouble understanding Fortran 90's kind parameter. As far as I can tell, it does not determine the precision (i.e., float or double) of a variable, nor does it determine the type of a ...
user avatar
Lana
37
votes
3
answers
82k
views
What does "real*8" mean?
The manual of a program written in Fortran 90 says, "All real variables and parameters are specified in 64-bit precision (i.e. real*8)."
According to Wikipedia, single precision corresponds to 32-bit ...
13
votes
2
answers
53k
views
Fortran: the largest and the smallest integer
Fortran is completely new for me, can anybody help me to solve the follwing problem? I want to find out all the integer kind numbers and the largest and the smallest value for each kind number on my ...
19
votes
1
answer
7k
views
Is there a difference when declaring a variable with a double colon
When declaring variables is there a difference when using a double colon?
real(8) :: a
real(8) b
Both of these apparently do the same thing. Is there any difference between these besides style?
I ...
5
votes
2
answers
3k
views
Does Fortran have inherent limitations on numerical accuracy compared to other languages?
While working on a simple programming exercise, I produced a while loop (DO loop in Fortran) that was meant to exit when a real variable had reached a precise value.
I noticed that due to the ...
4
votes
3
answers
10k
views
Long ints in Fortran
I'm trying to work with large numbers (~10^14), and I need to be able to store them and iterate over loops of that length, i.e.
n=SOME_BIG_NUMBER
do i=n,1,-1
I've tried the usual star notation, kind=...
2
votes
4
answers
11k
views
Precision problems of real numbers in Fortran [duplicate]
I've been trying to use Fortran for my research project, with the GNU Fortran compiler (gfortran), latest version,
but I've been encountering some problems in the way it processes real numbers. If ...
4
votes
2
answers
2k
views
Why do I have to specify implicitly for a double precision return value of a function in Fortran?
I am new to Fortran and I am trying on the common block. My code is simple
program main
implicit double precision (p)
real * 8 :: x, y
common /yvalue/ y
x = 3d0
y = 3d0
print *...
3
votes
3
answers
4k
views
Error: Operands of logical operator '.eq.' at (1) are INTEGER(4)/HOLLERITH
I am new in Fortran. So I need help. I'm using gfortran on SUSE to compile my code and receive the following error:
200 IF ( ID .EQ. 4HEOT ) GO TO 20
1
Error: Operands of logical ...
2
votes
4
answers
4k
views
Force explicit variable declaration with gfortran
I am linking some fortran code (f90) from matlab using mex and I am having matlab freeze occasionally.
In the past, I had freezing happening due to mismatch between data types (say integer*4 vs ...
3
votes
3
answers
521
views
Convert upper triangular matrix into vector In Fortran
I would like to convert upper triangle part of the matrix to the vector.
For example I have the following matrix (4x4 for simplicity):
1 2 3 4
5 6 7 8
9 10 11 ...