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

learn more… | top users | synonyms

1
vote
1answer
58 views

A fast I/O file format readable by Fortran, Java, PHP?

I am writing a Fortran program that does fairly light weigt computation on fairly large data files. The output must be readable by some Java-script (that i have no insight in) and preferably also by ...
0
votes
1answer
127 views

Fortran round-off error with floating point operations

I have simple code, which flags nodes with in region enclosed by cylinder. On implementing the code, the result is mild tilt of the cylinder observed case with $\theta=90^{\circ}$. The algorithm for ...
0
votes
0answers
36 views

MINPACK implementation in Fortran77 code

I am using LMDIF1 subroutine of MINPACK Library for curve fitting. The external subroutine fo6in LMDIF1 is the program that I want to use for curve fitting and was ...
2
votes
1answer
123 views

How do I program periodic boundary conditions? [duplicate]

Hi I have a code below that solves non linear coupled PDE's given Dirichlet boundary conditions. However I need to implement periodic boundary conditions. The periodic boundary conditions are ...
0
votes
0answers
48 views

Generating Random Numbers in Fortran for Metropolis method

I am having a really hard time getting any kind of reliable / consistent result from my Metropolis code. I have torn it apart and am now examining just the randomness in my random number generator. I ...
0
votes
0answers
125 views

Heat equation from implicit scheme with Neumann B.C

To solve the heat equation from implicit scheme subject to Neumann boundary condition we can write: $$ T_i^{j+1}-T_i^{j}=\alpha (T_{i+1}^{j+1}-2T_{i}^{j+1}+T_{i-1}^{j+1}) $$ $$ \textbf{A} T^{n+1} = T^...
0
votes
0answers
51 views

Using DSYEV in LAPACK

I am calculating eigenvalues of a symmetric matrix using DSYEV in LAPACK.The concerned matrix is in a lower triangular form in a .dat file. I was searching for a simple explanation of the parameters ...
6
votes
1answer
114 views

How to compare runtimes of two algorithms in a reproducible way

I am solving one relatively simple problem with two different algorithm: one which uses brute force while the other is optimized. For a variety of reasons I actually cannot show the codes here but I ...
0
votes
1answer
98 views

efficient MPI collective non-blocking communication

I am facing a problem with MPI (Fortran). I have a really big matrix at each node and they differ at different nodes. At some point of my calculations, each node needs the matrix from all other nodes, ...
2
votes
1answer
120 views

what is the best way to code a formula to reduce roundoff error

I have an expression like the following (anyway to input latex?), $$ z^{m}\left( \ln\left(\frac{z}{z-1}\right)-\sum_{k=1}^m \frac{z^{-k}}{k} \right)$$ for m integer, z complex It seems if I code it ...
0
votes
1answer
177 views

Solve AX=B where A is skyline matrix

This is in continuation to a question previous asked; My goal is to solve an equation linear equation of the type $AX=B$, where $A$ is an $n\times n$ symmetric matrix stored in the form of symmetric ...
1
vote
1answer
150 views

Skyline solver for AX=B where A is symmetric skyline matrix

I am looking for a simple subroutine in Fortran 90 (GNU Compiler) to solve linear equation of the type $AX=B$, where $A$ is an $n\times n$ symmetric matrix stored in the form of symmetric skyline ...
0
votes
0answers
39 views

Simple fortran 90 code for skyline matrix solution [duplicate]

I am looking for a simple subroutine in Fortran 90 (GNU Compiler) to solve linear equation of the type AX=B, where A is an n*n symmetric matrix stored in the form of symmetric skyline matrix. I want a ...
6
votes
3answers
285 views

What do C, C++ and Java have that Fortran 2003 don't? [closed]

As you may know, Fortran is widely and longly (?) used in science. I've heard a lot of people saying that we natural scientists should all migrate to C++ or Java. I've seen people increasingly ...
2
votes
1answer
41 views

Is it common or to use objects for calculation of pair interactions in physics and chemistry simulations?

When simulation atoms, molecules, colloids, autc., are there programs that define each interacting unity as an object in the OOP sense? In my own case, I've been simulating magnetic nanoparticles in ...
6
votes
0answers
70 views

Library with polylogarithm function

I am looking for a reliable library where I can find polylogarithm function and newton/secant method for solving non-linear equations. Basically I have something like this: ...
3
votes
1answer
182 views

computing turbulent energy spectrum from isotropic turbulence flow field in a box

I have my 3 dimensional velocity flow-field u, v and w at a given instant of time from DNS using pseudo-spectral method. I need to calculate the energy spectrum ( in Fourier space ) as a function of ...
3
votes
1answer
138 views

Meshing options to generate number of the sides of and element (tetgen-triangle)

