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 

Probably the most wrong thing in a Fortran book ...

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



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

PostPosted: Mon Aug 07, 2023 2:22 pm    Post subject: Probably the most wrong thing in a Fortran book ... Reply with quote

In: 'Mastering Fortran, A Comprehensive Guide to Programming in Fortran', the authoress Sarah Johnson tells us that an EXTERNAL subroutine or function is one that resides in a different source code file (presumably not the one with the PROGRAM routine).

Do I guess from the above that Ms Johnson has never used EXTERNAL? I have to admit that I had not until I started using ClearWin !

Can anyone cap that?

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



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Tue Aug 08, 2023 6:36 am    Post subject: Reply with quote

Hi Eddie,

When was this published ?

Well, perhaps she learnt her Fortran from using Ifort, or has only used subroutines that were in the CONTAINS section of the PROGRAM.
Unfortunately, she has not learnt EXTERNAL from the/any Fortran standard.

Mind you, many of us know the Fortran we like to use, me the one where REAL*8 and INTEGER*4 is included. ( much easier to read than REAL(2) or INTEGER(3) or INTEGER(4) ! )

Also, FTN95 does apply some strange assumptions regarding EXTERNAL, especially when debugging incorrect Fortran code.
Back to top
View user's profile Send private message
LitusSaxonicum



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

PostPosted: Tue Aug 08, 2023 9:24 am    Post subject: Reply with quote

Hi John,

I have the Kindle edition, published 21 Feb 2023. The 'cover' (because Kindle books don't really have a cover) has '2023' on it in a large font. To be fair, I found some of the descriptions interesting until I came across the EXTERNAL stuff.

I'd love to know what the 'strange assumptions' of FTN95 are.

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



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Thu Aug 10, 2023 4:32 am    Post subject: Re: Reply with quote

LitusSaxonicum wrote:
I'd love to know what the 'strange assumptions' of FTN95 are.


When writing new code and if you fail to declare an array and don't use /Implicit_none, then the arrays have the EXTERNAL function attribute and the compile might not report the error. It has been so long since I (wrote code with errors; NO) wrote code without /Implicit_none.

Actually, when writing new code, does Plato have an option of a pop-up list of variables in use in the current procedure, to select and paste into the code being written ?

Could this be an option, especially with long variable names ?
Perhaps an alternative option for local variable name list or module variable list or only names already used in this routine, to limit the list length ?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Thu Aug 10, 2023 7:41 am    Post subject: Reply with quote

Fortran uses round brackets for both arrays and subprograms so f(i,j) could be an element of an array f or a call to a function f.

At the moment Plato does not provide a list of variables but I have a mind to add this at some point.

In Plato:

1) Ctrl+G provides access to a list of your subprograms in the current file.
2) Ctrl+Space provides an auto-complete for standard intrinsics.
3) Ctrl+Shift+Space provides an auto-complete for standard constructs.
4) Open bracket after the name of a standard intrinsic gives a list of the arguments.
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 -> 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