- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
real,allocatable:: x(:),y(:)
allocate(x(4),y(4))
x=[1.,2.,3.,4.]
write(*,*)x,y
read(*,*)
end
real,intent(in):: inp(:)
integer,intent(in):: start
real xx(4)
integer:: j,n
n=size(inP)
do j=start,n
xx(j)=2.*inp(j)
enddo
Link Copied
- « Previous
-
- 1
- 2
- Next »
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
Sorry, I'm still having some trouble with this, I've followed your advicebut I now getthemessages:
Warning: This name has not been given an explicit type. [CALCVECTORFORPLANE]
Error: The characteristics of the subroutine/function differ from those of the same subroutine/function that is specified in the INTERFACE statement. [CALCVECTORFORPLANE]
I don't understand this as I've checked that they are not different, and asked someone else here to have a look to check that I'm not missing anything obvious. The problem can be solved by moving my interfaces into seperate files, but that isn't what I really want and it work with them all being in one file for other functions.
I've installed the latest version of IVF and I've attached a small sample of the code to illustrate the problem.
Thanks in advance
Glyn.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The fundamental problem here is that you INCLUDE an interface for a routine into the same routine. This is not legal, though the error you get from the compiler is confusing, I'll admit.
The recommended way of solving this is to put all your functions in a module and then USE the module where required. An alternative, which doesn't disturb your existing structure much, is to convert the INCLUDE file with the interfaces into a module and use the module. It is ok to use a module that defines the interface of the current routine - that is just ignored.
I have attached a zip file of my modification to your sources. It still doesn't build due to other issues, but you'll be on the right path.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
Thank you very much.
Looks like I have some background reading on Modules to do now! :-)
Glyn.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »