similar to: passing R array to Fortran subroutine

Displaying 20 results from an estimated 11000 matches similar to: "passing R array to Fortran subroutine"

2012 Oct 20
1
Trouble returning 2D array into R from Fortran
Hello, I have been trying to use a collection of Fortran subroutines to return a 2D array of calculated values to my R code, calling a Fortran wrapper subroutine from R. I've done this successfully before with C & C++ code. The Fortran wrapper subroutine which is to be called by R takes a set of input arguments & then should return an array of 2 columns & the specified number of
2007 Jun 12
1
Building packages with subroutine in fortran 90 under windows xp
Hello, I work under windows xp and I am trying to build a R package with a subroutine written in fortran 90. I have installed all the updated tools and I am working with R-2.4.0 or R-2.5.0. When I check a package with a subroutine in fortran 77 (and extension f) everything is ok. When I try to build the same package with a subroutine in fortran 90 (with extension f90) the following warning
2009 Sep 11
1
call Fortran from R
Dear R users, I have to call fortran program from within R (R 2.8.1 on ubuntu 8.10 machine). Suppose I have a fortran code like this (this is only a toy model, my working model is far more complex, but input/output is similar) DOUBLE PRECISION FUNCTION model(times, alfa, beta) DOUBLE PRECISION alfa, beta, times model=beta*sin(times)+alfa*cos(times) END FUNCTION which
2007 Jun 12
1
package with fortran 90 subroutines under windows xp
Hello, I work under windows xp and I am trying to build a R package with a subroutine written in fortran 90. I have installed all the updated tools and I am working with R-2.4.0 or R-2.5.0. When I check a package with a subroutine in fortran 77 (and extension f) everything is ok. When I try to build the same package with a subroutine in fortran 90 (with extension f90) the following warning
2012 Jan 15
1
Calling Fortran from R: Issues with dynamic loading of fortran dll
I successfully used .Fortran to load and execute my fortran procedures under WinXP and 32 bit R. Alas, the same isn't true with my next Windows 7/64 machine, R 2.14.1 (64 bit) and the gnu gfortran (64) compiler (mingw64 v. 4.6.1). Though I'm able to compile the routines from the command line using gfortran '...', .Fortran('foo2') results in an error saying the Fortran
2015 Jul 27
0
R package with Fortran module on Windows? undefined reference to `__stack_chk_fail'
You should be able to set PKG_FCFLAGS="-fno-stack-protector" when compiling to ensure that the stack protector is not used. (Trying that out on a Windows VM, with a simple `R CMD build` + `R CMD INSTALL`, compilation of your package succeeded but linking failed saying the DLL 'Fpi' was not found; I imagine that's a separate issue.) As an aside, be sure to check out what
2013 Apr 19
1
How to read a direct access file by connecting fortran with R ?
Hello all, I would like to read the specific line number row of a direct access file (which is stored as a n_row*n_col matrix of elements kind=p) without reading all the preceding lines (i.e 1,2,..,row-1). Is there a function in R that can perform this task? To solve my issue, I tried without to call Fortran from R by doing the following steps: I) I wrote a subroutine in fortran called
2005 Sep 09
2
A question on R memory management in .Fortran() calls under Windows
Dear R community, I have a question on how R manages memory allocation in .Fortran() calls under Windows. In brief, apparently, it is not possible to allocate large matrices inside a Fortran subroutine unless you pass them as arguments. If you do not act in this way RGUI crashes with a stack overflow error and acting on memory through vsize nsize ppsize and memory.limit does not help at all.
2009 Mar 28
0
R: Fortran 90 etc.
I have tried to compile the working Fortran-90 routines (see attachment) to interface them with R. The compiler automatically caled by R CMD command line prints a bunch of error messages (as follows). I think I'm better off translating the Fortran implementation into R ... which is what I hoped I could avoid. Maura host705:Desktop mauede$ R CMD SHLIB ford.f90 gfortran -arch i386
2011 May 04
3
Error in .Fortran Call
I have the following FORTRAN code converted to a DLL: ! my_xmean.f90 ! ! FUNCTIONS/SUBROUTINES exported from my_function.dll: ! my_function - subroutine ! subroutine my_xmean(X,N,XMEAN) ! Expose subroutine my_function to users of this DLL ! !DEC$ ATTRIBUTES DLLEXPORT,C,REFERENCE,ALIAS:'my_xmean_'::my_xmean ! Body of my_function DOUBLE PRECISION X(N) XMEAN=0D0 DO J=1,N
2016 Mar 04
0
ALLOCATE in a FORTRAN subroutine
Hi, Until you get a more definitive answer, I will make an attempt to give some advice. When using an assumed sized array (i.e. REAL*8 array1(*)) you still need to allocate the memory prior to calling the Fortran subroutine, so you would still need to know its maximum length. Arrays created in a Fortran subroutine via the use of the ALLOCATE statements are not simple arrays (in the sense of C
2015 Jul 27
2
R package with Fortran module on Windows? undefined reference to `__stack_chk_fail'
Hi, I created a R library that uses a Fortran module. Everything works like a charm on linux. Now I'm trying to make it work on Windows. I cloned my git repository <https://github.com/ignacio82/MyPi> on a windows computer, and when I press the build and reload button on Rstudio I get these errors: ==> Rcmd.exe INSTALL --no-multiarch --with-keep.source MyPi * installing to library
2008 Mar 12
1
Problem when calling FORTRAN subroutine (dll)
Hello, I am trying to call a FORTRAN subroutine from R. The Fortran code is @: http://lib.stat.cmu.edu/apstat/206 It performs a bivariate isotonic regression on a rectangular grid (m X n) matrix. I used the g77 compiler and successfully created a dll file and it also loads successfully from R. But somehow the programs fails to run properly. (I do get the correct result when I compile the
2004 Apr 20
2
compile Fortran code which calls C subroutine
I used "R CMD SHLIB" to compile the fortran filename.f file and the filename.so is generated. But since in filename.f it calls another subroutine written in C, i had problem in "dyn.load" because it could not find the C subroutine. I have the .c file but don't know how to tell R about it. How should I compile when I want to call the fortran function
2016 Mar 07
0
ALLOCATE in a FORTRAN subroutine
> On 7 Mar 2016, at 16:45, MAURICE Jean - externe <jean-externe.maurice at edf.fr> wrote: > > Hi Martyn, > > Many thanks for your answer. If I make it short : > we can, once we know how to do it, 'drive' R from within FORTRAN for example to do a > Myarray = seq(0, mydimension) > in R once we have compute mydimension in FORTRAN. Is that correct ? I too
2010 Mar 16
2
Help running a Fortran subroutine from R
useR's, I need help getting a Fortran DLL successfully returning the correct output. The attached fortran source code (filter2d.f) and DLL (filter2d.dll) are attached. Also, I attached a text file for which I want to apply the filter to (time702.txt). Here is what I am doing... > dyn.load("C:/f/NEW/filter2d.dll") > is.loaded("filter2d") [1] TRUE Then I pass the
2005 Mar 27
0
RE: [Rd] F90
G?ran, thanks. Happy easter! -----Original Message----- From: G?ran Brostr?m [mailto:gb at stat.umu.se] Sent: ned 2005-03-27 07:38 To: Gorjanc Gregor Cc: r-help at stat.math.ethz.ch Subject: Re: [Rd] F90 On Sun, Mar 27, 2005 at 03:26:39AM +0200, Gorjanc Gregor wrote: > Hello! > > Has anyone successfully compiled F90 sources in R-package? I found the > same question on r-devel list
2016 Mar 07
0
ALLOCATE in a FORTRAN subroutine
Hi, "we can, once we know how to do it, 'drive' R from within FORTRAN" I am not sure I understand what you mean by this ... You can call routines written in Fortran or C from within R - how easy this is depends on the interfaces to those routines. You can call (some) R functionality from C (see for example
2000 Nov 09
1
file processing with a FORTRAN subroutine
Dear all, Is it possible to call a FORTRAN subroutine which does file processing (open an input and write to an output file) using the .Fortran command. FYI, I am using R 1.1.1 for windows, Thanks, Agus Agus Salim PhD student Dept. of Statistics University College Cork Ireland Tel:353-21-4902197 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing
2016 Mar 04
3
ALLOCATE in a FORTRAN subroutine
Hi, I am a FORTRAN developer and I am 'translating' R functions in FORTRAN subroutines. I am 'new' to R. It's my first question in this mailing-list and English is not my natural language. Very often, an R function gives an 'array' as result and you don't have to bother with the dimension of the array : R creates automatically an array with the good length.