Re: [Rd] f2c to achieve reentrancy in odesolve?

From: Mike Prager <mike.prager_at_noaa.gov>
Date: Fri 24 Nov 2006 - 16:27:39 GMT

Setzer.Woodrow@epamail.epa.gov wrote:

> 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.

Hello, Woodrow.

Fortran 95 may be better than Fortran 77 in that regard (it does allow recursive calls). However, it is not an area I have experience with.

I suggest that you post your question to Usenet group comp.lang.fortran. Many highly experienced Fortran users populate that group, including several members of the standards committee. I can't think of a better place to get advice on such a question.

Mike

-- 
Mike Prager, NOAA, Beaufort, NC
* Opinions expressed are personal and not represented otherwise.
* Any use of tradenames does not constitute a NOAA endorsement.

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Sat Nov 25 03:42:40 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 24 Nov 2006 - 19:31:09 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.