Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
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!
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.