I wrote a finite element code in fortran 90. This code is really fast, except the meshing process. I used triangle and tetgen for meshing in 2D and 3D, respectively, so this process is fast, of ...
2
votes
2answers
380 views

Linear interpolation in Fortran

Is there a Fortran subroutine which performs linear interpolation in one-dimenional data? I need something similar to MATLAB function interp1.
0
votes
0answers
42 views

ARPACK- Reverse Communication Interface

I am trying to use ARPACK to diagonalize a sparse Hermitian matrix. My program is executing without error but returning incorrect eigenvalues. I have tried to trace the problem back. The work is ...
4
votes
2answers
192 views

Finite element library in fortran

I want to create a finite element code in fortran. There are many libraries out there on internet. Can someone suggest me a good finite element library in fortran? I am looking for Ease of use (...
1
vote
1answer
73 views

Comm argument on MPI_Reduce in FORTRAN giving unusual results

I'm putting together a very simple integration program in FORTRAN using MPI. I have done this with C and all was well. However, in my "MAP_REDUCE" call, the comm argument seems problematic. I have ...
3
votes
2answers
305 views

Fortran code for Ewald summation

I am trying to write a code to calculate the potential and forces, for the same using ewald summation.For this purpose, the formula for potential and force I have used is : $$ U = U^{(r)} + U^{(k)} +...
2
votes
2answers
233 views

Efficently invert tiny matrix in Fortran

I have a piece of code in Fortran90 in which I have to solve both a non-linear (with the Newton-Raphson method, for which I have to invert the Jacobian matrix) and a linear system of equations. When I ...
3
votes
1answer
144 views

Finite element mesh software

I'm looking for a program to obtain meshes to finite element codes 2D and 3D as complete as possible, preferably in fortran 90 or C/C++. For example, softwares "Triangle" or "TetGen" generate meshes ...
0
votes
0answers
22 views

fortran lib for sine weave with vectors as input

Hi i have problem with calculating sine wave. With python numpy, numexpr calculation of sine wave from equation z = sum(Asin(omt+eps),axis=1), takes me something like 1min50sec when shapes of A,om,eps ...
2
votes
0answers
124 views

Molecular dynamics: Lennard-Jones forces in 2D system

As I am new to all these stuff I would like to verify whether my procedure is correct. I need to calculate the Lennard-Jones potential, potential energy of the system and the forces. The procedure ...
5
votes
2answers
370 views

How to Run MPI-3.0 in shared memory mode like OpenMP

I am parallelizing code to numerically solve a 5 Dimensional population balance model. Currently I have a very good MPICH2 parallelized code in FORTRAN but as we increase parameter values the arrays ...
1
vote
3answers
131 views

Constructing sparsity pattern of the Jacobian of a FORTRAN subroutine

I need to calculate the Jacobian matrix of a subroutine F(U). Both F and U are of size N(=O($10^5$)). Using Tapenade, I differentiated the routine in tangent mode. I cannot calculate the full Jacobian ...
0
votes
1answer
119 views

Efficient method to multiply floating point matrix with binary matrix and get double precision results

I have a matrix A which is of size (n2, n1) and I am multiplying it by a matrix, B, of size <...
2
votes
0answers
43 views

Fortran solver for the Sparse LSE problem

I was wondering if there is a Fortran library that contains a solver for the Sparse LSE(linear equality-constrained least squares) problem $$ min_{x}\|Cx-d\|^2 \text{ subject to } Ax=b $$ where $A$ ...
1
vote
0answers
127 views

Differences in answers between Python and Fortran [closed]

I am translating a piece of Fortran code into Python and am testing my code with a certain test case. All the results differ with 0.04% compared to the Fortran results. This is a very small ...
0
votes
0answers
72 views

Monte Carlo simulation

I am wondering if I am thinking correct about the following problem : ...
1
vote
1answer
64 views

Shifting points in fortran

Hello I am trying to shift points which have been previously generated in the square area. I am having a trouble with some additional conditions how they should have been shifted. ...
1
vote
1answer
147 views

How do Fotran77 and Fortran90/95 differ in performance via present-day compilers with array manipulation?

I would like to write the most optimized program for array manipulation in Fortran (e.g. matrix multiplication of large matrices, squaring large matrices, etc.) So, using the fortran compilers on the ...
0
votes
0answers
37 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 ...
1
vote
1answer
67 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
134 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
121 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 \mathbf{...
1
vote
1answer
138 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
484 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
69 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 ...
2
votes
4answers
1k 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
81 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
59 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) = \frac{|a|x^{ap-1}}{b^{ap}B(p,q)(1+(x/b)^a)^{p+...
13
votes
2answers
3k 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?
2
votes
0answers
241 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 ...
2
votes
2answers
346 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
117 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 ...
1
vote
2answers
138 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 ...