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

More intelligently search for the right post-processed files #145

Merged

Conversation

andrew-c-ross
Copy link
Contributor

To support newer simulations, this changes the behavior of open_var to look for the right post-processed files, without any hard coding of the dates or chunk lengths.

The general assumptions are

  1. A path following the standard frepp naming, for example {pp_root}/pp/ocean_monthly/ts/monthly/, exists (error if not)
  2. Within that path, one or more directories with names like *yr exist (error if not)
  3. Of the directories above, whichever has the largest number in the name and contains one or more post-processed files of the right variable is the one to use.

We generally post-process two different chunk sizes, one of 5 years and the other the length of the simulation. This should work for that. One way to get a suboptimal result would be if the simulation length was longer than the longest chunk; for example, a 25 year simulation with 5 year and 20 year chunks. This is an unlikely user error though.

Copy link
Collaborator

@uwagura uwagura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ran it successfully with my own 27 year run, looks good to me!

@yichengt900
Copy link
Contributor

Thanks again, @andrew-c-ross, for your contribution! Just being a little picky about tiny details, but everything looks perfect to me!

@yichengt900 yichengt900 merged commit 6b6d2e7 into NOAA-GFDL:main Feb 14, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants