From 68e9882f2e0cce9ba697221d9707436d95260792 Mon Sep 17 00:00:00 2001 From: imreddyTeja Date: Mon, 23 Dec 2024 15:37:05 -0800 Subject: [PATCH] Change topo_drag.res.nc to a ClimaArtifact --- Artifacts.toml | 9 ++++++++- artifacts/artifact_funcs.jl | 12 ------------ artifacts/download_artifacts.jl | 1 - .../gravity_wave_drag/orographic_gravity_wave.jl | 3 ++- src/utils/AtmosArtifacts.jl | 11 ++++++++++- 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/Artifacts.toml b/Artifacts.toml index 1bbe36cfbc9..701e3e9818f 100644 --- a/Artifacts.toml +++ b/Artifacts.toml @@ -36,7 +36,7 @@ lazy = true [[earth_orography_60arcseconds.download]] sha256 = "eca66c0701d1c2b9e271742314915ffbf4a0fae92709df611c323f38e019966e" url = "https://caltech.box.com/shared/static/4asrxcgl6xsgenfcug9p0wkkyhtqilgk.gz" - + [era5_cloud] git-tree-sha1 = "10742e0a2e343d13bb04df379e300a83402d4106" @@ -51,3 +51,10 @@ lazy = true [[DYAMOND_SUMMER_ICS_p98deg.download]] sha256 = "9a5efd20d68d9b954af2fd7803bccdda3fc7ef4ff60421ed13d18f768312d2e3" url = "https://caltech.box.com/shared/static/whn01xr83v0s4p8tc59ds3nvfsfe6ebs.gz" + +[topo_drag] +git-tree-sha1 = "9970989c13c2ad015ab5738d42fd9f5b320f1451" + + [[topo_drag.download]] + sha256 = "2960d7ee10b3a15203dfa8b05b1b94c9546212230e5828787577864113829d6e" + url = "https://caltech.box.com/shared/static/pflpi9qoay7jknmajlj1uaxqtnp4frj2.gz" diff --git a/artifacts/artifact_funcs.jl b/artifacts/artifact_funcs.jl index 491cacacea9..d2a14b514bc 100644 --- a/artifacts/artifact_funcs.jl +++ b/artifacts/artifact_funcs.jl @@ -26,18 +26,6 @@ function era_single_column_dataset_path() return AW.get_data_folder(era_dataset) end -function topo_res_path() - topo_data = AW.ArtifactWrapper( - @__DIR__, - "topo-info", - AW.ArtifactFile[AW.ArtifactFile( - url = "https://caltech.box.com/shared/static/isa7l4ow4xvv9vs09bivdwttbnnw5tte.nc", - filename = "topo_drag.res.nc", - ),], - ) - return AW.get_data_folder(topo_data) -end - function mima_gwf_path() mima_data = AW.ArtifactWrapper( @__DIR__, diff --git a/artifacts/download_artifacts.jl b/artifacts/download_artifacts.jl index ac7552100e1..42129268695 100644 --- a/artifacts/download_artifacts.jl +++ b/artifacts/download_artifacts.jl @@ -4,7 +4,6 @@ include(joinpath(@__DIR__, "artifact_funcs.jl")) function trigger_download(lazy_download = true) @info "Era global dataset path:`$(era_global_dataset_path())`" @info "Era single column dataset path:`$(era_single_column_dataset_path())`" - @info "topo dataset path:`$(topo_res_path())`" @info "MiMA convective gravity wave path:`$(mima_gwf_path())`" @info "GFDL OGWD test data:`$(gfdl_ogw_data_path())`" return nothing diff --git a/src/parameterized_tendencies/gravity_wave_drag/orographic_gravity_wave.jl b/src/parameterized_tendencies/gravity_wave_drag/orographic_gravity_wave.jl index b4ee306ea05..7722dd97931 100644 --- a/src/parameterized_tendencies/gravity_wave_drag/orographic_gravity_wave.jl +++ b/src/parameterized_tendencies/gravity_wave_drag/orographic_gravity_wave.jl @@ -34,7 +34,8 @@ function orographic_gravity_wave_cache(Y, ogw::OrographicGravityWave) (; γ, ϵ, β, h_frac, ρscale, L0, a0, a1, Fr_crit) = ogw if ogw.topo_info == "gfdl_restart" - orographic_info_rll = joinpath(topo_res_path(), "topo_drag.res.nc") + orographic_info_rll = + AA.topo_res_file_path(; context = ClimaComms.context(Y.c)) topo_info = regrid_OGW_info(Y, orographic_info_rll) elseif ogw.topo_info == "raw_topo" # TODO: right now this option may easily crash diff --git a/src/utils/AtmosArtifacts.jl b/src/utils/AtmosArtifacts.jl index 2a3092406c4..5f81084c5e7 100644 --- a/src/utils/AtmosArtifacts.jl +++ b/src/utils/AtmosArtifacts.jl @@ -72,7 +72,7 @@ end Construct the file path for the 60arcsecond orography data NetCDF file. -Downloads the 60arc-second dataset by default. +Downloads the 60arc-second dataset by default. """ function earth_orography_file_path(; context = nothing) filename = "ETOPO_2022_v1_60s_N90W180_surface.nc" @@ -82,4 +82,13 @@ function earth_orography_file_path(; context = nothing) ) end +""" + topo_res_file_path(; context = nothing) + +Construct the file path for the topo_res NetCDF file. +""" +function topo_res_file_path(; context = nothing) + return joinpath(@clima_artifact("topo_drag", context), "topo_drag.res.nc") +end + end