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 

Compatibility between FTN95 and Intel Fortran

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



Joined: 27 Sep 2018
Posts: 57
Location: Australia

PostPosted: Thu May 20, 2021 10:52 am    Post subject: Compatibility between FTN95 and Intel Fortran Reply with quote

I have a large code that has been compiled with Intel Fortran and GNU Fortran but has 2 issues that FTN95 flags as an error. GFortran prompted me to use the FDEC flag as the code apparently contained nun-standard statements inherited from DEC Fortran.

The first issue is the following object definition

type, public :: sparsematrix
__integer :: nrow
__integer :: ncol
__integer :: nnz
__type(rowtype),allocatable,dimension(Smile :: row
___CONTAINS
___procedure :: init => initialize
___procedure :: addconnection
___procedure :: filliaja
___procedure :: sort
___procedure :: destroy
end type sparsematrix

Note that I added underscores to maintain indentation.

this results in a compile error 515 - CONTAINS is invalid in the definition of a derived TYPE

I have no experience with this type of object definition, and would much appreciate it if someone could indicate how to resolve this error/

The other issue is the use of 'SHARED' in a file open statement

OPEN(UNIT=IU,FILE=FNAME(1:IFLEN),FORM=FMTARG,SHARED,
1 ACCESS=ACCARG,STATUS=FILSTAT,ACTION=FILACT,ERR=2000)

This gives the following compile error 529 - Non-keyword specifiers must appear before keyword specifiers.

The offending part is 'SHARED' in the first line and if I remove it, the code compiles fine.

Is my assumption correct that this is non-standard Intel/Dec Fortran? and if so, is there an equivalent valid statement for FTN95?

Thanks,
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Thu May 20, 2021 11:20 am    Post subject: Reply with quote

jcherw

CONTAINS within a TYPE declaration is part of a Fortran 200x standard but not yet implemented in FTN95.

I think that SHARED is non-standard. It is not implemented in FTN95.

FTN95 has SHARE=<access mode> where <access mode> is one of "COMPAT", "DENYRW" etc.
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