View previous topic :: View next topic |
Author |
Message |
jose2kk
Joined: 21 Jul 2017 Posts: 1 Location: Venezuela
|
Posted: Thu Jul 27, 2017 8:35 pm Post subject: Error 24 - Array expressions |
|
|
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. _________________ Cheers,
José Andrés. |
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1886
|
Posted: Fri Jul 28, 2017 1:20 am Post subject: |
|
|
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.
Last edited by mecej4 on Fri Jul 28, 2017 12:59 pm; edited 2 times in total |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2815 Location: South Pole, Antarctica
|
Posted: Fri Jul 28, 2017 7:14 am Post subject: |
|
|
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 |
|
Back to top |
|
|
|