26.09.2013 Views

Chapter 11. More Fortran Elements: Functions and Subroutines 11.1 ...

Chapter 11. More Fortran Elements: Functions and Subroutines 11.1 ...

Chapter 11. More Fortran Elements: Functions and Subroutines 11.1 ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

g77 –o pgm.exe file.f<br />

If the source code of the main program is stored in one file <strong>and</strong> the source code of the subroutine is<br />

stored in a second file, then the compilation statement must include both files:<br />

g77 –o pgm.exe file1.f file2.f<br />

Here, file1.f <strong>and</strong> file2.f are the two files containing the main program <strong>and</strong> subroutine source code,<br />

<strong>and</strong> pgm.exe is the single executable program created by compilation. Note that any number of<br />

subroutines may be employed in a main program.<br />

74

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!