- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using "Numerical Recipes in Fortran" to solve a problem. The Levenberg-Marquart procedure calls for one to pass a subroutine name in a subroutine call. When I run the example program with the subroutine, "fgauss" it works fine. When I change the name of the routine to "fsumexp", the error message says "This actual arguement must be the name of a user subroutine or the name of an intrinsic subroutine" I have created a file with the subroutine name, it is in the workspace, and the subroutine compiled without a problem.
this happened before and the only way of getting around it was to take all the code out of the origninal name, and fill in my own code. I don't believe this should be necessary.
thanks,
Don
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you included the statement EXTERNAL FSUMEXP in the calling program/routine?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you are passing the name of the subroutine as a character string that you retrieved from a file, It
won't work.
You have to specify the name of the subroutine as
it was defined to the compiler implicitely
by using it somewhere as a function or subroutine,
or by defining it with an EXTERNAL statement.
sol
won't work.
You have to specify the name of the subroutine as
it was defined to the compiler implicitely
by using it somewhere as a function or subroutine,
or by defining it with an EXTERNAL statement.
sol
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks, that works
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I thought that the subroutine name had been used because it was in the same file as the main program. Only when I put in the EXTERNAL declaration did the problem go away.
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use of EXTERNAL only makes the interface implicit. If you want the interface to be explicit, with all the associated argument checking that goes along with an explicit interface as well as other "perks", then use the INTERFACE construct within the procedure that has the dummy argument procedure name.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page