Elemental statement provides a simple and generic interface for a procedure regarding its rank -dimensions-. Due to Fortran strong typing programming style, It was a bit challenging to provide generic functions. It required to implement all possible forms (type and rank-dimensions-). Elemental focus in the rank issue with a simple interface. Note an elemental procedure…

read more

JetBrains-cLion is a non-open source (paying) IDE for C/C++. It has support for CMake, GIT, Refactoring and many other features. Because of the payment, there is a 30 days trial period. It is worth mention because it has a Fortran plugin. It enables the possibility to enjoy all features mentioned above in a very stable…

read more

CodeBlocks is an open source Fortran IDE which runs on Linux and Windows. The application does not directly allow you to import a CMake project. However, it is possible to do it in a few simple steps. Check below the steps: # goto source project dir mkdir build cd build cmake -G”CodeBlocks – Unix Makefiles”…

read more

Fypp preprocessor generates Fortran code based on Python language. However, in some cases it is not straightforward. Read below to discover how to create higher level functions. Let’s say our program requires to allocate an array for N supported ranks. dim is an array with the size of each rank. To make it possible We…

read more

Overloading a subroutine means to redefine its internal functionality for a customized behavior. Overall it adapts the class new characteristics to already wide-spread Fortran functionalities (==, =, + ,-, …). Specifically, this post only focus on assignment (=). In the following example, Mynumber is generic class to hold any type of real number. For that…

read more

Fypp is a python based preprocessor to generate source code. It is usefull to overcome some Fortran weaknesses regarding array dimensions, types (and kind). Follow the instructions below to integrate into your CMake project. The following exmaple assumes the current project structure as: yourproject/ cmake/ utils.cmake src/ CMakelists.txt main.f90 subr.fpp common.fpp bin/ CMakelists.txt Create utils.cmake…

read more