[Rd] f2c to achieve reentrancy in odesolve?

Setzer.Woodrow at epamail.epa.gov Setzer.Woodrow at epamail.epa.gov
Tue Nov 21 16:10:49 CET 2006

I am beginning a much-delayed update of odesolve to include several
ordinary differential equation solvers from the Livermore package
ODEPACK.  These are much-used and reliable Fortran codes, and I plan (as
I did for lsoda in the current odesolve package) to make as few changes
as possible to the Fortran 77 code.  However, recently someone wanted to
make nested calls to lsoda, which will not work, because Fortran is not
generally reentrant.  I understand I can use f2c to convert the codes to
C, which would then gain reentrancy, and that there are parts of R which
were translated from Fortran to C for just this reason (at least, I read
that in an earlier R-help message).  My questions to this group are:

1) Will this indeed automatically make the solvers reentrant?
2) How much do I need to worry about changed numerical behavior of the C
version of the solvers after translation?
3) Are there special considerations not covered in R-exts for code
translated with f2c?
4) Is there a better way to make the Fortran solvers reentrant?

R. Woodrow Setzer, Ph. D.
National Center for Computational Toxicology
US Environmental Protection Agency
Mail Drop B205-01/US EPA/RTP, NC 27711
Ph: (919) 541-0128    Fax: (919) 541-1194

More information about the R-devel mailing list