similar to: Strange problems with external Fortran routine

Displaying 20 results from an estimated 30000 matches similar to: "Strange problems with external Fortran routine"

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
2001 May 09
1
Fortran subroutines dblepr, realpr, intpr
I am making my first attempts at using some Fortran code with R, and so far it's going OK. To print from my Fortran programs, it seems I need subroutines dblepr, realpr and intpr. From the excellent "Writing R Extensions" document: "Three subroutines are provided to ease the output of information from FORTRAN code. subroutine dblepr(label, nchar, data, ndata)
2005 Nov 17
1
Linking Fortran subroutines
Hi, I just started using R a few weeks ago and have a problem with linking Fortran subroutines to R. For some reasons, I need to compile a Fortran program in R (or Splus) and the whole program consists a couple of subroutines, say, subA and subB. There is no difficulty in linking the subroutines individually, but two subroutines are nested, as shown below, SUBROUTINE subA(arg.) EXTERNAL
2010 Jul 13
0
compiling, linking and including multiple FORTRAN subroutines in R
Although there are a number of documents describing library development, in which compiling and using C or FORTRAN source code is discussed, such documents are too detailed and complicated for my limited needs (i.e. I can't follow them!). I am looking for a worked example (i.e. the series of commands etc) that does the following from within a WINDOWS environment: Given a series (i.e. more
2003 Apr 04
0
R crashes on calling a Fortran routine (PR#2728)
Full_Name: martyn byng Version: 1.6.2 OS: windows 2000 (professional) Submission from: (NULL) (62.231.145.253) I am having problems calling a fortran routine from within R. When the routine is called, R exits with an application error: "The instruction at 0x004a8b7d referenced memory at 0x200000015. The memory could not be written". The R code used to call the routine is:
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
2009 Mar 27
0
Need some help at interfacing R with Fortran-90
I browsed through ch.5 of R manual "Writing R extensions". It seems to be written for experienced programmers rathern than for people who occasionally face this problem. A table summarising the main ley points for each supported platform would be very useful. Something like: Supported languages: C, Fortran-77, ...... Windows guidelines: 1. compie Fotran code with (commands) from
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
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.
2010 Oct 25
2
R-Fortran question (multiple subroutines)
Dear R-helpers, apologies if this is somewhere in a manual, I have not been able to find anything relevant. I run Windows Vista. I have some Fortran code in a subroutine, and have no problem calling this from R with .Fortran, compiling the code either with 'R CMD SHLIB' or independently with gfortran. But is it possible to have more than one subroutine in my source file, one depending
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 Sep 04
0
passing character vectors to FORTRAN
Hi, I've been trying to pass a character vector from R to a FORTRAN subroutine. There have been several posts discussing this issue (e.g. http://tolstoy.newcastle.edu.au/R/help/98a/0547.html, http://tolstoy.newcastle.edu.au/R/help/05/10/13558.html, http://tolstoy.newcastle.edu.au/R/help/01a/2577.html, http://tolstoy.newcastle.edu.au/R/help/01c/1795.html,
2012 Feb 21
1
R package built with Fortran code
Hi R users, I'm trying to build an R package and most of the work have been done in Fortran programming. I looked for help for a while and seems like R can only call Fortran subroutines. Now my fortran code has modules, subroutines and main program. Is there anyway that R can call such fortran programming? Or I should modify the coding and form them into subroutines before let R call them?
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
2009 Apr 15
1
Compiling Fortran Subroutines as R Shared Objects on Mac OS-X
Hello, I am trying to compile some F77 subroutines as shared objects for R on my Mac. --> Mac OS-X Version 10.4.11 (Tiger Intel Mac) I have done this (successfully) before on Sun Solaris and Linux Fedora systems using the following command. > R CMD SHLIB myfile.f I have g77 installed from this page. http://hpc.sourceforge.net/ I am using R 2.8.1, and I have installed all 4 additional
2009 Jan 13
2
Using fortran code which call LAPACK subroutines
Hello I'm trying to run a fortran code which use LAPACK subroutines. I think I should use some points shown in the manual 5.5 Creating shared objects but it is too technical for me :-(... Could anyone help me for the procedure to do: -which part of the manual is relevant for this type of question? actually I'm speaking from writing R extensions, should I read R admin? -point 1.2
2003 Apr 03
1
Calling Fortran routines
Hi, I am having problems calling a fortran routine from within R. When the routine is called, R exits with an application error: "The instruction at 0x004a8b7d referenced memory at 0x200000015. The memory could not be written". The R code used to call the routine is: .Fortran("GTEST",a=as.integer(1),b=as.integer(3),c=as.integer(-10),d=as.inte ger(0),e=as.integer(0)) The
2000 Nov 13
1
DLL for calling Fortran subroutines
Hi everybody, I'm trying to use fortran subroutines in a R function. I've generated a DLL file using my fortran subroutines, and I've got a DLL which includes an export table with the names of my subroutines. Then, I use the R command library(test), where test is a directory located in the R library tree and which contains a R directory (with my R functions) and a libs directory (with
2010 Mar 24
1
Fortran DLLs and R
Hi All, I'm writing R code that would benefit from doing certain tasks using compiled blocks of code, specifically Fortran subroutines of my own (already written, debugged in both Fortran77 and Fortran90). I am currently working on a Windows machine using Lahey and/or MinGW(g77) compilers. It is possible to dynamically load Fortran DLLs into R as evidenced from the several documents
2001 Oct 11
3
Underscores and Fortran code
This might more properly be filed as a bug report, but ... I came upon the following problem while trying to dyn.load a library of Fortran code into R. I'm running RedHat 7.1 on a Pentium III laptop, with R version 1.3.1 (latest rpm from CRAN) and gcc/g77 version 2.96. My library has a number of Fortran subroutines that have underscores in their names for readability. By default g77