############################################################ # Sample build and execution of mgfas2d ############################################################ % ls *.f *.inc Makefile Makefile mg.inc mgfas2d.f mgfas2dlib.f mgprob.inc ############################################################ # ALL of the libraries # # -lbbhutil -lmfhdf -ldf -ljpeg -lz # # should be specified (in the above order) to use the # gft_ ... utility routines. # # Note that you can safely ignore warnings about one or # more libraries not being used to resolve any symbols. ############################################################ % make make -f Makefile f77 -g -n32 -c mgfas2d.f f77 -g -n32 -c mgfas2dlib.f f77 -g -n32 -L/usr/localn32/lib -n32 mgfas2d.o mgfas2dlib.o \ -lp329f -lbbhutil -lmfhdf -ldf -ljpeg -lz -o mgfas2d ld32: WARNING 84: /usr/localn32/lib/libjpeg.a is not used for \ resolving any symbol. ############################################################ # Usage ############################################################ % mgfas2d usage: mgfas2d [ \ ] ############################################################ # Level 1 run---difference solution is essentially exact in # this case, but this is largely "accidental" (combination # of very coarse spacing, and nature of exact solution). ############################################################ % mgfas2d 1 1.0 Level 1 Coarse grid, sweep 2.01E-15 || Error ||: 8.5082E-17 ############################################################ # Level 3 run ############################################################ % mgfas2d 3 1.0 Level 1 Coarse grid, sweep 2.01E-15 Level 2 Pre-CGC, sweep 2.35E+01 Level 1 Coarse grid, sweep 3.42E-02 Level 1 Coarse grid, sweep 1.37E-05 Level 1 Coarse grid, sweep 2.19E-12 Level 2 Post-CGC, sweep 7.08E+00 Level 3 Pre-CGC, sweep 1.83E+01 Level 2 Pre-CGC, sweep 8.98E-01 Level 1 Coarse grid, sweep 3.11E-02 Level 1 Coarse grid, sweep 1.13E-05 Level 1 Coarse grid, sweep 1.50E-12 Level 2 Post-CGC, sweep 2.31E-01 Level 3 Post-CGC, sweep 2.55E+00 || Error ||: 9.2996E-03 ############################################################ # Level 5 run ############################################################ % mgfas2d 5 1.0 Level 1 Coarse grid, sweep 2.01E-15 Level 2 Pre-CGC, sweep 2.35E+01 Level 1 Coarse grid, sweep 3.42E-02 Level 1 Coarse grid, sweep 1.37E-05 Level 1 Coarse grid, sweep 2.19E-12 Level 2 Post-CGC, sweep 7.08E+00 Level 3 Pre-CGC, sweep 1.83E+01 Level 2 Pre-CGC, sweep 8.98E-01 Level 1 Coarse grid, sweep 3.11E-02 Level 1 Coarse grid, sweep 1.13E-05 Level 1 Coarse grid, sweep 1.50E-12 Level 2 Post-CGC, sweep 2.31E-01 Level 3 Post-CGC, sweep 2.55E+00 Level 4 Pre-CGC, sweep 1.89E+01 Level 3 Pre-CGC, sweep 8.86E-01 Level 2 Pre-CGC, sweep 4.68E-01 Level 1 Coarse grid, sweep 6.69E-04 Level 1 Coarse grid, sweep 5.24E-09 Level 1 Coarse grid, sweep 2.89E-19 Level 2 Post-CGC, sweep 1.41E-01 Level 3 Post-CGC, sweep 4.82E-01 Level 4 Post-CGC, sweep 1.10E+00 Level 5 Pre-CGC, sweep 1.96E+01 Level 4 Pre-CGC, sweep 3.25E-01 Level 3 Pre-CGC, sweep 2.69E-01 Level 2 Pre-CGC, sweep 1.45E-01 Level 1 Coarse grid, sweep 7.53E-05 Level 1 Coarse grid, sweep 6.64E-11 Level 2 Post-CGC, sweep 4.36E-02 Level 3 Post-CGC, sweep 1.49E-01 Level 4 Post-CGC, sweep 2.12E-01 Level 5 Post-CGC, sweep 3.39E-01 || Error ||: 3.5222E-04 ############################################################ # Level 11 run ############################################################ % mgfas2d 11 1 qalloc: Could not allocate block of size 263169 \ Total size: 1048576 ############################################################ # Define an alias for running the same problem at various # resolutions and extracting the '|| Error ||' line # from the output. # # Note the use of the 'csh' construct '|&' to # redirect both standard error and standard output # through a pipeline. ############################################################ % alias doit 'mgfas2d \!* 1.0 |& grep Error' % doit 3 || Error ||: 9.2996E-03 % doit 4 || Error ||: 1.6056E-03 % doit 5 || Error ||: 3.5222E-04 % doit 6 || Error ||: 8.4800E-05 % doit 7 || Error ||: 2.1139E-05 % doit 8 || Error ||: 5.2794E-06 ############################################################ # Compute approximate convergence rate using level 6, 7 and # 8 computations. ############################################################ % maple > evalf(8.4800E-05/2.1139E-05); 4.011542646 > evalf(2.1139E-05/5.2794E-06); 4.004053491 > quit;