Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [fortran]

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

0
votes
1answer
61 views

Compute outward normal and surface area for 8 noded brick element in FEA

I have a cube which is divided into 8 small cubes by bisecting each edge, I am trying to find out the surface area of each of the faces and the corresponding outward normals for them. This operation ...
0
votes
2answers
92 views

How write a integration loop in fortran, leapfrog scheme to solvind PDE (advection)?

I want to resolve numerically this equation using of difference finite method with Leapfrog Scheme $$\frac{\partial{u}}{\partial t}+ v \frac{\partial{u}}{\partial x}= 0 $$ I'm trying to write a code ...
4
votes
2answers
100 views

Analytical testing/quality control for scientific software in professional setting

I am charged with maintaining a buildserver on Teamcity which is meant to test our in house FE software. Currently our test suite consists of a list of benchmarks which run every time a commit is made ...
3
votes
1answer
105 views

Compute bilinear form with LAPACK

I need to compute a bilinear form for a set of left and right vectors $$ w_k = \sum_{i,j} V_{ik}^*A_{ij}U_{jk},$$ where $A_{ij}\in\mathbb{R}$ and $U_{jk}, V_{ik} \in \mathbb{C}$ (Assume that all the ...
2
votes
0answers
50 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 +...
4
votes
1answer
139 views

Recommended language/environment for large scale semi-continuous biological models

We have a fairly large (maybe 1000 equations) differential-algebraic equation model written in ACSLX, an obsolete modelling environment similar to Modelica. The model represents the evolution of a ...
0
votes
1answer
206 views

implementation of a simple SPH example

I am currently learning the Smoothed Particle Hydrodynamics method that I need to use later in my thesis. I have studied the mathematics behind the method and I want to code a simple example to show ...
1
vote
0answers
56 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\...
0
votes
3answers
200 views

Why there are people that still prefer fortran 77 over new versions?

I am reading some notes from a course in numerical analysis for physical sciences and it is my impression that there are still people that prefer Fortran 77 over new version due to the implicit ...
1
vote
1answer
95 views

Bulirsch-Stoer algorithm to solve simple chemistry. Spanning long time intervals after stationarity

Hi all and thank you in advance. I am working on a time-dependent transport-chemistry model to study the composition of planetary atmospheres. The equations are the following $$\frac{\partial n(z,t)}...
0
votes
1answer
65 views

implicit method (crank-Nicolson) I not understand the procedure [closed]

I'm trying to understand the passage through this equation can be written for easily solved with the fortran alghorithm in particular i don't understood the meaning of L_x and L_xx ... what (-1,0,1) ...
0
votes
1answer
124 views

Parameter identification for first order ODE

I have two arrays $f(z)$ and $z$ both indexed by k and I want to solve $\frac{df}{dz}=\mu(1-f)$ to find $\mu(z)$ What would be the best numerical method to solve this equation?
3
votes
1answer
734 views

Loop optimization with f2py, Cython and Numba

I tried to used f2py, Cython and Numba to make a simple loop structure be faster in python. Python implementation: ...
1
vote
1answer
110 views

LAPACK: ZGETRF with INFO greater than zero but ZGETRI does not fail.

I am computing the inverse of a complex matrix. I execute ZGETRF but U(2,2) = 0. When I compute ZGETRI, the inverse is determined. Can I trust this inverse?
5
votes
1answer
254 views

Half precision in Fortran

To improve the time efficiency of my code, I'd like to test a lower precision for real number, using e.g. half precision (2 bytes). However, I'm not sure if I can do that in Fortran. After playing ...
0
votes
3answers
1k views

What is the difference between MATLAB and FORTRAN?

In our university some Ph.D students for computational methods prefer FORTRAN over MATLAB. I can't understand why? What is the difference between them when are used in computational methods like ...
1
vote
0answers
459 views

IDE for Scientific computing using Fortran [closed]

I am looking to learn Fortran for Scientific Computing, which IDE setup for this exists that supports debugging, code completion capabilities and offers granular Running time Analytics. I am ...
1
vote
0answers
63 views

Is MATLAB feasible for app deployment versus lower level languages [duplicate]

MATLAB/Octave is a pretty useful language for prototyping scientific computation use cases, however I would like to know if the sheer nature of being a high level language bottlenecks how fast the ...
1
vote
1answer
167 views

Numerical Free Fall Analysis with RK4

I am trying to calculate real speed and time in free fall of a body. I wrote a code in Fortran and I am trying to improve it by using RK4 method x=time y=total free fall Purple line using: ...
1
vote
0answers
93 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 ...
1
vote
1answer
77 views

Declare variable to substitute one calculate only once

Frame of the question I am currently editing an add-on module to an ocean/circulation model, which is written in Fortran. The code of the main model is quite optimized with respect to short run time (...
0
votes
0answers
53 views

How determinate if two real numbers are equals? [duplicate]

I think that this problem is independent of the programming language, but, since I'm programming in Fortran, I wrote the example in that lenguage I'm writing a code where I need to decide if two real ...
0
votes
1answer
423 views

Best books and notes for beginners in the parallel FORTRAN 90 programming

I am a PhD student and my field of study is Quantum Information and Computation in the theoretical aspect. Actually I write the computer codes/program in FORTRAN 90 which are serial codes but now I ...
1
vote
0answers
137 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....
0
votes
1answer
84 views

checksum of a distributed variable

Let say I have N computers and 2 N-by-N matrices distributed across them called A and B. Matrix A is row distributed while B is column distributed. Therefore, processor i knows ...
1
vote
0answers
190 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 ...
1
vote
2answers
174 views

derivative of an array

Hi I am trying to take a derivative of an array but am having trouble. The array is two dimensional, $x$ and $y$ directions. I would like to take a derivative along $x$ and along $y$ using central ...
0
votes
2answers
163 views

Using two computers to run one parallelized program with intel fortran [closed]

I have two computers, both with 4-cores and I am running some heavy computational stuff in one of them using Intel Parallel Studio Cluster edition. I am coding in fortran and making extensive use of ...
3
votes
1answer
87 views

Alternative to messy grid node indexing within multiple layers of loops

Recently,I dive into a set of somehow ancient Fortran codes and try to fully understand them. A large fraction of these codes are multiple layers of loops over many state variable dimensions, which ...
0
votes
1answer
62 views

0 Hz (quite sharp) peak in FFT and division by 0

In a previous question, link, I asked about how I could most effectively do a Fourier Transform of a radial function given at certain values and which we knew the asymptotical behaviour of. The ...
1
vote
1answer
225 views

Does anyone have a driver for fortran DAE solver - COLDAE?

Coldae is a solver writter by U Ascher and R Spiteri, located here http://www.cs.ubc.ca/~ascher/coldae.f . It can solve upto index-2 DAEs using collocation. I am new to Fortran, and having a hard ...
3
votes
2answers
207 views

How to calculate efficiently and accurately the Fourier transform of a radial function in Fortran

As my question states, I want to calculate the Fourier transform $F(q)$ of a radial function $f(r)$ (defined on $[0,\infty)$ and which decays like an exponential $\exp(-Ar+b)$ at large $r$) as ...
1
vote
1answer
165 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
288 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 ...
3
votes
1answer
1k 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 ...
1
vote
0answers
378 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 ...
1
vote
0answers
302 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^...
6
votes
1answer
150 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 ...
1
vote
2answers
424 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
2answers
164 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 ...
2
votes
2answers
456 views

Solve $AX=B$ where $A$ is a skyline matrix

Solve a matrix equation of the type $AX=B$, where $A$ is an $n \times n$ symmetric matrix stored in the form of symmetric skyline matrix. With the solution given by Bill and some more research on ...
1
vote
1answer
744 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 ...
6
votes
3answers
663 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
61 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 ...
9
votes
2answers
426 views

Library with polylogarithm function [duplicate]

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: ...
6
votes
1answer
2k 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 ...
5
votes
1answer
647 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 ...
5
votes
2answers
5k 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.
1
vote
0answers
95 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 ...
5
votes
2answers
766 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 (...