# Tag Info

### Which version of Fortran should I learn?

It's a bit of a popular misnomer that there is a "version" of Fortran to know. With rare exception, the latest Fortran standards (and compilers) retain excellent backwards compatibility with older ...
• 2,213
Accepted

### How to compare runtimes of two algorithms in a reproducible way

To make more robust comparisons (on linux), you can : 1) On Intel CPUs the turbo overclocks your CPU. This is controlled by the temperature of the CPU, so it can behave differently from one run to ...
Accepted

### Fortran 90/95: Deallocating variables

Fortran's allocatable variables are automatically deallocated when the variable goes out of scope (see http://www.fortran90.org/src/best-practices.html#allocatable-arrays). This means that it is not ...
• 4,521
Accepted

### What is the difference between MATLAB and FORTRAN?

When one uses a low–level programming language, e.g. C++ or FORTRAN, one essentially controls lots of things: how parameters are passed, how data structures are aligned in memory, what is the most ...
• 861
Accepted

### Accuracy loss in single-precision Euclidean norm computation

The squares are harmless (as long as they don't overflow/underflow), because the relative perturbation they introduce is of the order of the machine precision $u\approx 10^{-8}$. Your troubles here ...
• 9,065

### Use of Java or Scala in HPC?

Java has been around for almost 20 years now as a major programming language, but it hasn't caught on in scientific computing so far. I think that's a good indicator for what's going to happen in the ...
• 51.6k
Accepted

### Linear interpolation in Fortran

There is no built-in Fortran functionality to do linear interpolation. You could either use a library or write your own routine. I haven't tried compiling or testing and my fortran may be a bit rusty, ...
• 4,521
Accepted

### Loop optimization with f2py, Cython and Numba

I think that the problem is linked to the way in which f2py generates the fortran interface: the argument to fortranrun.f2py should be stored as a F_CONTIGUOUS ...
• 3,789

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

You should consider giving Julia a try. Let me explain what's going on in the design space right now that would be of interest to you. Full disclosure I am the lead developer of JuliaDiffEq. ...
• 11.8k

### What is the difference between MATLAB and FORTRAN?

In general, you will be much more productive writing software in a higher-level language (e.g MATLAB) that has features useful in describing problems in your particular domain (e.g. matrices in ...
• 5,744

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

I think it's generally true that there are no advantages of Fortran 77 over either newer versions of Fortran or in fact any number of other programming languages that are widely used in scientific ...
• 51.6k
Accepted

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

There is almost no good reason to write your own dense matrix manipulation routines until you have compared to fast libraries (MKL, FLAME, MAGMA, etc). Writing these libraries is challenging work that ...
• 10.8k

### Why Is This Python Code Faster Than Fortran Wrapper with F2PY?

Shoutout to Kyle Mandli and Endulum who each contributed to this answer in the comments. First, I took Endulum's suggestion and removed the redundant reshapes. ...

### Lua and Fortran (or Python) I/O

This is probably not the answer you are looking for, but I wanted to state it anyway: Your choice of programming languages introduces two difficulties you will encounter as your program grows. First,...
• 51.6k

### Use of Java or Scala in HPC?

It seems unlikely to me. The Java MPI APIs haven't been worked on in years (so you're wrong about #4), and the JVM's floating-point performance is notoriously poor. Java may out perform C/C++ or ...
• 10.8k

### Use of Java or Scala in HPC?

I would argue that Java will in fact REDUCE productivity when compared with modern c++, or even with modern Fortran for the purpose of scientific computing. Writing ...
• 2,473
Accepted

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

There are three issues that are likely to cause such problems in pseudospectral methods: Gibbs oscillations Aliasing Time step too large In any case you likely develop oscillations in the solution ...
• 4,521

### Fortran code for Ewald summation

Notice that the summation in $U^{(r)}$ is incorrect. You want to sum over all the copies of the atoms in the lattice of periodic boxes, not just those whose indices satisfy $i > j$. In the ...
• 3,954
Accepted

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

One issue causing the jagged spectra at high wavenumbers is under sampling there. For example consider the 2D analogue of your binning procedure: You don't want to sample from the red zones as they ...
• 1,859