Hey, I've got a question to a fortran code.
I have to write a subroutine as part of a main programm. Now i have the following arrangement causing me trouble:
Main Programm
-----------------------
subroutine MySub(...)
!here a variable x is set (with parameter) which is used to
!set the size of a matrix in a sub-sub
implizit none
integer x
parameter (x=5)
...
call subroutine Subsub(x)
...
end
-----------------------
subroutine Subsub(x)
implicit none
integer x
real*8 aa(x,x)
...
end
-----------------------
With this I have the problem that the size of the matrix is correctly dimensioned, but it is not usable. In the debugger I get only "invalid floating point" entries. Not even initialization is working.
Is this arrangement generally possible? A declaration in a sub-sub without declarating in the superior sub? I just need it in the sub-sub and i did not want it actually to hand it over.
Although the debugger says that x contain the right numer in the sub-sub.
While changing the code to dimension with a simple number (e.g. 5 that was the value of the parameter) and not by a parameter-variable it works.
But I have to write the code variable-dependant.
Hope someone could help me
ogx
I have to write a subroutine as part of a main programm. Now i have the following arrangement causing me trouble:
Main Programm
-----------------------
subroutine MySub(...)
!here a variable x is set (with parameter) which is used to
!set the size of a matrix in a sub-sub
implizit none
integer x
parameter (x=5)
...
call subroutine Subsub(x)
...
end
-----------------------
subroutine Subsub(x)
implicit none
integer x
real*8 aa(x,x)
...
end
-----------------------
With this I have the problem that the size of the matrix is correctly dimensioned, but it is not usable. In the debugger I get only "invalid floating point" entries. Not even initialization is working.
Is this arrangement generally possible? A declaration in a sub-sub without declarating in the superior sub? I just need it in the sub-sub and i did not want it actually to hand it over.
Although the debugger says that x contain the right numer in the sub-sub.
While changing the code to dimension with a simple number (e.g. 5 that was the value of the parameter) and not by a parameter-variable it works.
But I have to write the code variable-dependant.
Hope someone could help me
ogx