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

learn more… | top users | synonyms

0
votes
0answers
17 views

How to use QUADPACK for complex integrand with independent parameters?

I am new to fortran and wish to integrate a function using one of the standard quadrature methods contained in quadpack.f The problem is that my integrand is of a ...
0
votes
0answers
33 views

Optimization of nonlocal stencil-like operator on subset of regular grid

I am trying to optimize the execution time for this particular piece of fortran code. Details: i_gc is a (ngpts, 3) array of containing (i,j,k) indices for each grid point. This is a subset of the ...
0
votes
1answer
42 views

Incomplete Cholesky

Is there an efficient way to perform an incomplete Cholesky factorization on a symmetric positive definite sparse matrix (CSR format), in order to use it as a preconditioner for a CG solver? Is there ...
2
votes
1answer
60 views

precision loss in non-trigonometric, periodic functions using FFTW and NaNs after marching forward in time (Fortran)

I have developed a pseudospectral solver of the Navier-Stokes equations using FFTW. I tested my formulation of right hand sides (RHS) of the NS equations against standard trigonometric functions ...
2
votes
0answers
39 views

Iteratively finding both left and right eigenvectors for non-symmetric complex matrix

I have a complex, non-Hermitian matrix $\mathbf{A}$, for which I need to find a few eigenvalues and eigenvectors in the generalised eigenvalue problem: $$\mathbf{A}\cdot \mathbf{x} = \lambda ...
1
vote
1answer
65 views

OpenMP threaded nonlinear solver for complex numbers

Problem: I have translated Jacobian-Free Newton-Krylov solver written by C. T. Kelley to Fortran and now want to parallelize it on shared-memory system with OpenMP. In addition, I want to precondition ...
3
votes
2answers
436 views

literature on scientific computing

Maybe, this is a dump question. But anyway. I developed a finite difference code for a class of problems in dynamo theory. I used GNU Octave (MATLAB) which is good for testing. The problem size ...
2
votes
0answers
59 views

How to fix time intervals to store data in a stochastic simulation (continous time markov chain)

I am using FORTRAN to implement Gillespie's stochastic simulation algorithm. I would be running many simulations in parallel (both parallel instances with different seed and parallel functions); if I ...
0
votes
3answers
287 views

Use of Java or Scala in HPC?

I was looking to brush up and/or pick up some languages for a hobby project on my free Amazon EC2, and I was going through the benchmark results for Java vs C (or Scala vs C)and Fortran vs C. It seems ...
0
votes
2answers
78 views

How in Fortran 77 or in the next standards to do a multi-column out put in a simple calculation, having a Nested loop?

I have a simple question concerning the management of the output after running a Fortran code, having a NESTED LOOP.. I want to calculate for different k=1,5,9 the value $\mathbf{Sin(kx)}$ in the ...
1
vote
1answer
41 views

Sampling from the Generalized Beta of the Second Kind in Fortran

I need to sample from the generalized beta of the second kind (GB2) distribution (McDonald, 1984, Econometrica). Its PDF has the form $$ f_{a,b,p,q}(x) = ...
11
votes
1answer
2k views

Which version of Fortran should I learn?

I'm a Mechanical Engineering student interested in the field of aerospace engineering where, I'm told, Fortran is still commonly used. Which version of Fortran should I invest my time to learn?
1
vote
0answers
57 views

Fortran library for minimization or maximization of functions (optimization problem)

I'm looking for a library or individual package which provides convenient optimization subroutine for Fortran, any suggestions? I'm testing the codes from Numerical Recipe, downhill simplex method ...
1
vote
2answers
197 views

(Fortran) Integrating/summing over complicated 3D domain

I have some function $F(k_x,k_y,k_z)$ that I wish to numerically integrate over a polygon domain - physically, I am integrating over the first Brillouin Zone (BZ) of the FCC lattice (a truncated ...
1
vote
1answer
75 views

Fortran 2003 ARPACK wrapper

I wrote a Fortran 2003 wrapper for the ARPACK routine znaupd, basically translating the the example driver routine zndrv1 into modern Fortran 2003 language with automatic arrays. I initialize every ...
0
votes
2answers
113 views

Azimuthal average in Fortran? Find indexes in Fortran?

I am working on an eigenvalue problem in fortran. I have used Lapack to solve the problem and get the eigenvalues and eigenvectors. This is done for $201\times101$ wavenumbers, only half the wavespace ...
2
votes
1answer
86 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
46 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
169 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
164 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
200 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
81 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
276 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
52 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 ...
4
votes
1answer
266 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
527 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
1answer
70 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
115 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
84 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
82 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
183 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
112 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 ...
8
votes
6answers
5k 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
322 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
302 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 ...
1
vote
1answer
337 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
266 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 ...
2
votes
2answers
125 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 ...
2
votes
2answers
744 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
133 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
412 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
1k 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
259 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
353 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
435 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
634 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
1k 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
517 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
202 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
128 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 ...