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

Gardner - SOUP Program

JohnNichols
Valued Contributor III
871 Views

I have created a new post as the last one was getting long.

I enclose the soup program again, but there are png files which show the BASIC listing, I will need to go to the library and see if I can find the original article.

SOUP.BAS runs nicely on PC-basic, but it is a slow as I remember on my old COMPAQ portable - which is why I wanted to move it to Fortran

 

0 Kudos
8 Replies
JohnNichols
Valued Contributor III
871 Views

I took a few minutes and set up a VS Solution file in Fortran and fixed the minor errors in the code so it starts to run - but crashes. The code is very old fashioned and needs to be fixed, but it starts.

Before I play with it - I will try and find MG article -- he was really great.

 

0 Kudos
JohnNichols
Valued Contributor III
871 Views

Article attached

0 Kudos
Steve_Lionel
Honored Contributor III
871 Views

It wasn't Gardner, it would seem. Love the ads! I once owned a 1986 Saab 900S.

0 Kudos
jimdempseyatthecove
Honored Contributor III
871 Views

10MB hard drive for $500!

Today, you can buy 10TB of hard disk for less than $500
$344.66 https://www.newegg.com/Product/Product.aspx?Item=N82E16822234351

1 million times the storage (better performance too), for lower cost.

Jim Dempsey

 

0 Kudos
John_Campbell
New Contributor II
871 Views

John,

I suggest you try running soup.for with bound checking on.

line 95 : call randf(ic1,ic2,ic3,ity,iseed,k,iseed2) returns ic1,ic2,ic3 in the range 0:9 ( RANDOM returns iCUN in range 0:9 )

line 104 uses ic3 as an array subscript.

It is interesting that the provided RANDOM routine uses the wall clock for setting random values. This may not work well with a ghz processor unlike the mhz processor in 1986. Perhaps replace gettim by intrinsic random_number ?

0 Kudos
JohnNichols
Valued Contributor III
871 Views

Steve:  You are correct it was the other guy who wrote Computer Recreations, I am just so used to saying Gardner and everybody who is a competent   in Mathematics knows who I am talking about -- he is one of that great group of mathematicians known by their last name, even though he is not a pure mathematician -- but he probably got a lot of great math people started.  Imagine the ultimate math class - who would you put into it?

John: Thanks for the note -- I am in the process of rewriting the code to the standard taught to me by mecej4.  I have a day waiting for a package so I might get it finished.

mecej4: I did not know about tokenized BASIC -- thanks -- the program runs on PC-BASIC in 64 bit Windows, but the environment is so bad and slow I would like to get the FORTRAN version running properly - speed difference is huge.

 

0 Kudos
mecej4
Honored Contributor III
871 Views

Nichols, John wrote:
I did not know about tokenized BASIC -- thanks -- the program runs on PC-BASIC in 64 bit Windows, but the environment is so bad and slow I would like to get the FORTRAN version running properly - speed difference is huge.

Here is the secret recipe: http://www.chebucto.ns.ca/~af380/GW-BASIC-tokens.html .

0 Kudos
JohnNichols
Valued Contributor III
871 Views

I ran the Basic program last night, it 2 hours to run 1000 cycles, it become stuck at a score of 84.

The Fortran program runs in 9 seconds with each of the 1000 flibs output to the screen, so it is much much faster. I finished the revision, but it needs cleaning a lot of cleaning.

I was wondering if anyone had any experience with this type of algorithm?

 

0 Kudos
Reply