ford
ford copied to clipboard
Feature request: documentation for list of variables
Given Fortran's style of variable declaration, it is common to see (and write) variable or, more importantly, dummy argument declarations as
REAL(8), DIMENSION(:) :: X, Y, Z
Right now to document X
, Y
and Z
I need to repeat REAL(8), DIMENSION(:)
part as in
REAL(8), DIMENSION(:) :: X
!! X docs
REAL(8), DIMENSION(:) :: Y
!! Y docs
REAL(8), DIMENSION(:) :: Z
!! Z docs
I would like to have it a bit more like in Doxygen with, say param:
tag (at least for dummy arguments):
REAL(8), DIMENSION(:) :: X, Y, Z
!! param: X Docs for X
!! param: Y Docs for Y
!! param: Z Docs for Z
I am not sure if that kind of tag is possible though.
Similarly, for fields in TYPE
declaration (BTW, Doxygen cannot do this):
TYPE FOO
REAL(8) :: X, Y, Z
!! param: X Doc for X
!! ....
END TYPE
Searching through the closed issues revealed that someone asked for this kind of feature in the past. (issue #206 ) The conclusion was to use this style:
REAL(8), DIMENSION(:) :: X !! Doc
REAL(8), DIMENSION(:) :: Y !! Doc
REAL(8), DIMENSION(:) :: Z !! Doc
Will anyone else second my request or is it actually better to use this style?
To me at least, writing each variable on a separate line is more clear. By your suggested Doxygen style you do not save any lines, and you now have to repeatedly write param, and repeat the variable name, to me that appears much more error prone and I don't see any benefit.
If you are bothered by the dimension
keyword, why not declare your arrays with
real(kind=rk) :: x(:)
?
It's not so much on saving the line space, it's just i find it easier to read the documentation while exploring the source code when all arguments are put together with the rest of the procedure documentation (kind of old F77-style documentation: might look like an anachronism, but it is actually very readable).
On the other hand, as I am using Code Blocks and it pulls out the documentation on the argument from the comments right before or after, current Ford style actually works better for this.