[R] passing char to Fortran routine

Ingmar Visser I.Visser at uva.nl
Mon Oct 10 17:20:18 CEST 2005


Hello all,

I am using an existing Fortran routine that takes a single character string
as argument. The routine echoes the argument that I provide. When working on
OS X 3.9 there seems to be no problem, ie the Fortran routine nicely echoes
my argument. However, I compiled the same package on a PC (using all the
tools provided in the R for windows faq), and the routine only echoes the
first letter of each character string that I pass on to it.

My questions are: 
1) Is this somehow compiler specific?
2) Should I explicitly provide the Fortran routine with the length of the
character string? 
3) I am at a loss as to what is happening here, so any hint is welcome (-;

The call to the Fortran routine is as follows:

.Fortran("npoptn",as.character(opt),PACKAGE="depmix")

where opt is a character string such as opt="Iteration limit = 100"

best, ingmar




More information about the R-help mailing list