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 tides on angled boundaries, consolidate regridded of velocity and tracers, add proper body tide parameters, add MOM6's angle calculation. #33

Merged
merged 90 commits into from
Jan 17, 2025

Conversation

manishvenu
Copy link

@manishvenu manishvenu commented Oct 25, 2024

Closes #22, Closes #31

This PR address three problems/improvements in RM6:

Major Changes:

  1. Add the rotation to the tides regridder (that was previously missing) AND the rotation missing in regrid_velocity_tracers (oops!)
  2. Completely refactor the regridding into a seperate file (regridding.py) and standardize functions & encoding in velocity, tracers, and tides. They still remain seperate functions but contain the same methods.
  3. SOLUTION TO ORIGINAL ISSUE: Create new land mask function for the BCs that either fills NaNs (default) or creates a land mask with two exceptions -> ensures corner boundary points are non-NaN & coasts have a buffer of three points (A q, u/v, and another q)
  4. Implement MOM6 Angle Calculation in a new file called "rotation.py". Please see MOM6 Angle Calculation #34 for all changes.
  5. Add land_mask functions based on generated bathymetry (get_boundary_mask, mask_boundary)

Minor Changes:

  1. Minor bug in setup_run_directory when it checked to make sure tidal files exist
  2. Add a logger function to utils to make well formatted log statements in regridding.py
  3. Reformat the parameters setup_boundary_tides to take the TPXO elevation and velocity filepaths directly instead of a weird combination of folder and product name w/ .nc attached to it (completely my fault)
  4. Change default tidal consts to all 10 allowed in MOM6.
  5. Add an update the date change for diag_table
  6. Change get_glorys_rectangular to get_glorys
  7. Add docs on rotation, docker editing, and workflow
  8. Reorganize tests

Personal notes that might be easier to understand: https://docs.google.com/document/d/1pgpuFPhGon3mMdP4vj_8KbHp3AkKzoCbT7JS9KACdjU/edit?usp=sharing

@manishvenu manishvenu self-assigned this Oct 28, 2024
@manishvenu
Copy link
Author

Because this is such a big change... I'm doing dev in a branch of crr (there's no reason for it to be there other than version control) https://github.com/CROCODILE-CESM/crocodile-regional-ruckus/tree/support_tides_clean_branch/tides_dev

Currently a good way through the merging and some progress on the tides bug.

regional_mom6/utils.py Outdated Show resolved Hide resolved
regional_mom6/regional_mom6.py Outdated Show resolved Hide resolved
regional_mom6/regional_mom6.py Show resolved Hide resolved
regional_mom6/regional_mom6.py Outdated Show resolved Hide resolved
regional_mom6/regional_mom6.py Outdated Show resolved Hide resolved
regional_mom6/regional_mom6.py Outdated Show resolved Hide resolved
regional_mom6/regional_mom6.py Outdated Show resolved Hide resolved
regional_mom6/regional_mom6.py Show resolved Hide resolved
regional_mom6/regional_mom6.py Outdated Show resolved Hide resolved
regional_mom6/regridding.py Show resolved Hide resolved
@manishvenu
Copy link
Author

manishvenu commented Jan 17, 2025

Solution to original bug:

  1. Default: Fill NaNs with zeroes by default in BC Files
  2. When bathymetry is supplied, create a land mask for the boundaries with certain exceptions (corner points & 3 points at the coast must be real).

@manishvenu manishvenu marked this pull request as ready for review January 17, 2025 16:59
@manishvenu manishvenu merged commit 6dbb9ca into main Jan 17, 2025
4 checks passed
@manishvenu
Copy link
Author

FYI: Discussion with Alper offline, decided to merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
2 participants