Silverfrost Forums

Welcome to our forums

Error 24 - Array expressions

27 Jul 2017 7:35 #19898

Hello everybody,

I am a beginner in programming, this is my first post and I would like to be an active participant.

I am trying to make a code to solve 'bouyant force in a summerged object'. Please find in the link below the code: https://drive.google.com/open?id=0BxYwOb2RaOSfVFdwVXgzUm5hYnc

The problem is with the arrays in using to make the iterations, but I have tried many things and nothing have had effect. Compilation always failed.

Thanks in advance.

Cheers, José Andrés.

28 Jul 2017 12:20 (Edited: 28 Jul 2017 11:59) #19901

Instead of just trying many things, you could develop the habit of reading the compiler's error messages and consulting the corresponding sections of the compiler documentation and/or a Fortran textbook to find out how to remove the errors.

Here are bugs that I noted: Tab characters in the source code.

Use of an array instead of an array element in a scalar expression, Z+TS*WN.

Use of an F format to print an integer variable.

28 Jul 2017 6:14 #19903

Jose, Not bad for the first code. No one in our class ended with their first code without errors besides me. Since then I program probably more then all of them together. But here was a trick.

My first code was to calculate day of the week for the arbitrary date. That was punchcard era. Funny, but that at that time we thought that programming is so old-fashioned,dumb and boring for us top physics school students that I asked some older years guy to write it. 😃

Now I help many novices myself to avoid their cognitive dissonance trauma. It also looks like with time the programming (like cities) become less and less old-fashioned.

Do you mean Z+TS*WN(I) ? And Format 2 for integers is I not F GL

Please login to reply.