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

+Refactor set_viscous_BBL and add non-trigonometric find_L_open option #543

Merged

Commits on Mar 5, 2024

  1. Refactor set_viscous_BBL channel drag calculations

      Refactored set_viscous_BBL to separate out the routines setting the open
    interface lengths used for the channel drag, shortening a 1070 line long routine
    to 915 lines and reducing the scope of a number of temporary variables.  A
    number of logical branch points have been moved outside of the innermost do
    loops.  This refactoring will also make it easier to provide alternatives to
    some of the solvers that do not use the trigonometric functions to solve for the
    roots of a cubic expression and avoiding the issues noted at
    NOAA-GFDL/issues/483.  All answers are bitwise identical and public
    interfaces are unchanged.
    Hallberg-NOAA committed Mar 5, 2024
    Configuration menu
    Copy the full SHA
    2a1d851 View commit details
    Browse the repository at this point in the history
  2. +Add find_L_open_concave_iterative

      Added the new routine find_L_open_concave_iterative to use iterative Newton's
    method approaches with appropriate limits to solve the cubic equation for the
    fractional open face lengths at interfaces that are used by the CHANNEL_DRAG
    code.  These solutions are analogous to those given by the previous expressions
    that are now in find_L_open_concave_trigonometric, and the two differ at close
    to roundoff, but the new method is completely independent of the transcendental
    function library, thereby addressing dev/gfdl MOM6 issue mom-ocean#483.  This new routine
    is called when the new runtime parameter TRIG_CHANNEL_DRAG_WIDTHS is set to
    false, but by default the previous answers are recovered.  By default all
    answers are bitwise identical, but there is a new runtime parameter in some
    MOM_parameter_doc files.
    Hallberg-NOAA committed Mar 5, 2024
    Configuration menu
    Copy the full SHA
    04da773 View commit details
    Browse the repository at this point in the history
  3. Add the debugging routine test_L_open_concave

      Added the new debugging or testing subroutine test_L_open_concave along with
    extra calls when DEBUG = True that can be used to demonstrate that the iterative
    solver in find_L_open_concave_iterative is substantially more accurate but
    mathematically equivalent to the solver in find_L_open_concave_trigonometric.
    This extra code is only called in debugging mode, and it probably should be
    deleted in a separate commit after find_L_open_concave_iterative has been
    accepted onto the dev/gfdl branch of MOM6.  All answers are bitwise identical
    and no output or input is changed.
    Hallberg-NOAA committed Mar 5, 2024
    Configuration menu
    Copy the full SHA
    44e7b9c View commit details
    Browse the repository at this point in the history
  4. Minor refactoring in set_viscous_BBL

      Carried out minor refactoring in set_viscous_BBL as suggested by the reviews
    of this PR, including the elimination of some unnecessary error handling and the
    replacement of C2pi_3 as an argument to find_L_open_concave_trigonometric with
    an internal parameter.  All answers are bitwise identical and there are no
    changes to publicly visible interfaces.
    Hallberg-NOAA committed Mar 5, 2024
    Configuration menu
    Copy the full SHA
    f534b0e View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    80ca0d7 View commit details
    Browse the repository at this point in the history