Hi I'm relatively new to programming in Fortran and have come across something that I can't explain. I am working on optimizing some code (slatec algebra package) and I find that within the code there is a particular subroutine "MSOLVE" that is called many times. The mystery is in the fact that the subroutine for MSOLVE is not defined anywhere that I can see when I search within all source files for "subroutine MSOLVE". As far as I can tell, the code calls MSOLVE and then somehow decides to use one of about eight other subroutines.
Is there some functionality to Fortran that I am missing that allows a call to "MSOLVE" to be interpreted in multiple ways? How can one 'missing' subroutine, "MSOLVE", represent multiple real subroutines?
Thanks in advance for your help!
Fortran call to missing subroutine?
Page 1 of 14 Replies - 5958 Views - Last Post: 23 October 2012 - 10:13 AM
Replies To: Fortran call to missing subroutine?
#2
Re: Fortran call to missing subroutine?
Posted 23 October 2012 - 02:27 AM
Do the subroutines that call MSOLVE have a parameter named MSOLVE by any chance?
#3
Re: Fortran call to missing subroutine?
Posted 23 October 2012 - 08:28 AM
The call to MSOLVE doesn't have a parameter called MSOLVE however calls to other subroutines list MSOLVE as a parameter. Also I forgot to include that there is a line
EXTERNAL MSOLVEin the beginning of the file.
#4
Re: Fortran call to missing subroutine?
Posted 23 October 2012 - 08:42 AM
sirknorpo, on 23 October 2012 - 05:28 PM, said:
The call to MSOLVE doesn't have a parameter called MSOLVE
I think you misread my question. I asked whether the subroutine that calls MSOLVE takes a parameter named MSOLVE - not whether the call to MSOLVE itself has MSOLVE as an argument.
Quote
however calls to other subroutines list MSOLVE as a parameter. Also I forgot to include that there is a line
EXTERNAL MSOLVEin the beginning of the file.
Wait, calls to other subroutines have MSOLVE as an argument, but not subroutine definition actually has a parameter named MSOLVE? Did I understand that correctly?
This post has been edited by sepp2k: 23 October 2012 - 08:46 AM
#5
Re: Fortran call to missing subroutine?
Posted 23 October 2012 - 10:13 AM
Now I understand what your first reply meant and yes you nailed it. I hadn't noticed that MSOLVE was actually a parameter being passed to the subroutine I was looking at. I now know that subroutines can be passed in this manner.
Thanks for the help!
Thanks for the help!
Page 1 of 1