Fortran/Fortran 文件
外觀
< Fortran
FORD 是一個用於文件化 Fortran 原始碼的優秀程式。
有關安裝和使用 FORD 的說明,請參見 github 頁面:github.com。
可以使用 Doxygen 直接從原始碼建立文件。
命令列程式 doxygen 使用配置檔案建立文件。GUI 程式 doxygen-wizard 幫助建立這些檔案。
原始碼需要使用特殊的 註釋語法 進行文件化: !> 和 !!。
始終應在配置檔案中設定 OPTIMIZE_FOR_FORTRAN = YES。
Doxygen 命令通常以空註釋行或新的 doxygen 命令結束。
注意,Doxygen 對 Fortran 的支援相當差。即使是 type 內的 public/private 語句等簡單結構也不受支援(參見 github.com)。
您也可以在文件中包含 LaTeX 程式碼。Doxygen 網站 提供了詳細的資訊。
!> @brief inserts a value into an ordered array
!!
!! An array "list" consisting of n ascending ordered values. The method insert a
!! "new_entry" into the array.
!! hint: use cshift and eo-shift
!!
!! @param[in,out] list a real array, size: max_size
!! @param[in] n current values in the array
!! @param[in] max_size size if the array
!! @param[in] new_entry the value to insert
subroutine insert(list, n, max_size, new_entry)
implicit none
real, dimension (:), intent (inout) :: list
integer, intent (in) :: n, max_size
real, intent (in) :: new_entry
! code ........
end subroutine insert
!> @brief calcs the angle between two given vectors
!!
!! using the standard formula:
!! \f$\cos \theta = \frac{ \vec v \cdot \vec w}{\abs{v}\abs{w}}\f$.
!!
!! @param[in] \f$v,w\f$ real vectors
!! @return a real value describing the angle. 0 if \f$\abs v\f$ or \f$\abs w\f$ below a
!! threshold.
pure function calc_angle(v, w) result (theta)
implicit none
real, dimension (:), intent (in) :: v, w
real :: theta
! code .......
end function calc_angle
如果文件只是一張空頁面,您可以嘗試設定 EXTRACT_ALL = YES。