Source File Organization

A number of people have asked where/how they should organize a FORTRAN source file. I suggest that you use the following style. It is a top-down style that is used fairly frequently by many programmers/textbook authors. Please remember that many programs are composed of multiple files.
c file name, e.g., Org.for

c header/other pertinent information 


c234567
      Program Org
c
c  Variable declarations
c
      stop
      end

c  function/subroutine definitions

      int function Func1( x )
c 
      real x
c
      Func1 = x**3

      return
      end



      subroutine Sub1( n )
c
      int n

      ....        !  statements

      return 
      end

Home