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 

MODULE and EXTERNAL query
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2145
Location: Sydney

PostPosted: Fri Aug 01, 2014 4:22 am    Post subject: Reply with quote

I think there is a bug in FTN95 when using /check, that needs to be reviewed. With the USE of the module, the CONTAINS function F should not require an EXTERNAL, but the program fails with /check compilation option.

John
Back to top
View user's profile Send private message
davidb



Joined: 17 Jul 2009
Posts: 557
Location: UK

PostPosted: Fri Aug 01, 2014 10:04 pm    Post subject: Reply with quote

Can you give an example of the bug you are referring to John?
_________________
Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2145
Location: Sydney

PostPosted: Sat Aug 02, 2014 7:25 am    Post subject: Reply with quote

Davidb,

If you take the example I posted : Wed Jul 23, 2014 11:32 am (could be GMT +10hr) and remove the line 50 as : ! EXTERNAL F,C,U ; then you have an example where EXTERNAL should not be required as F, C and U are defined by being contained in M1 ( IMPLICIT NONE confirms this )
I interpreted Mecej4's comments as confirming this.

FTN95 simp.f90 /lgo and
FTN95 simp.f90 /debug /lgo both run successfully, but
FTN95 simp.f90 /check /lgo fails with an error report that I would suggest is wrong.

Using SDBG and hovering over the function names in "CALL SIMPSON (" does suggest that these functions are not real variables.

Also, the other use of EXTERNAL at line 26 also does not appear to be required for FTN95, as the use of F is interpreted as a function.

While I would consider the use of EXTERNAL in both cases to be unnecessary, I would still use it as it provides some clarity of definition of the use of these functions, as is my continued use of IMPLICIT NONE.

John
Back to top
View user's profile Send private message
davidb



Joined: 17 Jul 2009
Posts: 557
Location: UK

PostPosted: Sat Aug 02, 2014 2:27 pm    Post subject: Reply with quote

John,

You are correct. If there is a use statement which defines a function or subroutine, it is non-standard conforming to also use an external statement. It would be good if FTN95 could provide an error or warning about such cases but I would suggest there are other more important bugs to squash.
_________________
Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl
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
Goto page Previous  1, 2
Page 2 of 2

 
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