From 1db2ae4c20f79432406e6439c6d8827d9b51aa86 Mon Sep 17 00:00:00 2001 From: Anastasia Popova Date: Fri, 5 Apr 2024 19:14:35 -0400 Subject: [PATCH] broadcasted file --- src/Regridder.jl | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Regridder.jl b/src/Regridder.jl index 53326adce..79f585331 100644 --- a/src/Regridder.jl +++ b/src/Regridder.jl @@ -647,10 +647,14 @@ function truncate_dataset( name, comms_ctx::ClimaComms.AbstractCommsContext, ) - if ClimaComms.iamroot(comms_ctx) - date_start = date0 + Dates.Second(time_start) - date_end = date0 + Dates.Second(time_start + time_end) + date_start = date0 + Dates.Second(time_start) + date_end = date0 + Dates.Second(time_start + time_end) + + file_name = string(name, "_truncated_data_", string(date_start), string(date_end), ".nc") + datafile_truncated = joinpath(datapath, file_name) + println(datafile_truncated) + if ClimaComms.iamroot(comms_ctx) ds = NCDataset(datafile, "r") dates = ds["time"][:] @@ -696,11 +700,6 @@ function truncate_dataset( println("set start and end id") println("----------------------------") - file_name = string(name, "_truncated_data_", string(date_start), string(date_end), ".nc") - datafile_truncated = joinpath(datapath, file_name) - - println(datafile_truncated) - truncated_ds = NCDataset(datafile_truncated, "c") println("file made?") c = view(ds, time = start_id:end_id)