View previous topic :: View next topic |
Author |
Message |
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Mon Apr 28, 2014 12:30 pm Post subject: The Details of FTN95 and F77 Code Mixing in a single program |
|
|
I've seen an article in the knowledge base which talks about this, but the reply to the question there is not completely clear.
F77 and FTN code be 'mixed' together in a single program BUT it's not clear to me exactly how.
FTN95 recognizes the code formaqt based on file extensions of the code,
so preseumeably the various different sections of code have to be each in seperate files with different extensions e.g. main.f95 containing INCLUDES (?) referrring to F77 code in seperate files e.g. ro0utine1_f77.f , etc..... |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7930 Location: Salford, UK
|
Posted: Mon Apr 28, 2014 12:45 pm Post subject: |
|
|
FTN95 accepts fixed format FORTRAN and free format FORTRAN.
You must use only one format in a given file but object code from different files can be linked together using the linker. So you can mix fixed and free format FORTRAN provided that you keep them in separate files.
FTN95 determines the format from the file extension or from a command line switch /FIXED_FORMAT or /FREE_FORMAT.
The OPTIONS compiler directive (placed in the code before a subprogram) may allow you to use one format for one subprogram and the other for another subprogram (all within one file) but I have never tried this. If it works then I am not sure this is a good idea anyway. |
|
Back to top |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Tue Apr 29, 2014 2:25 am Post subject: |
|
|
Thanks for the clarification Paul, helps me with my decision whether or not to convert my heritage code to FTN95 or not. |
|
Back to top |
|
|
|