Appendix. Sample Fortran programs

Example 1 - XL Fortran source file
Execution results
Example 2 - valid C routine source file
Example 3 - valid Fortran SMP source file
Example 4 - invalid Fortran SMP source file
Programming examples using the Pthreads library module

The following programs are provided as coding examples for XL Fortran. A number of these samples illustrate various aspects of SMP programming that may be new to many users. If you are new to SMP programming, you should examine these samples to gain a better understanding of the SMP coding style. Every attempt has been made to internally document key areas of the source to assist you in this effort.

You can compile and execute the first program to verify that the compiler is installed correctly and your user ID is set up to execute Fortran programs.