replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - FORTRAN ERROR
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

FORTRAN ERROR

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
PPPO



Joined: 04 Nov 2012
Posts: 6

PostPosted: Fri Dec 14, 2012 6:50 am    Post subject: FORTRAN ERROR Reply with quote

Hi
"Access violation"
Anyone seen this error?
It occurs when trying to call subroutine:


Back to top
View user's profile Send private message
khoshravan



Joined: 03 Dec 2012
Posts: 31

PostPosted: Fri Dec 21, 2012 11:07 am    Post subject: Re: FORTRAN ERROR Reply with quote

PPPO wrote:
Hi
"Access violation"
Anyone seen this error?
It occurs when trying to call subroutine:




I have no idea what is the answer to this question is, but want to learn more from this question.
Is it possible to call subroutines only with their name without specifying their parameters?
Back to top
View user's profile Send private message
IanLambley



Joined: 17 Dec 2006
Posts: 506
Location: Sunderland

PostPosted: Fri Dec 21, 2012 1:24 pm    Post subject: Reply with quote

Yes it is.
If the subroutine has no parameters, i.e. all data is passed to and from it by other means, such as comon, modules or files. If there are no parameters, you do not need the open and close brackets in the subroutine definition or in the call statement.

For functions with no parameters, you do need the open and close brackets in both the function definition and the statement which references the function.

Examples:
Code:

      program test

      real*8 a, john
     
      call fred

      a = john()

      end

      subroutine fred
        print *, 'Executing subroutine FRED'
      end

      real*8 function john()

      john = atan(0.7071d0)

      end
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group