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 

Two FORTRAN programs

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
ajaytaneja



Joined: 08 Apr 2011
Posts: 17

PostPosted: Tue Feb 21, 2017 4:34 pm    Post subject: Two FORTRAN programs Reply with quote

I have 2 different FORTRAN programs (quite big programs). Let us call program 'A' and 'B'

My program 'B' needs to use a subroutine of program A (exactly the same subroutine). I do not want to copy/paste this.

Is it possible to call that subroutine of A from a subroutine of B?

Any examples will be appreciated.

Kindest Regards,
Peter
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Feb 21, 2017 5:46 pm    Post subject: Reply with quote

One way to do this is to put the "subroutine of program A" into a separate file and to use an INCLUDE statement for this code in both program A and program B.
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Tue Feb 21, 2017 7:32 pm    Post subject: Reply with quote

Or you could compile the subroutine separately, and link the OBJ file with both programs.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General 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