Skip to content

Commit

Permalink
Update e3sm_diags/driver/utils/dataset_xr.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvothecoder committed Oct 1, 2024
1 parent dd4e7fe commit 7b53932
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions e3sm_diags/driver/utils/dataset_xr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1436,9 +1436,9 @@ def _exclude_sub_monthly_coord_spanning_year(
time_dim = xc.get_dim_keys(ds_subset, axis="T")
time_values = ds_subset[time_dim]
last_time_year = time_values[-1].dt.year.item()
second_time_year = time_values[-2].dt.year.item()
second_last_time_year = time_values[-2].dt.year.item()

if self.is_sub_monthly and last_time_year > second_time_year:
if self.is_sub_monthly and last_time_year > second_last_time_year:
ds_subset = ds_subset.isel(time=slice(0, -1))

return ds_subset
Expand Down

0 comments on commit 7b53932

Please sign in to comment.