merged Martin Erwig's base code from Parametric Fortran

Whoops- forgot to do this several months ago. D