synhedionn
Programmer
hi,
I wondered how to declare a tempory matrix saving variable: must it have same intent() parameters than the parent one it's related to?
For instance:
"program paramMat
! gfortran paraMatrix.f90 -o paraMatrix
implicit none
integer, parameter :: dim = 4
real, dimension(dim,dim) ::a
call initialisation
call morphMatrix(a)
contains
subroutine morphMatrix(Matrix)
real,intent(in), dimension(dim,dim) ::Matrix
real, dimension(size(Matrix,1),size(Matrix,2)) ::mat
mat=Matrix !temp saving var before modifying Matrix
end subroutine morphMatrix
subroutine initialisation
a = reshape( (/ 1., 1., 1., 1., &
& 1., 0., 1., 0., &
& 0., 1., 0., 1., &
& 1. ,0., 0., 1. /), (/dim,dim/)
end subroutine initialisation
end program paramMat
"
But I ve errors:
"
gfortran paraMatrix.f90 -o paraMatrix
In file paraMatrix.f90:32
& 1. ,0., 0., 1. /), (/dim,dim/)
1
Error: Syntax error in argument list at (1)
Compilation exited abnormally with code 1
"
What is wrong?