View previous topic :: View next topic |
Author |
Message |
ajaytaneja
Joined: 08 Apr 2011 Posts: 17
|
Posted: Tue Feb 21, 2017 4:34 pm Post subject: Two FORTRAN programs |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Tue Feb 21, 2017 5:46 pm Post subject: |
|
|
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 |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Tue Feb 21, 2017 7:32 pm Post subject: |
|
|
Or you could compile the subroutine separately, and link the OBJ file with both programs. |
|
Back to top |
|
|
|