public override int go()
        {
            int logd2;

            double[,,,] y = new double[2, d2, fftblockpad, 2];

            int i, j, k, ii, io;

            logd2 = ilog2(d2);
            for (k = 0; k < d3; k++)
            {
                for (ii = 0; ii <= d1 - fftblock; ii = ii + fftblock)
                {
                    for (j = 0; j < d2; j++)
                    {
                        for (i = 0; i < fftblock; i++)
                        {
                            io = ((k * d2 + j) * d1 + (i + ii)) * 2;

                            int m1 = (io % size1);
                            int m2 = (m1 % size2);
                            int _i = io / size1;
                            int _j = m1 / size2;
                            int _k = m2 / 2;

                            y[0, j, i, REAL] = x[_i, _j, _k, REAL];
                            y[0, j, i, IMAG] = x[_i, _j, _k, IMAG];
                        }
                    }

                    Swarztrauber.setParameters(dir, logd2, d2, y);
                    Swarztrauber.go();

                    for (j = 0; j < d2; j++)
                    {
                        for (i = 0; i < fftblock; i++)
                        {
                            io = ((k * d2 + j) * d1 + (i + ii)) * 2;

                            int m1 = (io % size1);
                            int m2 = (m1 % size2);
                            int _i = io / size1;
                            int _j = m1 / size2;
                            int _k = m2 / 2;

                            xout[_i, _j, _k, REAL] = y[0, j, i, REAL];
                            xout[_i, _j, _k, IMAG] = y[0, j, i, IMAG];
                        }
                    }
                }
            }
            return(0);
        }
        public override int go()
        {
            int logd1;

            double[,,,] y = new double[2, d1, fftblockpad, 2];

            int i, j, k, jj, io;

            logd1 = ilog2(d1);
            for (k = 0; k < d3; k++)
            {
                for (jj = 0; jj <= (d2 - fftblock); jj = jj + fftblock)
                {
                    for (j = 0; j < fftblock; j++)
                    {
                        for (i = 0; i < d1; i++)
                        {
                            io = ((k * d2 + (j + jj)) * d1 + i) * 2;

                            int m1 = (io % size1);
                            int m2 = (m1 % size2);
                            int _i = io / size1;
                            int _j = m1 / size2;
                            int _k = m2 / 2;

                            y[0, i, j, REAL] = x[_i, _j, _k, REAL];
                            y[0, i, j, IMAG] = x[_i, _j, _k, IMAG];
                        }
                    }
                    Swarztrauber.setParameters(dir, logd1, d1, y);
                    Swarztrauber.go();

                    for (j = 0; j < fftblock; j++)
                    {
                        for (i = 0; i < d1; i++)
                        {
                            io = (((k * d2 + (j + jj)) * d1 + i) * 2);

                            int m1 = (io % size1);
                            int m2 = (m1 % size2);
                            int _i = io / size1;
                            int _j = m1 / size2;
                            int _k = m2 / 2;

                            xout[_i, _j, _k, REAL] = y[0, i, j, REAL];
                            xout[_i, _j, _k, IMAG] = y[0, i, j, IMAG];
                        }
                    }
                }
            }
            return(0);
        }