[Info-vax] Text processing examples with Fortran requested
Ken Fairfield
ken.fairfield at gmail.com
Tue Nov 17 11:27:26 EST 2009
On Nov 16, 5:14 pm, "Richard B. Gilbert" <rgilber... at comcast.net>
wrote:
> Arne Vajhøj wrote:
> > Richard B. Gilbert wrote:
> >> Arne Vajhøj wrote:
> >>> glen herrmannsfeldt wrote:
> >>>> Even so, a lot was done in Fortran 66 because that was what
> >>>> was available. Storing one character per INTEGER array element
> >>>> was inefficient but usually worked.
>
> >>> One - not two or four??
>
> >> If you use two or more, you are faced with the problem of "packing"
> >> and "unpacking" the data.
>
> > A problem but a solveable problem.
>
> >> I don't believe that either Fortran II or Fortran
> >> 66 supported a character data type. "Hollerith literals" were the
> >> best you could do and I don't think they could be used outside of
> >> FORMAT statements. My copy of "Guide to Fortran Programming" has
> >> vanished in the mists of time along with the later edition, "A Guide
> >> to Fortran IV" programming. Fortran IV did support a character data
> >> type.
>
> > Standard it did not.
>
> > Arne
>
> Sometimes the standards people needed some time to catch up with
> reality. VAX Fortran was Fortran IV and my recollection is that it did
> support a character data type. ISTR that IBM System/360 Fortran also
> supported a character data type in the mid 1980's.
Beg to differ: VAX Fortran was FORTRAN 77 (yes, upper-cased until the
Fortran 90 standard) from the first release I saw at VAX/VMS V2.3. It
certainly supported older IBM-isms from FORTRAN IV (or more likely,
the IBM FORTRAN H and/or G compilers), as well as extensions from
other vendors.
In the mid-1980's, IBM's F77 compiler was VS FORTRAN, IIRC. The
CHARACTER data type was introduced with F77, so it was the mid-80's
before most (at least a large number) of compilers supported CHARACTER
as part of becoming FORTRAN 77 compliant. VAX FORTRAN was the
gold-standard among Fortran compilers of that era, and was one of the
first F77-compliant compilers available (I'm sure Steve Lionel would
have
more to say about that if he were around...he hangs out in
comp.lang.fortran
these days...).
> I do recall that programs coded in IBM Fortran needed a little "touching
> up" before it would compile and run on the VAX.
The codes I saw on the IBM mainframes of the day did really dirty
tricks. Not just stuffing character data into REAL*8 <sic> variables,
(because FORTRAN G & H didn't support CHARACTER), but changing
the value of literal constants(!) to control program execution,
something
that triggers an ACCVIO on VAX. I can't recall all the stuff, but as
a
naive grad student, I was blown away with disgust when I saw that...
> When I got my first VAX I had to port both IBM System/360 Fortran and
> HP's Fortran for the 2100 Series machines to VAX/VMS. The experience
> taught me to write more portable code!! I had used non standard
> features simply because they were there; needless to say no OTHER
> Fortran supported an identical set of non standard features.
Precisely. Richard Maine (editor of F2003, on the standards committee
for many years), has the following in his .sig:
"Good judgment comes from experience;
experience comes from bad judgment.
-- Mark Twain"
-Ken
More information about the Info-vax
mailing list