Fortran is a general purpose programming language widely used by the scientific computing community.

learn more… | top users | synonyms

1
vote
1answer
36 views

CUDA Fortran: Multi GPU Programming and memory allocation

I am writing a program that is supposed to use multiple GPUs on a single node using CUDA Fortran. Although I've looked through the Portland Group CUDA Fortran Reference, I am still unclear about how ...
0
votes
0answers
30 views

How much time does DSYEV take to diagonalise a $N \times N $

I have been using a DSYEV, for some time. My instructor told me to calculate how much time does DSYEV take to diagonalise a $N \times N $. I know, in our case matrix M is symmetric. Standard ...
0
votes
1answer
43 views

Using OpenMP in Fortran for common array operations

In Fortran, given arrays A(1000000) and B(1000000), and to compute the sum you simply write: C = A + B However, when I want to implement OpenMP, I have to write ...
4
votes
1answer
130 views

Pre calculate mathematical expressions in Fortran 90

Is there some flag to let the Fortran compiler pre calculate a math expression before compiling it?. I have to write expressions that contain many small 4x4 matrix multiplications. The thing is, most ...
1
vote
2answers
99 views

Lua and Fortran (or Python) I/O

I am writing a global climate simulation software system. My idea is the following : At the top of everything, I interface to the OS using D, a very powerful language for compile time code ...
0
votes
0answers
24 views

F2Py with allocatable and assumed shape arrays as callback arguments

I would like to use f2py to overload some fortran subroutines in my main fortran program by python methods. Some of these subroutines receive an assumed shape array. I have found here how to make ...
2
votes
2answers
176 views

CFD absractions in Modern Fortran

I'm a novice in object-oriented programming, but this design technique seems very interesting for me. I have a Fortran 90 CFD package , not very complex, but it is already very hard to maintain and to ...
1
vote
1answer
36 views

Compiling HSL_ME57 and interfacing with C code

Has anyone here had any success (or at least tried) compiling the HSL_ME57 (or similar such as MA57, etc.) matrix factorization libraries? Do any C wrappers exist for the Fortran function calls? I'm ...
3
votes
1answer
94 views

Fortran 90/95: Deallocating variables

I understand the crucial importance of freeing memory when certain variables or arrays need to be reused later in the program, or may not be in use for a while. However, in my experience with ...
0
votes
1answer
96 views

MPI_ERR_TRUNCATE appears for no understandable reason

