Linked Questions
164 questions linked to/from Fortran 90 kind parameter
3 votes
0 answers
332 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
164 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 ...
69 votes
3 answers
40k views
Fortran: integer*4 vs integer(4) vs integer(kind=4)
I'm trying to learn Fortran and I'm seeing a lot of different definitions being passed around and I'm wondering if they're trying to accomplish the same thing. What is the difference between the ...
3 votes
4 answers
10k views
How to learn Fortran. Problems? [closed]
I have just got a job, starting in a months time which requires me to use fortran. I have brought a couple of books, but they seem to lack any questions or problems and that is how i learn best. I ...
6 votes
3 answers
13k views
Fortran functions returning unexpected types and values
I'm working on a project that needs to implement few numerical methods in Fortran. For this, I need to write some recursive functions. Here is my code. ! ! File: main.F95 ! RECURSIVE FUNCTION ...
6 votes
2 answers
5k views
Extended double precision
Is it possible to obtain more than 16 digits with double precision without using quadruple? If it is possible, does it depend on compiler or something else? Because I know someone said he was working ...
6 votes
2 answers
2k views
Numerical Precision in Fortran 95:
I have the following Fortran code: Program Strange Real(Kind=8)::Pi1=3.1415926535897932384626433832795028841971693993751058209; Real(Kind=8)::Pi2=3....
6 votes
6 answers
2k views
Fortran 90 Resources? [closed]
I'm taking Fortran 90 class, and I'm looking for any good websites about Fortran. Does anyone know any?
2 votes
2 answers
5k views
Fortran: Cast double precision complex to single precision
I can cast a double precision real variable into single precision using sngl. But how can I cast a double precision complex variable into a single precision one?
1 vote
1 answer
3k views
why change "complex*16" to "complex(16)" cause the runtime increased unreasonably in fortran?
This fortran code was originally written in Fortran 77 format(I will show it later). After I got it, I changed it into f90 free format via a converting tool. Using intel fortran compiler ifort, the ...
1 vote
1 answer
6k views
Segmentation fault - invalid memory reference in Fortran
Lately I received the following error in my Fortran code Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: #0 0x2AD9B0F8FE08 #1 ...
3 votes
1 answer
17k views
Program received signal SIGSEGV: Segmentation fault - invalid memory reference in arrays with big sizes
I am getting an error while I run this code. When I run the code with small L's like L=16 or L=32 I get no error but in L = 128 or L=96 after 7000-8000 steps I get following error : Program received ...
1 vote
1 answer
3k views
How to set Fortran Integer kind
program PEU3 integer(kind=7) :: num = 600851475143 integer(kind=7) :: pf, counter This is a section of my fortran code. Num is very large, so I tried to set it to kind = 7, but for some reason It's ...
4 votes
2 answers
1k views
Monte Carlo integration to find pi with a certain precision in FORTRAN
I'm taking a course in Numerical Methods and I've been requested to implement the famous Monte Carlo algorithm to find pi that you can find here. I had no difficulties in writing the code with an ...
1 vote
1 answer
4k views
"A kind type parameter must be a compile-time constant." in Fortran 90
I try to introduce complex-valued array and variables in Fortran. For the following code program integer :: i , j !two dimensional real array real(dp) :: m1(3,2) complex(dp) :: a1(3,2),...