I’m compiling with intel fortran ifort 15.0.2.
It gives the following error
error #6457: This derived type name has not been declared. [CHARACTER]
type(character(len=30)), allocatable, dimension(:) :: solid_name_start, solid_name_end
Is the problem related to my code or just to the old ifort version?
Is there anything I can do to downgrade the code ?
Unfortunately I’ve no access to more updated ifort version…
Gfortran 11 was released about two years ago. IFort 2015 was released in late 2014. Your code uses a parameterized derived type, which was probably not implemented in IFort 2015, or was just making its appearance for the first time.
Yes, that is the likely case: the extension to allow the type statement with intrinsic types, something that was expected to help with “machine” generated code, was added in Fortran 2008 which was likely not implemented in the compiler version used by OP.
The indicated use conforms and the compiler now obliges:
C:\temp>ifort /standard-semantics p.f90
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.6.0 Build 20220226_000000
Copyright (C) 1985-2022 Intel Corporation. All rights reserved.
Microsoft (R) Incremental Linker Version 14.30.30706.0
Copyright (C) Microsoft Corporation. All rights reserved.
-out:p.exe
-subsystem:console
p.obj
C:\temp>p.exe
30
Thanks, I’m aware that intel one API is now free, but I’m compiling the program on a HPC cluster where I’m only an user without any rights to install or even upload anything.
If type(intrinsic-type) had not been equivalent of intrinsic-type declaration, it could have been recognized as a PDT. And apparently it was recognized as such by the old ifort version. Change just one letter to get perfectly valid code:
type charakter(len)
integer, len :: len
real :: a(len)
end type charakter
type(charakter(len=20)), allocatable :: der(:)