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

Merge various quality-of-life changes & tides boundary functions (From GFDL NWA25) into RMOM6 #12

Closed manishvenu closed 1 month ago

manishvenu commented 1 month ago

This (originally draft) PR is a conglomeration of work by @ashjbarnes and me adding tidal boundary conditions, certain MOM file functions, and other quality of life improvements to RM6. Here is a categorization of the changes and TO-DOs:

  1. Add tides from GFDL NWA25 to RMOM6 in 5 functions:

    • [X] Two util functions (utils.ap2ep, utils.ep2ap)
    • [X] Coordinate function for the boundaries (segment.coords)
    • [X] Implement loose horizontal subsetting (utils.find_roughly_nearest_ny_nx)
    • [X] Create a setup tides function for the user side (expt.setup_tides_rectangular_boundaries)
    • [X] Create a regrid tides function to setup the tides on the RMOM6 generated Hgrid (segment.regrid_tides)
      • [ ] Use segment.coords for the expt.ocean_state_rectangular_boundaries (changed to a new branch w/ new PR #13 )
      • [ ] Use segment.coords to read-in angled grids (like NWA12) (changed to a new branch w/ new PR #13 )
      • [x] Test tides in the CESM
      • [x] Add test tides functions to rm6 tests
  2. Change function names to verb-starts & more descriptive names

    • [X] Change expt.rectangular_boundaries and expt.simple_boundaries to "setup_oceanstate...."
    • [ ] Create a coherent and understandable naming scheme, which will address #9, shifted to PR#13
    • [x] Validate function name choices
  3. Make the changes to MOM files caused by RMOM6 more understandable (addresses #8)

    • [X] Create MOM file dictionary for better manipulation of MOM_input, override, and layout
    • [x] Rework the setup_run_directory to more clearly make changes in MOM_override vs changing MOM_input
    • [x] Create config files, or json/another abstraction layer to explain the changes caused by RMOM6
    • [x] As part of the previous, create a feature/function for the user to change parameters (See change_MOM_parameter)
    • [x] Verify this fix addresses #8
  4. Extraneous small changes

    • [x] Remove greek letters
manishvenu commented 1 month ago

Hey @ashjbarnes,

Let me know if you have any opinions on what should be added or taken out from here!

manishvenu commented 1 month ago

I don't want to try to remove the OBC stuff from the default MOM_input files b/c not sure if I 'll miss a place they are stored based on if installed as a package or cloned, so I'll manually delete those fields in setup_run_directory.

ashjbarnes commented 1 month ago

I don't want to try to remove the OBC stuff from the default MOM_input files b/c not sure if I 'll miss a place they are stored based on if installed as a package or cloned, so I'll manually delete those fields in setup_run_directory.

Should be fine to delete them - the only difference with installed vs not installed is to do with the directory structure of the package. Either way, it'll always be in the premade_run_directories folder. So you can delete if you'd prefer! That's probably cleaner than doing programatically each time

manishvenu commented 1 month ago

I don't want to try to remove the OBC stuff from the default MOM_input files b/c not sure if I 'll miss a place they are stored based on if installed as a package or cloned, so I'll manually delete those fields in setup_run_directory.

Should be fine to delete them - the only difference with installed vs not installed is to do with the directory structure of the package. Either way, it'll always be in the premade_run_directories folder. So you can delete if you'd prefer! That's probably cleaner than doing programatically each time

Sounds good, I'll take it out of the premade_run_directories folder, but keep in the deletion to explicitly state it in setup_run_directories.

manishvenu commented 1 month ago

Issue #8 will be tested again tomorrow and closed with the new demo. This PR does address this. Issue #9 will be addressed in start_angled_boundaries, which will be merged when Issue #8 is finished.