Questions tagged [fortran]
Fortran is a general-purpose, procedural, imperative programming language that is especially suited for numeric computation and scientific computing. Since 2003, standard Fortran also supports object-oriented programming. Fortran 2008 introduced coarrays for SPMD parallel programming. This tag should be applied to all questions about the Fortran language; other specific tags can be added for compilers, language revisions and particular aspects of use.
fortran
13,112
questions
0
votes
1
answer
63
views
Loop Splitting Decreases Performance in Intel Fortran
Compiler: Intel Fortran 2024
Operating System: Windows 11
I'm pretty new to Fortran, working on a Fortran project and found out that the loop splitting will decrease the efficiency dramatically.
For ...
0
votes
0
answers
47
views
What is causing these mathematical inaccuracies in my code? [duplicate]
After learning that the function representing the velocity of an object with respect to time is the derivative of the function representing the position of the object with respect to time, I made this ...
1
vote
0
answers
48
views
How to create a Fortran Interface for a C function that takes a Fortran function as input using Fortran-C Interoperability?
I have a C library with a function Calculate_Integral that performs definite integration on a given C float function within specified limits and parameters. The signature of this C function looks ...
2
votes
2
answers
79
views
passing an allocatable multi dimensional fortran array to a C function
I have the following main program in Fortran
program test
use iso_c_binding
implicit none
real(c_double), dimension(:,:), allocatable :: a
allocate(a(2,3))
call c_func(a)
print *,a
end program ...
0
votes
1
answer
52
views
Unexpected Data Transfer in Fortran OpenACC: Debugging transfer$r Copies
I have the following fortran openacc code for batched dgemm and was trying to instead make only a single allocation for the workspace:
! nvfortran -acc -Minfo=all -cuda -gpu=lineinfo -cpp -g -O0 -...
-2
votes
0
answers
36
views
complile Mstar code with gfortran, what is wrong? [duplicate]
any solution
**bouchentouf@bouchentouf-desktop**:~/wien/SRC_mstar$ make
gfortran -L/lib/intel64 -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread -fopenmp -ldl -g -fbacktrace -ffpe-summary=none -o ...
0
votes
1
answer
61
views
Proper dereferencing of Fortran double precision values in GDB
I am using Fortran double precision reals. gdb works correctly, e.g.
(gdb) p t(27,8,1)
$17 = 4816.0976560758863
Sometimes I need to watch addresses, so
(gdb) p &t(27,8,1)
$18 = (PTR TO -> ( ...
0
votes
0
answers
29
views
What happens if I assign a Fortran character type using a literal that is too short? [duplicate]
Suppose I have the following Fortran code:
character(len=1000) :: my_string
my_string = "hello world!"
Since hello world! is only 12 characters long, what happens to the other 988 ...
0
votes
0
answers
62
views
fftw3 results invalid memory reference error
I'm encountering a problem, which I am not being able to solve despite trying several options. The problem goes like this.
I have to carry a FFT forward transformation for a Poisson solver, which I'm ...
2
votes
0
answers
41
views
Using Assumed Rank with Unlimited Polymorphic Issues
There must be something I'm misunderstanding.
I'm attempting to use an assumed rank unlimited polymorphic variable to store data. When I do this I either get access violations or corrupted data. I ...
2
votes
1
answer
78
views
QR decomposition successful but has high errors
I have two implementations of QR decomposition in a Fortran code. One is a custom QR decomposition function:
! QR decomposition solving for vector B in AX = B
subroutine qr_eqsystem(A, B, X, M, N, ...
0
votes
1
answer
34
views
mpi cluster debugger
I am trying to debug an MPI application using Intel MPI and Fortran in Visual Studio 2019. When I press F5 to start debugging, it does not work. There is no MPI CLUSTER DEBUGGER in Debugging > ...
0
votes
0
answers
40
views
Fortran class select type with multiple arguments
I want to write a subroutine taking as argument two class objects which can be of any extended type from a common ancestor. Inside the subroutine I will have a type select to check the class. Since I ...
1
vote
1
answer
49
views
Why does this allocatable array cause an error?
I don't entirely understand allocation, so this may be a simple problem, but I wrote this Fortran code:
program name
implicit none
integer :: A, B
integer, dimension(:), allocatable :: ARR
...
0
votes
1
answer
43
views
What are len and kind parameters in a parameterised derived type?
fortran-lang.org's Quickstart Tutorial gives the following example for a parameterised derived type:
type, public :: t_matrix(rows, cols, k)
integer, len :: rows, cols
integer, kind :: k = kind(0....