soccer jersey forums.silverfrost.com :: View topic - Fixed Fortran
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 

Fixed Fortran

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
stfark1



Joined: 02 Sep 2008
Posts: 222

PostPosted: Tue Apr 18, 2023 8:51 pm    Post subject: Fixed Fortran Reply with quote

Been writing in Fortran for several years, always using the Fixed Fortran. Is Variable Length Fortran upward compatible? In other words, can I enter variable length Fortran statements into fixed Fortran or? Please advise, Sid Kraft
Back to top
View user's profile Send private message
Kenneth_Smith



Joined: 18 May 2012
Posts: 711
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Wed Apr 19, 2023 12:35 am    Post subject: Reply with quote

See the following information, which may help:
https://www.nsc.liu.se/~boein/f77to90/c5.html
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Wed Apr 19, 2023 6:52 am    Post subject: Reply with quote

Sid

I think that you would need to give an example of what you would like to do. But then, you could always try it and see whether or not it works.

Fixed format means that labels, statements etc. must appear in specific columns. Free format has fewer restrictions (labels must appear before statements etc.).

Typically, for FTN95, fixed Fortran files are given the .for extension whilst free Format files have the .f90 or .f95 extension. Alternatively you can use /FREE or /FIXED on the FTN95 command line.
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2393
Location: Yateley, Hants, UK

PostPosted: Wed Apr 19, 2023 4:47 pm    Post subject: Reply with quote

Sid,

You can write your source code so that it works both ways. For an example, look at CLRWIN.INS.

The trick is to put the & character in column 73 of the line to be continued, and use the & character in column 6 of the continuation line. You can do it multiple times.

I used to use column 6 continuation characters in the order 1, 2, 3 ... when there was a risk of dropping cards, but it is easy to use & instead.

Eddie
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2585
Location: Sydney

PostPosted: Mon Apr 24, 2023 6:20 am    Post subject: Reply with quote

Interesting that the requirement for puting line numbers in columns 74+ ended when I stopped using cards in '74

Eddie is correct to note the most significant difference between fixed and free format Fortran is the use of line extensions in column 6.

Free format ( which extends the line from col 72 to col 132 ) is a much easier/flexible format to use, where the line continuation character & is placed at the end of each continued line and optionally at the start of each subsequent continued line.
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 -> Support 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