Re: Many small programs vs. one large program?



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)) then
read (1, '(a50, i10, a8, e13.6)')
1 a50, timestep(count2), a8, time(count2)
Here, the "continuation" character, "1", appears in column 8 (or 9,
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
.



Relevant Pages

  • Re: reading variably sized floats
    ... the nX or An) format field specifier. ... While that is a likely behavior with most compilers, ... it is *NOT* behavior specified by the standard. ... number of replacements blanks, or the definition of tab points, to be ...
    (comp.lang.fortran)
  • Re: reading variably sized floats
    ... the nX or An) format field specifier. ... While that is a likely behavior with most compilers, ... it is *NOT* behavior specified by the standard. ... number of replacements blanks, or the definition of tab points, to be ...
    (comp.lang.fortran)
  • Re: Interpretation of literal reals
    ... Do note, however, that in f77 this does *NOT* apply to internal I/O, as used in your example. ... List-directed formatting is not allowed for internal files in standard f77, and there used to be f77 compilers that didn't do it. ... In cases where the input data is always generated by a formatted write, I might relent and allow the same format to be used for reading, even though it has something other than ".0". ...
    (comp.lang.fortran)
  • Re: Equation line numbers
    ... I use different margin settings for different kinds ... So setting the right tab for the equation number to 6 will not ... I checked the MathType Help file, and I didn't find any reference to ... To format the equation numbers, ...
    (microsoft.public.word.pagelayout)
  • Re: Corrupt Word Doc While Editing
    ... Word does not "auto format" your document unless you tell it to using ... On the AutoFormat As You Type tab, ... Disable this at on the Save tab of Tools | Options. ... Embedded graphics: When feasible, it is preferable to link the ...
    (microsoft.public.word.formatting.longdocs)