Hello,
Michael E. Burke wrote:
> I haven't used FORTRAN since the late 80's and I'm LOST! I'm looking for
> code snippets, examples and/or clear instructions on some simple tasks.
Try reading Metcalf, Reid & Cohen's _Fortran 95/2003 Explained_
> I'm using LF95 and here's a list of the things I can't seem to get right:
> I can't seem to read a data file. The file is time-sequenced data for
> Fourier analysis, but right now I'd be happy to be able to read any data
> file, assign it to an array, and print it to the screen or console.
Try something like:
copy_records: do record_idx = 1, number_of_records
read( unit= input_unit, fmt = *) array_1( record_idx), array_2...
write( unit= output_unit, fmt= *) array_1...
enddo copy_records
The trick is to open the units with the correct file names,
you must RTFM, or know the filenames otherwise. Investigate
the file= specifier on the open statement.
> I'd like to be able to plot the data.
This task is not part of standard Fortran (nor standard
C nor C++ either), so you'll need an external library
of some sort. Investigate Winteracter, http://www.winteracter.com
> I'd like to be able to build a Windows input form with command buttons, and
> generate a plot of the data, before and after transform. (I admit it: I've
> been spoiled by all the cool tools in Python and Visual Studio.)
Winteracter has "Visual Development" tools.
> Basically, I'd like to see how to actually develop a cool program or two in
> FORTRAN95. I'm embarrassed that I can't do this stuff. I did the same tasks
> in Visual Basic, Java, and Visual C++ in less than half an hour each, but
> the customer needs this in FORTRAN95. (Engineering company with a lot of
> legacy software for me to convert.)
And smart of them to not break it by a needless language conversion.
You'll want to switch to free format from fixed format, try
Metcalf's convert program, or Miller's to_f90, or Olagnon's f90ppr.
> Any suggestions on books or tutorials would be very helpful. I'm working
> through the Liverpool tutorial at this time, but it's slow slogging and I'd
> really like to see some examples like I see on the Fortran Programmer's Club
> site (although it looks like that site is getting commercial and less
> active, and it uses Compaq Visual FORTRAN, I believe).
IMNSHO, Visual Studio is not all that well suited to Fortran,
though others disagree.
> Thanks for any suggestions,
You're welcome. :-)
> Mike Burke
--
Cheers!
Dan Nagle
Purple Sage Computing Solutions, Inc.
|