Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. NickFort

    Dynamic array assignments within function, with pointers returned to calling function

    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...
  2. NickFort

    No strip.exe needed in gfortran4.7?

    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...
  3. NickFort

    Sorting of ordered triples

    Might this help?: http://www.fortran-2000.com/rank/ -------------------------------------- Background: Chemical engineer, familiar mostly with MATLAB, but now branching out into real programming.
  4. NickFort

    Having trouble getting "&" to work.

    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...
  5. NickFort

    Comprehending shortcuts in fortran 77

    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...
  6. NickFort

    code compiled with ifort doesn't work (but with gfortran does)

    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...
  7. NickFort

    code compiled with ifort doesn't work (but with gfortran does)

    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? --------------------------------------...
  8. NickFort

    g95 -march switch not working

    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...
  9. NickFort

    Fortran's precision vs. MATLAB's

    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...
  10. NickFort

    Fortran's precision vs. MATLAB's

    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...
  11. NickFort

    FORTRAN 90 subroutine

    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...
  12. NickFort

    FORTRAN 90 subroutine

    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...
  13. NickFort

    Differences in execution speed when compiled on 32-bit and 64-bit

    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...
  14. NickFort

    Passing unit numbers from a shared library (FLIBS)

    Reply from Arjen Markus, in case anyone is interested: -------------------------------------- Background: Chemical engineer, familiar mostly with MATLAB, but now branching out into real programming.
  15. NickFort

    Passing unit numbers from a shared library (FLIBS)

    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...
  16. NickFort

    Portable directory &quot;crawl&quot; from Fortran

    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...
  17. NickFort

    Portable directory &quot;crawl&quot; from Fortran

    (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...
  18. NickFort

    Modules that USE eachother and thus don't compile ever

    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...
  19. NickFort

    Print out runtime

    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...
  20. NickFort

    Coffee question: Who uses fortran?

    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...

Part and Inventory Search

Back
Top