Tagged Questions

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

learn more… | top users | synonyms

0
votes
0answers
20 views

computational science fortran 90 solar cycle fortran model [migrated]

I'm a new fortran user. I've been given a task and I'm not quite sure how to tackle it. The task is: **Solar radiation is an energy source which plays a central role for atmospheric processes. Half ...
1
vote
0answers
22 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
94 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
42 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
58 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 ...
1
vote
1answer
49 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
35 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
55 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
139 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
110 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
40 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
193 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
40 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
119 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
135 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
37 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
57 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
69 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
131 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
89 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 ...
4
votes
6answers
2k 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
213 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
198 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
250 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
171 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
83 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
266 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
113 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
297 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
942 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
205 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
287 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
311 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
439 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
753 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
377 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
168 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
112 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
403 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
393 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
642 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
239 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
131 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
423 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 ...