How can I simply use (old) routines?
- From: "Arno" <arnoinperu@xxxxxxxxxxx>
- Date: 18 Sep 2006 08:22:52 -0700
Hi all,
I have a bunch of old routines, written by others, that I would like to
use in my code. However, it seems that I cannot access those routines
if I have an 'implicit none' in my program.
For example, the following does not compile:
** set_number.f90 **
integer function set_number(i)
implicit none
integer,intent(in) :: i
set_number = 2*i
end function set_number
**********************************
** main.f90 **
program test
implicit none
integer :: i,j
i = 1
j = set_number(i)
write(*,*) j
end program test
**********************************
g95 set_number.f90 main.f90
results in:
Error: Function 'set_number' at (1) has no implicit type
The intel compiler gives a similar error.
What is the problem here? Why does this not work?
I know two ways to solve it; make use of modules, or add a line
'integer :: set_number' in main.f90, but I just would like to know why
the code given above doesn't work.
Thanks!
Arno
.
- Follow-Ups:
- Re: How can I simply use (old) routines?
- From: robin
- Re: How can I simply use (old) routines?
- From: glen herrmannsfeldt
- Re: How can I simply use (old) routines?
- From: David Frank
- Re: How can I simply use (old) routines?
- From: e p chandler
- Re: How can I simply use (old) routines?
- From: michael
- Re: How can I simply use (old) routines?
- From: claude . simon
- Re: How can I simply use (old) routines?
- From: Jan Vorbrüggen
- Re: How can I simply use (old) routines?
- From: michael
- Re: How can I simply use (old) routines?
- Prev by Date: Re: general query
- Next by Date: Re: How can I simply use (old) routines?
- Previous by thread: Array range assignments and characters
- Next by thread: Re: How can I simply use (old) routines?
- Index(es):
Relevant Pages
|