Skip to content

Commit cd785c8

Browse files
committed
Replace cesm2_albedo artifact with sw_albedo
The cesm2_albedo artifact was renamed to sw_albedo in ClimaArtifacts PR #97. This PR also added a new dataset with two new albedo variables. This commit updates the Artifacts accessor functions for albedo and adds tests for the new dataset.
1 parent f8e3d59 commit cd785c8

File tree

4 files changed

+214
-177
lines changed

4 files changed

+214
-177
lines changed

Artifacts.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ git-tree-sha1 = "6ce1717bb8b7aa767380f1053b9d8d3a4e4edaa6"
77
sha256 = "27d49fce7f4a5e2b81bbd29e8a7caf08f568a2df53e3af817126363decfd5a7c"
88
url = "https://caltech.box.com/shared/static/99aw2gce2k65bdu0h8jkfxq4vin08gi2.gz"
99

10-
[cesm2_albedo]
11-
git-tree-sha1 = "316096635acaa8102477820f480ca02fe66eb828"
10+
[sw_albedo]
11+
git-tree-sha1 = "136f1db3ed969614fb589c5250545a3ed1e8aaab"
1212

13-
[[cesm2_albedo.download]]
14-
sha256 = "5ac358d4485f6ba7bae129d4570cabc712b793d4a3e22caa8808de147b2c8f9b"
15-
url = "https://caltech.box.com/shared/static/awz2lku3ngoto6t78muktzfk3kjloxsw.gz"
13+
[[sw_albedo.download]]
14+
sha256 = "777371543cc3285c0779e7ecd925fe782b5b45e0ed27f82260827ac8ebe6a700"
15+
url = "https://caltech.box.com/shared/static/of1admpndmikoumtgk5j3yvt92v71awk.gz"
1616

1717
[clm_data]
1818
git-tree-sha1 = "3f6873a3e67722bda1fd23f7d5a05f5e2df1fe8c"

src/Artifacts.jl

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -290,21 +290,20 @@ function mizoguchi1990_soil_freezing_data(; context = nothing)
290290
end
291291

292292
"""
293-
cesm2_albedo_dataset_folder()
293+
sw_albedo_dataset_folder(; context = nothing)
294294
295-
Triggers the download of the CESM2 albedo folder, if not
295+
Triggers the download of the sw_albedo folder, if not
296296
already downloaded, using Julia Artifacts, and returns the path to
297297
this file.
298298
299-
This dataset contains monthly albedo data from 15/01/1850
300-
to 15/12/2014.
299+
This dataset contains surface shortwave albedo calculated from CESM2 and CERES data.
301300
"""
302-
function cesm2_albedo_dataset_folder(; context = nothing)
303-
return artifact_path = @clima_artifact("cesm2_albedo", context)
301+
function sw_albedo_dataset_folder(; context = nothing)
302+
return artifact_path = @clima_artifact("sw_albedo", context)
304303
end
305304

306305
"""
307-
cesm2_albedo_dataset_path()
306+
cesm2_albedo_dataset_path(; context = nothing)
308307
309308
Triggers the download of the CESM2 land albedo dataset, if not
310309
already downloaded, using Julia Artifacts, and returns the path to
@@ -315,13 +314,13 @@ to 15/12/2014.
315314
"""
316315
function cesm2_albedo_dataset_path(; context = nothing)
317316
return joinpath(
318-
cesm2_albedo_dataset_folder(; context),
317+
sw_albedo_dataset_folder(; context),
319318
"sw_albedo_Amon_CESM2_historical_r1i1p1f1_gn_185001-201412_v2_no-nans.nc",
320319
)
321320
end
322321

323322
"""
324-
bareground_albedo_dataset_path()
323+
bareground_albedo_dataset_path(; context = nothing)
325324
326325
Triggers the download of the average bareground land albedo dataset, if not
327326
already downloaded, using Julia Artifacts, and returns the path to
@@ -330,9 +329,24 @@ this file.
330329
This dataset does not contain a time component.
331330
"""
332331
function bareground_albedo_dataset_path(; context = nothing)
332+
return joinpath(sw_albedo_dataset_folder(; context), "bareground_albedo.nc")
333+
end
334+
335+
"""
336+
ceres_albedo_dataset_path(; context = nothing)
337+
338+
Triggers the download of the CERES land albedo dataset, if not
339+
already downloaded, using Julia Artifacts, and returns the path to
340+
this file.
341+
342+
This dataset contains the monthly average shortwave albedo in the
343+
`sw_alb` variable, and the monthly average clear-sky shortwave albedo in the
344+
`sw_alb_clr` variable. Both variables cover from 15/03/2000 to 15/10/2019.
345+
"""
346+
function ceres_albedo_dataset_path(; context = nothing)
333347
return joinpath(
334-
cesm2_albedo_dataset_folder(; context),
335-
"bareground_albedo.nc",
348+
sw_albedo_dataset_folder(; context),
349+
"sw_albedo_Amon_CERES_EBAF_Ed4.2_Subset_200003-201910.nc",
336350
)
337351
end
338352

src/standalone/Bucket/Bucket.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,14 @@ end
155155
PrescribedSurfaceAlbedo{FT}(
156156
start_date::Union{DateTime, DateTimeNoLeap},
157157
Space::ClimaCore.Spaces.AbstractSpace;
158-
get_infile = ClimaLand.Artifacts.cesm2_albedo_dataset_path,
159-
varname = "sw_alb"
158+
albedo_file_path = ClimaLand.Artifacts.cesm2_albedo_dataset_path(),
159+
varname = "sw_alb",
160+
regridder_type = :InterpolationsRegridder,
160161
) where {FT}
161162
162163
Constructor for the PrescribedSurfaceAlbedo struct.
163164
The `varname` must correspond to the name of the variable in the NetCDF
164165
file retrieved by the `get_infile` function.
165-
`get_infile` uses ArtifactWrappers.jl to return a path to the data file
166-
and download the data if it doesn't already exist on the machine.
167166
The input data file must have a time component.
168167
"""
169168
function PrescribedSurfaceAlbedo{FT}(

0 commit comments

Comments
 (0)