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 

Error re. definition of a derived type (in object)

 
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: 56
Location: Australia

PostPosted: Fri Jun 11, 2021 5:28 am    Post subject: Error re. definition of a derived type (in object) Reply with quote

I have a subroutine that uses some Fortran 2003 extensions and FTN 95 gives an error on the following of these

type, public :: sparsematrix
integer :: nrow
integer :: ncol
integer :: nnz
type(rowtype),allocatable,dimension(Smile :: row
NOTE THE PREVIEW OF THIS MESSAGE GIVES AN EMOJI AFTER THE DIMENSION IN THE STATEMENT ABOVE - IT SHOULD BE L_PARENTHESIS-COLON-R_PARETHESIS JUST AFTER DIMENSION
contains
procedure :: init => initialize
procedure :: addconnection
procedure :: filliaja
procedure :: sort
procedure :: destroy
end type sparsematrix

The error is

sparse.F(16) : error 515 - CONTAINS is invalid in the definition of a derived TYPE

There are also 2 warnings

sparse.F(Cool : warning 1088 - The use of ALLOCATABLE in the definition of a derived TYPE is not standard conforming. No auto deallocation.

Could anyone suggest a workaround or resolution at least for the fatal error?

I am unfortunately unfamiliar with object-oriented programming, and this routine (part of a library) is the only of many where it is applied.

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


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

PostPosted: Fri Jun 11, 2021 7:01 am    Post subject: Reply with quote

jcherw

CONTAINS within a TYPE definition is a feature of the Fortran 2003 Fortran standard that has not yet been implemented in 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