LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-14-2015, 11:03 PM   #1
unswliao
LQ Newbie
 
Registered: Dec 2015
Posts: 7

Rep: Reputation: Disabled
Problems with "Too many arguments in call to "


Hi

When I compile a .for fortran program in my centos 6.7 with gfortran compiler, the error that "Too many arguments in call to **** at (1)" always appear. However, the number of arguments in the subroutine when calling is same with the number when the subroutine is defined, so I am quite confused and do not know how to deal with this problem. Could anyone help me with this?

Regards,
 
Old 12-14-2015, 11:32 PM   #2
fu9ar
Member
 
Registered: Oct 2014
Location: Cyberinternetspace
Distribution: Slackware, mostly
Posts: 49

Rep: Reputation: 2
Share the code.
 
Old 12-14-2015, 11:38 PM   #3
unswliao
LQ Newbie
 
Registered: Dec 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by fu9ar View Post
Share the code.
Hi

Thanks so much for your reply.

The attachment is a program by Prof. Brink from WHOI. It is freely available, so I think it is safe to post it here.

When I compile it with gfortran, the problem I described appear.

Kind regards,
Attached Files
File Type: txt BIGLOAD4.FOR-----BIGLOAD4_26113.txt (33.3 KB, 147 views)
 
Old 12-14-2015, 11:56 PM   #4
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Now we also need the precise error message - i.e. which function, and which line.
 
Old 12-15-2015, 12:09 AM   #5
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
I think I have a hint. I tried to compile the program as well, with the same error message (the subroutine in question is DTIME).

After uncommenting DTIME from the code, the same error message is issued. The compiler doesn't complain that DTIME is missing.
After replacing the name of this subroutine with blabla, compilation proceeds.

So, your error is most probably provoked by a library function DTIME that "masks" the subroutine DTIME in your source code. How to handle this best, I can't say, but renaming DTIME certainly works.

Note that I get another error message about a missing right parenthesis; perhaps because the parenthesis is too far on the right? I faintly remember that Fortran code lines mustn't be longer than seventysomething characters. Perhaps the GNU Fortran compiler has an option for that.

Last edited by berndbausch; 12-15-2015 at 12:10 AM.
 
2 members found this post helpful.
Old 12-15-2015, 01:12 AM   #6
unswliao
LQ Newbie
 
Registered: Dec 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
Thumbs up

Dear berndbausch

Thank you so much for your kind and detailed reply. When I changed the name DTIME into BALA, it works.

Yeah, I also encounter the second error you mentioned. It seems quite unreasonable.

Many thanks,
 
Old 12-16-2015, 04:31 AM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Col limit = 72 https://web.stanford.edu/class/me200...03_basics.html for old eg F77 std.
I beleive a modern FORTRAN compiler allows longer lines, but it may be a compile option , rather than the default.
 
Old 12-16-2015, 05:27 AM   #8
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by chrism01 View Post
I remember it was so that the last eight positions on a punch card could be used for numbering the cards. In case you fell down the stairs with a pack of cards in your hands, there were machines that could sort them. Not so much of an issue anymore nowadays.
 
1 members found this post helpful.
Old 12-16-2015, 04:05 PM   #9
unswliao
LQ Newbie
 
Registered: Dec 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
Thumbs up

Hi,berndbausch

I have made an alternative expression in replace, and it works well.

Many thanks for your kind reply.

Very best wishes
 
Old 06-28-2016, 04:35 PM   #10
Eric Sánchez
LQ Newbie
 
Registered: Jun 2016
Posts: 1

Rep: Reputation: Disabled
Bigload4

Hi, I'm sorry for the delayed answer. It is exciting find a person who work in the same CTW model!, I'm from Chile, I hope we can share the experience with the model (Or if you know a forum of this topic I'd appreciated that info! ). I run the CTW model too. For this questions it worked for me: "gfortran -ffixed-line-length-0 BIGLOAD4_26113.FOR -o BIGLOAD4_26113.out"
Best Regards!
 
Old 06-09-2022, 05:06 PM   #11
JeffAmthor
LQ Newbie
 
Registered: Jun 2022
Posts: 1

Rep: Reputation: 0
This is a place for the Fortran EXTERNAL statement

I know this is from long ago, but I'd say the 'proper' solution is the Fortran EXTERNAL statement. The problem can be compiler dependent (I can reproduce the error with gfortran, but not my favorite compilers).

In the main, perhaps after

CHARACTER*15 FINP,FOT

simply insert

EXTERNAL DTIME

and for at least gfortran the problem is gone. Always a good idea, to be safe, to declare all your own functions/subroutines as EXTERNAL so the compiler knows to use your DTIME (or 'whatever') instead of the compilers DTIME (or 'whatever'). You can name your functions whatever you want because Fortran has no reserved words, but some compilers will get confused (w/o EXTERNAL).

So to the comment: "How to handle this best, I can't say, but renaming DTIME certainly works." [from berndbausch] I think you can conclude that 'best' is 'EXTERNAL', a standard Fortran statement created for this purpose, and then name your routines whatever you like.

Regards
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
php "system"-call to access tty port, "error accessing" wedz Linux - Software 3 05-22-2012 07:34 PM
Qt "cannot call constructor for""a function-style cast remove the redundant ::QBrush" Peterius Linux - Software 4 11-24-2010 04:57 PM
Make "Too many arguments in call to 'idate' ?? idk666 Linux - Software 1 11-08-2006 09:17 AM
Any way to get "Alice"; "Call of Duty" series and "Descent 3" to work? JBailey742 Linux - Games 13 06-23-2006 01:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration