ParaFEM Coding Standard for Fortran 90

This standard has been prepared by Lee Margetts at the University of Manchester. It is based on Version 1.1 of the European Standards for Writing and Documenting Exchangeable Fortran 90 Code published by the Met Office.

Contents

  • 1.0 Introduction
  • 2.0 Documentation
  • 3.0 Coding Rules For Packages
  • 4.0 Guidance for The Use Of Dynamic Memory
  • 5.0 Coding Rules For Routines
  • 6.0 Enforcing These Standards
  • References
  • Appendix A: Modification History
  • Appendix B: Standard Headers
  • Appendix C: Examples
  • 1.0 Introduction

    The aim of this document is to provide a framework for the use of Fortran 90 in ParaFEM and related projects and thereby to facilitate the exchange of code between them. In order to achieve this goal we set standards for the documentation of code, both internal and external to the software itself, as well as setting standards for writing the code. The latter standards are designed to improve code readability and maintainability as well as to ensure, as far as possible, its portability and the efficient use of computer resources.

    Back to top

    2.0 Documentation

    Documentation may be split into two categories: external documentation, outside the code; and internal documentation, inside the code. These are described in sections 2.1 and 2.2 respectively. In order for the documentation to be useful it needs to be both up to date and readable at centres other than that at which the code was originally produced. Since these other centres may wish or need to modify the imported code we specify that all documentation, both internal and external, must be available in English.

    2.1 External Documentation

    In most cases this will be provided at the package level, rather than for each individual routine. It must include the following:

    2.2 Internal Documentation

    This is to be applied at the individual routine level. There are four types of internal documentation, all of which must be present.