jcherw
Joined: 27 Sep 2018 Posts: 57 Location: Australia
|
Posted: Thu May 20, 2021 10:52 am Post subject: Compatibility between FTN95 and Intel Fortran |
|
|
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( :: 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, |
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Thu May 20, 2021 11:20 am Post subject: |
|
|
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. |
|