Questions tagged [fortran]

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

23 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5 votes
0 answers
526 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{...
DaveP's user avatar
  • 161
4 votes
0 answers
415 views

Algorithm for face based data-structure - CFD

Good morning I'm trying to develop an unstructured CFD code to solve Euler equations in a finite-volume (cell-centered) context (learning purposes). I was able to build from a cgns file some basic ...
LM_O's user avatar
  • 77
3 votes
0 answers
3k 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 ...
Hai-Wei LONG's user avatar
3 votes
0 answers
182 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 ...
Jouni's user avatar
  • 131
2 votes
0 answers
72 views

OpenMP Fortran array operations in target regions

I am asking this here for the possibility that someone here is familiar with OpenMP offloading. Is there some other way to parallelise Fortran array operations outside of unrolling the loops of the ...
Touko Puro's user avatar
2 votes
0 answers
59 views

Losing memory on each call to scalapack solve function

I am solving a large system of equations using scalapack. Some systems that should run with no problem failed, apparently due to lack of memory in an mpi call. After investigating with ...
mp_def's user avatar
  • 21
2 votes
0 answers
75 views

Parallel compact schemes using the Parallal Diagonal Dominant (PDD) algorithm

I would like to use the PDD algorithm developed by Sun to solve tridiagonal matrices in parallel for the following compact finite difference scheme: $ \begin{align} \dfrac{1}{4}f^{'}_{i-1} + f^{'}_i +...
user26633's user avatar
2 votes
0 answers
192 views

Mass conservation in atmospheric continuity equation numerical solution

My phd project is heavily related to numerical modeling of planetary atmospheres. In particular now I am dealing with a particular expression of the continuity equation, involving a thermodynamic flux....
Juanlu's user avatar
  • 21
2 votes
0 answers
604 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 ...
Beginner in fort's user avatar
2 votes
0 answers
85 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$ ...
Patrick's user avatar
  • 21
2 votes
0 answers
87 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 ...
WYSIWYG's user avatar
  • 143
1 vote
0 answers
69 views

Fortran - Lid-Driven Cavity Boundary Conditions Error when using SIMPLE method

I am studying Numerical Methods for incompressible flows. part of the tasks is to model the lid driven cavity problem in 2D using the SIMPLE method. I have been provided with Fortran code that is ...
Xray25's user avatar
  • 21
1 vote
0 answers
221 views

Fortune algorithm for voronoi diagram

Although there are many algorithms to construct Voronoi diagram, some of them are faster than others. Based on my knowledge Fortune algorithm is fastest for construct Voronoi diagram either in two ...
ALIN's user avatar
  • 11
1 vote
0 answers
111 views

Dealing with non-physical negative ODE solutions using ODEPACK

Hi and thank you all again. I am solving the reaction-diffusion-advection equation as follows $ \partial_{t} n\left(t,z\right) = -\partial_{z}\left(\Phi\left(t,z\right)\right) + p\left(t,z\right) -n\...
Juan Luis Gómez González's user avatar
1 vote
0 answers
154 views

Computing only the $k$ biggest eigenvalues and eigenvectors with Scalapack

Given that there are eigensolvers in Scalapack that use a divide and conquer method, is there any way we can use Scalapack functions to only compute the first $k$ dominant eigenvalues and ...
Yacine E.Faris's user avatar
1 vote
0 answers
933 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 ...
Joseph's user avatar
  • 131
1 vote
0 answers
1k 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^...
Abolfazl's user avatar
  • 111
1 vote
0 answers
53 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 ...
user1984528's user avatar
1 vote
0 answers
127 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 ...
will's user avatar
  • 131
0 votes
0 answers
89 views

Sparse linear solver in fortran working with REAL16

I need some (direct) sparse linear solver for fortran, which works with REAL16 data type. Any suggestions? Both Pardiso and MUMPS support only REAL8. (identical question: https://math.stackexchange....
Vítězslav Štembera's user avatar
0 votes
0 answers
148 views

Windows Fortran compiler for legacy Finite Element (1980) code?

The version of Fortran used comes from Montreal Ecole Polytechnique in 1980. I need a compiler for Fortran for Windows 7 or Windows 8.
Daniel Bedard's user avatar
0 votes
0 answers
23 views

How to convert this code to scan random datas instead of binned datas?

I am new to Fortran and I am trying to write a code using random data instead of binned data in x, y, z as shown in my sample code. ...
Dark Knight45's user avatar
0 votes
0 answers
104 views

Create random number generator from a top hat distribution

How would I use a random number generator to give random numbers from a top hat distribution in Fortran? I've seen lots of information about how to make a Gaussian random number generator, but not one ...
Pruthvi Mehta's user avatar