0

I want to write a comment before a Fortran77 routine (main or another subroutine), where the Doxygen (version 1.9.0) comment lines should appear in the Doxygen HTML documentation as in the source code (here four lines, with line breaks). The documentation of the parameter TOTAL should also be displayed.

Can you reproduce that? What is the exact way to use Doxygen for this example?

Example (test.f):

!> header of doxygen documentation
!! first line of doxygen documentation
!! third line of doxygen documentation
!! @param AVRAGE information about the average
      PROGRAM CH0502
C> THIS PROGRAM READS IN THREE NUMBERS AND SUMS
C> AND AVERAGES THEM.
C
      IMPLICIT LOGICAL (A-Z)
      REAL NUMBR1,NUMBR2,NUMBR3,AVRAGE,TOTAL 
C
      INTEGER N
        N = 3
        TOTAL = 0.0
        PRINT *,'TYPE IN THREE NUMBERS'
        PRINT *,'SEPARATED BY SPACES OR COMMAS'
        READ *,NUMBR1,NUMBR2,NUMBR3
        TOTAL= NUMBR1+NUMBR2+NUMBR3 !> @param TOTAL is the total
        AVRAGE=TOTAL/N 
        PRINT *,'TOTAL OF NUMBERS IS', 
        PRINT *,'AVERAGE OF THE NUMBERS IS',AVRAGE
      END

doxygen -x Doxyfile gives as output:

# Difference with default Doxyfile 1.9.0 (71777ff3973331bd9453870593a762e184ba9f78)
PROJECT_NAME           = "Fortran project"
OUTPUT_DIRECTORY       = C:\Users\me\Desktop\doxygen_fortran_documentation
OPTIMIZE_FOR_FORTRAN   = YES
EXTRACT_ALL            = YES
INPUT                  = C:\Users\me\Desktop\doxygen_fortran
RECURSIVE              = YES
GENERATE_TREEVIEW      = YES
GENERATE_LATEX         = NO
CLASS_DIAGRAMS         = NO

The documentation result looks different as expected.

enter image description here

len
  • 749
  • 1
  • 8
  • 23
  • Which version of doxygen are you using? With the command `doxygen -x Doxyfile` you will get the settings that differ from the default settings, this you should include in the question (and not the non persistent link to an external place) – albert Apr 15 '22 at 14:48
  • @albert: Thank you for your information (I will run `doxygen -x Doxyfile`) and sorry I did not mention the version, it is 1.9.0 (you can see it also in the pastebin link). With 1.9.3 I have the problem that the button "Show HTML output" is not reacting, but the html documentation is the same. – len Apr 15 '22 at 14:52
  • @albert: I have included the required command. – len Apr 15 '22 at 15:01
  • The problem with the "show button" is know and fixed in the master version. The use of the `\param` is a bit strange as this is intended for arguments and not for local variables. – albert Apr 15 '22 at 15:39

1 Answers1

1

As a comment cannot include images or layouted text I have to revert to an answer (well it partly is).

When I understand it correctly you would like to have something like:

enter image description here

  • is this correct?

This can be accomplished in a number of ways.

  • by means of adding \n at the end of each line
  • by means of adding <br> at the end of each line

So the source code will look like:

!> header of doxygen documentation\n
!! first line of doxygen documentation\n
!! third line of doxygen documentation\n
!! @param AVRAGE information about the average
      PROGRAM CH0502
albert
  • 8,285
  • 3
  • 19
  • 32
  • Great, thank you for the solution with the line breaks. Do you have also a solution for how I can tell Doxygen that `TOTAL` is a parameter or a variable and that it should be listed in the documentation. I got a single Fortran77 file of 12000 lines and now I am first trying to document it. For example, if I have any subroutine and somewhere inside is a declaration: `INTEGER IS,IPI,I,NW`, I would like to tell Doxygen exactly at this position, that `IS,IPI,I,NW` are integer variables which should be listed and described by my comment what they mean. – len Apr 15 '22 at 16:21
  • Not 100% sure what you mean but probably best is to create a list or table that describes the variables. Maybe the `\internal` command can help as well. – albert Apr 15 '22 at 17:39
  • Thank you for this hint. I thought it should be possible to write insted of `INTEGER IS,IPI,I,NW` something like `INTEGER IS,IPI,I,NW !> @param IS,IPI,I,NW These are the input parameters`. – len Apr 15 '22 at 20:52
  • Like written `\param` is for argumets of a function / subroutine, but it might work with warnings. You should not use `!>` here but `!<` though. – albert Apr 16 '22 at 07:43