I have created a data structure that contains an array:
real*8 :: T(3,3)
real*8 :: T8(3,3)
type(EXAMPLE) :: array
To initialise a normal variable array like T8 I can use the following statement:
T8 = (/1.0d0,0.0d0,0.0d0,0.0d0,1.0d0,0.0d0,0.0d0,0.0d0,1.0d0/)
however when I try to do this with the data structure thus:
array%T = (/1.0d0,0.0d0,0.0d0,0.0d0,1.0d0,0.0d0,0.0d0,0.0d0,1.0d0/)
I get the following compiler error:
Compiling with Intel(R) Visual Fortran Compiler XE 188.8.131.52 [Intel(R) 64]...
C:\Win\FEM2000_v25\Modules\FluxLib.f90(53): error #6366: The shapes of the array expressions do not conform. [T]
compilation aborted for C:\Win\Modules\FluxLib.f90 (code 1)
However when I use this:
array%T(1,1:3) = (/1.0d0,0.0d0,0.0d0/)
array%T(2,1:3) = (/0.0d0,1.0d0,0.0d0/)
array%T(3,1:3) = (/0.0d0,0.0d0,1.0d0/)
there is no problem.
Is this behavior expected?