Skip to content

Commit 65084e9

Browse files
committed
Flush the logging
1 parent f5db8b5 commit 65084e9

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ETOPO"
22
uuid = "eb8fb1ab-fde0-4497-ad36-194d38f2cde7"
33
authors = ["Nathanael Wong <natgeo.wong@outlook.com> and contributors"]
4-
version = "0.1.0"
4+
version = "0.1.1"
55

66
[deps]
77
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"

src/get.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@ function getLandSea(
4747
if !isfile(lsmfnc)
4848

4949
@info "$(modulelog()) - The ETOPO $(uppercase(type)) Relief dataset for the \"$(geo.ID)\" GeoRegion is not available, extracting from Global ETOPO $(uppercase(type)) Relief dataset ..."
50+
flush(stderr)
5051

5152
area = (geo.E-geo.W)/360 * (geo.N-geo.S)/180
5253
if area > 0.1 * (resolution/60)^2
5354
@info "$(modulelog()) - The total specified area covers more than $(10 * (resolution/60)^2)% of global points, set `downloadglb = true` ..."
55+
flush(stderr)
5456
downloadglb = true
5557
end
5658
glbfnc = joinpath(etd.path,"etopo-$(type)-GLB_$(resolution)arcsec.nc")
@@ -59,8 +61,10 @@ function getLandSea(
5961

6062
if isfile(glbfnc)
6163
@info "$(modulelog()) - The Global ETOPO $(uppercase(type)) Relief dataset has already been downloaded, now using it for extraction ..."
64+
flush(stderr)
6265
else
6366
@info "$(modulelog()) - Downloading the Global ETOPO $(uppercase(type)) Relief dataset ..."
67+
flush(stderr)
6468
setup(type,etd.path,resolution)
6569
end
6670

@@ -75,6 +79,7 @@ function getLandSea(
7579
nlat = length(ggrd.ilat)
7680

7781
@info "$(modulelog()) - Extracting regional ETOPO $(uppercase(type)) Relief data for the \"$(geo.ID)\" GeoRegion from the Global ETOPO Relief dataset ..."
82+
flush(stderr)
7883

7984
roro = extract(goro,ggrd)
8085
rlsm = deepcopy(roro)
@@ -83,12 +88,14 @@ function getLandSea(
8388
rlsm[isnan.(roro)] .= NaN
8489

8590
@info "$(modulelog()) - Saving the regional ETOPO Relief data for \"$(geo.ID)\" GeoRegion ..."
91+
flush(stderr)
8692

8793
save(geo,ggrd.lon,ggrd.lat,rlsm,roro,etd.path,type,resolution)
8894

8995
else
9096

9197
@info "$(modulelog()) - Opening global ETOPO Relief dataset directly from OPeNDAP servers ..."
98+
flush(stderr)
9299

93100
etopods = NCDataset(joinpath(
94101
"https://www.ngdc.noaa.gov/thredds/dodsC/global/ETOPO2022","$(resolution)s",
@@ -123,6 +130,7 @@ function getLandSea(
123130
end
124131

125132
@info "$(modulelog()) - Extracting regional ETOPO Relief data for the \"$(geo.ID)\" GeoRegion from the Global ETOPO Relief dataset ..."
133+
flush(stderr)
126134

127135
if !shift
128136
NCDatasets.load!(etopods["z"].var,roro,ilon,ilat)
@@ -144,6 +152,7 @@ function getLandSea(
144152
rlsm[isnan.(roro)] .= NaN
145153

146154
@info "$(modulelog()) - Saving the regional ETOPO Relief data for \"$(geo.ID)\" GeoRegion ..."
155+
flush(stderr)
147156

148157
save(geo,ggrd.lon,ggrd.lat,rlsm,roro,etd.path,type,resolution)
149158

@@ -159,6 +168,7 @@ function getLandSea(
159168
close(lds)
160169

161170
@info "$(modulelog()) - Retrieving the regional ETOPO $(uppercase(type)) Land-Sea mask for the \"$(geo.ID)\" GeoRegion ..."
171+
flush(stderr)
162172

163173
return LandSeaTopo{FT,FT}(lon,lat,lsm,oro)
164174

@@ -234,6 +244,7 @@ function setup(
234244
)
235245

236246
@info "$(modulelog()) - The Global ETOPO $(uppercase(type)) Land-Sea mask dataset is not available, downloading from ETOPO OPeNDAP servers ..."
247+
flush(stderr)
237248

238249
download(joinpath(
239250
"https://www.ngdc.noaa.gov/thredds/fileServer/global/ETOPO2022","$(resolution)s",
@@ -269,6 +280,7 @@ function setup(
269280
ggrd = RegionGrid(GeoRegion("GLB"),glon,glat)
270281

271282
@info "$(modulelog()) - Extracting regional ETOPO $(uppercase(type)) Land-Sea mask for the \"GLB\" GeoRegion from the Global ETOPO Land-Sea mask dataset ..."
283+
flush(stderr)
272284

273285
roro = extract(goro,ggrd)
274286
rlsm = deepcopy(roro)

0 commit comments

Comments
 (0)