This document describes the programming rules for developing shallow water wave model SWAN.
It is essential for all programmers to strictly observe the rules set out in this document.
The programming rules should be suitable to support the programmer to make reliable, stable,
readable and structured source code.
It is furthermore recommended that the adjacent programs also comply with these rules, as this
results in a considerable simplification of maintenance, management and error tracking in particular.
Chapter 2 discusses several general FORTRAN 90 standards, while programming of FORTRAN
control statements is dealt with in Chapter 3.
Use of modules is outlined in Chapter 4. The layouts of subroutines and modules are
the subject of Chapter 5, and Chapter 6 discusses input and output. Instructions
concerning errors are covered in Chapter 7. The pseudo code mentioned in Chapter 5,
is further discussed in Chapter 8. Chapter 9 gives some advices on the improvement
of the code, while Chapter 10 briefly considers machine
dependency. Chapter 11 describes exceptions to the FORTRAN 90 standards which goes against
programming ethics, but is nevertheless acceptable in certain prescribed cases because it strongly improves
user-friendliness. Chapter 12 mentions several agreements on defining names for SWAN
subroutines and modules. Chapter 13 provides examples of a subroutine layout and module layout,
written according to the above-mentioned standards.
This document has no final status, but will be developed and modified as experience and insight
are being gained. Please refer to the Log sheet for a summary of this document's modifications.
The document uses different fonts for plain text and FORTRAN text.
The latter is in a sanserif typewriter font.
The SWAN team 2022-08-10