-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathholland_model.py
221 lines (157 loc) · 8.03 KB
/
holland_model.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# -*- coding: utf-8 -*-
"""
This script is part of Bloemendaal et al, Estimation of global tropical cyclone wind probabilities using the STORM dataset (in review)
The script has been developed by Nadia Bloemendaal, Job Dullaart and Sanne Muis.
This script contains all the formulas necessary for the generation of the Holland model. The methodology is heavily inspired by
Lin, N., and Chavas, D. ( 2012), On hurricane parametric wind and applications in storm surge modeling,
J. Geophys. Res., 117, D09120, doi:10.1029/2011JD017126.
The TC tracks are taken from the STORM model, see
Bloemendaal, N., Haigh, I.D., de Moel, H. et al.
Generation of a global synthetic tropical cyclone hazard dataset using STORM.
Sci Data 7, 40 (2020). https://doi.org/10.1038/s41597-020-0381-2
Copyright (C) 2020 Nadia Bloemendaal. All versions released under the GNU General Public License v3.0
"""
import numpy as np
from math import radians,cos,sin,asin,sqrt,degrees
def Generate_Spyderweb_mesh(n_cols,n_rows,tc_radius,lat0):
"""
Generate a polar grid, the spyderweb mesh, which serves as a 2D-representation of the wind and pressure fields
Arguments:
*n_cols* : Number of columns, representing the number of gridpoints in angular direction ("pie slices")
*n_rows* : Number of rows, representing the number of gridpoints in radial direction ("radius slices")
*tc_radius*: Tropical cyclone radius, in km.
Returns:
*rlist* : radius from center, in km(in a list)
*thetalist* : angle, 0 deg = EAST (in a list)
*xlist* : The corresponding zonal distance (in km) of the (r,theta)-coordinate (in a list)
*ylist* : The corresponding meridional distance (in km) of the (r,theta)-coordinate (in a list)
"""
#Generate a meshgrid of the distance from the center and the angle
rlist,thetalist=np.meshgrid(np.linspace(1,tc_radius,n_rows),np.linspace(0,2.*np.pi,n_cols))
if lat0<0.:
thetalist=thetalist-radians(180)
thetalist[thetalist<0]+=radians(360)
#Compute the corresponding size of the vector as a x- and y component
xlist=rlist*np.cos(thetalist)
ylist=rlist*np.sin(thetalist)
return rlist,thetalist,xlist,ylist
def Generate_Spyderweb_lonlat_coordinates(xlist,ylist,lat1,lon1):
"""
Generate a grid of longitude/latitude coordinates corresponding to the spyderweb grid.
Arguments:
*xlist* : The zonal distance (in km) from the eye of the tropical cyclone (in a list)
*ylist* : The meridional distance (in km) from the eye of the tropical cyclone (in a list)
*lat1* : Latitude position of the eye
*lon1* : Longitude position of the eye
Returns:
*latlist* : List of latitude points of the spyderweb grid
*lonlist* : List of longitude points of the spyderweb grid
"""
radius=6371.
latlist=lat1+(xlist/radius)*(180./np.pi)
lonlist=lon1+(ylist/radius)*(180/np.pi)/cos(lat1*np.pi/180.)
return latlist,lonlist
def Calculate_translation_speed(lon_0,lat_0,lon_1,lat_1,dt):
"""
Calculate translation speed (forward speed) of a tropical cyclone using a haversine function
Arguments:
*lon0* : Longitude-coordinate of tropical cyclone eye at time step t (in radians)
*lat0* : Latitude-coordinate of tropical cyclone eye at time step t (in radians)
*lon1* : Longitude-coordinate of tropical cyclone eye at time step t+1 (in radians)
*lat1* : Latitude-coordinate of tropical cyclone eye at time step t+1 (in radians)
*dt*: Size of time step between t and t+1, in seconds
Returns:
*translation_speed* : Translation speed (forward speed) in m/s
"""
dlon=abs(lon_0-lon_1)
dlat=abs(lat_0-lat_1)
a=sin(dlat/2.)**2.+cos(lat_0)*cos(lat_1)*sin(dlon/2.)**2.
c=2.*asin(sqrt(a)) #fraction of the radius
radius=6371000. #radius of the Earth in m
distance=c*radius
translation_speed=distance/dt
return translation_speed
def Compute_background_flow(lon0,lat0,lon1,lat1,dt):
"""
Compute the background flow of the tropical cyclone
Arguments:
*lon0* : Longitude-coordinate of tropical cyclone eye at time step t-1 (ranging between 0-360 deg, in deg)
*lat0* : Latitude-coordinate of tropical cyclone eye at time step t-1 (in deg)
*lon1* : Longitude-coordinate of tropical cyclone eye at time step t (ranging between 0-360 deg, in deg)
*lat1* : Latitude-coordinate of tropical cyclone eye at time step t (in deg)
*dt*: Size of time step between t and t+1, in seconds
Returns:
*bg* : background flow (=translation speed), in m/s
*ubg* : u-component of background flow (zonal), in m/s
*vbg* : v-component of background flow (meridional), in m/s
"""
#convert lons and lats to radians
lon_0,lat_0,lon_1,lat_1=map(radians,[lon0,lat0,lon1,lat1])
#Calculate the bearing between the two points.
#For details, see http://www.igismap.com/formula-to-find-bearing-or-heading-angle-between-two-points-latitude-longitude/
X=cos(lat_1)*sin(lon_1-lon_0)
Y=cos(lat_0)*sin(lat_1)-sin(lat_0)*cos(lat_1)*cos(lon_1-lon_0)
bearing=np.arctan2(Y,X)
bearing=degrees(bearing)
#Convert the projection so that 0 deg = North (instead of East)
h=450-bearing
if h>360:
h=h-360
h=radians(h)
#Finally, compute the background flow (=translation speed), and the u- and v-components of this flow
bg=Calculate_translation_speed(lon_0,lat_0,lon_1,lat_1,dt)
ubg=bg*sin(h)
vbg=bg*cos(h)
return bg,ubg,vbg
def Holland_model(lat1,P,Usurf,Rmax,r):
"""
Compute the 2D-wind field of a tropical cyclone at a time step using the Holland (1980) model.
Arguments:
*lat1* : Latitudinal position of the eye of the tropical cyclone at time step t (in deg)
*P* : Minimum central pressure in the eye of the tropical cyclone (in hPa)
*Usurf* : Maximum surface wind speed, minus the background flow, at time step t (in m/s)
*Rmax* : Radius to maximum winds (radius of the eye of the tropical cyclone) at time step t
*r* : Radius "slice" from the center (calculated previously) in km.
Returns:
*Vs* : Symmetrical surface wind speed at radius r (m/s)
*Ps* : Symmetrical pressure at radius r (m/s)
"""
Rmax0=Rmax*1000. #convert from km to m
r=r*1000. #convert from km to m
Patm=101325. #ambient pressure (in Pa)
rho=1.15
omega=7.292*10.**-5. #in rad/s, rotation rate of the Earth
f=abs(2.*omega*sin(radians(lat1))) #Coriolis parameter
P=P*100. #convert from hPa (mb) to Pa
vv=(Usurf+f*Rmax0/2.)**2.-f**2.*Rmax0**2./4.
if P>=Patm or vv<=0:
print(P,Usurf,vv)
P=Patm
Ps=P
Vs=0
else:
B=vv*np.exp(1)*rho/(Patm-P)
Ps=P+(Patm-P)*np.exp(-(Rmax0/r)**B)
Vs=sqrt((Rmax0/r)**B*B*(Patm-P)/rho*np.exp(-(Rmax0/r)**B)+r**2.*f**2/4.)-f*r/2.
return Vs,Ps
def Inflowangle(r,Rmax,lat0):
"""
Calculate the inflow angle, used for the asymmetry in the wind field.
Arguments:
*r* : Distance from the eye (km)
*Rmax* : Radius to maximum winds (km)
*lat0*: Latitude
Returns:
*beta* : Inflow angle at distance r from the eye (in radians)
"""
if r<Rmax:
beta=10.*(r/Rmax)
elif r>= Rmax and r<1.2*Rmax:
beta=10.+75.*((r/Rmax)-1.0)
else:
beta=25.
if lat0>0.:
beta=radians(90-beta)
else:
beta=radians(-90+beta)
return beta