GfsEventScript

From Gerris

(Difference between revisions)
Jump to: navigation, search
Revision as of 14:56, 27 June 2008
Dfuster (Talk | contribs)

← Previous diff
Current revision
Popinet (Talk | contribs)
(examples cross-reference)
Line 16: Line 16:
;GFS_STOP: if the exit status of the shell script is <code>GFS_STOP</code> the simulation is terminated (the return status indicates a failure) ;GFS_STOP: if the exit status of the shell script is <code>GFS_STOP</code> the simulation is terminated (the return status indicates a failure)
-===Examples===+<examples/>
-#[http://gfs.sourceforge.net/tests/tests/merging/merging.gfs.html Convergence for the three-way vortex merging problem] : Example of eps figures generation on the fly with a given format. The simulation must be piped with gfsview+

Current revision

GfsEventScript can be used to execute a shell-script at given intervals.

The syntax in parameter files is as follows:

[ GfsEvent ] {
  COMMANDS
}

where COMMANDS is the script to be executed with /bin/sh.

Several shell variables are set:

GfsTime
the physical time
GfsIter
the iteration number
GfsPid
the processor number
GFS_STOP
if the exit status of the shell script is GFS_STOP the simulation is terminated (the return status indicates a failure)

Examples

  • Parallel simulation on four processors
  •   EventScript { start = end } {
          echo "Save pid.eps { format = EPS width = 800 height = 100 line_width = 0.2 }" | \
    	  gfsview-batch2D pid.gfv end.gfs
          awk '{
            if ($1 == "step:")
              t = $4;
            else if ($1 == "domain")
              print t, 100.*($9/$3 - 1.), $3, $5, $9;
          }' < balance > balance1
          cat <<EOF | gnuplot
          set term postscript eps lw 3 solid 20 colour
          set output 'balance.eps'
          set xlabel 'Time'
          set ylabel 'Number of elements per processor'
          set key bottom right
          plot 'balance1' u 1:3 w l t 'minimum', '' u 1:4 w l t 'average', '' u 1:5 w l t 'maximum'
    EOF
      }
    

  • Rayleigh-Taylor instability
  •   EventScript { start = 0 } { echo "Save t-0.eps { format = EPS }" }
    

      EventScript { start = 0.7 step = 0.1 } { echo "Save t-$GfsTime.eps { format = EPS }" }
    

  • Boussinesq flow generated by a heated cylinder
  •   EventScript { istep = 4 } { echo "Save stdout { width = 256 height = 512 }" }
    

      EventScript { start = 19 } { echo "Save t.ppm { width = 256 height = 512 }" }
    

      EventScript { start = end } { convert -colors 256 t.ppm t.eps ; rm -f t.ppm }
    

  • Coalescence of a pair of Gaussian vortices (Gerris logo)
  •     EventScript { start = end } {
            echo "Save logo.ppm { width = 1024 height = 1024 }"
            sleep 5 # to wait for GfsView to finish writing the image
            convert -transparent "#0000FF" logo.ppm -geometry 156x156 logo.png
            montage -background white -geometry +0+0 logo.png logo.eps
            rm -f logo.ppm
        }
    

  • Collapse of a column of grains
  •     EventScript { start = end } {
    	for t in 0 1.65132 2.3769 3.10248 3.80304 5.70456; do
    	    echo "Save snapshot-$t.gnu { format = Gnuplot }" | \
         		gfsview-batch2D column.gfv snapshot-$t.gfs
    	done
    	echo "Save movie.ppm { format = PPM width = 1280 height = 480 }" | \
    	    gfsview-batch2D movie.gfv snapshot-0.gfs
    	convert movie.ppm -geometry 640x240 movie.png
    	convert movie.png movie.eps
    	rm -f movie.ppm
    	tar xzf grains.tgz
    	gnuplot comparison.plot
        }
    

  • Turbulent air flow around RV Tangaroa
  •   EventScript { istep = 4 } { echo "Save stdout { width = 1024 height = 768 }" }
    

      EventScript { start = 1.5 } { echo "Save sections.ppm { width = 1024 height = 768 }" }
    

      EventScript { start = end } {
          convert -colors 256 sections.ppm sections.eps ; rm -f sections.ppm 
      }
    

  • Savart--Plateau--Rayleigh instability of a water column
  •     EventScript { istep = 1000 } { gzip -f -q plateau-*.gfs }
    

        EventScript { start = end } {
    	for f in white plateau closeup; do
    	    echo "Save $f.ppm { format = PPM width = 960 height = 960 }" | \
    		gfsview-batch3D $f.gfv plateau-1000.gfs.gz
    	    convert $f.ppm -geometry 480x480 $f.png
    	    convert $f.png $f.eps
    	    rm -f $f.ppm
    	done
    	cat <<EOF | gnuplot
            set term postscript eps color lw 2 20
            set output 'size.eps'
            set xlabel 'Timestep'
            set ylabel 'Total number of cells'
            unset key
            plot [10:]'< grep domain size' u 3 w l
    EOF
        }
    

  • Atomisation of a pulsed liquid jet
  •     EventScript { istep = 100 } { rm -f snapshot-*.gfs }
    

        EventScript { start = end } {
    	for f in jet back; do
    	    convert $f.ppm -geometry 640x480 $f.png
    	    convert $f.png $f.eps
    	    rm -f $f.ppm
    	done
    	awk '{if ($1 == "step:") t = $4; 
                  else if ($1 == "domain") print t,$3,$5,$9;}' < log > balance
    	cat <<EOF | gnuplot
            set term postscript eps color lw 2 20 solid
            set output 'balance.eps'
            set xlabel 'Time'
            set ylabel 'Number of cells per processor'
            plot [0:1.6]'balance' u 1:2 w l t 'Minimum', \
                        'balance' u 1:3 w l t 'Average', \
                        'balance' u 1:4 w l t 'Maximum'
    EOF
        }
    

  • Air-water flow around a Series 60 cargo ship
  •     EventScript { istep = 5 end = 4 } { echo "Save stdout { width = 1600 height = 1200 }" }
    

        EventScript { start = 1 step = 1 } { gzip -f -q sim-*.gfs }
    

        EventScript { start = 10 } {
            echo "Save stdout { width = 1600 height = 1200 }" | \
            gfsview-batch3D sim-10.gfs.gz closeup.gfv | \
            convert -colors 256 ppm:- closeup.eps
    
            echo "Save stdout { width = 1600 height = 1200 }" | \
            gfsview-batch3D sim-10.gfs.gz front.gfv | \
            convert -colors 256 ppm:- front.eps
    
            echo "Save stdout { width = 800 height = 600 }" | \
            gfsview-batch3D sim-10.gfs.gz comparison.gfv | \
            convert -trim ppm:- comparison.ppm
    
    #       echo "Save stdout { width = 800 height = 600 }" | \
    #       gfsview-batch3D sim-10.gfs.gz tank-data.gfv | \
    #       convert -trim -flip ppm:- tank-data.png
    
            convert tank-data.png tank-data.ppm
            montage -geometry +0+0 -tile 1x2 tank-data.ppm comparison.ppm png:- | \
            convert -colors 256 png:- comparison.eps        
    
            cat <<EOF | gnuplot
            set term postscript eps lw 3 solid 20 colour
            set output 'f.eps'
            set xlabel 'Time'
            set ylabel 'Force'
            plot 'f' u 1:(\$2*2.) every 10 w l t 'Drag', 'f' every 10 u 1:(\$4*2.) w l t 'Lift'
    EOF
        }
    

  • Forced isotropic turbulence in a triply-periodic box
  •   EventScript { istep = 100 } { rm -f snapshot-*.gfs }
    

      EventScript { start = end } {
          gnuplot <<EOF
            set term postscript eps lw 3 solid 20 colour
    
            set output 'Energy.eps'
            set xrange [0:300]
            set xlabel 'Time'
            set ylabel 'Kinetic energy'
            set logscale y
            plot 'Energy.dat' u 3:7 w l t 'Gerris', 'spectral.dat' u 1:(\$3*3/2) w l t 'Spectral'
    
            set output 'Reynolds.eps'
            set ylabel 'Microscale Reynolds number'
            plot 'Reynolds.dat' u 3:7 w l t 'Gerris', 'spectral.dat' u 1:4 w l t 'Spectral'
    
            set output 'Dissipation.eps'
            set ylabel 'Dissipation function'
            plot 'Dissipation.dat' u 3:7 w l t 'Gerris', 'spectral.dat' u 1:2 w l t 'Spectral'
    
            set output 'size.eps'
            set ylabel 'Total number of grid points'
            unset logscale
            plot "< awk '{ if (\$1 == \"step:\") t = \$4; else if (\$1 == \"domain\") print t,\$5*8.;}' < log" w l t 'Gerris', 128**3 t 'spectral'
    EOF
      }
    

  • Lunar tides in Cook Strait, New Zealand
  •     EventScript { start = end } {
            cat <<EOF | gnuplot
            set term postscript eps lw 3 solid 20 colour
            set output 'pv.eps'
            set xlabel 'Time (days)'
            set ylabel 'Elevation (metres) or Velocity (metres/s)'
            plot 'p' u (\$3/86400.):(\$9/9.81) w l t "Elevation", \
                 'u' u (\$3/86400.):9 w l t "Velocity"
            set output 'a0.eps'
            set ylabel 'Maximum harmonic elevation (metres)'
            plot [1:]'a0' u (\$3/86400.):(\$9/9.81) w l t ""
    EOF
        }
    

  • Dam break on complex topography
  •     EventScript { start = end } {
    	echo "\rcreating animation...            " > /dev/stderr
            sleep 10 # give a chance to gnuplot to catch up
    	for f in sim-*.png; do
    	    convert $f -trim +repage -bordercolor white \
    		-border 10 -resize 640x282! `basename $f .png`.gif && rm -f $f
    	done
    	gifsicle --colors 256 --optimize --delay 12 --loopcount=0 sim-*.gif > dam.gif && \
    	    rm -f sim-*.gif
        }
    

  • Small amplitude solitary wave interacting with a parabolic hump
  •     EventScript { istep = 10 } { echo "Save stdout { width = 640 height = 480 }" }
    

        EventScript { start = end } {
    	for i in 0.6 0.9 1.2 1.5 1.8; do
    	    echo "Save stdout { format = EPS line_width = 0.2 }" | \
    		gfsview-batch2D sim-$i.gfs isolines.gfv > iso-$i.eps
    	    echo "Save stdout { format = EPS line_width = 0.2 }" | \
    		gfsview-batch2D sim-$i.gfs cells.gfv > cells-$i.eps
    	done
    	echo "Save stdout { width = 1280 height = 960 }" | \
    	    gfsview-batch2D sim-0.9.gfs hump.gfv | convert ppm:- hump.eps
        }
    

  • Tsunami runup onto a complex three-dimensional beach
  •     EventScript { step = 1 } { gzip -f sim-*.gfs }
    

  • The 2004 Indian Ocean tsunami
  •     EventScript { istep = 100 } { rm -f snapshot-*.gfs }
    

        EventScript { step = 900} { gzip -f sim-*.gfs }
    

        EventScript { start = end } {
    	# timeseries at specific locations
    	gnuplot <<EOF
    set term postscript eps color lw 2 size 5,2 18
    
    set size ratio 0.4
    
    set output 'hani.eps'
    plot [3:5]'hanires.txt' u 1:(\$2/100.) w lp t 'observed' ps 2, \
               'hani.txt' u (\$3/3600.):7 w l t 'modelled'
    
    set output 'male.eps'
    plot [3:5]'maleres.txt' u 1:(\$2/100.) w lp t 'observed' ps 2, \
               'male.txt' u (\$3/3600.):7 w l t 'modelled'
    
    set output 'gana.eps'
    plot [3:5]'ganares.txt' u 1:(\$2/100.) w lp t 'observed' ps 2, \
               'gana.txt' u (\$3/3600.):7 w l t 'modelled'
    
    set output 'dieg.eps'
    plot [3:5]'diegres.txt' u 1:(\$2/100.) w lp t 'observed' ps 2, \
               'dieg.txt' u (\$3/3600.):7 w l t 'modelled'
    
    set output 'colo.eps'
    plot [2.5:4.5]'colores.txt' u 1:(\$2/100.) w lp t 'observed' ps 2, \
               'colo.txt' u (\$3/3600.):7 w l t 'modelled'
    
    set output 'jason.eps'
    set xlabel 'Latitude (deg)'
    set ylabel 'Elevation (m)'
    plot [-6:20][-1:1]'jasonres.txt' u 2:4 w l t 'observed', \
               'jason.txt' u 3:(\$3 > 19.2 ? 0 : \$8) w l t 'modelled'
    EOF
        }
    

  • "Garden sprinkler effect" in wave model
  •     EventScript { step = 12 } { gzip -f sim-*-*-*.gfs }
    

        EventScript { start = end } { gzip -f end-*-*.gfs }
    

  • Cyclone-generated wave field
  •     EventScript { step = 4 } { gzip -f sim-*.gfs }
    

        EventScript { start = end } {
    	for i in 12 24 36 48; do
    	    echo "Save hs-$i.eps { format = EPS }" | gfsview-batch2D sim-$i.gfs.gz hs.gfv
    	    echo "Save mesh-$i.eps { format = EPS }" | gfsview-batch2D sim-$i.gfs.gz mesh.gfv
    	done
    	echo "Save shifted.eps { format = EPS }" | gfsview-batch2D sim-48.gfs.gz shifted.gfv
    	cat <<EOF | gnuplot
            set term postscript eps color lw 2 18
            set output 'hsmax.eps'
            set xlabel 'Time (hours)'
            set ylabel 'Amplitude (m or m/s)'
            set xtics 0,12,48
            set grid
            plot 'hs' u 3:11 w l t 'max(Hs)', 'vr' u 3:11 w l t 'max(|U10|)'
    EOF
        }
    

  • Time-reversed advection of a VOF concentration
  •     EventScript { start = end } {
    	conservation() 
            {
    	    if awk -v tolerance=$1 'BEGIN { min = 1.; max = -1.; }{ 
                  if ($5 > max) max = $5; 
                  if ($5 < min) min = $5; 
                }END{ if (max - min > tolerance) { print max - min > "/dev/stderr"; exit (1); } }'; then
    		:
    	    else
    		exit $GFS_STOP;
    	    fi
    	}
            conservation 1e-4 < t
            conservation 2e-5 < t1
            conservation 0. < t2
        }
    

  • Rotation of a straight interface
  •     EventScript { start = end } {
    	gnuplot <<EOF
    set term postscript eps color lw 3 18
    set output 'error.eps'
    set ylabel 'Maximum volume fraction error'
    set xlabel 'Time'
    set key top left
    set logscale y
    set grid y
    plot [][1e-3:]'error' u 3:9 w l t 'n=4', 'error.n1' u 3:9 w l t 'n=1'
    EOF
            for t in 0 1 2 5; do
    	    gnuplot <<EOF
    set term postscript eps color lw 2 solid
    set output 'rotate-$t.eps'
    unset border
    unset xtics
    unset ytics
    unset key
    set size ratio -1
    plot 'cells.gnu' w l lc 0, 'rotate-$t.gnu' w l lw 2 lc 1, 'n1-$t.gnu' w l lc 2 lw 2
    EOF
            done
    
            status=0;
            if awk '{if ($5 != 2.) { print $5 > "/dev/stderr"; exit (1); }}' < t ; then :
            else
                status=$GFS_STOP;
            fi
    
            paste error error.ref > tmp
    	if awk '{
              if ($9 > $20) {
                print $3,$9,$20 > "/dev/stderr"
                exit (1);
              }
            }' < tmp; then :
    	else
    	    status=$GFS_STOP;
            fi
    	
    	exit $status
        }
    }
    

  • Comparison between explicit and implicit diffusion schemes on concentration tracer
  •     EventScript { start = end } {
    	conservation() 
            {
    	    if awk -v tolerance=$1 'BEGIN { min = 1.; max = -1.; }{ 
                  if ($5 > max) max = $5; 
                  if ($5 < min) min = $5; 
                }END{ if (max - min > tolerance) { print max - min > "/dev/stderr"; exit (1); } }'; then
    		:
    	    else
    		exit $GFS_STOP;
    	    fi
    	}
            conservation 2.1e-7 < T1vol
            conservation 2.1e-7 < Cvol
        }
    

  • Conservation of diffusive tracer
  •     EventScript { start = end } {
    	if awk '{if ($9 > 8e-3) { 
                       print "diff: " $9 > "/dev/stderr"; exit (1); 
                    }}' < diff &&
    	   awk 'BEGIN{ s=-1 } {
                      if (s < 0.) s = $5; 
                      else if ($5 - s != 0.) {
                        print "st: " $5 - s > "/dev/stderr"; exit (1);
                      }
                    }' < st &&
    	   awk 'BEGIN{ s=-1 } {
                      if (s < 0.) s = $5;
                      else if ($5 - s != 0.) {
                        print "ste: " $5 - s > "/dev/stderr"; exit (1);
                      }
                    }' < ste ; then :
            else
                exit $GFS_STOP;
            fi
        }
    }
    

  • Convergence for the three-way vortex merging problem
  •   EventScript { start = 0.05 } {
        echo Clear
        cat levels.gfv
        echo Save tm_0_05.eps { format = EPS line_width = 0.1 }
        echo Clear
        cat vorticity.gfv
        echo Save tv_0_05.eps { format = EPS line_width = 0.1 }
      }
    

      EventScript { start = 0.15 } {
        echo Clear
        cat levels.gfv
        echo Save tm_0_15.eps { format = EPS line_width = 0.1 }
        echo Clear
        cat vorticity.gfv
        echo Save tv_0_15.eps { format = EPS line_width = 0.1 }
      }
    

      EventScript { start = 0.25 } {
        echo Clear
        cat levels.gfv
        echo Save tm_0_25.eps { format = EPS line_width = 0.1 }
        echo Clear
        cat vorticity.gfv
        echo Save tv_0_25.eps { format = EPS line_width = 0.1 }
      }
    

  • Mass conservation
  •     EventScript { step = 0.2 } {
    	echo "Save stdout { format = Gnuplot }"
        }
    

        EventScript { start = 1.2 } {
    	echo "Clear"
    	cat vectors.gfv
    	echo "Save vectors.gnu { format = Gnuplot }"
        }
    

  • Boundary layer on a rotating disk
  •     EventScript { start = end } {
    	awk 'BEGIN{ nu = 0.2 } {
                   if ($2 != 0. && $1 != "#" && ($1*$1 + $2*$2) < 8.0)
                     print $1/sqrt(nu),-$4/sqrt(nu),$5/$2;
                 }' < end.txt > nu
    	if gnuplot <<EOF ; then :
        set term postscript eps lw 3 color solid 20 enhanced
        set output 'profiles.eps'
        set xlabel '{/Symbol z}'
        set key center right
        plot [0:6]'analytical' u 1:2 w l t '-F({/Symbol z})', 'nu' u 1:2 t 'Gerris', \
                  'analytical' u 1:3 w l t 'G({/Symbol z})', 'nu' u 1:3 t 'Gerris'
    EOF
    	else
    	    exit $GFS_STOP;
    	fi
    
    	if python <<EOF ; then :
    from check import *
    from sys import *
    if (Curve('nu',1,2) - Curve('analytical',1,2)).normi() > 8e-3 or \
       (Curve('nu',1,3) - Curve('analytical',1,3)).normi() > 8e-3 :
        print (Curve('nu',1,2) - Curve('analytical',1,2)).normi()
        print (Curve('nu',1,3) - Curve('analytical',1,3)).normi()
        exit(1)
    EOF
    	else
    	    exit $GFS_STOP;
    	fi
        }
    

  • Lid-driven cavity at Re=1000
  •   EventScript { start = end } {
        gnuplot <<EOF
        set term postscript eps lw 3 solid 20
        set output 'xprof.eps'
        set xlabel 'Y'
        set ylabel 'U'
        plot [-0.5:0.5]'xprof.ghia' u 1:2 title "Ghia et al." w p ps 2 pt 9, 'xprof' u 3:7 w l title "Gerris"
        set output 'yprof.eps'
        set xlabel 'X'
        set ylabel 'V'
        plot [-0.5:0.5]'yprof.ghia' u 1:2 title "Ghia et al." w p ps 2 pt 9, 'yprof' u 2:8 w l title "Gerris"
    EOF
      }
    

  • Lid-driven cavity at Re=1000 (explicit scheme)
  •   EventScript { start = end } {
        cat <<EOF | gnuplot
        set term postscript eps lw 3 solid 20
        set output 'xprof.eps'
        set xlabel 'Y'
        set ylabel 'U'
        plot [-0.5:0.5]'../xprof.ghia' u 1:2 title "Ghia et al." w p ps 2 pt 9, 'xprof' u 3:7 w l title "Gerris"
        set output 'yprof.eps'
        set xlabel 'X'
        set ylabel 'V'
        plot [-0.5:0.5]'../yprof.ghia' u 1:2 title "Ghia et al." w p ps 2 pt 9, 'yprof' u 2:8 w l title "Gerris"
    EOF
      }
    

  • Lid-driven cavity with a non-uniform metric
  •   EventScript { start = end } {
        gnuplot <<EOF
        set term postscript eps
        set output 'velocity.eps'
        set size ratio -1
        unset border
        unset key
        unset xtics
        unset ytics
        plot 'isolines.gnu' w l
    EOF
        gnuplot <<EOF
        set term postscript eps lw 3 solid 20
        set output 'xprof.eps'
        set xlabel 'Y'
        set ylabel 'U'
        plot [-0.5:0.5]'xprof.ghia' u 1:2 title "Ghia et al." w p ps 2 pt 9, 'xprof' u 3:7 w l title "Gerris"
        set output 'yprof.eps'
        set xlabel 'X'
        set ylabel 'V'
        plot [-0.5:0.5]'yprof.ghia' u 1:2 title "Ghia et al." w p ps 2 pt 9, 'yprof' u 2:8 w l title "Gerris"
    EOF
      }
    

  • Lid-driven cavity on an anisotropic mesh
  •   EventScript { start = end } {
        gnuplot <<EOF
        set term postscript eps lw 3 solid 20
        set output 'xprof.eps'
        set xlabel 'Y'
        set ylabel 'U'
        plot [-0.5:0.5]'xprof.ghia' u 1:2 title "Ghia et al." w p ps 2 pt 9, 'xprof' u 3:7 w l title "Gerris"
        set output 'yprof.eps'
        set xlabel 'X'
        set ylabel 'V'
        plot [-0.5:0.5]'yprof.ghia' u 1:2 title "Ghia et al." w p ps 2 pt 9, 'yprof' u 2:8 w l title "Gerris"
    EOF
      }
    

  • Momentum conservation for large density ratios
  •     EventScript { start = end } {
            gnuplot <<EOF
                set term postscript eps color lw 3 solid 20
                set output 'k.eps'
                set xlabel 'Time'
                set ylabel 'Kinetic energy'
                set grid
                plot 'k' u 3:5 w l t ''
    EOF
            if awk '{if ($5 > 7.2e-3) exit (1);}' < k ; then
                return 0;
            else
                return $GFS_STOP;
            fi
        } 
    

  • Hydrostatic balance with solid boundaries and viscosity
  •     EventScript { start = end } { 
            if awk '{if ($9 > 1.5e-12) { print $9 > "/dev/stderr"; exit (1); }}' < v ; then
                exit 0;
            else
                exit $GFS_STOP;
            fi
        }
    }
    

  • Hydrostatic balance with quadratic pressure profile
  •     EventScript { start = end } { 
            if awk '{if ($9 > 1.5e-12) exit (1);}' < v ; then :
            else
                exit $GFS_STOP;
            fi        
            if awk '{if ($9 > 1e-12) exit (1);}' < p ; then :
            else
                exit $GFS_STOP;
            fi
        } 
    

  • B\'enard--von K\'arm\'an vortex street behind a cylinder translating in a fluid at rest
  •   EventScript { start = end } {
          cat <<EOF | gnuplot 2>&1 | awk '{if ($1 == "400") print $0;}'
               f(x)= a*cos(b*(x+c))
               a = 0.00525
               b = 110.49
               c = 0.611
               fit [0.5:] f(x) 'forces.dat' u 1:6 via a,b,c
               print "400 ", b/(2*pi)*0.0125       
    EOF
      }
    

  • Shape oscillation of an inviscid droplet
  •     EventScript { start = end } {
            cat <<EOF | gnuplot 2>&1 | awk '{if ($1 == "result:") print LEVEL,$2,$3,$4,$5;}'
               k(t)=a*exp(-b*t)*(1.-cos(c*t))
               a = 3e-4
               b = 1.5
      
               D = DIAMETER
               n = 2.
               sigma = 1.
               rhol = 1.
               rhog = 1./1000.
               r0 = D/2.
               omega0 = sqrt((n**3-n)*sigma/((rhol+rhog)*r0**3))
    
               c = 2.*omega0
               fit k(x) 'k-LEVEL' u 3:5 via a,b,c
               print "result: ", a, b, c, D
    EOF
            rm -f fit.log
        }
    

  • Scalings for Plateau--Rayleigh pinchoff
  •    EventScript { start = end } {
           # set t0 (breakup time) as the time for which the minimum
           # radius is smaller than the size of the finest cell: 1/2^14
           t0=`awk '{ if ($5 < 1./2.**14) { print $3; exit(0);} }' < y`
           rm -f fit.log
           gnuplot <<EOF
           set term postscript eps lw 3 20 color enhanced
           set key spacing 1.5
           set grid
           set output 'y.eps'
           set xlabel 't_0 - t'
           set ylabel 'r_{min}'
           set logscale
           fit [1e-6:1e-3] a*x**(2./3.) 'y' u ($t0 - \$3):5 via a
           plot [1e-6:][1./2**14:]'y' u ($t0 - \$3):5 ps 0.5 t '', a*x**(2./3.) t 'x^{2/3}'
    EOF
           status=0
           if awk '{if ($1 == "rms" && (NF < 8 || $8 > 4e-5)) {
                      print "rmsy: " $8 > "/dev/stderr"; exit (1); 
                   }}' < fit.log; then :
           else
    	   status=$GFS_STOP;
           fi
           rm -f fit.log
           gnuplot <<EOF
           set term postscript eps lw 3 20 color enhanced
           set key spacing 1.5
           set grid
           set output 'u.eps'
           set xlabel 't_0 - t'
           set ylabel 'u_{max}'
           set logscale
           fit [1e-6:1e-3] a*x**(-1./3.) 'u' u ($t0 - \$3):9 via a
           plot [1e-6:]'u' u ($t0 - \$3):9 ps 0.5 t '', a*x**(-1./3.) t 'x^{-1/3}'
    EOF
           if awk '{if ($1 == "rms" && (NF < 8 || $8 > 8.)) {
                      print "rmsu: " $8 > "/dev/stderr"; exit (1); 
                   }}' < fit.log; then :
           else
    	   status=$GFS_STOP;
           fi
           exit $status;
       }
    }
    GfsBox {
        bottom = Boundary
        left = Boundary
        right = Boundary
    }
    

  • Geostrophic adjustment
  •   EventScript { start = end } {
        cat <<EOF | gnuplot
        set term postscript eps lw 3 color solid 20
        set output 'geo_error.eps'
        set xlabel 'Time (days)'
        set ylabel 'Maximum error on surface height (m)'
        plot 'e.ref' t 'ref' w l, 'e' t '' w l
    EOF
      }
    

  • Geostrophic adjustment with Saint-Venant
  •   EventScript { start = end } {
        cat <<EOF | gnuplot
        set term postscript eps lw 3 color solid 20
        set output 'geo_error.eps'
        set xlabel 'Time (days)'
        set ylabel 'Maximum error on surface height (m)'
        plot 'e.ref' t 'ref' w l, 'e' t '' w l
    EOF
      }
    

  • Coastally-trapped waves
  •   EventScript { start = end } { echo -n "-30 " }
    

      EventScript { start = end } { echo -n "-29 " }
    

      EventScript { start = end } { echo -n "-20 " }
    

      EventScript { start = end } { echo -n "25 " }
    

      EventScript { start = end } { echo -n "26 " }
    

      EventScript { start = end } { echo -n "27 " }
    

      EventScript { start = end } { echo -n "28 " }
    

      EventScript { start = end } { echo -n "29 " }
    

      EventScript { start = end } { echo -n "30 " }
    

      EventScript { start = end } { echo -n "-19 " }
    

      EventScript { start = end } { echo -n "-18 " }
    

      EventScript { start = end } { echo -n "-17 " }
    

      EventScript { start = end } { echo -n "-16 " }
    

      EventScript { start = end } { echo -n "-15 " }
    

      EventScript { start = end } { echo -n "-14 " }
    

      EventScript { start = end } { echo -n "-13 " }
    

      EventScript { start = end } { echo -n "-12 " }
    

      EventScript { start = end } { echo -n "-11 " }
    

      EventScript { start = end } { echo -n "-28 " }
    

      EventScript { start = end } { echo -n "-10 " }
    

      EventScript { start = end } { echo -n "-9 " }
    

      EventScript { start = end } { echo -n "-8 " }
    

      EventScript { start = end } { echo -n "-7 " }
    

      EventScript { start = end } { echo -n "-6 " }
    

      EventScript { start = end } { echo -n "-5 " }
    

      EventScript { start = end } { echo -n "-4 " }
    

      EventScript { start = end } { echo -n "-3 " }
    

      EventScript { start = end } { echo -n "-2 " }
    

      EventScript { start = end } { echo -n "-1 " }
    

      EventScript { start = end } { echo -n "-27 " }
    

      EventScript { start = end } { echo -n "0 " }
    

      EventScript { start = end } { echo -n "0.1 " }
    

      EventScript { start = end } { echo -n "0.2 " }
    

      EventScript { start = end } { echo -n "0.3 " }
    

      EventScript { start = end } { echo -n "0.4 " }
    

      EventScript { start = end } { echo -n "0.5 " }
    

      EventScript { start = end } { echo -n "0.6 " }
    

      EventScript { start = end } { echo -n "0.7 " }
    

      EventScript { start = end } { echo -n "0.8 " }
    

      EventScript { start = end } { echo -n "0.9 " }
    

      EventScript { start = end } { echo -n "-26 " }
    

      EventScript { start = end } { echo -n "1 " }
    

      EventScript { start = end } { echo -n "1.1 " }
    

      EventScript { start = end } { echo -n "1.2 " }
    

      EventScript { start = end } { echo -n "1.3 " }
    

      EventScript { start = end } { echo -n "1.4 " }
    

      EventScript { start = end } { echo -n "1.5 " }
    

      EventScript { start = end } { echo -n "1.6 " }
    

      EventScript { start = end } { echo -n "1.7 " }
    

      EventScript { start = end } { echo -n "1.8 " }
    

      EventScript { start = end } { echo -n "1.9 " }
    

      EventScript { start = end } { echo -n "-25 " }
    

      EventScript { start = end } { echo -n "2 " }
    

      EventScript { start = end } { echo -n "2.1 " }
    

      EventScript { start = end } { echo -n "2.2 " }
    

      EventScript { start = end } { echo -n "2.3 " }
    

      EventScript { start = end } { echo -n "2.4 " }
    

      EventScript { start = end } { echo -n "2.5 " }
    

      EventScript { start = end } { echo -n "2.6 " }
    

      EventScript { start = end } { echo -n "2.7 " }
    

      EventScript { start = end } { echo -n "2.8 " }
    

      EventScript { start = end } { echo -n "2.9 " }
    

      EventScript { start = end } { echo -n "-24 " }
    

      EventScript { start = end } { echo -n "3 " }
    

      EventScript { start = end } { echo -n "3.1 " }
    

      EventScript { start = end } { echo -n "3.2 " }
    

      EventScript { start = end } { echo -n "3.3 " }
    

      EventScript { start = end } { echo -n "3.4 " }
    

      EventScript { start = end } { echo -n "3.5 " }
    

      EventScript { start = end } { echo -n "3.6 " }
    

      EventScript { start = end } { echo -n "3.7 " }
    

      EventScript { start = end } { echo -n "3.8 " }
    

      EventScript { start = end } { echo -n "3.9 " }
    

      EventScript { start = end } { echo -n "-23 " }
    

      EventScript { start = end } { echo -n "4 " }
    

      EventScript { start = end } { echo -n "4.1 " }
    

      EventScript { start = end } { echo -n "4.2 " }
    

      EventScript { start = end } { echo -n "4.3 " }
    

      EventScript { start = end } { echo -n "4.4 " }
    

      EventScript { start = end } { echo -n "4.5 " }
    

      EventScript { start = end } { echo -n "4.6 " }
    

      EventScript { start = end } { echo -n "4.7 " }
    

      EventScript { start = end } { echo -n "4.8 " }
    

      EventScript { start = end } { echo -n "4.9 " }
    

      EventScript { start = end } { echo -n "-22 " }
    

      EventScript { start = end } { echo -n "5 " }
    

      EventScript { start = end } { echo -n "6 " }
    

      EventScript { start = end } { echo -n "7 " }
    

      EventScript { start = end } { echo -n "8 " }
    

      EventScript { start = end } { echo -n "9 " }
    

      EventScript { start = end } { echo -n "10 " }
    

      EventScript { start = end } { echo -n "11 " }
    

      EventScript { start = end } { echo -n "12 " }
    

      EventScript { start = end } { echo -n "13 " }
    

      EventScript { start = end } { echo -n "14 " }
    

      EventScript { start = end } { echo -n "-21 " }
    

      EventScript { start = end } { echo -n "15 " }
    

      EventScript { start = end } { echo -n "16 " }
    

      EventScript { start = end } { echo -n "17 " }
    

      EventScript { start = end } { echo -n "18 " }
    

      EventScript { start = end } { echo -n "19 " }
    

      EventScript { start = end } { echo -n "20 " }
    

      EventScript { start = end } { echo -n "21 " }
    

      EventScript { start = end } { echo -n "22 " }
    

      EventScript { start = end } { echo -n "23 " }
    

      EventScript { start = end } { echo -n "24 " }
    

  • Coastally-trapped waves with adaptive refinement
  •   EventScript { start = end } { echo -n "-30 " }
    

      EventScript { start = end } { echo -n "-29 " }
    

      EventScript { start = end } { echo -n "-20 " }
    

      EventScript { start = end } { echo -n "25 " }
    

      EventScript { start = end } { echo -n "26 " }
    

      EventScript { start = end } { echo -n "27 " }
    

      EventScript { start = end } { echo -n "28 " }
    

      EventScript { start = end } { echo -n "29 " }
    

      EventScript { start = end } { echo -n "30 " }
    

      EventScript { start = end } { echo -n "-19 " }
    

      EventScript { start = end } { echo -n "-18 " }
    

      EventScript { start = end } { echo -n "-17 " }
    

      EventScript { start = end } { echo -n "-16 " }
    

      EventScript { start = end } { echo -n "-15 " }
    

      EventScript { start = end } { echo -n "-14 " }
    

      EventScript { start = end } { echo -n "-13 " }
    

      EventScript { start = end } { echo -n "-12 " }
    

      EventScript { start = end } { echo -n "-11 " }
    

      EventScript { start = end } { echo -n "-28 " }
    

      EventScript { start = end } { echo -n "-10 " }
    

      EventScript { start = end } { echo -n "-9 " }
    

      EventScript { start = end } { echo -n "-8 " }
    

      EventScript { start = end } { echo -n "-7 " }
    

      EventScript { start = end } { echo -n "-6 " }
    

      EventScript { start = end } { echo -n "-5 " }
    

      EventScript { start = end } { echo -n "-4 " }
    

      EventScript { start = end } { echo -n "-3 " }
    

      EventScript { start = end } { echo -n "-2 " }
    

      EventScript { start = end } { echo -n "-1 " }
    

      EventScript { start = end } { echo -n "-27 " }
    

      EventScript { start = end } { echo -n "0 " }
    

      EventScript { start = end } { echo -n "0.1 " }
    

      EventScript { start = end } { echo -n "0.2 " }
    

      EventScript { start = end } { echo -n "0.3 " }
    

      EventScript { start = end } { echo -n "0.4 " }
    

      EventScript { start = end } { echo -n "0.5 " }
    

      EventScript { start = end } { echo -n "0.6 " }
    

      EventScript { start = end } { echo -n "0.7 " }
    

      EventScript { start = end } { echo -n "0.8 " }
    

      EventScript { start = end } { echo -n "0.9 " }
    

      EventScript { start = end } { echo -n "-26 " }
    

      EventScript { start = end } { echo -n "1 " }
    

      EventScript { start = end } { echo -n "1.1 " }
    

      EventScript { start = end } { echo -n "1.2 " }
    

      EventScript { start = end } { echo -n "1.3 " }
    

      EventScript { start = end } { echo -n "1.4 " }
    

      EventScript { start = end } { echo -n "1.5 " }
    

      EventScript { start = end } { echo -n "1.6 " }
    

      EventScript { start = end } { echo -n "1.7 " }
    

      EventScript { start = end } { echo -n "1.8 " }
    

      EventScript { start = end } { echo -n "1.9 " }
    

      EventScript { start = end } { echo -n "-25 " }
    

      EventScript { start = end } { echo -n "2 " }
    

      EventScript { start = end } { echo -n "2.1 " }
    

      EventScript { start = end } { echo -n "2.2 " }
    

      EventScript { start = end } { echo -n "2.3 " }
    

      EventScript { start = end } { echo -n "2.4 " }
    

      EventScript { start = end } { echo -n "2.5 " }
    

      EventScript { start = end } { echo -n "2.6 " }
    

      EventScript { start = end } { echo -n "2.7 " }
    

      EventScript { start = end } { echo -n "2.8 " }
    

      EventScript { start = end } { echo -n "2.9 " }
    

      EventScript { start = end } { echo -n "-24 " }
    

      EventScript { start = end } { echo -n "3 " }
    

      EventScript { start = end } { echo -n "3.1 " }
    

      EventScript { start = end } { echo -n "3.2 " }
    

      EventScript { start = end } { echo -n "3.3 " }
    

      EventScript { start = end } { echo -n "3.4 " }
    

      EventScript { start = end } { echo -n "3.5 " }
    

      EventScript { start = end } { echo -n "3.6 " }
    

      EventScript { start = end } { echo -n "3.7 " }
    

      EventScript { start = end } { echo -n "3.8 " }
    

      EventScript { start = end } { echo -n "3.9 " }
    

      EventScript { start = end } { echo -n "-23 " }
    

      EventScript { start = end } { echo -n "4 " }
    

      EventScript { start = end } { echo -n "4.1 " }
    

      EventScript { start = end } { echo -n "4.2 " }
    

      EventScript { start = end } { echo -n "4.3 " }
    

      EventScript { start = end } { echo -n "4.4 " }
    

      EventScript { start = end } { echo -n "4.5 " }
    

      EventScript { start = end } { echo -n "4.6 " }
    

      EventScript { start = end } { echo -n "4.7 " }
    

      EventScript { start = end } { echo -n "4.8 " }
    

      EventScript { start = end } { echo -n "4.9 " }
    

      EventScript { start = end } { echo -n "-22 " }
    

      EventScript { start = end } { echo -n "5 " }
    

      EventScript { start = end } { echo -n "6 " }
    

      EventScript { start = end } { echo -n "7 " }
    

      EventScript { start = end } { echo -n "8 " }
    

      EventScript { start = end } { echo -n "9 " }
    

      EventScript { start = end } { echo -n "10 " }
    

      EventScript { start = end } { echo -n "11 " }
    

      EventScript { start = end } { echo -n "12 " }
    

      EventScript { start = end } { echo -n "13 " }
    

      EventScript { start = end } { echo -n "14 " }
    

      EventScript { start = end } { echo -n "-21 " }
    

      EventScript { start = end } { echo -n "15 " }
    

      EventScript { start = end } { echo -n "16 " }
    

      EventScript { start = end } { echo -n "17 " }
    

      EventScript { start = end } { echo -n "18 " }
    

      EventScript { start = end } { echo -n "19 " }
    

      EventScript { start = end } { echo -n "20 " }
    

      EventScript { start = end } { echo -n "21 " }
    

      EventScript { start = end } { echo -n "22 " }
    

      EventScript { start = end } { echo -n "23 " }
    

      EventScript { start = end } { echo -n "24 " }
    

  • Gravity waves in a realistic ocean basin
  •     EventScript { start = end } {
            gnuplot <<EOF
                set term postscript eps color lw 3 solid 20
                set output 'k.eps'
                set xlabel 'Time'
                set ylabel 'Kinetic energy'
                set grid
                plot 'k' u 3:5 w l t ''
    EOF
            if awk '{if ($5 > 6e-12) exit (1);}' < k ; then
                return 0;
            else
                return $GFS_STOP;
            fi
        }
    

  • Lake-at-rest balance in an inclined domain with cut cells
  •     EventScript { start = end } {
    	status=0
    	if awk '{if ($9 > 1e-5) { print "u: " $9 > "/dev/stderr"; exit (1); }}' < u ; then :
            else
                status=$GFS_STOP;
            fi
    	if awk '{if ($9 > 4e-3) { print "ep: " $9 > "/dev/stderr"; exit (1); }}' < ep ; then :
            else
                status=$GFS_STOP;
            fi
    	exit $status
        }
    }
    GfsBox {
        left = Boundary
        right = Boundary
        top = Boundary
        bottom = Boundary
    }
    

  • Lake-at-rest balance in an inclined domain with bipolar metric
  •     EventScript { start = end } {
    	status=0
    	if gnuplot <<EOF; then :
            set term postscript eps lw 2 solid color
            set output 'still.eps'
            unset key
            unset logscale
            unset border
            unset xtics
            unset ytics
            unset xlabel
            unset ylabel
            set size ratio -1
            plot 'mesh.gnu' w l lc 0, 'p.gnu' w l lc 1
    EOF
    	else
    	    status=$GFS_STOP;
    	fi
    	if awk '{if ($9 > 8e-7) { print "u: " $9 > "/dev/stderr"; exit (1); }}' < u ; then :
            else
                status=$GFS_STOP;
            fi
    	if awk '{if ($9 > 3e-4) { print "ep: " $9 > "/dev/stderr"; exit (1); }}' < ep ; then :
            else
                status=$GFS_STOP;
            fi
    	exit $status
        }
    }
    GfsBox {
        left = Boundary
        right = Boundary
    }
    GfsBox {
        left = Boundary
        right = Boundary
    }
    GfsBox {
        left = Boundary
        right = Boundary
    }
    GfsBox {
        left = Boundary
        right = Boundary
    }
    GfsBox {
        left = Boundary
        right = Boundary
    }
    GfsBox {
        left = Boundary
        right = Boundary
    }
    GfsBox {
        left = Boundary
        right = Boundary
    }
    GfsBox {
        left = Boundary
        right = Boundary
    }
    1 2 top
    2 3 top
    3 4 top
    4 5 top
    5 6 top
    6 7 top
    7 8 top
    8 1 top
    

  • Circular dam break on a sphere
  •     EventScript { start = end } {
    	status=0
    	for i in 0.3 0.6 0.9; do
    	    if awk 'BEGIN { n1 = 0; pi = 3.14159265359 }{
                  if ($1 != "#") {
                    c = cos($1*pi/180.)*cos($2*pi/180.);
                    d = atan2(sqrt(1. - c*c),c)*180./pi
                    i = int(d*2.)
                    x[i] += d
                    y[i] += $6
                    n[i]++
                    x1[n1] = d;
                    y1[n1++] = $6;
                  }
                }END {
                  for (i = 0; i <= 180; i++)
                    if (n[i] > 0)
                      print x[i]/n[i], y[i]/n[i], n[i];
                  sum = 0.;
                  for (i = 0; i < n1; i++) {
                    j = int(x1[i]*2.)
                    d = y1[i] - y[j]/n[j];
                    sum += d*d;
                  }
                  scatter = sqrt(sum/n1);
                  if (scatter > 0.013) {
                    print scatter > "/dev/stderr";
                    exit (1);
                  }
                }' < sim-$i.txt > prof-$i.txt ; then :
    	    else
    		status=$GFS_STOP;
    	    fi
    
    	    cat <<EOF | gnuplot
    rdist(x,y)=acos(cos(x*pi/180.)*cos(y*pi/180.))*180./pi
    cdist(x,y)=sqrt(x*x+y*y)
    set xlabel 'Angular distance (degree)'
    set ylabel 'Surface height'
    set xtics 0,22.5,90
    set ytics 0,0.25,0.75
    set term postscript eps color lw 2 solid 20
    set output 'p-$i.eps'
    plot [0:90][0:0.75]'sim-$i.txt' u (rdist(\$1,\$2)):6 ps 0.25 pt 6 t '', 'prof-$i.txt' w l lw 2 t ''
    EOF
    
    	done
    	exit $status
        }
    

  • Circular dam break on a ``cubed sphere''
  •     EventScript { start = end } {
    	status=0
    	for i in 0.3 0.6 0.9 1.2 1.5; do
    	    if awk 'BEGIN { n1 = 0; pi = 3.14159265359 }{
                  if ($1 != "#") {
                    c = cos($1*pi/180.)*cos($2*pi/180.);
                    d = atan2(sqrt(1. - c*c),c)*180./pi
                    i = int(d*2.)
                    x[i] += d
                    y[i] += $6
                    n[i]++
                    x1[n1] = d;
                    y1[n1++] = $6;
                  }
                }END {
                  for (i = 0; i <= 180; i++)
                    if (n[i] > 0)
                      print x[i]/n[i], y[i]/n[i], n[i];
                  sum = 0.;
                  for (i = 0; i < n1; i++) {
                    j = int(x1[i]*2.)
                    d = y1[i] - y[j]/n[j];
                    sum += d*d;
                  }
                  scatter = sqrt(sum/n1);
                  if (scatter > 0.015) {
                    print scatter > "/dev/stderr";
                    exit (1);
                  }
                }' < sim-$i.txt > prof-$i.txt ; then :
    	    else
    		status=$GFS_STOP;
    	    fi
    
    	    gnuplot <<EOF
    set term postscript eps color lw 1 18
    set output 'isolines-$i.eps'
    set size ratio -1
    set xtics -90,30,90
    set ytics -90,30,90
    unset key
    plot [-90:90][-90:90]'isolines-$i.gnu' w l
    
    set term postscript eps color lw 2 solid 20
    set output 'p-$i.eps'
    rdist(x,y)=acos(cos(x*pi/180.)*cos(y*pi/180.))*180./pi
    cdist(x,y)=sqrt(x*x+y*y)
    set xlabel 'Angular distance (degree)'
    set ylabel 'Surface height'
    set xtics 0,22.5,90
    set ytics 0,0.25,0.75
    plot [0:90][0:0.75]'sim-$i.txt' u (rdist(\$1,\$2)):6 ps 0.25 pt 6 t '', 'prof-$i.txt' w l lw 2 t ''
    EOF
    
    	done
    	exit $status
        }
    

  • Advection of a cosine bell around the sphere
  •   EventScript { start = end } {
          ( cat isolines.gfv
            echo "Save isolines.gnu { format = Gnuplot }"
            echo "Clear"
            cat reference.gfv
            echo "Save reference.gnu { format = Gnuplot }"
    	echo "Clear"
            cat zero.gfv
            echo "Save zero.gnu { format = Gnuplot }"
          ) | gfsview-batch2D end-LEVEL-ALPHA.gfs
          cat <<EOF | gnuplot
            set term postscript eps lw 2 18 color
            set output 'isolines-LEVEL-ALPHA.eps'
            set size ratio -1
            set xlabel 'Longitude'
            set ylabel 'Latitude'
            unset key
            plot [60:120][-30:30]'isolines.gnu' w l, 'reference.gnu' w l, 'zero.gnu' w l
    EOF
          fixbb isolines-LEVEL-ALPHA.eps
          rm -f isolines.gnu reference.gnu zero.gnu
    
          # check mass conservation
          if awk '
            BEGIN { min = 1000.; max = -1000.; }{ 
              if ($5 < min) min = $5; 
              if ($5 > max) max = $5; 
            }
            END {
              if (max - min != 0.)
                exit (1);
            }' < t-LEVEL-ALPHA; then
    	  exit 0
          else
    	  exit $GFS_STOP
          fi
      }
    

  • Poisson equation on a sphere with Gaussian forcing
  •   EventScript { start = end } {
          gnuplot <<EOF
          set term pos enhanced eps color solid 20 lw 3 
          set out 'profile.eps'
    
          set key bottom right
          set xl "Latitude"
          set yl "{/Symbol F}"
          set xr [-90:90]
    
          plot './prof.dat' u 3:5 every 5 ps 2 t "Gerris",\
               'prof.ref'u 1:2 w l t "(Boyd and Zhou, 2009)"
    EOF
      }
    

  • Gaussian forcing using longitude-latitude coordinates
  •   EventScript { start = end } {
          gnuplot <<EOF
          set term pos enhanced eps color solid 20 lw 3 
          set out 'profile.eps'
    
          set key bottom right
          set xl "Latitude"
          set yl "{/Symbol F}"
          set xr [-90:90]
    
          plot './prof.dat' u 3:(\$5-0.0078011) every 5 ps 2 t "Gerris",\
               'prof.ref'u 1:2 w l t "(Boyd and Zhou, 2009)"
    EOF
      }
    

  • Dielectric-dieletric planar balance
  •     EventScript { start = end } { 
           if awk '{
                  deltap = ($11 - $5) - 0.75
                  if (deltap < 0.)
                    deltap = - deltap;
                  if (deltap > 5e-8) { 
                    print "deltap:", deltap > "/dev/stderr"; 
                    exit (1); 
                  }
                }' < p &&
              awk '{
                  deltap = ($11 - $5) - 1.
                  if (deltap < 0.)
                    deltap = - deltap;
                  if (deltap > 0.) { 
                    print "deltaey:", deltap > "/dev/stderr"; 
                    exit (1); 
                  }
                }' < ey &&
              awk '{
                  if ($9 > 3.) { 
                    print "vmax:", $9 > "/dev/stderr"; 
                    exit (1); 
                  }
                }' < v; then
                exit 0;
            else
                exit $GFS_STOP;
            fi
        }
    

  • Balance with solid boundaries
  •     EventScript { start = end } { 
           if awk '{
                  deltap = ($11 - $5) - 3./(1.1*1.1)
                  if (deltap < 0.)
                    deltap = - deltap;
                  if (deltap > 4e-4) { 
                    print "deltap:", deltap > "/dev/stderr"; 
                    exit (1); 
                  }
                }' < p &&
              awk '{
                  deltap = ($11 - $5) - 2./1.1
                  if (deltap < 0.)
                    deltap = - deltap;
                  if (deltap > 3e-4) { 
                    print "deltaey:", deltap > "/dev/stderr"; 
                    exit (1); 
                  }
                }' < ey &&
              awk '{
                  if ($9 > 10.) { 
                    print "vmax:", $9 > "/dev/stderr"; 
                    exit (1); 
                  }
                }' < v; then
                exit 0;
            else
                exit $GFS_STOP;
            fi
        }
    

Personal tools
communication