Re: [R] passing char to Fortran routine

From: Prof Brian Ripley <>
Date: Tue 11 Oct 2005 - 01:35:12 EST

> PLEASE do read the posting guide!

Programming questions are appropriate for R-devel, as it says there.

The issue is OS-specific, but we don't see what your Fortran code is. If you send a reproducible example to the R-devel list, people may be able to suggest what the problem is.

On Mon, 10 Oct 2005, Ingmar Visser wrote:

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

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list
PLEASE do read the posting guide!
Received on Tue Oct 11 01:48:18 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 18:37:46 EST