From murdoch.duncan at gmail.com  Fri May  6 17:17:28 2011
From: murdoch.duncan at gmail.com (Duncan Murdoch)
Date: Fri, 06 May 2011 11:17:28 -0400
Subject: [Rd] fortan common block
In-Reply-To: <6441154A9FF1CD4386AF4ABF141A056D2159FADE@WMEXOSCD2-N1.bocad.bank-banque-canada.ca>
References: <6441154A9FF1CD4386AF4ABF141A056D2159FADE@WMEXOSCD2-N1.bocad.bank-banque-canada.ca>
Message-ID: <4DC41108.2020701@gmail.com>

On 06/05/2011 11:04 AM, Paul Gilbert wrote:
> Is it possible in R to call a fortran routine that sets variables in a common block and expect the values to persist when a call is made from R to a second routine that uses the common block?

I think the stats package does this; see src/library/stats/src/ppr.f.  
The Fortran functions don't "know" that R is doing the calling, so 
they'll set and read values as if they were called from a Fortran main 
program.

Duncan Murdoch

> If not (as I suspect),  is it possible to use a common block in a group of routines that are used together, for as long the routines do not return to R?
>
> Paul
> ====================================================================================
>
> La version fran??aise suit le texte anglais.
>
> ------------------------------------------------------------------------------------
>
> This email may contain privileged and/or confidential information, and the Bank of
> Canada does not waive any related rights. Any distribution, use, or copying of this
> email or the information it contains by other than the intended recipient is
> unauthorized. If you received this email in error please delete it immediately from
> your system and notify the sender promptly by email that you have done so.
>
> ------------------------------------------------------------------------------------
>
> Le pr??sent courriel peut contenir de l'information privil??gi??e ou confidentielle.
> La Banque du Canada ne renonce pas aux droits qui s'y rapportent. Toute diffusion,
> utilisation ou copie de ce courriel ou des renseignements qu'il contient par une
> personne autre que le ou les destinataires d??sign??s est interdite. Si vous recevez
> ce courriel par erreur, veuillez le supprimer imm??diatement et envoyer sans d??lai ? 
> l'exp??diteur un message ??lectronique pour l'aviser que vous avez ??limin?? de votre
> ordinateur toute copie du courriel re??u.
>
> 	[[alternative HTML version deleted]]
>
>
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] fortan common block
Duncan Murdoch