Hi
Me again. Sorry.
Thanks for the advice thus far. Based on your last reply, I have provided interfaces for my subroutines which are passing 'assumed shape' arrays and also routines with 'optional' statements. These routines are being called successfully but now I've run into another problem.
I am trying to call the following subroutine:
SUBROUTINE fkdiag(kdiag,g)
IMPLICIT NONE INTEGER,INTENT(IN)::g(:) INTEGER,INTENT(OUT)kdiag(:) INTEGERidof,i,iwp1,j,im,k idof=SIZE(g) DO i=1,idof iwp1=1 IF(g(i)/=0)THEN DO j=1,idof IF(g(j)/=0)THEN im=g(i)-g(j)+1 IF(im>iwp1)iwp1=im END IF END DO k=g(i) IF(iwp1>kdiag(k))kdiag(k)=iwp1 END IF END DO RETURN END SUBROUTINE fkdiag
I have provided the following interface for FKDIAG:
INTERFACE FEDOR subroutine fkdiag(kdiag,g) INTEGER,INTENT(IN)::g(:) INTEGER,INTENT(OUT)::kdiag(:) end subroutine END INTERFACE
...and the arguments I'm trying to pass are as follows:
g = (0,1,2,3,0,6) kdiag : This has been allocated for 12 integer entries.
When FKDIAG is called, the following error message appears:
'*** Error 112, Reference to undefined variable, array element or function result (/UNDEF)'
The problematic line in the FKDIAG subroutine is identified as the following:
IF(iwp1>kdiag(k))kdiag(k)=iwp1
This being the case, it seems to be having difficulty with the integer array kdiag(12), even though it has already been declared and allocated.
Can anyone let me know if they know the solution to this problem?
Thanks very much in advance.
Mikhail Kalashnikov