Re: speed up calculation suggestions



<rleavitt@xxxxxxxxxxxxxxxx> wrote:

Just to make sure I understand... a text based file has, for example,
a real number expressed as a seriers of ascii characters that then
need to be converted into a floating point real number.

Yes.

The
unformatted file means that the number is stored as what?? The actual
bytes that the Fortran uses to represent the number interally?

Yes, exactly. In fact, that will be the "floating point" bit that you
mention above. That terminology refers to the general form that real
numbers are almost always stored in internally.

I do not even know how to read or write such things, but I assume could
find out.

Pretty much any programming language can write data like that because
the representation will be determined by the CPU. This isn't really a
Fortran matter. Essentialy all languages wil use and can read/write the
same internal formats - the ones that the CPU supports. (It is possible
for a compiler to use a different internal format, and it even happens
in some arcane situations - but that is rare enough that I can say with
confidence that you won't need to worry about it).

In C, for example, thsi is commonly known as "binary I/O". (I think that
term misleading, but that's the one usually used; the term often spills
over into Fortran in informal use.)

Fortran compilers do tend to add a small amount of Fortran-specific
stuff at the beginning and end of each "record", but there are ways to
deal with that. No point in going into that level of detail yet, though.

Just because of the kind of business you are in, I perhaps should
mention that the exact details of floating point formats do vary from
one class of CPU to another. Thus, if you write unformatted data with
one kind of machine and read it with another, there can be "issues".
However, the large majority of machines today use the same format. That
basically includes all machines based on Intel CPUS (or competitors like
AMD). So it is a pretty large class. Most other current CPUs also use
the same format (sometimes with one minor distinction of byte order).
THis includes, for example, most Unix workstations.

One difference of note is IBM mainframes (and their competition). Most
posters here have probably never even seen such a machine. But corporate
accounting is one place where they do have a significant presence. I'm
not getting the impression that you are working with machines of that
class, but I thought the caveat worth mentioning.

--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
.



Relevant Pages

  • Re: Language lawyers: Was: Re: Paging the gfortran (64-bit Linux, medium memory model) mavens
    ... The H format descriptor goes back to Fortran I in 1956. ... Doing character manipulation on machines like the CDCs was a PITA. ... that the computing power of a musical greeting card is more than ...
    (comp.lang.fortran)
  • Re: Is it time to legitimise REAL*8 etc?
    ... why the Fortran 90 Standard introduced the kind selection functions, ... to programmers who still use this notation that they really ought to use ... machines as we can. ... but Gaussian cost something like US$2000. ...
    (comp.lang.fortran)
  • Re: Write position
    ... But it's surprisingly hard to do in Fortran. ... the format correct to fill the record (including the newline sequence). ... NCOUNT = NCOUNT + 1 ...
    (comp.lang.fortran)
  • Re: Model and CPU
    ... Is there a list of CPU types associated with model? ... While there is not a direct command to determine processor speed in AIX V4, ... Note on some machines the ... Each 2 way processor resides on one CPU card. ...
    (comp.unix.aix)
  • Re: FS Nucore hardwarePC Hardware
    ... boards, CPU, hard drives ETC is quite a challenge. ... machines before the company went under. ... One kit remaining at this price ... CPU: Q9400 QUAD core 2.66GHz..yes a QUAD core ...
    (rec.games.pinball)