1 0 GfsOcean GfsBox GfsGEdge {} {
  Time { iend = 1580 dtmax = 1000 }
  Refine 6
  Global {
      #define L0 1000e3
      #define H0 1000
      #define G 0.01
      #define R0 100e3
      #define ETA0 599.5
      #define F0 1.0285e-4
  }
  PhysicalParams { L = L0 g = G }
  Solid (z + H0)
  Init {} {
    # e-folding radius = 100 km
    # umax = 0.5 m/s = sqrt(200)*exp(-1/2)
    P = ETA0*exp (-(x*x + y*y)/(R0*R0))*G
    U = 2.*G*ETA0*y/(F0*R0*R0)*exp (-(x*x + y*y)/(R0*R0))
    V = - 2.*G*ETA0*x/(F0*R0*R0)*exp (-(x*x + y*y)/(R0*R0))
  }
  SourceCoriolis F0
 
  AdvectionParams { scheme = none }
  ApproxProjectionParams { tolerance = 1e-6 }

  OutputErrorNorm { istep = 1 } { 
      awk '{print $3/86400. " " $9; fflush (stdout); }' > e
  } { v = P/G } {
    s = ETA0*exp (-(x*x + y*y)/(R0*R0))
    unbiased = 1
    v = E
  }
  GModule gfsview
  OutputView {  istart = 100 iend = 500 istep = 100 } error-%ld.eps { format = EPS } geo.gfv
  OutputView {  istart = 1500 } error-%ld.eps { format = EPS } geo.gfv
  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
  }
}
GfsBox {
  front = Boundary
}