- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi everyone,
I'm new in Fortran and using Visual Fortran Composer XE 2013 on Windows 7.
In side of main program I'm calling a subroutine by using: CALL CCOEFF(DL, DD, DDD) and I'm getting these errors:
Error 1 error #7976: An allocatable dummy argument may only be argument associated with an allocatable actual argument. [DDD]
Error 2 error #8055: The procedure has a dummy argument that has the ALLOCATABLE, ASYNCHRONOUS, OPTIONAL, POINTER, TARGET, VALUE or VOLATILE attribute. Required explicit interface is missing from original source. [DDD]
By changing DDD in main program to an Allocatable argument (which related to error 1) I'm getting just the error 2 which I have no idea about it.
It would be very kind of you to help me figure it out.
Thanks in advance and Best Regards,
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Does your subroutine CCOEFF require the third argument to be allocatable? If you do not allocate or deallocate the variable in the subroutine (or in other subroutines called from CCOEFF), there is no need to declare the dummy argument as allocatable.
If you determine that the argument needs to be allocatable, you have to provide an explicit interface. This can be done in a number of ways, and you should read Fortran textbooks or the Intel Fortran language reference for details.
If you feel tempted to change attributes merely to quieten the compiler, resist the temptation, since you will only succeed in promoting compile time errors to run time errors.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Mecej4,
I do appreciate your consideration and response. The third argument has to be allocatable.
Would you please give me some hints about explicit interface which you've mentioned in your comment?
Best Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Consult the IVF documents
INTERFACE
Although you can place the interface block within the data declaration section of the code that makes the call, you are best advised to place the interface(s) in a module, then USE that module wherever you make the calls.
Jim Dempsey

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page