comm argument length defined in doc is different from zfft1mx_example.f definition.

In documentation the comm argument is defined COMM(3*n+100), being N the number of elements in each sequence to be transformed(the number of rows).

In zfft1mx_example.f comm argument is defined COMM(3*NMAX+100), where NMAX and N are different.

C .. Parameters ..

INTEGER NMAX, NSMAX

PARAMETER (NMAX=20,NSMAX=10)

C .. Local Scalars ..

DOUBLE PRECISION SCALE

INTEGER I, INCX1, INCX2, INCY1, INCY2, INFO, J, N, NSEQ

LOGICAL INPL

C .. Local Arrays ..

COMPLEX *16 COMM(3*NMAX+100), X(NMAX,NSMAX), XX(NMAX,NSMAX),

* Y(NMAX-1,NSMAX)

The sequence of complex data

SCALE = 1.0D0

INPL = .FALSE.

INCX1 = 2

INCX2 = NMAX

INCY1 = 3

INCY2 = NMAX - 1

NSEQ = 2

In function call, n is the parameter and not NMAX. N = 5 and NMAX = 20.

* Initialize work array

CALL ZFFT1MX(0,SCALE,INPL,NSEQ,N,X,INCX1,INCX2,Y,INCY1,INCY2,COMM,

* INFO)

What is right way in comm definition, the doc way COMM(3*n+100) or the example way COMM(3*NMAX+100)?

In documentation the comm argument is defined COMM(3*n+100), being N the number of elements in each sequence to be transformed(the number of rows).

In zfft1mx_example.f comm argument is defined COMM(3*NMAX+100), where NMAX and N are different.

**COM def with NMAX in example:**C .. Parameters ..

INTEGER NMAX, NSMAX

PARAMETER (NMAX=20,NSMAX=10)

C .. Local Scalars ..

DOUBLE PRECISION SCALE

INTEGER I, INCX1, INCX2, INCY1, INCY2, INFO, J, N, NSEQ

LOGICAL INPL

C .. Local Arrays ..

COMPLEX *16 COMM(3*NMAX+100), X(NMAX,NSMAX), XX(NMAX,NSMAX),

* Y(NMAX-1,NSMAX)

**N def:**The sequence of complex data

SCALE = 1.0D0

INPL = .FALSE.

INCX1 = 2

INCX2 = NMAX

INCY1 = 3

INCY2 = NMAX - 1

**N = 5**NSEQ = 2

In function call, n is the parameter and not NMAX. N = 5 and NMAX = 20.

* Initialize work array

CALL ZFFT1MX(0,SCALE,INPL,NSEQ,N,X,INCX1,INCX2,Y,INCY1,INCY2,COMM,

* INFO)

What is right way in comm definition, the doc way COMM(3*n+100) or the example way COMM(3*NMAX+100)?

For a real application, ensure that you provide at least 3*N+100, whether with a static array or dynamic allocation.