It seems Fortran 90 does not allow named constants in derived data types. Is this true? The following code does not work.
program my_prog
implicit none
type :: my_type
integer, parameter :: a = 1
real(kind(1.d0)) :: b
end type my_type
type (my_type) :: complex_type
end program my_prog
The compiler says parameter statement is not permitted in derived type definitions.
When I remove the parameter
keyword everything works fine. But then how can I make sure that the component a
is not modified elsewhere?
a
is not modified elsewhere? You mean besides not using it? :D – Neelon