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: Can we standardize CSV input/output?
    ... interfacing Fortran programs with other packages (spreadsheets, ... databases) and found that the only common semi-portable format is CSV ... Many people have written subroutines or modules to handle CSV ... It surely would not be too hard to extend the next Fortran Standard to ...
    (comp.lang.fortran)
  • Re: Yet another bulging-capacitors replacement
    ... capacitors in the power supply, not on the logic board, that were ... It took an hour or two of catalog work to find low-ESR replacements ... ghz CPU and Asus M4A78E-T mobo. ... I've recently been working with some games machines that have two very ...
    (sci.electronics.repair)
  • 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)