Re: Many small programs vs. one large program?
- From: Ken Fairfield <Ken@xxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 20 Jan 2007 10:00:06 -0800
sk8terg1rl wrote:
Hi Ken,[...]
There was no mass.txt file provided, so testing couldn't be completed...
A little frustrating after I went to the trouble to fix up the source
code format, etc...
Sorry about that. mass.txt is just a plain text file with the mass in
grams of the rigid body. To be specific, it is 0.89g, although it can
be any real number for the purposes here.
Good, I'll give that a try. I just didn't have any idea was whether
this was the mass of a tractor or a fly! :-)
More importantly, you're using fixed-form source, which led to some
other problems. First was, my compiler (with strict checking enabled)
complained about "tab-formating". In other words, the source file
includes tabs, and as an extension in some compilers (including mine),
a tab in column 1 counts as only a single character in a 72-charcter
maximum length input record. You've taken "advantage" of that in
two ways:
Unfortunately I have no control over the format of the output file as
it is the result of a pre-compiled binary.
As someone else pointed out, I was commented in your source code
format, not the input or output data files...
One other note: many compilers, I believe Intel's are among them,
assume that a .FOR file (or .for, or .f) is fixed-form source.
use .F90 or .f90 for free-form source. These compilers usually
have an explicit switch, qualifier, or "project" setting to
override this convention, but you'll be happier in the long run
if you just stick to the convention.
[...]
if (i==marked(count2)) thenHere, the "continuation" character, "1", appears in column 8 (or 9,
read (1, '(a50, i10, a8, e13.6)')
1 a50, timestep(count2), a8, time(count2)
hard to tell), rather than in columns 1-5 as required in fixed-form
Brain-fade here. As you comment below, columns 1-5 are, of course
the label-field. Column 6 is the continuation character field.
The continuation character can be any letter or digit _except_ "0"
(I don't recall the reason for the exclusion of "0").
Many DEC-heritage compilers, including CVF and IVF, allowed "tab
formatting" in which a tab in column 1 counted for only 1 column
in the 72-column record, _and_ they allowed a "tab+digit" starting
in column 1 to count as a continuation record. I encountered
this is a fellow student's code back in, oh, 1982 or so and was
so appalled by it, I swore never to use it! (As soon as you
replace that tab by blanks, the record (potentially) gets truncated,
etc.)
Regards, Ken
--
Ken & Ann Fairfield
What: Ken dot And dot Ann
Where: Gmail dot Com
.
- Follow-Ups:
- Re: Many small programs vs. one large program?
- From: Richard Maine
- Re: Many small programs vs. one large program?
- References:
- Re: Many small programs vs. one large program?
- From: Gordon Sande
- Re: Many small programs vs. one large program?
- From: Beliavsky
- Re: Many small programs vs. one large program?
- From: Ken Fairfield
- Re: Many small programs vs. one large program?
- Prev by Date: Re: Random number generator?
- Next by Date: Re: Most elegant way to read to allocatable array?
- Previous by thread: Re: Many small programs vs. one large program?
- Next by thread: Re: Many small programs vs. one large program?
- Index(es):
Relevant Pages
|