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 

Interface

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





PostPosted: Fri Aug 05, 2005 6:30 am    Post subject: Interface Reply with quote


I am working on ftn95 in windows .net. enviornment. I could not suceed in compiling 'modules' seperately. It should be a part of the souce files in the project. My purpose of using modules is ' to precompile certain number of subroutines'. Whenever I run a program, I want to use it as compiled version. What I tried is to create an interface. Interface format I created is correct. But when it is run, it is not accessing the subroutines I called. Also I want to know how to create a libray in ftn95.

I tried to run the following program as follows. First I comiled file abprocedures2.f95 as a seperate file including in the project demo. When it is compiled, abprocedures2.mod
is created. Then I removed it from the project and builded the project. It is successfully buileded. But when it is execued, it shows the run time error, ' calling to missing subroutine,
abcd_ef2'. What should i do to run it successfully?

Kochuthresia
!********************************************************************
! file demo.f95
program main
use interfaces
x=1.0
call abcd_ef2(x)
print*,'x=',x
read*,d
!use abprocedures
end program

!******************************************************************************8

!*********************************************************************************
!file interfaces.f95
module interfaces
interface
subroutine abcd_ef2(xn)
!use xyz

end subroutine abcd_ef2


subroutine abcd_ef3(xn)
!use xyz

end subroutine abcd_ef3

end interface

end module interfaces

!************************************************************************************************************


! file abprocedures2.f95
module abprocedures2
contains

subroutine abcd_ef2(xn)
!use xyz
xn=5
end subroutine abcd_ef2


subroutine abcd_ef3(xn)
!use xyz
xn=15
end subroutine abcd_ef3

end module abprocedures2




kochuthresia
Back to top
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Fri Aug 05, 2005 7:24 am    Post subject: Interface Reply with quote

Kochuthresia

Your program structure does not look good.
How about putting the subroutines abcd_ef2 and abcd_ef3 in the CONTAINS part of the module called interfaces.
Then the interfaces are nolonger required.

You can put the module(s) into a DLL by compiling them separately from the main program and by linking
into a DLL using DBK_LINK.

You can then compile the main program by using a /REF to the DLL on the command line of DBK_LINK
(or FTN95 when used with /LINK).

You can do this from Plato or Visual Studio by creating two projects, one for the DLL and one for the main program.
Back to top
View user's profile Send private message AIM Address
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