View previous topic :: View next topic |
Author |
Message |
christyleomin
Joined: 08 Apr 2011 Posts: 155
|
Posted: Wed Apr 10, 2013 4:21 pm Post subject: Modules in FORTRAN |
|
|
Can a module declared in one program be accessed by another program? |
|
Back to top |
|
 |
davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Wed Apr 10, 2013 5:18 pm Post subject: |
|
|
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. _________________ Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl |
|
Back to top |
|
 |
christyleomin
Joined: 08 Apr 2011 Posts: 155
|
Posted: Thu Apr 11, 2013 12:37 pm Post subject: |
|
|
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.
5) Can the arrays generated by F1 be sued by F2 and vice versa
Christy |
|
Back to top |
|
 |
christyleomin
Joined: 08 Apr 2011 Posts: 155
|
Posted: Fri Apr 12, 2013 8:19 am Post subject: |
|
|
Pleaqse can anyone provide some insight?
Christy |
|
Back to top |
|
 |
davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Fri Apr 12, 2013 8:18 pm Post subject: |
|
|
Different programs cannot share variables in the way you have described. _________________ Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl |
|
Back to top |
|
 |
christyleomin
Joined: 08 Apr 2011 Posts: 155
|
Posted: Sun Apr 14, 2013 10:17 am Post subject: |
|
|
Is there any way wherein different programs could share variables? |
|
Back to top |
|
 |
christyleomin
Joined: 08 Apr 2011 Posts: 155
|
Posted: Sun Apr 14, 2013 10:18 am Post subject: |
|
|
Is there any manner wherein different programs could share variables? |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
|
Back to top |
|
 |
christyleomin
Joined: 08 Apr 2011 Posts: 155
|
Posted: Sun Apr 14, 2013 3:16 pm Post subject: |
|
|
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 |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Sun Apr 14, 2013 7:40 pm Post subject: |
|
|
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. |
|
Back to top |
|
 |
|