1 0 GfsWave GfsBox GfsGEdge {} {
Refine 4
Time { end = 48 }
PhysicalParams { L = 3328 }
Global {
static double gaussian (double f, double fmean, double fsigma) {
return exp (-((f - fmean)*(f - fmean))/(fsigma*fsigma));
}
static double costheta (double theta, double thetam, double thetapower) {
double a = cos (theta - thetam);
return a > 0. ? pow (a, thetapower) : 0.;
}
static double holland(double r, double Rmax, double Vmax) {
if (r < Rmax/1e3) return 0.;
return Vmax*pow(Rmax/r, 2)*exp(2.*(1. - Rmax/r));
}
double ut = 555./24.;
static double xc (double t) {
return 0.;
}
static double yc (double t) {
return 1110. - ut*t;
}
static double vmax (double t) {
return 50.*(t < 25. ? t/25. : 1.);
}
static double ur (double x, double y, double t) {
x -= xc (t);
y -= yc (t);
double r = sqrt (x*x + y*y);
return holland (r, 100., vmax (t))*y/r;
}
static double vr (double x, double y, double t) {
x -= xc (t);
y -= yc (t);
double r = sqrt (x*x + y*y);
return - holland (r, 100., vmax (t))*x/r;
}
}
GModule wavewatch
Init { istep = 1 } {
U10 = ur(x, y, t)
V10 = vr(x, y, t)
}
AdaptError { istep = 1 } { cmax = 0.1 minlevel = 4 maxlevel = LEVEL c = Hse } Hs
AdaptError { istep = 1 } {
cmax = 0.2 minlevel = 4 maxlevel = LEVEL c = Ve
} sqrt(U10*U10 + V10*V10)
OutputTime { istep = 1 } stderr
OutputBalance { istep = 1 } stderr
OutputTiming { istep = 100 } stderr
OutputScalarStats { step = 0.25 } hs { v = Hs }
OutputScalarStats { step = 0.25 } vr { v = sqrt(U10*U10 + V10*V10) }
OutputSimulation { istep = 10 } stdout
OutputSimulation { step = 4 } sim-%g.gfs
EventScript { step = 4 } { gzip -f sim-*.gfs }
OutputPPM { istep = 1 } { ppm2mpeg > hs.mpg } { v = Hs maxlevel = 9 }
OutputPPM { istep = 1 } { ppm2mpeg > level.mpg } { v = Level min = 4 max = LEVEL maxlevel = 9 }
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
}
} {
alpha_s = ALPHA
}
GfsBox {}