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 

IMPORT statement produces confusing error message

 
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: Sat Feb 05, 2022 3:14 pm    Post subject: IMPORT statement produces confusing error message Reply with quote

The IMPORT statement was added in F2003, so it is understandable that FTN95 will issue an error message when it encounters that statement in a source file that it is asked to compile. The error message wording, however, is somewhat confusing. In the following example, the IMPORT statement allows the kind parameter DOUBLE to be declared once and reused in a number of interface blocks where it is needed.

Code:
Module fcn_INT
   implicit none
   Integer, Parameter :: DOUBLE = kind(0.0d0)

   abstract INTERFACE
      Subroutine NLEfcn (N, X, FVEC, iflag)
         import :: DOUBLE
         implicit none
         Integer, Intent (In) :: N
         Integer :: iflag  ! set only to terminate
         Real (DOUBLE), Dimension (N), Intent (In) :: X
         Real (DOUBLE), Dimension (N), Intent (Out) :: FVEC
      End Subroutine
   End Interface

   abstract INTERFACE
      Subroutine NLSfcn (M, N, X, FVEC, IFLAG)
         import :: DOUBLE
         implicit none
...
      End Subroutine
   End Interface

End Module


The error message is

Code:
[FTN95/Win32 Ver. 8.83.0 Copyright (c) Silverfrost Ltd 1993-2021]
    PROCESSING MODULE  [<FCN_INT> FTN95/Win32 v8.83.0]
ERROR T:\MinPack\Netlib\V90\fcn_INT.F90 8:  Statement ordering error - IMPLICIT NONE cannot appear after type definition


Abstract interfaces were also not present in F95, so FTN95 would probably issue an error message for those lines of code if it gets to the point of parsing those lines.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Mon Feb 07, 2022 9:19 am    Post subject: Reply with quote

mecej4

Many thanks for the bug report. I have logged this for fixing.

A temporary work-around may be to use OPTIONS(IGNORE 299). This fixes the immediate failure but I have not tested it in a working program.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Thu Feb 10, 2022 12:31 pm    Post subject: Reply with quote

This bug has now been fixed for the next release.

At the moment, if the IMPORT statement is omitted, FTN95 does not report an error (it uses the given parameter in the outer scope when it shouldn't). This issue remains outstanding.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Mon Oct 10, 2022 11:52 am    Post subject: Reply with quote

If IMPORT is omitted, FTN95 only reports an error when /ISO is applied.

This means that, as an extension to the Standard, FTN95 allows IMPORT to be omitted in this context.

I am not sure that this is ideal but a change might break existing code.
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