Global/Local Dimension Conflicts
SUBROUTINE HORADV( U1,V1,PS1,M,N )
PARAMETER (MX=161,NX=121,KK=20)
DIMENSION U1(M,N,KK), V1(M,N,KK), PS1(M,N)
COMMON/BLK1/ HXU(MX,NX),HXV(MX,NX)
D1(I,J)=(PS1(I+1,J)+PS1(I,J))*HXU(I,J)*U1(I,J,K)
D2(I,J)=(PS1(I,J+1)+PS1(I,J))*HXV(I,J)*V1(I,J,K)
SUBROUTINE HORADV( U1,V1,PS1,M,N )
PARAMETER (MX=(decomposed MX),NX=(decomposed NX),KK=20)
DIMENSION U1(MX,NX,KK), V1(MX,NX,KK), PS1(MX,NX)
COMMON/BLK1/ HXU(MX,NX),HXV(MX,NX)
D1(I,J)=(PS1(I+1,J)+PS1(I,J))*HXU(I,J)*U1(I,J,K)
D2(I,J)=(PS1(I,J+1)+PS1(I,J))*HXV(I,J)*V1(I,J,K)
In the original code, M and N are used both as loop bounds (global) and array dimensions (local), which is no problem as long as they are identical (as in a single address space)
Workaround: after determining that external dimensions of arguments are equivalent to the static dimensions within the routine, lexically transform only the uses of M and N within the Declarations part of the subroutine (using FLIC supplies a marker).