For Programmers: Free Programming Magazines  


Home > Archive > Fortran > May 2005 > Re: static function ? how ?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: static function ? how ?
beliavsky@aol.com

2005-05-26, 8:58 am

Arjen Markus wrote:
> KC wrote:
>
> You can do this using g95 (that is the GNU
> compiler for Fortran 90/95):


Perhaps "the GNU compiler" should be replaced with "a GNU compiler",
since gfortran exists :).

> Via the contains statement you can introduce new subroutines and
> functions
> that can only be accessed by each other and the containing routine:
>
> subroutine suba( ... )
> ...
> call subb( ... )
> ....
> contains
> subroutine subb( ... )
> write(*,*) 'In subb!'
> end subroutine subb
>
> subroutine subc( ... )
> ...
> end subroutine subc
>
> end subroutine suba
>
> (The same for main programs). Modules are even more useful, because
> more general.


Is this part of Fortran 2003 or is it an extension specific to g95?

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com