Skip to content
Steve Penny edited this page Jul 3, 2015 · 6 revisions

We will generally follow the suggestions of the CESM software development team: http://www.cesm.ucar.edu/working_groups/Software/dev_guide/dev_guide/node7.html

However, the following requirements override anything above:

Use 2 spaces instead of indenting with a tab, since there are sometimes numerous levels used at one time.

Use upper case for all fortran instantiation to clearly identify the beginning of a code block.

Try to keep lines at 80 characters.

Use lower case in general. Use lower case for control commands like 'if/then' and 'do', but use UPPER CASE for all other fortran keywords and intrinsic commands to make it clear they are defined by the language standard.

Use the following to label sections:
!-----------------------
! Informative heading
!-----------------------

Use the following to label subroutines:
SUBROUTINE xyz()
!===============================
! Informative heading for xyz()
!===============================

Other guidelines:
http://research.metoffice.gov.uk/research/nwp/numerical/fortran90/f90_standards.html

Clone this wiki locally