| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| will anyone plz. show me an example of creating manual of fortran code with doxygen?i tried and failed |
|
#2
| |||
| |||
| rudra schreef: > will anyone plz. show me an example of creating manual of fortran code > with doxygen?i tried and failed Rudra, Which version of doxygen do you use? Version 1.4.7 that I have installed does not support Fortran. What I did in the past was just use Latex as documentation tool. The Latex 'command' I added as comment to the source. Like: c \chapter{Program Laplace} c \begin{verbatim} Program Laplace use myfunctions implicit none include 'omp_lib.h' !needed for OMP_GET_NUM_THREADS() REAL(4),Allocatable :: A(:, , OLD(:,![]() integer :: i,j REAL(4) :: h,k,error integer :: N,nthr write (*,*) 'Begin of Laplace' open (10,file="input.txt") read (10,*) N close(10) write(*,*) N," bij ",N h=1d0/(N) error=10d0 write(*,*) 'allocate A(1:',N+1,',1:',N+1,')' allocate (A(1:N,1:N)) write(*,*) 'allocate OLD(1:',N+1,',1:',N+1,')' allocate (OLD(1:N,1:N)) write(*,*) 'Initialize A' A=0d0 do while ( (error .gt. h*h) ) !$OMP PARALLEL !$omp single nthr = OMP_GET_NUM_THREADS() write (*,*) ' We are using',nthr,' thread(s)' !$omp end single forall (i=1:N,j=1:N) OLD(i,j)=A(i,j) end forall ! forall (i=1:N) A(1,i)=bnd(1,i,h) OLD(1,i)=bnd(1,i,h) A(N,i)=bnd(N,i,h) OLD(N,i)=bnd(N,i,h) A(i,1)=bnd(i,1,h) OLD(i,1)=bnd(i,1,h) A(i,N)=bnd(i,N,h) OLD(i,N)=bnd(i,N,h) end forall forall (i=2:N-1, j=2:N-1) A(i,j)=1d0/4d0*(A(i-1,j)+A(i+1,j)+A(i,j-1)+A(i,j+1)) end forall error=0.0d0 do i=1,N do j=1,N if ( (error .lt. (abs(A(i,j)-OLD(i,j))) )) then error = abs(A(i,j)-OLD(i,j)) end if end do end do !$omp single write(*,*) error,'>',h*h !$omp end single !$OMP END PARALLEL enddo open (11,file="output.txt") do i=1,N do j=1,N write(11,*) i*h,j*h,A(i,j) end do end do close(11) deallocate(OLD) deallocate(A) write (*,*) 'End of Laplace' end program Laplace c \end{verbatim} c \chapter{module myfunction} c \begin{verbatim} module myfunctions implicit none contains real(4) pure function bnd(i,j,h) implicit none integer, intent(in) :: i, j real(4), intent(in) :: h real(4) :: pi, x, y x=(i-1)*h y=(j-1)*h pi=DASIN(1.0d0)*2.0d0 if (x .eq. 0d0) then bnd=x*x-y*y-x+y+cos(pi*x)-cos(2*pi*y)-x*y-1.0d0 end if if (x .eq. 1d0) then bnd=x*x-y*y-x+y+sin(pi*x)-sin(2*pi*y)+x*y end if if (y .eq. 0d0) then bnd=x*x-y*y-x+y+cos(pi*x)-cos(2*pi*y)+x*y+0.5d0 end if if (y .eq. 1d0) then bnd=x*x-y*y-x+y+sin(pi*x)-sin(2*pi*y)-x*y+1.0d0 end if end function bnd end module myfunctions c \end{verbatim} The file input must contain a power of 2 Each source file I add with an include statement into the Latex mainfile You can use the refman.tex made by Doxygen as the Latex mainfile. Be aware that the include file needs .tex files to refer to the source files. I fool Latex by making symbolic links to the .f source files. I run my compiler and doxygen on Linux. Kind regards, Jan Gerrit Kootstra |
|
#3
| |||
| |||
| On Sep 4, 1:38 am, Jan Gerrit Kootstra <jan.ger...@kootstra.org.uk> wrote: > > Which version of doxygen do you use? > I am using the latest one, i.e. 1.5.6 and it clames it supports fortran. but in its documentation, i didnt found if any fortran-like comment i is allowed. nor i have managed to create documentation. |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.