changing array dimensions in fortran

See the RESHAPE intrinsic, e.g. http://gcc.gnu.org/onlinedocs/gfortran/RESHAPE.html Alternatively, if you want to avoid the copy (in some cases an optimizing compiler might be able to do a reshape without copying, e.g. if the RHS array is not used afterwards, but I wouldn’t count on it), as of Fortran 2003 you can assign pointers to targets of … Read more

How does BLAS get such extreme performance?

A good starting point is the great book The Science of Programming Matrix Computations by Robert A. van de Geijn and Enrique S. Quintana-Ortí. They provide a free download version. BLAS is divided into three levels: Level 1 defines a set of linear algebra functions that operate on vectors only. These functions benefit from vectorization … Read more

GFortran error: ld: library not found for -lSystem when trying to compile

On macOS Big Sur v11.1: Relevant SO post: https://apple.stackexchange.com/questions/408999/gfortran-compiler-error-on-mac-os-big-sur The fix is to add the stdlib to your $LIBRARY_PATH. For some reason or another it isn’t in your standard $PATH anymore on 11.1. export LIBRARY_PATH=”$LIBRARY_PATH:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib” (or add it to login file and restart terminal).

OS X package installation depends on gfortran-4.8

Type these two lines in your terminal, direct quote: curl -O http://r.research.att.com/libs/gfortran-4.8.2-darwin13.tar.bz2 sudo tar fvxj gfortran-4.8.2-darwin13.tar.bz2 -C / It will download you the gfortran for Mavericks (which is missing in your system at the moment) and will install it in your system. At least, this solved the same problem for me (I’m running late 2011 … Read more

Procedure with assumed-shape dummy argument must have an explicit interface [duplicate]

Assumed shape dummy arguments (those with (:)) require explicit interface to the procedure to be available at the call site. That means the calling code must know how exactly the subroutine header looks like. See also Module calling an external procedure with implicit interface That explicit interface can be provided in several ways 1. preferred … Read more