View previous topic :: View next topic |
Author |
Message |
colt1954
Joined: 21 Dec 2010 Posts: 81
|
Posted: Thu Mar 06, 2014 3:21 pm Post subject: Bizarre error message |
|
|
I have a quite complex Fortran program that I recently decided to add some interim print outputs to see certain calculated values on the screen. I started getting this message 'Attempt to call a routine with four arguments when three were required' from Main program line 313 start of first subroutine call to start of a FFT subroutine at line 919...
Weird I assumed there was some variable assign problem error, so I ended by asking for the most trivial of print outs e.g. print *, 'check message' and it still gave the same error message above so its not a a variable assignment error I don't think, i have even tried this trivial print out before any subroutine still the same errors, and further if I removed the print line the same error occurs...ie I cannot get rid of this error the program falls over...I have a separate unedited source of the original code I don't touch fortunately.. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Thu Mar 06, 2014 3:52 pm Post subject: |
|
|
This looks like a run time error report generated for example by /CHECK.
Is it a valid error report? Does the code at this point need fixing?
If the error report is false then you can report it as a bug but we will need sample code that demonstrates the false error report. |
|
Back to top |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2615 Location: Sydney
|
Posted: Fri Mar 07, 2014 3:34 am Post subject: |
|
|
The error report says that on line 313 of the main program, you are calling a routine (which might be called FFT). The compiler has identified that for a call to this routine you have a different argument count to the number of arguments expected, or it is not consistent with other calls to this routine.
I think this is an error report and not a warning, so including print statements will not fix the problem.
Is your code overflowing the available length of the line ? (72 or 132 character limit)
You need to identify which routine is being called and search for all calls and also the actual routine and check the call list. Something is not consistent and you need to fix it.
You could use the Dos FIND command to search all fortran files.
A load map would indicate where the routine that is being loaded is located, which might help if you have multiple copies of the source.
Using /check would also help.
John |
|
Back to top |
|
 |
colt1954
Joined: 21 Dec 2010 Posts: 81
|
Posted: Fri Mar 07, 2014 1:11 pm Post subject: Uodate on Bizarre |
|
|
Really sorry Chaps...I am an idiot, the original source code did have a genuine error so when I re-complied it without changing anything it still reported same error message, so the print output change was a red herring, and so somehow the original source code did not reflect the working compiled version, they had some how got out of sync. Anyway I tracked down the error its was obvious as stated by the actual error message I was passing only three variables when 4 were required...duh
Hope that makes sense.... |
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Fri Mar 07, 2014 3:43 pm Post subject: |
|
|
The most prolific posters on this forum have all made the same sort of mistake sometime in their programming career.
The thing to learn from it is that FTN95 has the best diagnostics out there, and if it says something is wrong, then you are much better off believing it! The messages are only very occasionally inscrutable, unlike some other compilers, where the messages give numbers that aren't documented, along the lines of "I haven't got a clue what is wrong, but something is", or worse.
Eddie |
|
Back to top |
|
 |
|