On 2019-11-28 15:35, Dennis Lee Bieber wrote:
On Thu, 28 Nov 2019 12:45:27 +0000, Ben Bacarisse <ben.use...@bsb.me.uk>
declaimed the following:
Madhavan Bomidi <blmadha...@gmail.com> writes:
print,'Column ',J,' of product matrix A*AINV:',format='(1X,A7,I3,A27)'
I don't know what the 1X format does. The A7 and A27 formats just seem
to involve the programmer counting the strings. Very odd.
Channeling ancient FORTRAN, I'd interpret it as
1X Skip one space
A7 Seven character alpha
I3 Three digit integer
A27 27 character alpha
and it is rather painful when the arguments are literals of those sizes.
Makes more sense if the arguments are strings of various widths yet column
alignment is required.
Since I still favor string interpolation for formatting, I'd probably
just end up with
print(" Column %3d of product matrix A*AINV:")
{Odd that the original uses a 1X format, when the literals have white space
at the adjoining ends... Why not " Column " with A8 format?}
In Fortran, if the first character printed is a space, then the
remainder is printed on a new line, else the remainder is printed as a
continuation of the previous line. Thus, the initial 1X is making it
start on a new line.
This is very odd. What does it mean when a label is duplicated in IDL?
If the second one were not there, this:
JMP: IF WK(L-1,K-1) EQ 0 THEN BEGIN
L=L+1
GOTO, JMP
ENDIF
would just be a while loop:
while WK[L-1,K-1] == 0:
L=L+1
<cut>
Did you notice that "JMP:" occurs twice? Very strange!
By the way, all those -1s suggest that the IDL was itself a translation
from a language with 1-based array indexing. All that might be able to
be tidied up.
Heck -- the IDL could be tidied up... All those loop indices could be
configured to run 0..n-1, rather than 1..n
Looks a lot like a garbaged form of FORTRAN that has removed the . from
relational operators, and tried to use blocked syntax.
EQ => .eq.
NE => .ne.
FOR i = s, e DO BEGIN
=>
DO lbl i=s, e
stuff
lbl CONTINUE
--
https://mail.python.org/mailman/listinfo/python-list