From: mecej4 on
On 5/20/2010 8:30 AM, Gordon Sande wrote:
<--- CUT --->
> One of the issues
> was what happened if the value of the adjustable dimension was changed
> during execution of the subroutine.
<--- CUT --->

I have a copy of the IBM VS Fortran Rel.1.1 Reference Manual, dated
1982. It claims to be Fortran 77 + IBM extensions. Page 22 covers the
topic of adjustable dimensions in great detail:

"...Instead, the array declarators appearing in an explicit
specification statement or DIMENSION statement in the subprogram may
contain dummy arguments or _variables_in_common_ (italics mine) that are
integer variables of length 4 to specify the size of the array."

Later on, on the same page, it says:

"Integer variables in the explicit specification or DIMENSION
statement that provide dimension information may be redefined within the
subprogram but the redefinitions have no effect on the size of the
array. The size of the array is determined at the entry point at which
the array information is passed."

-- mecej4
From: Gordon Sande on
On 2010-05-20 11:50:32 -0300, mecej4 <mecej4_no_spam(a)operamail.com> said:

> On 5/20/2010 8:30 AM, Gordon Sande wrote:
> <--- CUT --->
>> One of the issues
>> was what happened if the value of the adjustable dimension was changed
>> during execution of the subroutine.
> <--- CUT --->
>
> I have a copy of the IBM VS Fortran Rel.1.1 Reference Manual, dated
> 1982. It claims to be Fortran 77 + IBM extensions. Page 22 covers the
> topic of adjustable dimensions in great detail:
>
> "...Instead, the array declarators appearing in an explicit
> specification statement or DIMENSION statement in the subprogram may
> contain dummy arguments or _variables_in_common_ (italics mine) that
> are integer variables of length 4 to specify the size of the array."
>
> Later on, on the same page, it says:
>
> "Integer variables in the explicit specification or DIMENSION
> statement that provide dimension information may be redefined within
> the subprogram but the redefinitions have no effect on the size of the
> array. The size of the array is determined at the entry point at which
> the array information is passed."
>
> -- mecej4

The issue was not whether it was well defined and documented but
whether anyone ever
bothered to read the relevant manuals and remember what was read. All
too often the
manuals were never read but rather relayed many handed with the details
being lost.
Programming "standards" and "styles" had more superstition in them than
one would have
liked. Anyone who had read the manual and hung out in the ready room
had plenty of
horror stories of what the common wisdom was saying!

Very few folks were aware that the adjustable dimensions could be in
common. I would
guess that remains true to this day. It seems to have needed extra
attention even here.
The issue of the use of the adjustable dimension in the "pre-execution
prefix" makes
sense once it is explained but is at the level of arcane detail. It
desrves to be
described as something that should not be exploited (by changing the
values at anytime)
in any program pretending to be well written. The mixing of resticted subscript
expressions with the new fearure of adjustable dimensions lead to a fair bit of
superstition as to what was possible and what worked, notwithstanding
that it was
well defined and fully described in a manual that one never saw.



From: glen herrmannsfeldt on
mecej4 <mecej4_no_spam(a)operamail.com> wrote:
(snip)

> I have a copy of the IBM VS Fortran Rel.1.1 Reference Manual, dated
> 1982. It claims to be Fortran 77 + IBM extensions. Page 22 covers the
> topic of adjustable dimensions in great detail:

IBM is pretty good at marking extensions in their manuals,
usually by giving them a grey background.

> "...Instead, the array declarators appearing in an explicit
> specification statement or DIMENSION statement in the subprogram may
> contain dummy arguments or _variables_in_common_ (italics mine) that are
> integer variables of length 4 to specify the size of the array."

I believe the COMMON case is standard Fortran 66. Is it grey?

> Later on, on the same page, it says:

> "Integer variables in the explicit specification or DIMENSION
> statement that provide dimension information may be redefined within the
> subprogram but the redefinitions have no effect on the size of the
> array. The size of the array is determined at the entry point at which
> the array information is passed."

-- glen
From: mecej4 on
On 5/20/2010 1:17 PM, glen herrmannsfeldt wrote:
> mecej4<mecej4_no_spam(a)operamail.com> wrote:
> (snip)
>
>> I have a copy of the IBM VS Fortran Rel.1.1 Reference Manual, dated
>> 1982. It claims to be Fortran 77 + IBM extensions. Page 22 covers the
>> topic of adjustable dimensions in great detail:
>
> IBM is pretty good at marking extensions in their manuals,
> usually by giving them a grey background.
>
>> "...Instead, the array declarators appearing in an explicit
>> specification statement or DIMENSION statement in the subprogram may
>> contain dummy arguments or _variables_in_common_ (italics mine) that are
>> integer variables of length 4 to specify the size of the array."
>
> I believe the COMMON case is standard Fortran 66. Is it grey?

No, this manual appears to have been "typeset" on a Printronix before
copying. IBM extensions are marked by surrounding them by lines. The
sections that I quoted here are NOT marked as extensions.

-mecej4

>> Later on, on the same page, it says:
>
>> "Integer variables in the explicit specification or DIMENSION
>> statement that provide dimension information may be redefined within the
>> subprogram but the redefinitions have no effect on the size of the
>> array. The size of the array is determined at the entry point at which
>> the array information is passed."
>
> -- glen

From: Gordon Sande on
On 2010-05-20 17:06:06 -0300, mecej4 <mecej4_nospam(a)operamail.com> said:

> On 5/20/2010 1:17 PM, glen herrmannsfeldt wrote:
>> mecej4<mecej4_no_spam(a)operamail.com> wrote:
>> (snip)
>>
>>> I have a copy of the IBM VS Fortran Rel.1.1 Reference Manual, dated
>>> 1982. It claims to be Fortran 77 + IBM extensions. Page 22 covers the
>>> topic of adjustable dimensions in great detail:
>>
>> IBM is pretty good at marking extensions in their manuals,
>> usually by giving them a grey background.
>>
>>> "...Instead, the array declarators appearing in an explicit
>>> specification statement or DIMENSION statement in the subprogram may
>>> contain dummy arguments or _variables_in_common_ (italics mine) that are
>>> integer variables of length 4 to specify the size of the array."
>>
>> I believe the COMMON case is standard Fortran 66. Is it grey?
>
> No, this manual appears to have been "typeset" on a Printronix before
> copying. IBM extensions are marked by surrounding them by lines. The
> sections that I quoted here are NOT marked as extensions.
>
> -mecej4

I would guess that the folks who documented Fortran IV looked at the generated
code and asked what it depended up. The answer was that it needed a value that
existed at the beginning of the program like those of the arguement list or
in common and that the execution prefix would set up all the necessary
addressing constants so it would be OK to change those values. They did a good
job. Perhaps too good of a job as the flexibility to change the adjustable
dimension variables seems to be poor programmng practice. The use of common
variables is just curious. Once you notice the aliasing resriction on
arguements
and common it is perhaps plausible to allow the common variables.

This all happened when there were chaacters around who would have read the
generated code and asked for all of its capabilites to be permiited. Times
were different back then.

Fortran 66 is basically Fortran IV so the flexibility has been there
since then.

>>> Later on, on the same page, it says:
>>
>>> "Integer variables in the explicit specification or DIMENSION
>>> statement that provide dimension information may be redefined within the
>>> subprogram but the redefinitions have no effect on the size of the
>>> array. The size of the array is determined at the entry point at which
>>> the array information is passed."
>>
>> -- glen