Skip to content

Commit

Permalink
broadcasted file
Browse files Browse the repository at this point in the history
  • Loading branch information
anastasia-popova committed Apr 5, 2024
1 parent cf9da0e commit 1db2ae4
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/Regridder.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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"][:]

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 1db2ae4

Please sign in to comment.