File f2c.c

Parent directory (source)

Definition (source/f2c.c)

Detailed Description

This file contains routines that are called by the Fortran version of the PGAPack calls. Authors: David M. Levine, Philip L. Hallstrom, David M. Noelle, Brian P. Walenz, Ralf Schlatterbeck

They just make the call to the appropriate C routine. Issues are:

  • Fortran’s always passing by reference,

  • Using Fortran integers for holding C pointer values

  • Fortran’s 1,…,n indexing vs. C’s 0,…,n-1 (this comes up in population member and allele indices)

  • Pointers to functions

  • File pointers

  • Characters strings

  • Variable length argument lists

We assume the Fortran compiler generates one of three symbol names for the external PGAPack routine, e.g., pgasetpopsize, pgasetpopsize_, or PGASETPOPSIZE. We use #ifdef’s based on the appropriate routine to convert the canonical pgasetpopsize_ to the other two. Since the real C routine is always mixed case we will never have a conflict.

Note that the functions are not explicitly documented, they are typically a mangled variant (lowercase or uppercase, leading and/or trailing underscore) of the C original.

Includes