Skip to content

Commit 25965bc

Browse files
authored
Merge pull request #168 from JHenneberg/master
specified order of attributes #167
2 parents 6661975 + 499a455 commit 25965bc

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

STYLE_GUIDE.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,26 @@ focus on the semantics of the proposed changes rather than style and formatting.
4242
* Where conventional and appropriate shortening of a word is used then the underscore may be omitted,
4343
for example `linspace` is preferred over `lin_space`
4444

45+
## Attributes
46+
47+
* Always specify `intent` for dummy arguments.
48+
* Don't use `dimension` attribute to declare arrays because it is less verbose.
49+
Use this:
50+
51+
```
52+
real, allocatable :: a(:), b(:,:)
53+
```
54+
55+
instead of:
56+
57+
```
58+
real, dimension(:), allocatable :: a
59+
real, dimension(:,:), allocatable :: b
60+
```
61+
62+
When defining many arrays of the same dimension, `dimension` can be used as an exception if it makes the code less verbose.
63+
* If the `optional` attribute is used to declare a dummy argument, it should follow the `intent` attribute.
64+
4565
## End <scope> block closing statements
4666

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

0 commit comments

Comments
 (0)