Hi all,
I'm very new to C++, having come from a Fortran 90+ and MATLAB background. I've been playing with pointers in C++, and I've stumbled upon something I can't quite explain. This is an arbitrary example I've come up with, just from messing around, trying to understand how C++ works.
In...
I think I know what's happening, and it has to do with static vs shared gfortran/gcc libraries.
In older versions of gfortran, by default, it would use static libraries, where every executable had all of the necessary gfortran binaries packed into the executable. The new version -- from what...
Might this help?:
http://www.fortran-2000.com/rank/
--------------------------------------
Background: Chemical engineer, familiar mostly with MATLAB, but now branching out into real programming.
That is bizarre; I see no reason why that continuation character wouldn't work. Maybe a stupid question, but what version of gfortran are you running? Execute "gfortran --version" and see what it says.
--------------------------------------
Background: Chemical engineer, familiar mostly with...
Why don't you let this give you a head-start?:
http://www.mathworks.com/matlabcentral/fileexchange/5260
What you could do is use Michael Metcalf's F77 to F90 converter (http://www.nag.co.uk/nagware/Examples/convert.f90), and then use the above to convert to MATLAB? I don't know how well the...
FJacq, you're right, but why would gfortran be OK, but ifort not? When I've messed up with something like that, gfortran's complained during compile time.
Pfor, which version of gfortran are you using? Also, what about trying to compile with G95? It might give different errors which should give...
Segmentation faults can also happen with optional arguments (I seem to recall, although, right now, I can't think of why the compiler wouldn't catch them), and allocatable arrays, so checking just the bounds might not help. Do you use either of those?
--------------------------------------...
For some reason, I've found that executables compiled with the MinGW gfortran binaries are literally hundreds of times slower on 64-bit than on 32-bit (http://www.tek-tips.com/viewthread.cfm?qid=1644242&page=3).
I couldn't even get the gfortran binary you mentioned working on 64-bit; it kept...
Thanks for the reply, FJacq. I was convinced that this wasn't the case, because I've been very careful with this sort of thing, and had checked the main code, but as it turns out, some loops from an old piece of code didn't initialise properly with double precision.
Thanks for the suggestion...
I'm trying to translate a piece of code from MATLAB to Fortran (one that typically has lots of iterations), line-by-line. To check that everything is fine and dandy, in both, I output all of the variables at each assignment (an arduous process!). What I've found is that as the iterations...
Yes -- what you can do is take the file with all of the subroutines in it, put "module <your module name>" at the very beginning, then "end module <your module name>" at the very end. In your driver program, BEFORE any declarations, just add "use <your module name>". Now you can call the...
Why would the size of the subroutine matter? You just need an explicit interface from the subroutine(s) in the driver program. Alternatively, you can just put all of the subroutines into a module, and then "use" that module in the main program.
However, I'm not entirely certain I understand...
I have a program, which I compile on my 32-bit Windows 7 system with gfortran (http://users.humboldt.edu/finneyb/gfortran-windows-20110214.exe); execution time is about 90 milliseconds.
I then gave this source code to a colleague who is running the same version of Windows, except 64-bit. He...
Reply from Arjen Markus, in case anyone is interested:
--------------------------------------
Background: Chemical engineer, familiar mostly with MATLAB, but now branching out into real programming.
I'm playing around with FLIBS (http://flibs.sourceforge.net/), and getting some strange behaviour with csv_write.
To test just this module, I copy "csv_tst.f90" from "/tests/strings" and "csv_file.f90", "csv_file_1d.f90", "csv_file_2d.f90" from "/src/strings" to the same folder.
If I compile...
Oh, perfect! I've had a look at FLIBS in search of other things before, I've bookmarked it, but now when I need a routine, I completely forgot to check it. Thanks, François!
--------------------------------------
Background: Chemical engineer, familiar mostly with MATLAB, but now branching out...
(I could have sworn I posted this a week or so ago, and then it disappeared. I hope it's not a duplicate; if it is, my apologies.)
Is there a portable way of returning the directory structure and contained files to Fortran for processing?
An example of what I want to do:
- Get the...
Good question. That sort of problem has always led me to restructure the modules to not be dependent on each other that way. I wonder if there is a "proper" solution to that problem...
--------------------------------------
Background: Chemical engineer, familiar mostly with MATLAB, but now...
I use "system_clock" as I find it to be much more accurate than "cpu_time". If I am not mistaken, that should be portable, as it is standard F95 and later (according to the gfortran manual, anyway).
--------------------------------------
Background: Chemical engineer, familiar mostly with...
I use Fortran 90 for the development of an in-house chemical process simulator at my company. I got to choose the programming language, and I picked Fortran because I used it (for its speed) in some of my postgrad research so I was already somewhat acquainted with it, and I -- again -- need the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.