Skip to content

Commit

Permalink
Change albedo artifacts to use ClimaArtifacts (#820)
Browse files Browse the repository at this point in the history
* Change albedo artifascts to use ClimaArtifacts

Both cesm2_albedo_dataset_path and bareground_albedo_dataset_path
now use the new ClimaArtifact cesm2_albedo. This commit also deletes
src/standalone/Bucket/artifacts, which was in an include, but never
used.

* Add function to get folder
  • Loading branch information
imreddyTeja authored Oct 7, 2024
1 parent 8ac9786 commit 6dc2192
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 76 deletions.
7 changes: 7 additions & 0 deletions Artifacts.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
[cesm2_albedo]
git-tree-sha1 = "316096635acaa8102477820f480ca02fe66eb828"

[[cesm2_albedo.download]]
sha256 = "5ac358d4485f6ba7bae129d4570cabc712b793d4a3e22caa8808de147b2c8f9b"
url = "https://caltech.box.com/shared/static/awz2lku3ngoto6t78muktzfk3kjloxsw.gz"

[clm_data]
git-tree-sha1 = "5fcb868a751f4a2e32181612bb0c123e9a8e7e97"

Expand Down
41 changes: 19 additions & 22 deletions src/Artifacts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,20 @@ function mizoguchi1990_soil_freezing_data(; context = nothing)
return dataset_path
end

"""
cesm2_albedo_dataset_folder()
Triggers the download of the CESM2 albedo folder, if not
already downloaded, using Julia Artifacts, and returns the path to
this file.
This dataset contains monthly albedo data from 15/01/1850
to 15/12/2014.
"""
function cesm2_albedo_dataset_folder(; context = nothing)
return artifact_path = @clima_artifact("cesm2_albedo", context)
end

"""
cesm2_albedo_dataset_path()
Expand All @@ -304,19 +318,9 @@ This dataset contains monthly albedo data from 15/01/1850
to 15/12/2014.
"""
function cesm2_albedo_dataset_path(; context = nothing)
dir = joinpath(@__DIR__, "../")
land_albedo_dataset = ArtifactWrapper(
dir,
"land_albedo",
ArtifactFile[ArtifactFile(
url = "https://caltech.box.com/shared/static/1uhqspj4xujkyz661x0pio59hvmgsi5c.nc",
filename = "esw_albedo_Amon_CESM2_historical_r1i1p1f1_gn_185001-201412_v2.nc",
),],
)
path = get_data_folder(land_albedo_dataset)
return joinpath(
path,
"esw_albedo_Amon_CESM2_historical_r1i1p1f1_gn_185001-201412_v2.nc",
cesm2_albedo_dataset_folder(; context),
"sw_albedo_Amon_CESM2_historical_r1i1p1f1_gn_185001-201412_v2_no-nans.nc",
)
end

Expand All @@ -330,17 +334,10 @@ this file.
This dataset does not contain a time component.
"""
function bareground_albedo_dataset_path(; context = nothing)
dir = joinpath(@__DIR__, "../")
bareground_albedo_dataset = ArtifactWrapper(
dir,
"bareground_albedo",
ArtifactFile[ArtifactFile(
url = "https://caltech.box.com/shared/static/ga9385kyl82t955dylsbnn4x51b412md.nc",
filename = "bareground_albedo.nc",
),],
return joinpath(
cesm2_albedo_dataset_folder(; context),
"bareground_albedo.nc",
)
path = get_data_folder(bareground_albedo_dataset)
return joinpath(path, "bareground_albedo.nc")
end

end
3 changes: 0 additions & 3 deletions src/standalone/Bucket/Bucket.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ export BucketModelParameters,
surface_albedo,
partition_snow_surface_fluxes

include(
joinpath(pkgdir(ClimaLand), "src/standalone/Bucket/artifacts/artifacts.jl"),
)

abstract type AbstractBucketModel{FT} <: AbstractExpModel{FT} end

Expand Down
51 changes: 0 additions & 51 deletions src/standalone/Bucket/artifacts/artifacts.jl

This file was deleted.

0 comments on commit 6dc2192

Please sign in to comment.