diff --git a/src/Regridder.jl b/src/Regridder.jl index a734fe5e4..77bec9579 100644 --- a/src/Regridder.jl +++ b/src/Regridder.jl @@ -656,7 +656,7 @@ function truncate_dataset( println("datapath : ", datapath) println("file_name: ", file_name) println("joint path: ", datafile_truncated) - + if ClimaComms.iamroot(comms_ctx) ds = NCDataset(datafile, "r") dates = ds["time"][:] @@ -703,16 +703,12 @@ function truncate_dataset( println("set start and end id") println("----------------------------") - truncated_ds = NCDataset(datafile_truncated, "c") - println("file made?") - c = view(ds, time = start_id:end_id) - println(c) - println(ds) - truncated_ds = write(truncated_ds, c) #view(ds, time = start_id:end_id)) + ds_truncated = NCDataset(datafile_truncated, "c") + ds_truncated = write(truncated_ds, view(ds, time = start_id:end_id)) println("truncated") close(ds) - close(truncated_ds) + close(ds_truncated) return datafile_truncated end diff --git a/test/regridder_tests.jl b/test/regridder_tests.jl index a492c7e8b..2c97401c8 100644 --- a/test/regridder_tests.jl +++ b/test/regridder_tests.jl @@ -334,7 +334,7 @@ end COUPLER_OUTPUT_DIR = joinpath("experiments", "AMIP", "output", "tests") mkpath(COUPLER_OUTPUT_DIR) - REGRID_DIR = joinpath(COUPLER_OUTPUT_DIR, "regrid_tmp", "") + REGRID_DIR = joinpath(COUPLER_OUTPUT_DIR, "regrid_tmp") #, "") mkpath(REGRID_DIR) println("regrid_dir: ", REGRID_DIR)