Note that there are some explanatory texts on larger screens.

plurals
  1. POWriting robust and "modern" Fortran code
    text
    copied!<p>In some scientific environments, you often cannot go without FORTRAN as most of the developers only know that idiom, and there is lot of legacy code and related experience. And frankly, there are not many other cross-platform options for <em>high performance</em> programming (C++ would do the task, but the syntax, zero-starting arrays, and pointers are not compatible with some people).</p> <p>So, let's assume a new project <em>must</em> use Fortran 90, but I want to build the most modern software architecture out of it, while being compatible with most recent compilers (Intel ifort, but also including the Sun/HP/IBM compilers)</p> <p>So I'm thinking of imposing stuff that is widely known as common good sense, but not yet a standard in my environment:</p> <ul> <li>global variable forbidden, no gotos, no jump labels, <code>implicit none</code>, etc.</li> <li>"object-oriented programming" (modules with datatypes and related subroutines)</li> <li>modular/reusable functions, well documented, reusable libraries</li> <li>assertions/preconditions/invariants (implemented using preprocessor statements)</li> <li>unit tests for all (most) subroutines and "objects"</li> <li>an intense "debug mode" (<code>#ifdef DEBUG</code>) with more checks and all possible Intel compiler checks possible (array bounds, subroutine interfaces, etc.)</li> <li>uniform and enforced legible coding style, using code processing tool helpers.</li> </ul> <p>The goal with all that is to have trustworthy, maintainable and modular code. Whereas, in lot of legacy codes, re-usability was not a important target.</p> <p>I searched around for references about object-oriented Fortran, programming-by-contract (assertions/preconditions/etc.), and found only ugly and outdated documents, syntaxes and papers done by people with no large-scale project involvement, and dead projects.</p> <p><strong>Any good URLs, advice, reference paper/books on this subject?</strong></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload