R Functions and Fortran Subroutines