Define M2F (2.*M_PI/44700.)
Define M2(t) (A_amp*cos (M2F*t)+B_amp*sin (M2F*t))
1 0 GfsOcean GfsBox GfsGEdge {} {
Time { dtmax = 100. }
PhysicalParams { L = 500e3 }
GModule map
MapProjection { lon = 174 lat = -40.8 angle = 40 }
Refine 6
ApproxProjectionParams { tolerance = 1e-6 nitermax = 10 }
Init {} {
A_amp = AM2.gts
B_amp = BM2.gts
}
Solid bath.gts
RefineSurface 10 bath.gts { twod = 1 }
PhysicalParams { g = 9.81 }
SourceCoriolis -1e-4
Init { istep = 1 } {
U = U/(1. + dt*Velocity*4e-4/H)
V = V/(1. + dt*Velocity*4e-4/H)
}
EventHarmonic { start = 100000 istep = 10 } P A B Z EP M2F
EventHarmonic { start = 100000 istep = 10 } U AU BU ZU EU M2F
EventHarmonic { start = 100000 istep = 10 } V AV BV ZV EV M2F
EventStop { start = 100000 istep = 100 } A0 0.025
OutputTime { istep = 1 } stderr
OutputProjectionStats { istep = 1 } stderr
OutputSimulation { istep = 20 } stdout { solid = 0 }
OutputSimulation { start = end } end.gfs
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
}
OutputScalarNorm { istep = 1 } p { v = P }
OutputScalarNorm { istep = 1 } u { v = Velocity }
OutputScalarNorm { istep = 10 } a0 { v = sqrt(A0*A0 + B0*B0) }
}
GfsBox {
left = Boundary {
BcFlather U 0 H P M2(t)
}
right = Boundary {
BcFlather U 0 H P M2(t)
}
top = Boundary {
BcFlather V 0 H P M2(t)
}
bottom = Boundary {
BcFlather V 0 H P M2(t)
}
front = Boundary
}