I haven't determined the root cause of the numerical accuracy bug yet (I haven't determined a way to compare the values used when the code is run from R as opposed to from a Fortran test), but I did have another issue with retrieving the matrix from the Fortran code that I hoped you might be able to help with. I'm very much a beginner user of R, so any help would be appreciated.
The attached R file contains the R function that calls the Fortran subroutines & code to make a test run. The attached Fortran file is the Fortran wrapper subroutine called by R & a second subroutine that it then calls to calculate the two elements of each row of the output matrix. When running this code, the matrix returned by the R function is incorrect in that the returned elements are being stored sequentially down the first row & then the second row of the 2D output matrix, rather than sequentially across the two columns as desired. Might you be able to point me to where I've written the code wrong so that the output is being stored incorrectly? Thanks in advance for any help parallax_Rhelp.f90 <http://r.789695.n4.nabble.com/file/n4647005/parallax_Rhelp.f90> xypos_parallax.R <http://r.789695.n4.nabble.com/file/n4647005/xypos_parallax.R> -- View this message in context: http://r.789695.n4.nabble.com/Trouble-returning-2D-array-into-R-from-Fortran-tp4646862p4647005.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.