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 form, '!' in column 6

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



Joined: 31 Oct 2006
Posts: 1885

PostPosted: Wed Mar 03, 2021 1:23 am    Post subject: Fixed form, '!' in column 6 Reply with quote

I find myself working with a package written in Fortran 77 in the 1990s, and it uses an exclamation mark in column 6 to indicate continuation. The Fortran standards explicitly permit this. The Fortran 95 standard, for instance, says in 3.3.2.1:
Quote:
The character "!" initiates a comment except when it appears within a character context or in character position 6.


FTN95, in contrast, treats a fixed form source line with blanks in columns 1-5 and a '!' in column 6 as a comment. Thus

Code:
      subroutine BasInf(KAT,MaxIt,TolTh,TolH,lWat,lChem,AtmInF,ShortF,
     !                  SeepF,CheckF,FluxF,FreeD,DrainF)


gives rise to the continuation line being treated as a comment, hence giving rise to a syntax error.
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Wed Mar 03, 2021 4:40 am    Post subject: Reply with quote

Why would they write code like that in 1990's ?
Too smart by half !
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Mar 03, 2021 9:12 am    Post subject: Reply with quote

mecej4

Thanks for the bug report. I have made a note that this needs fixing.
Back to top
View user's profile Send private message AIM Address
mecej4



Joined: 31 Oct 2006
Posts: 1885

PostPosted: Wed Mar 03, 2021 11:13 am    Post subject: Re: Reply with quote

JohnCampbell wrote:
Why would they write code like that in 1990's ?
Too smart by half !

Many such packages, often from govt. research organizations, were originally written in Fortran-66, then moved to Fortran 77. Fortran 90 had a very long gestation period, and the first Fortran 90 compilers yielded such slow executables that users stuck to Fortran 77 well into the 1990s. The exclamation mark was not used to start in-line comments in the older Fortrans and those did not provide for inline comments. The exclamation mark was not part of the Fortran-77 character set.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Mar 30, 2021 10:19 am    Post subject: Reply with quote

This has now been fixed for the next release of FTN95.
Back to top
View user's profile Send private message AIM Address
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