4 Replies - 2623 Views - Last Post: 23 October 2012 - 10:13 AM Rate Topic: -----

#1 sirknorpo  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 22-October 12

Fortran call to missing subroutine?

Posted 22 October 2012 - 03:09 PM

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!

Is This A Good Question/Topic? 0
  • +

Replies To: Fortran call to missing subroutine?

#2 sepp2k  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2113
  • View blog
  • Posts: 3,235
  • Joined: 21-June 11

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?
Was This Post Helpful? 1
  • +
  • -

#3 sirknorpo  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 22-October 12

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 MSOLVE 
in the beginning of the file.
Was This Post Helpful? 0
  • +
  • -

#4 sepp2k  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2113
  • View blog
  • Posts: 3,235
  • Joined: 21-June 11

Re: Fortran call to missing subroutine?

Posted 23 October 2012 - 08:42 AM

View Postsirknorpo, 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 MSOLVE 
in 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

Was This Post Helpful? 1
  • +
  • -

#5 sirknorpo  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 22-October 12

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!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1