Fortran Programming with NumPy Arrays
Python loops over large array structures are known to run slowly. Tests with class Grid2D from Chapter 8.6.11 show that filling a two-dimensional array of size 1100 × 1100 with nested loops in Python may require about 150 times longer execution time than using Fortran 77 for the same purpose. With Numerical Python (NumPy) and vectorized expressions (from Chapter 4.2) one can speed up the code by a factor of about 50, which gives decent performance.
KeywordsFortran Program Extension Module Fortran Code Output Array Input Array
Unable to display preview. Download preview PDF.