Skip to content

specified order of attributes #167 #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions STYLE_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,26 @@ focus on the semantics of the proposed changes rather than style and formatting.
* Where conventional and appropriate shortening of a word is used then the underscore may be omitted,
for example `linspace` is preferred over `lin_space`

## Attributes

* Always specify `intent` for dummy arguments.
* Don't use `dimension` attribute to declare arrays because it is less verbose.
Use this:

```
real, allocatable :: a(:), b(:,:)
```

instead of:

```
real, dimension(:), allocatable :: a
real, dimension(:,:), allocatable :: b
```

When defining many arrays of the same dimension, `dimension` can be used as an exception if it makes the code less verbose.
* If the `optional` attribute is used to declare a dummy argument, it should follow the `intent` attribute.

## End <scope> block closing statements

Fortran allows certain block constructs or scopes to include the name of the program unit in the end statement.
Expand Down