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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use GET_FILES@ command? 2

Status
Not open for further replies.

eriehml

Technical User
Jul 17, 2009
9
US
I have several files with extention .dat in a folder where I run my fortran code. I would like to use GET_FILES fortran command to read automatically these files names from the working folder. Could you provide me a simple example on how to use GET_FILES@ subroutine in Fortran? Your help is very much appreciated. Thanks.
 
Hi xwb,

I looked at Intel Visual Fortran now, I thought the Linux version was earlier free for personal or student usage, but now I couldn't find something free, it all costs money.

I looked at silvefrost too. They offer personal edition and I was at downloading, to try it, but then I saw on the page
this
"4. What are the differences from the full product?
Any applications made with FTN95PE will display an initial banner. There are of course restrictions on the licence."

so I decided, not to download, because I hate banners and crippleware. GNU compiler are adequate for the little fortran coding, that I do in this forum.
On the other side I understand: silverfrost is for someone who doesn't want to bother with OpSys and command line and need an IDE.
But I'm not a GUI guy, for me the GNU compilers are sufficient.

Fortran at work is a funny beast.
..but very often, you have to maintain old code.
It is good that it is not still in Fortran II or Fortran66.
...
In industry, you sometimes have to mix 2-4 variations of Fortran is the same program.

I'm not using Fortran at my work, but I'am using COBOL. And what you say is analogous to my work. I'm working in banking and have to maintain mass of COBOL code.
For new development we are using the "modern" standard 85 (i.e. 24 years old), but they are some old programs code in standard 74 too. These are full of "GO TO" statements - so called spaghetti code. So trully, the debugging is very "funny".
:)
 
Mikrom. The banner you get when you run Plato IDE from Silverfrost it just comes up for one second and that is all. You can use that one second to take a deep breath. I tried your code and works fine. Using Common worked alright. So I guess the Common is some kind of allocation and if I understand correctly it ends up allocating only nr_lines rather than the original 1000. Thank you.
 
I'm glad that the last example worked finally with silverfrost.
In the code I posted, the global variable N in common block has constant value of 1000. It has nothing to do with the variable nr_lines.
For example, you can read about common blocks here:

As xwb suggested, try to change the source file extensions of earlier examples (with allocatable arrays, contains and modules) from *.f90 at *.f95 and maybe it should work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top