The work array passed to the FFT routine needs to be increased in size from 3*MAXDIM elements (for NAG) to 6*MAXDIM+15 (for FFTPACK). Here, MAXDIM is the size of the largest array dimension.
Using NAG, the inverse transform is usually done by the three calls:
CALL C06GCF( Y, N, IFAIL )
CALL C06FJF( NDIM, ND, N, X, Y, WORK, LWORK, IFAIL )
CALL C06GCF( Y, N, IFAIL )
These three calls should be replaced by the single call:
CALL PDA_DNFFTB( NDIM, ND, X ,Y, WORK, ISTAT )
PDA [1ex