Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
anastasia-popova committed Apr 11, 2024
1 parent 8260634 commit bb11761
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 21 deletions.
2 changes: 1 addition & 1 deletion artifacts/artifact_funcs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand Down
9 changes: 0 additions & 9 deletions experiments/AMIP/coupler_driver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions src/Regridder.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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"][:]
Expand Down
8 changes: 1 addition & 7 deletions test/regridder_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit bb11761

Please sign in to comment.