forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The Details of FTN95 and F77 Code Mixing in a single program

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
John-Silver



Joined: 30 Jul 2013
Posts: 1283
Location: Aerospace Valley

PostPosted: Mon Apr 28, 2014 12:30 pm    Post subject: The Details of FTN95 and F77 Code Mixing in a single program Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 6222
Location: Salford, UK

PostPosted: Mon Apr 28, 2014 12:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1283
Location: Aerospace Valley

PostPosted: Tue Apr 29, 2014 2:25 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group