![]() |
Use Fortran 90 or later. Port parts of code written in Fortran77 to Fortran90. Every subroutine must be in a module. Always use: implicit none
, intent(in)
, intent(out)
etc. When working with arrays, avoid specifying ranges, or specify ranges explicitly, i.e.:
Avoid implicit range specification, such as A(:)= B(:) + C(:)
. Use named loops with self-explaining names. Do not use goto
. Always use print*
instead of write(*,*)
for console output. Do not use array(:); use either array(1:n) or simply array. The type real(r_kind)
is defined in macros.h. Use it everywhere instead of real*8
or real
. Avoid long lines; line width should be no more than 78-80 characters; if line doesn't fit, wrap it with a '&' character:
For developing it is useful to use git-hooks. These hooks can be used to test the Code prior to pushing/commiting changes. If the following shell script is saved in "winnet_path/.git/hooks/pre-commit", the automatic test cases will be executed before every commit. This will prevent you from commiting non-functioning code versions.
Doxygen compatible comment block always starts with !>
. Subsequent lines must start with two exclamation marks !!
. Description of function parameters should be in the end of lines defining those parameters, and should start with !<
, e.g.:
Supply each file with a header describing what the file is about:
Example header for a module, subroutine or function:
supplement all subroutines with your name and the date of last modification. E.g.:
use enddo
, endif
and endselect
instead of end do
, end if
and end select
. for long conditional blocks, append a comment after endif
reminding the condition, e.g.:
write full name in the end of a subroutine or function:
use three spaces for indentation; never use tabs comments should be left aligned with the current block, i.e.:
rather than:
two empty lines between subroutines spaces:
x(k)= k + 2
x1*x2
x + 1
The master branch is proteced and it is not possible to push to it directly. All changes in the code have to be pushed to other branches and then merged to the master branch with a pull request. When creating a pull request the automatic test cases will be run on a github server. Only if all tests pass, it is possible to merge the pull request. The scripts to automatically run these tests are located in the hidden ".github" folder.