Skip to content

Commit

Permalink
directory change?
Browse files Browse the repository at this point in the history
  • Loading branch information
anastasia-popova committed Apr 8, 2024
1 parent 7b965d4 commit 04e1b90
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions src/Regridder.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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"][:]
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/regridder_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 04e1b90

Please sign in to comment.