Silverfrost Forums

Welcome to our forums

Modules in FORTRAN

10 Apr 2013 3:21 #12026

Can a module declared in one program be accessed by another program?

10 Apr 2013 4:18 #12029

What do you mean?

A MODULE is a program unit declared and defined inside a Fortran source file. Provided the source file isn't the one containing your main PROGRAM, you can re-use the source file (and module) in as many programs as you like.

P.S. There can be more than one module in a source file if you like.

11 Apr 2013 11:37 #12039

Thank you very much for the response.

I have another question

  1. I have a software A
  2. I have two FORTRAN programs F1 and F2
  3. The software A is running both F1 and F2 4)The arrays declared in module are party generated by F1 and partly by F2.
  4. Can the arrays generated by F1 be sued by F2 and vice versa

Christy

12 Apr 2013 7:19 #12040

Pleaqse can anyone provide some insight?

Christy

12 Apr 2013 7:18 #12048

Different programs cannot share variables in the way you have described.

14 Apr 2013 9:17 #12053

Is there any way wherein different programs could share variables?

14 Apr 2013 9:18 #12054

Is there any manner wherein different programs could share variables?

14 Apr 2013 1:36 #12055

The short answer is YES but it is not easy.

For FTN95 see https://forums.silverfrost.com/Forum/Topic/1063

14 Apr 2013 2:16 #12056

Thanks Paul.

IS this feature only in FTN 95 express or it also exists in Fortran 2003,Fortran 90?

Any ides-I shall be grateful.

Christy

14 Apr 2013 6:40 #12057

It is not a feature of Standard Fortran. It is an extension in Silverfrost FTN95 based on Windows API functions so, in theory you can access the base functions from almost any compiler.

Please login to reply.