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

fix_ocean_restarts.py bugs #1

Open
aekiss opened this issue Nov 30, 2020 · 0 comments
Open

fix_ocean_restarts.py bugs #1

aekiss opened this issue Nov 30, 2020 · 0 comments

Comments

@aekiss
Copy link
Contributor

aekiss commented Nov 30, 2020

There are some bugs in fix_ocean_restarts.py:

  • output_files are based on template_files, not old_files, and then filled in with data from old_files only for fields of shape (1, 75, 2700, 3600), so there are many fields it should fix but doesn't, e.g.
    • eta_t with shape (1, 2700, 3600)
    • t_surf with shape (1, 2700, 3600)
    • advectionu with shape (2, 75, 2700, 3600)
    • dswt with shape (1, 76, 2700, 3600)
    • etc
      Since output_files are based on template_files these variables would then contain values from template_files, not old_files, and so would be inconsistent with fields with shape (1, 75, 2700, 3600) that were replaced with values from old_files.
  • something like out_fp.variables[var][..., level, :, :] = out_data needs to be added to actually write the changes to the file.

I've made a variant of this script called fix_ocean_restarts_cpumask.py which could be used as a starting point, but is designed for cpu mask changes rather than topography changes. fix_ocean_restarts_cpumask.py has different logic:

  • output_files is based on old_files, not template_files
  • all >1-d fields are processed
  • replaces output_files cpu mask with that from template_files
  • replaces newly-unmasked values with values from template_files (this should be fine, since we assume the topography has not changed so the newly-unmasked values will still be in the land mask)
  • leaves old_files data intact everywhere else in output_files

Something different will be needed for fix_ocean_restarts.py, since this is for topography changes rather than cpu mask changes. I think what we want here is to locate the points that are wet with the new bathymetry but were dry with the old one, and replace their values with a nearest-neighbour horizontal extrapolation from old_files, like what we do with initial conditions.

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

No branches or pull requests

1 participant