logo LMD

Page de Lionel GUEZ

Enseignement à l'école normale supérieure, en L3 de sciences de la planète, 2016/2017

Cours :

Mise à jour
Cours : algorithmique et programmation
Cours sur la compilation et l'utilitaire make
Cours de Fortran 95, premier semestre
Mots-clefs du langage Fortran 95
Éditeurs de texte
Indications pour la programmation en Fortran avec Emacs
Cours de Fortran 95, second semestre
Bibliothèques de procédures en Fortran
Introduction à NetCDF

Travaux dirigés :

Travaux dirigés de compilation
Travaux dirigés de Fortran, premier semestre
Algorithmes solutions des travaux dirigés, premier semestre
Travaux dirigés de Fortran, second semestre
Algorithmes solutions des travaux dirigés, second semestre
Travaux dirigés sur NetCDF





Templates of makefiles for Fortran programs and libraries

From the simplest case to more complex cases, makefiles for a Fortran program made up with:

Makefiles for a Fortran library made up with:

The above makefiles contain the description of your program or library: the names of inputs files, the directories where they are, the dependencies between them. But, by design, the part of the makefile which depends on the compiler is well isolated. The part that depends on the compiler is the definition of variables FC, FFLAGS, CPPFLAGS, LDFLAGS and LDLIBS. If you are going to compile your program with a single compiler then you can just add the definition of those variables inside the makefile. But if you use several compilers then write the definition of FC, FFLAGS, CPPFLAGS, LDFLAGS and LDLIBS in a separate file, one file for each compiler.

If you just want the products of compilation (executable file, library, object files, compiled module interfaces) to be created in the directory containing the makefile, you just go to that directory and invoke make from there. However, often, one wants the products of the compilation to go somewhere else, in a directory not related to the source files (maybe another file system, or a directory the position of which relative to your source files will change when you port your code to another machine). In that case, instead of invoking make, use the script make.sh. Choose the value of MAKE and dest_dir in make.sh and just invoke make.sh instead of make. You can add any argument to make.sh that you would want to use with make. For example, you could type:

make.sh clean all
make.sh FC=pgf95

Managing kind parameters for numeric types in Fortran

Fortran : insertion des procédures dans des modules


Révision 1293 de LMDZ : correction de create_etat0_limit

Forme de LMDZ


Climatologie de l'ozone (18 KiB), de Fortuin et Kelder (1998), convertie au format NetCDF. Cf. page correspondante du Tropospheric Emission Monitoring Internet Service.