Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Olden days of Fortran question

JohnNichols
Valued Contributor III
5,688 Views
IF(IT.LE.49) GO TO 476                    !   00335000

    WRITE(*,70107)                       !   00336000
70107 FORMAT(" ","CONVERGENCE FLAG: UNABLE TO ACHIEVE SATISFACTORY CLUST1ERS AFTER 50 ITERATIONS.")     !   00338000

476 WRITE(6,466)                        !   00339000
466 FORMAT(" ",//," NO. OF CLUSTERS",3X,"PART. COEFF.",5X,"LOWER BOUND",5X,"ENTROPY",5X,"NUMBER OF ITERATIONS")

I have been programming Fortran since 1978, I have seen the ! 0033500 numbers before - but what were they for? 

Did these olden day folk, always use the if ..... goto ... instead of a proper if   then else etc... 

 

0 Kudos
27 Replies
GVautier
New Contributor II
4,161 Views

It's the line/card number at position 73 to 80 on punch cards. This is the reason of the 72 characters per line limit in Fortran.

Later it was used by first text editors.

 

The three last digits are the fractional part allowing line/card insertion.

00335000

00335500

...

00336000

 

There were "tools" to renumber to plain line numbers.

 

 

0 Kudos
mecej4
Honored Contributor III
4,143 Views

And, if you slipped on an icy sidewalk and dropped the card deck of your program on the way to the computer center, you picked up the cards, and fed them to the card sorting machine at the computer center, which would return your deck sorted by columns 73-80.

Numbering cards by increments of 1000 indicates that the programmer had big plans, leaving herself/himself scope for adding up to another 999 cards between currently adjacent cards.

0 Kudos
Barbara_P_Intel
Employee
4,143 Views

sorting them ... assuming the cards didn't get all wet when they landed!!

0 Kudos
AlHill
Super User
4,138 Views

Remember:  9 edge in, face down.

 

Doc (not an Intel employee or contractor)
[Windows 11 is the new Vista]

0 Kudos
JohnNichols
Valued Contributor III
4,112 Views

My ex father in law had a t shirt from the 70's that said - stuff the MAN - bend the cards. 

 

Remember:  9 edge in, face down.   ==== No idea I only used punch cards for short time and never more than about 30. 

 

The Fuzzy K Means is running nicely and the example from the paper can be repeated.   it is so much easier to compare a graph than a long table of numbers.  I was going over the paper last night and my first thought was the peer reviewer could have picked up a few of the oddly explained points.  

Set00Sector00.png

Windows 11 is the new Vista    === actually it is pretty nifty with a few new things,  VS 2019 and oneAPI 4 run on it so I am happy, the multiple windows is nice and updating is fast.  

The final fuzzy program is attached ---  this forum does not allow bmp files, so I have to open the file in paint.net and output a png file,  one would ask why?  But better not to. 

0 Kudos
JohnNichols
Valued Contributor III
4,083 Views

I am now comparing the KMEANS runs to the Fuzzy Set runs, there is a significant difference in the run times and the rate of convergence, Fuzzy is very slow. 

0 Kudos
AlHill
Super User
4,069 Views

9 edge in, face down.

 

It was in the 70’s when I wrote my version of StarTrek in Fortran at the university.  It was about 2000 cards, or lines, in length.  In the Computer Science building, there was a Univac 1108, with a Fortran compiler known as Ralph.  In addition to compiling Fortran programs, Ralph also announced all holidays.  Not important, just interesting.

 

Carrying my box of cards (today’s equivalent of a USB stick with your source code), all in perfect condition and numbered in columns 73-80, I went to the student lab and created a job card for my deck and took it to the job window.  The student behind the window took it, and said it should be done in about 30 minutes.  There were other jobs ahead of me.

 

I figured I would go to the student union, and grab a sandwich and soda while waiting.  On the way, I saw Debbie.  Debbie was a college girl who possessed all of the attributes and qualities admired by the college guy.  We stopped and talked, and arraigned a date for Saturday night.  Now, I had to figure out where to get money for the date and to buy gas for a 1970’s Lime Green Plymouth Satellite.  Because of the conversation, I had no time left for the sandwich and soda.  I was feeling particularly pleased with myself, having a date for Saturday night.  But, that has nothing to do with this story. 

 

I go back to the job submission window and looked in the output stack.   There is my box of cards, and a printout that looks smaller than it should be.   I read the printout – job failure.   I look at the deck.   Probably a dozen cards were mangled, getting eaten by the card reader.   Now I have to retype the mangled cards and resubmit my deck.  I found a  card punch machine that was not being used, and replaced all the mangled cards.  A student who was walking by brushed against my box, spilling it to the floor.  

 

What to do now?   There was a 1401 that was setup as a sorter, but it was out of order.  Sorter out of order?  I knew there was a 360/20 in the Business Studies building I could use.  So, off I go to Business Studies.  On the way, I saw Debbie again.  And, again, that has nothing to do with this story.  

 

At the Business Studies building, I was ready to load my now unsorted deck.  The sign on the 360/20 said “9 edge in, face down”.  So, I loaded my deck as instructed, set the sort field for columns 73-80, and the deck was sorted perfectly. 

 

So remember:   "9 edge in, face down" is the key when loading your deck, whether to be sorted or loaded.

 

Doc (not an Intel employee or contractor)
[Windows 11 is the new Vista]

0 Kudos
mecej4
Honored Contributor III
4,033 Views

For most people, few of whom were programmers in those days, far more important than "Nine-edge First, Face Down", was the stern injunction from Uncle Sam,

“Do Not Fold, Spindle or Mutilate”

A movie with that name was made in 1971.

You may well wonder what the verb "Spindle" meant in this context. 

In the early 1900s, there were some attempts to manufacture and sell machines to "deMutilate" mutilated punch cards.

0 Kudos
GVautier
New Contributor II
4,058 Views
andrew_4619
Honored Contributor III
4,045 Views

"Did these olden day folk, always use the if ..... goto ... instead of a proper if   then else etc... " IF ...THEN is an F77 creation

0 Kudos
jimdempseyatthecove
Honored Contributor III
3,987 Views

Andrew, there is nothing wrong with a GOTO. In many situations, code is much clearer to read than use of many levels of nested IF...THEN...ELSE...

Every statement has to be used correctly. You do not fix lazy programmers by removing functionality. I suppose one could have a compiler switch to dumb down the functionality. IOW revert back to procedures with one entry and one exit with no flow control.

Jim Dempsey

0 Kudos
andrew_4619
Honored Contributor III
3,966 Views

"Andrew, there is nothing wrong with a GOTO." I didn't make any comment  about the use of goto, I was simply quoting from Johns original post and commenting on that. Though, having tweaked some old BSpline codes to achieve standards compliance recently I think the deletion or the three way arithmetic IF was a sound choice! 

0 Kudos
mecej4
Honored Contributor III
4,036 Views

Andrew_4619 wrote: "IF ...THEN is an F77 creation"

Algol 60 already had structured programming features, and was widely used to publish algorithms in journal articles, in the 1960s and later.

Here is a sample, which I took from the Wikipedia article on Algol-60.

 

procedure Absmax(a) Size:(n, m) Result:(y) Subscripts:(i, k);
    value n, m; array a; integer n, m, i, k; real y;
comment The absolute greatest element of the matrix a, of size n by m,
    is transferred to y, and the subscripts of this element to i and k;
begin
    integer p, q;
    y := 0; i := k := 1;
    for p := 1 step 1 until n do
        for q := 1 step 1 until m do
            if abs(a[p, q]) > y then
                begin y := abs(a[p, q]);
                    i := p; k := q
                end
end Absmax

 

0 Kudos
andrew_4619
Honored Contributor III
4,026 Views

Yes I wasn't suggesting that If...then was invented in F77 just that it was the first Fortran std to include it.

0 Kudos
jimdempseyatthecove
Honored Contributor III
3,944 Views

>> I think the deletion or the three way arithmetic IF was a sound choice! 

IMHO, I think it was sad to remove it. Old code will break. 

Jim Dempsey

0 Kudos
Steve_Lionel
Honored Contributor III
3,940 Views

Not in practice, because compilers don't remove support for deleted features. 

0 Kudos
JohnNichols
Valued Contributor III
3,903 Views

 

This code is a straight OCR from the 1984 paper, 

it is running at the moment and producing what appears to be the correct answer.  The only things I did was to change 0.0 to a parameter and one, I find it makes the code easier to read.  You can see the OCR errors I have yet to fix.  But taking a few days to write a simple drawer that can take XY output was worth the effort.  

 

 

 IF( ICON-1)380,380,382	                                                            !   00113000
380 DO 381 I=1,NDIM		                                                                !   001140CO
        DO 381 J=1,NDIM	                                                                !   001150CO
381 CC( I,J)=ZERO		                                                                !   00116300

    DO 370 I=1,NDIM                                                                     !   00117000
370 CC(I,I)=ONE		                                                                    !   00118000
    GO TO 390		                                                                    !   00119000

382 IF(ICON-2)384,384,386		                                                        !   00120300

 

 

 

Ring001.png

 This is the output, the outer circles in red (cluster 1) and yellow(cluster 2) are the cluster elements 1 - 510 as my friend wants in Left hand moment rule, modern books have changed the name for probity sake, the white ring is a separator and the inner rings are the Euclidian distance to the center in n dimensional space in this case 300 dimension space.  This is the fuzzy set, interestingly it has only one or two minor changes from the means set.   The paper offers a number of alternatives, I have ye to test them.  

I have not found anything yet, although I have not searched that hard on cascading K Means tests.  But it seems to be a method worth investigating. 

 

0 Kudos
Mike_M_1
New Contributor I
3,882 Views

I learned FORTRAN IV in c. 1965 and subsequently back-tracked to FORTRAN II.

The number look to me like the remnants of sequence numbers that used to be punched into columns 73-80 of punched cards, put there so that if someone dropped the deck of cards, they could easily put the cards back into the correct order.  Great in theory, but not so much in practice - I'm sure you can imagine multiple scenarios where this didn't work.

 IF-THEN-ELSEIF-ELSE-ENDIF syntax didn't appear until FORTRAN 66, if I remember correctly.  

0 Kudos
Steve_Lionel
Honored Contributor III
3,874 Views

IF-THEN-ELSE was FORTRAN 77.

0 Kudos
TonyRichards
Novice
3,767 Views

Oldie here.

I was taught Fortran IV as an undergraduate physicist starting 1966, and I regard it as one of, if not the best, courses in terms of pay-off later, that I was given. I was still using Fortran in 2016 in my job when I eventually retired. I had to learn a bit of C++ eventually, but Fortran was/is my workhorse of choice for number crunching and, latterly, writing programs with a Windows GUI. The only tool that came close for data generation and visualisation was MathCad, which was brilliant until it was sold on and the new owners mended it until it broke for me. They made it not back compatible! Unbelievable.

I think my largest punch-card program computing broadening of spectral lines in high-temperature plasma, occupied nearly the whole of a card tray, probably about 16 inches or maybe more, and because boxes of cards came with various coloured edges, was a pretty psychedelic sight, which developed a jumbled spectrum of colours as I modified and corrected and added to it.

Memories of floors littered with discarded cards and 'chads', and not so fond ones of waiting for, then seeing, unexpectedly short print-outs from your job appearing in the fast-turn-around CDC 6600 and later 7600 job queues.

I liked the GO TO and agree depths of IFs, Elseifs endifs can be difficult to interpret at times.

Anyway, most of my time at present is taken up with problems getting at Fortran compiler and other documentation in VS2019 and not Fortran ones (except the struggle to remember stuff that was second nature but whose details I have forgotten since I retired and stopped regular programming!)

Regards

Anthony Richards

Reply