CROCODILE-CESM / regional-mom6

Automatic generation of regional configurations of the Modular Ocean Model 6 (MOM6) in Python
https://regional-mom6.readthedocs.io/en/latest
MIT License
0 stars 2 forks source link

Tidal regridding doesn't appear to take into account curved lat / lon #22

Open ashjbarnes opened 1 month ago

ashjbarnes commented 1 month ago

Discrepancy found in the tide and velocity/tracer boundary segments that needs to be fixed!

To reproduce:

Run through the example notebook and generate the boundary forcing files for both the regular boundaries and for the tides.

Look at the variable lon_segment_001 in both the tide and velocity / tracer segment 1 file. You'll notice that the lon_segment_001 variable, which is supposed to keep track of the longitudes along the segment, is 2D for velocity / tracers, but 1D for tides. This is because the tidal regridding functions have been borrowed and refactored from the NWA25 repository

Suggested fix: Either

  1. Refactor the regrid_tides and regrid_velocity_tracers methods to share the same regridding as regrid_tides. This would removing some from regrid_tides that's generic enough to make a regridding function. Note that the dimensions of the lon/lat variables also need to be expanded!
  2. If a refactor is too hard, need to ensure that the regrid_tides and associated encode_tidal_files_and_output function is changed to ensure that the lat/lon_segment_00x coordinates are exactly the same as the output for the velocities and tracers
manishvenu commented 1 month ago

A quick task to sneak into any PR for this could be making sure the body tides are properly setup using @gseijo's MOM_input for nwa.test.tides

ashjbarnes commented 1 month ago

Oops yeah that's my bad! Good spotting @gseijo I had intended to include body forcing but that didn't make it through the pipeline. Should be easy enough to put the body tide options into the setup_rundir function