From bb1176134062fedaaf6b49ba02eba06755b4059f Mon Sep 17 00:00:00 2001 From: Anastasia Popova Date: Thu, 11 Apr 2024 16:45:02 -0400 Subject: [PATCH] clean up --- artifacts/artifact_funcs.jl | 2 +- experiments/AMIP/coupler_driver.jl | 9 --------- src/Regridder.jl | 4 ---- test/regridder_tests.jl | 8 +------- 4 files changed, 2 insertions(+), 21 deletions(-) diff --git a/artifacts/artifact_funcs.jl b/artifacts/artifact_funcs.jl index cdabc60b67..2ad520781a 100644 --- a/artifacts/artifact_funcs.jl +++ b/artifacts/artifact_funcs.jl @@ -62,7 +62,7 @@ function pr_obs_data_path() end """ - artifact_data(datapath, datafile, date0=nothing, time_start=nothing, time_end=nothing) + artifact_data(datapath_full, name; datapath_trunc, date0, time_start, time_end, comms_ctx) Truncates given data set, and constructs a new dataset containing only the dates that are used in the simulation """ diff --git a/experiments/AMIP/coupler_driver.jl b/experiments/AMIP/coupler_driver.jl index 919cee5716..a817060b57 100644 --- a/experiments/AMIP/coupler_driver.jl +++ b/experiments/AMIP/coupler_driver.jl @@ -177,20 +177,11 @@ original sources. =# include(joinpath(pkgdir(ClimaCoupler), "artifacts", "artifact_funcs.jl")) -#sst_data_all = joinpath(sst_dataset_path(), "sst.nc") -#sic_data_all = joinpath(sic_dataset_path(), "sic.nc") -#co2_data_all = joinpath(co2_dataset_path(), "mauna_loa_co2.nc") -#land_mask_data = joinpath(mask_dataset_path(), "seamask.nc") sst_data = artifact_data(sst_dataset_path(), "sst", REGRID_DIR, date0, t_start, t_end, comms_ctx) sic_data = artifact_data(sic_dataset_path(), "sic", REGRID_DIR, date0, t_start, t_end, comms_ctx) co2_data = artifact_data(co2_dataset_path(), "mauna_loa_co2", REGRID_DIR, date0, t_start, t_end, comms_ctx) land_mask_data = artifact_data(mask_dataset_path(), "seamask") -# truncate data sets to needed dates -#sst_data = Regridder.truncate_dataset(date0, t_start, t_end, sst_data_all, sst_dataset_path()) -#sic_data = Regridder.truncate_dataset(date0, t_start, t_end, sic_data_all, sic_dataset_path()) -#co2_data = Regridder.truncate_dataset(date0, t_start, t_end, co2_data_all, co2_dataset_path()) - #= ## Component Model Initialization Here we set initial and boundary conditions for each component model. Each component model is required to have an `init` function that diff --git a/src/Regridder.jl b/src/Regridder.jl index 5c76be2479..ada39da579 100644 --- a/src/Regridder.jl +++ b/src/Regridder.jl @@ -653,10 +653,6 @@ function truncate_dataset( file_name = replace(string(name, "_truncated_data_", string(date_start), string(date_end), ".nc"), r":" => "") datafile_truncated = joinpath(datapath_trunc, file_name) - println("datapath : ", datapath_trunc) - println("file_name: ", file_name) - println("joint path: ", datafile_truncated) - if ClimaComms.iamroot(comms_ctx) ds = NCDataset(datafile, "r") dates = ds["time"][:] diff --git a/test/regridder_tests.jl b/test/regridder_tests.jl index eda271c51d..28650d0c5a 100644 --- a/test/regridder_tests.jl +++ b/test/regridder_tests.jl @@ -337,11 +337,9 @@ end REGRID_DIR = joinpath(COUPLER_OUTPUT_DIR, "regrid_tmp", "") mkpath(REGRID_DIR) - println("regrid_dir: ", REGRID_DIR) - # values for the truncations time_start = 0.0 - time_end = 1.728e6 + time_end = 1.728e6 # tests five cases: # 1. both start and end are earlier than in datafile # 2. start is early, end is within datafine @@ -376,10 +374,6 @@ end @test new_dates[length(new_dates) - 1] <= date_end end - #tests to make sure the datasets were truncated correctly - #@test nds["time"][1] == ds["time"][start_id] - #@test last(nds["time"][:]) == ds["time"][end_id] - close(ds_truncated) end