Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hysplit.open_dataset failing when cdump outputs have same sampling start time #149

Open
amcz opened this issue Nov 10, 2023 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@amcz
Copy link
Collaborator

amcz commented Nov 10, 2023

This is a bug which causes the loading of cdump information into the xarray dataset to fail under a rare use case.
It affects the open_dataset and combine_dataset functions in hysplit module

The cdump file is structured so that the records indicate the sampling start and sampling end time.
The open_dataset function utilizes one of these as the value of the time coordinate in the xarray DataArray that it uses to store the cdump information in. By default it uses the sampling start time.

Usually this works well. However there can be cases under which this fails.

As an example:
A file was created in which the model was initialized with a pardump file and the sampling start time was set before the simulation start time.

The first model output had a sampling start time = sampling end time = simulation start time = 12:00 .
The second model output had sampling start time = 12:00 and sampling end time = 13:00.

This resulted in two records with the same time coordinate and z values.
Thus the merge of the datasets from these records failed.

This is a rare use case and would usually result from model setup that is not optimal. For instance, the first output from the cdump file with the sampling from 12:00 to 12:00 is probably unwanted and unintended and the CONTROL file should be changed to set the sampling start to the simulation start which would prevent this record from being entered into the cdupm file.

However, the open_dataset function should be able to handle or at least produce a cogent warning for such an occurrence.

@amcz amcz added the bug Something isn't working label Nov 10, 2023
@amcz amcz self-assigned this Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant