Silverfrost Forums

Welcome to our forums

Two FORTRAN programs

21 Feb 2017 3:34 #18866

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

21 Feb 2017 4:46 #18867

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.

21 Feb 2017 6:32 #18868

Or you could compile the subroutine separately, and link the OBJ file with both programs.

Please login to reply.