0
|
1 |
#======================================================================
|
|
2 |
# L I B T I D E S . P L
|
|
3 |
# doc: Thu Aug 24 21:37:14 2006
|
|
4 |
# dlm: Thu Apr 26 10:22:53 2012
|
|
5 |
# (c) 2006 A.M. Thurnherr
|
|
6 |
# uE-Info: 17 0 NIL 0 0 72 2 2 4 NIL ofnI
|
|
7 |
#======================================================================
|
|
8 |
|
|
9 |
# tidal calculations
|
|
10 |
|
|
11 |
# HISTORY:
|
|
12 |
# Aug 24, 2006: - created during GRAVILUCK
|
|
13 |
# Jan 22, 2008: - renamed M2() to M2_bias()
|
|
14 |
# - added M2_phase()
|
|
15 |
# Apr 26, 2012: - added K1 & M2 tidal frequencies
|
|
16 |
|
|
17 |
#----------------------------------------------------------------------
|
|
18 |
# tidal frequencies
|
|
19 |
# - taken from thesis Makefile
|
|
20 |
# - according to my memory, the values are from Apel's book
|
|
21 |
#----------------------------------------------------------------------
|
|
22 |
|
|
23 |
$M2 = 24/1.9322;
|
|
24 |
$K1 = 24/1.0027;
|
|
25 |
|
|
26 |
#----------------------------------------------------------------------
|
|
27 |
# given t0, a decimal day at the beginning of "flood", return a scale
|
|
28 |
# between -1 and 1 that can be multiplied with the max tidal flow amplitude
|
|
29 |
# to estimate tidal velocity at time t.
|
|
30 |
#----------------------------------------------------------------------
|
|
31 |
|
|
32 |
sub M2_bias(@)
|
|
33 |
{
|
|
34 |
my($t0,$t) = &antsFunUsage(2,'ff','time-origin, time',@_);
|
|
35 |
return sin(2*3.14159265358979 * ($t-$t0) / ($M2/24));
|
|
36 |
}
|
|
37 |
|
|
38 |
sub M2_phase(@)
|
|
39 |
{
|
|
40 |
my($t0,$t) = &antsFunUsage(2,'ff','time-origin, time',@_);
|
|
41 |
return round(360 * frac(($t-$t0) / ($M2/24)));
|
|
42 |
}
|
|
43 |
|
|
44 |
1;
|