I am trying to define an array of 1 dimension phi0(ngrains)
where each element is a matrix of dimension (taille,taille), so whene I look for phi0(1)
for example it should display a matrix of taille*taille
elements, and the same case for phi0(2) .... phi0(ngrains)
.
How it can be done in Fortran?
This is what I have tried so far: but I keep getting error messages
PROGRAM DERIVED_TYP
INTEGER :: i,ngrains,nmax=4
TYPE INITIAL
REAL, DIMENSION(:,:), ALLOCATABLE :: zeros(:,:)
END TYPE INITIAL
TYPE (INITIAL), dimension(:), allocatable :: phi0
ALLOCATE (phi0(1)%zeros(nmax,nmax))
ALLOCATE (phi0(2)%zeros(nmax,nmax))
print*,phi0(1)%zeros
!phi0(2)=INITIAL(0.)
END PROGRAM DERIVED_TYP