You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/landsea/landsea.jl
+189Lines changed: 189 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -195,6 +195,195 @@ function saveLandSea(
195
195
196
196
end
197
197
198
+
function getLandSea(
199
+
efol ::AbstractString,
200
+
ereg ::ERA5Region= ERA5Region(GeoRegion("GLB"));
201
+
returnlsd =true,
202
+
FT = Float32
203
+
)
204
+
205
+
lsmfnc = joinpath(efol,"emask-$(ereg.gstr).nc")
206
+
207
+
if!isfile(lsmfnc)
208
+
209
+
@info "$(modulelog()) - The ERA5 Land-Sea mask dataset for the \"$(ereg.geoID)\" ERA5Region is not available, extracting from Global ERA5 Land-Sea mask dataset ..."
@info "$(modulelog()) - The Global ERA5 Land-Sea mask dataset for the \"$(ereg.geoID)\" ERA5Region is not available, downloading from the Climate Data Store ..."
214
+
downloadLandSea(efol,ereg)
215
+
end
216
+
217
+
gds = NCDataset(glbfnc)
218
+
glon = gds["longitude"][:]
219
+
glat = gds["latitude"][:]
220
+
glsm = gds["lsm"][:] *1
221
+
goro = gds["z"][:] *1
222
+
close(gds)
223
+
224
+
rinfo = ERA5RegionGrid(ereg,glon,glat)
225
+
ilon = rinfo.ilon; nlon = length(rinfo.ilon)
226
+
ilat = rinfo.ilat; nlat = length(rinfo.ilat)
227
+
rlsm = zeros(nlon,nlat)
228
+
roro = zeros(nlon,nlat)
229
+
230
+
if typeof(rinfo) <:PolyGrid
231
+
mask = rinfo.mask; mask[isnan.(mask)] .=0
232
+
else; mask = ones(Int16,nlon,nlat)
233
+
end
234
+
235
+
@info "$(modulelog()) - Extracting regional ERA5 Land-Sea mask for the \"$(ereg.geoID)\" ERA5Region from the Global ERA5 Land-Sea mask dataset ..."
0 commit comments