c----------------------------------------------------------- c Data structure for FAS multi-grid program c----------------------------------------------------------- c----------------------------------------------------------- c Main storage array; all arrays used in MG solve are c "allocated" from 'q'. The integer 'qptr' maintains c the index into 'q' representing the "high-water mark" c of allocation. See routine 'gsinit()'. c c Make sure that this array is "sensibly" dimensioned c for the machine on which the code is running. c----------------------------------------------------------- integer qsize parameter ( qsize = 2**24 ) real*8 q(qsize) common / comr8 / q integer qptr common / comi4 / qptr integer lmax parameter ( lmax = 12 ) c----------------------------------------------------------- c Pointers for various grid functions. Once these c arrays have been initialized (see routine 'gsinit'), c q(u(l)), for example, is the start of storage for c the level-l 'unknown' grid function. This c implementation uses temporary arrays ('t1', 't2', 't3') c heavily in order to keep the code relatively c straightforward. A production code (particularly a c 3-d code) should arguably be more economical of storage. c----------------------------------------------------------- integer u(lmax), rhs(lmax), tau(lmax), & t1(lmax), t2(lmax), t3(lmax) common / comi4 / & u, rhs, tau, & t1, t2, t3 c----------------------------------------------------------- c Mesh spacings and grid sizes. c----------------------------------------------------------- real*8 h(lmax) common / comr8 / h integer nx(lmax), ny(lmax) common / comi4 / & nx, ny c----------------------------------------------------------- c Coarse grid convergence criterion and iteration limit c----------------------------------------------------------- real*8 epsi1 parameter ( epsi1 = 1.0d-10 ) integer maxsweep1 parameter ( maxsweep1 = 20 )