I’m new to writing in the fortran 2003 standard and trying out some of the new object oriented facilities. I have run into a problem using an array of a parameterized derived data type…
I have a derived type defined as:
Type DataPoint(N)
Integer,Len::N
Real,Dimension(N)::x
Real::f
Real,Dimension(N)::df
Real,Dimension(N,N)::d2f
CONTAINS
Procedure::FillData => FillDataPoint
Procedure,Pass(InputDataPt)::Taylor => Taylor_MultiD
End Type DataPoint
In my main program I want to use an array of the DataPoint type and have defined my array as follows:
Integer,Parameter::NDim=3
Type(DataPoint(NDim)),Dimension(2)::InputData
I have a point where I try to initialize the values of InputData(1)%x and InputData(2)%x using
InputData(1)%x(1) = -1.0
That last line causes a seg fault at run time (the code compiles without any errors).
I assume I’m overlooking something simple, but I don’t know what. Any help would be greatly appreciated![/quote]