6
1 Introduction
1.3.2 Modular Source Codes
FORTRAN source codes of this book consist of several text files, a main program
plus separate so-called modules. Most exercises of this book use two separate module files. One module contains hereby global declarations, the other one all subroutines and functions. Figure 1.2 displays these components and how they are linked
with each other.
Fig. 1.2 Code structure and associated file names
The compiling of a multiple file FORTRAN code consists of two steps. The
modules are first compiled with:
g95 -c file2.f95 file3.f95
Then, the module files can be linked with the main code via:
g95 -o run.exe file1.f95 file2.o file3.o
where the “-o” allows for specification of a name of the executable program, called
“run.exe” in this example. The code can then be executed by entering “run.exe” in
the Command Prompt window. The above example is for Microsoft Windows operation systems. Executable files carry a different file extension for other operation
systems.
1.4 Visualisation with SciLab
1.4.1 Writing SciLab Scripts
The open-source SciLab software suite is used for visualisation of results. SciLab is
available from:
1 Introduction
1.3.2 Modular Source Codes
FORTRAN source codes of this book consist of several text files, a main program
plus separate so-called modules. Most exercises of this book use two separate module files. One module contains hereby global declarations, the other one all subroutines and functions. Figure 1.2 displays these components and how they are linked
with each other.
Fig. 1.2 Code structure and associated file names
The compiling of a multiple file FORTRAN code consists of two steps. The
modules are first compiled with:
g95 -c file2.f95 file3.f95
Then, the module files can be linked with the main code via:
g95 -o run.exe file1.f95 file2.o file3.o
where the “-o” allows for specification of a name of the executable program, called
“run.exe” in this example. The code can then be executed by entering “run.exe” in
the Command Prompt window. The above example is for Microsoft Windows operation systems. Executable files carry a different file extension for other operation
systems.
1.4 Visualisation with SciLab
1.4.1 Writing SciLab Scripts
The open-source SciLab software suite is used for visualisation of results. SciLab is
available from:
