Sherman Crank Up The WayBack Machine
If you don't get the title, you're probably too young to get the rest of this. If you don't know who John Backus was or what his contribution to computer science was then you're also, probably, too young.
The first programming I ever did was in a language called DITRAN using punched cards. DITRAN was a Diagnostic version of FORTRAN. I found it about as interesting as watching the corn grow.
Some years later, sitting in front of a CRT, it was a completely different story, I was hooked. We were developing accounting applications in FORTRAN 66 (you read that right) on a Prime 300 mini-computer. Prime had a BASIC interpreter, but that was for wimps.
So, today I wondered if I could compile and run a FORTRAN program on Linux. First problem I had, was I couldn't remember enough FORTRAN to actually write a program, so I stole this from the Wikipedia FORTRAN page. Had to make a few slight modifications to get it to compile:
C AREA OF A TRIANGLE WITH A STANDARD SQUARE ROOT FUNCTION C INPUT - CARD READER UNIT 5, INTEGER INPUT C OUTPUT - LINE PRINTER UNIT 6, REAL OUTPUT C INPUT ERROR DISPLAY ERROR OUTPUT CODE 1 IN JOB CONTROL LISTING READ 501, IA, IB, IC 501 FORMAT (3I5) C IA, IB, AND IC MAY NOT BE NEGATIVE C FURTHERMORE, THE SUM OF TWO SIDES OF A TRIANGLE C IS GREATER THAN THE THIRD SIDE, SO WE CHECK FOR THAT, TOO IF (IA) 777, 777, 701 701 IF (IB) 777, 777, 702 702 IF (IC) 777, 777, 703 703 IF (IA+IB-IC) 777,777,704 704 IF (IA+IC-IB) 777,777,705 705 IF (IB+IC-IA) 777,777,799 777 STOP 1 C USING HERON'S FORMULA WE CALCULATE THE C AREA OF THE TRIANGLE 799 S = FLOAT (IA + IB + IC) / 2.0 AREA = SQRT( S * (S - FLOAT(IA)) * (S - FLOAT(IB)) * + (S - FLOAT(IC))) WRITE (0,601) IA, IB, IC, AREA 601 FORMAT (4H A= ,I5,5H B= ,I5,5H C= ,I5,8H AREA= ,F10.2, + 13H SQUARE UNITS) STOP END
$ gfortran test.fRunning it is simple, although it took me a while to remember that FORTRAN likes its input values separated by commas:
$ ./a.out 3,4,5 A= 3 B= 4 C= 5 AREA= 6.00 SQUARE UNITSAlso took me a while to figure out some acceptable input values... can you say trigonometry?.
If none of this is new to you, if it seems quite old-hat, then maybe you're involved in some sort of HPC (High Performance Computing). If so, check this link and maybe you can pass along some of that knowledge to some of these youngsters.
Mitch Frazier is an Associate Editor for Linux Journal.
|PostgreSQL, the NoSQL Database||Jan 29, 2015|
|HPC Cluster Grant Accepting Applications!||Jan 28, 2015|
|Sharing Admin Privileges for Many Hosts Securely||Jan 28, 2015|
|Red Hat Enterprise Linux 7.1 beta available on IBM Power Platform||Jan 23, 2015|
|Designing with Linux||Jan 22, 2015|
|Wondershaper—QOS in a Pinch||Jan 21, 2015|
- PostgreSQL, the NoSQL Database
- Sharing Admin Privileges for Many Hosts Securely
- HPC Cluster Grant Accepting Applications!
- Designing with Linux
- Wondershaper—QOS in a Pinch
- January 2015 Issue of Linux Journal: Security
- Internet of Things Blows Away CES, and it May Be Hunting for YOU Next
- Ideal Backups with zbackup
- Red Hat Enterprise Linux 7.1 beta available on IBM Power Platform
- Slow System? iotop Is Your Friend
Editorial Advisory Panel
Thank you to our 2014 Editorial Advisors!
- Jeff Parent
- Brad Baillio
- Nick Baronian
- Steve Case
- Chadalavada Kalyana
- Caleb Cullen
- Keir Davis
- Michael Eager
- Nick Faltys
- Dennis Frey
- Philip Jacob
- Jay Kruizenga
- Steve Marquez
- Dave McAllister
- Craig Oda
- Mike Roberts
- Chris Stark
- Patrick Swartz
- David Lynch
- Alicia Gibb
- Thomas Quinlan
- Carson McDonald
- Kristen Shoemaker
- Charnell Luchich
- James Walker
- Victor Gregorio
- Hari Boukis
- Brian Conner
- David Lane