I am developing some parallel CFD code using Fortran 90 and OpenMPI. The processes are structured into two groups such that half perform a certain type of calculations (let's say Velocity, Pressure ...
0
votes
0answers
29 views

Molecular Dynamics : Phase transition Lennard Jones potential

I'm doing molecular dynamics of $N$ bodies interacting through Lennard-Jones potential. I'm studying the hysteresis phenomena in the phase transition solid-liquid and liquid-solid. Which parameters ...
0
votes
2answers
52 views

Molecular Dynamics: Diffusion with PBC

How can I implement the computation of the diffusion coefficient $D$ using periodic boundary conditions (PBC)? I use molecular dynamics of a set of $nboby$ particles with positions $pos(3,nbody)$ in ...
1
vote
1answer
66 views

Heuristic help with preconditioning large system ODEs

I'm looking for some general insight on preconditioning. In particular, relevant references/resources/comments would be greatly appreciated. Note, I have been through some of the literature, but am ...
1
vote
0answers
75 views

Why would this a pair of E5-2670 cpus be faster than 4 E5-2640 cpus for large matrix diagonalisation problems?

Not really much more to say; Of several computers available for use, these are two of the larger ones; one has 2x E5-2670, and the other has 4x E5-4640. The problems we're looking at essentially boil ...
1
vote
2answers
114 views

Python like generic List in Fortran [closed]

I like to have a list just like in Python, but for Fortran. I know that there is a generic list type. But here I would have to define a type for each data I would like into the list, e.g. one for ...
2
votes
1answer
79 views

'Varargin' in Fortran

Consider the following: I would like to solve a differential equation in Fortran (with a Runge-Kutta routine), e.g. x'=-a*x, where ...
3
votes
6answers
1k views

Python vs FORTRAN

Which one is better: FORTRAN or Python? And I guess that in both cases you need Gnuplot, am I right? I'm working on a Windows machine at the moment. I'd like to use it to get numerical solutions for ...
2
votes
2answers
200 views

Newton-Raphson method fails!

I am trying to solve an equation like $R(x) = 0$, using Newton-Raphson method. To obtain the $x$ increment in each iteration I solve $dx = -(A)^{-1}\cdot R$ where $A = dR/dx$. But the convergence ...
3
votes
3answers
181 views

How to solve a Linear Matrix Equation: AX-XA=B efficiently?

recently I have been working on solving some math problems using Fortran. There occurs to me that a linear matrix equation: $$ AX-XA=B $$ where $A$ and $B$ are known $n\times n$ matrices and $X$ is ...
0
votes
0answers
36 views

how to detect planets in resonance

I make this program, i have a 2xN matrix in which the columns are the ID of planets and their period, the rows are the number of planets, for istance something like that: ...
1
vote
1answer
219 views

Parallel 2d heat equation (implicit timestepping) using MPI

I am trying to solve the time dependent heat equation with backward euler timestepping and second order space finite differences. This results in a Poisson system needing to be inverted. In serial ...
2
votes
1answer
151 views

2-body problem with Fortran 95

I am trying to implement the N-body problem using Fortran 95. Before generalizing it to N bodies, I am first trying to calculate the motion of a single orbiting body (body 2 in my code below) around a ...
1
vote
2answers
72 views

How to design a Hessian Algorithm based on Gradient Algorithm?

I have a question which I think should be pretty simple. I have written a subroutine in Fortran which will compute the Gradient at a point of the form ...
1
vote
2answers
187 views

Stop process from continuing until others have finished MPI

I am looping an array using MPI. The problem is, i think that some processes are moving onto their next iteration before other precesses have finished theirs. This is causing me problems because data ...
0
votes
0answers
107 views

How can we visualize the data in polar coordinates using openDx?

Actually I am trying to visualize data in polar coordinates using openDx but openDx always does in Cartesian coordinates i-e in box shape I want circular shape of my data. I want the data ...
1
vote
1answer
279 views

Lid driven cavity flow problem to solve with the help of projection method and use coding in fortran 90 [closed]

I want to solve Lid driven cavity flow with the help of projection method i want to make own fortran program to solve two dimensional unsteady flow. I propose to solve the equations in the following ...
4
votes
1answer
785 views

Fortran, making a more efficient bilinear interpolation

I'm trying to write an efficient bilinear (2D)-interpolation, after reading some recipes, as a fortran-mex for Matlab that is used extensively throughout a long algorithm of solar image processing, ...
2
votes
1answer
192 views

how to use lanczos code from netlib for large sparse symmetric matrix?

I want to use lanczos method to calculate the few lowest eigenvalue and eigen-vector of a large sparse symmetric matrix(~50k x ~50k). In http://www.netlib.org/lanczos/index.html I found the codes ...
5
votes
4answers
271 views

Need Fortran 77 compiler

Does anyone know a compiler for Fortran 77 available as a free download? I have pre-written 77 code from a source published in the early 90's that I just need to compile, build, and run. But I don't ...
1
vote
3answers
287 views

Eigenvectors: Mathematica vs. LAPACK dgeev

I've been using LAPACK dgeev in FORTRAN in the last months spending hours to diagonalize ~4000*4000 matrices. It takes about 2'75 hours to find eigenvalues and ...
0
votes
1answer
371 views

what is difference “DSYEV(LAPACK SUBROUTINE)” and “Lanczos”?

I am working on Fermion and Boson Hubbard Models, in which the dimension of Hilbert Spaces are quite large (~50k). Because the Hamiltonian matrix is ~50k X ~50k, to diagonalize these big sparse ...
6
votes
4answers
673 views

Learning Fortran

I was wondering what is the best way to learn how to program in Fortran ? I've been looking for books, the examples that seemed OK to me were "Fortran 95/2003 Explained" and "Fortran For Scientists ...
6
votes
1answer
359 views

Generalized Singular Value Decomposition: only compute the r largest singular values

I want to compute the Generalized Singular Value Decomposition for sparse matrices with a size of up to 1000000 x 1000000 (not necessarily square). The method is going to be used in machine learning ...
2
votes
2answers
160 views

Programming with Fortran, large eigen value problem

I use matlab/fortran to deal with some large eigenvalue problem (FEM type). For example, I use spalloc and eigs to declare and solve the problem in Matlab, could anyone give some advice on how can I ...
2
votes
2answers
109 views

MPI_Send/Recv not transmitting initial entries

Problem I'm building a simple MPI Send/Recv hello world in Fortran and am running into an odd error. I want to make sure I'm not missing anything trivial before blaming OpenMPI or gfortran. In the ...
8
votes
2answers
379 views

An Octree Code in Fortran

I am new to scientific computing. I am looking for a Fortran ( preferably f90) implementation of an Octree. My problem requires an Octree which divides my domain until there aren't more than some N ...
4
votes
2answers
128 views

How does longer simulation time affect simulation results?

I have a transient flow and solute transport simulation running using a fortran code. The final solution time is 1 day. I need the output of hydraulic head for the output time of 0.5 day. I want to ...
4
votes
2answers
2k views

F2Py with allocatable and assumed shape arrays

I would like to use f2py with modern Fortran. In particular I'm trying to get the following basic example to work. This is the smallest useful example I could ...
3
votes
1answer
378 views

Effecient CFD programming techniques

I'm trying to make highly efficient CFD programming complex for solving combustion problems. I've finished writing core which realises mathematical model, and now I'm concerned about code performance. ...
9
votes
3answers
546 views

Fortran: Best way to time sections of your code?

Sometimes while optimizing code it is required to time certain portions of the code, I have been using the following for years but was wondering if there is a simpler/better way to do it? ...
2
votes
1answer
201 views

Memory management in time-domain simulation

I develop a parallel time-domain DAE simulation software using OpenMP and Fortran 2003. The main algorithm is: ...
6
votes
5answers
237 views

Evaluate the sum

I want to evaluate the sum $$\sum_{k=1}^\infty \left(\frac{i+1}{\sqrt{2}}\right)^k\cdot k^{-\alpha}$$ where $i=\sqrt{-1}$ and $\alpha\in[\frac{3}{4},1]$ with 8 digits accuracy. If I am willing to ...
3
votes
0answers
128 views

How to accurately decompose positive semidefinite matrix and use the lower triangular part in linear equations

I have $n$ arbitrary $p\times 1$ vectors $x_i$, and $p\times k$ matrices $A_i$, and $n$ $p \times p$ positive semidefinite matrices $S_i$, where some (often most) of the $S_i$'s are same (for example ...
4
votes
1answer
398 views

Grid mapping from an unstructured triangular mesh to a regular rectangular mesh

I am modeling fracture propagation using a 2-D dynamic unstructured grid. As the fracture propagates over time, the elements move accordingly. For a given time step, I would like to interpolate the ...
11
votes
2answers
1k views

Row major versus Column major layout of matrices

In programming dense matrix computations, is there any reason to choose a row-major layout of the over the column-major layout? I know that depending on the layout of the matrix chosen, we need to ...
7
votes
2answers
2k views

Memory usage in fortran when using an array of derived type with pointer

In this sample program I'm doing the same thing (at least I think so) in two different ways. I'm running this on my Linux pc and monitoring the memory usage with top. Using gfortran I find that in the ...
4
votes
1answer
524 views

How to get sparse complex matrices from my code to PETSc efficiently

What is the most efficient way to get a complex sparse matrix from my Fortran code to PETSc? I understand that this is problem dependent, so I tried to give as many relevant details as possible below. ...
2
votes
1answer
727 views

Where is the bug in my fourth order Runge-Kutta method implementation?

I am trying to build a Runge-Kutta code to integrate the equations of motion for a simple harmonic oscillator. However, when I run the code, I only see first order improvement in the error as I ...
7
votes
3answers
739 views

How do I know if my code is being vectorized by the compiler?

As exemplified by Jed Brown's answer to Costs of lookups versus calculations, using vectorized vs non-vectorized floating point operations results in much faster code. Many modern compilers claim ...
14
votes
5answers
1k views

Parallel Scientific Computation Software Development Language?

I want to develop a parallel scientific computation software from scratch. I want some thoughts on which language to start. The program involves reading/writing data to txt files and doing heavy ...