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

+(*)Add new viscosity options and discourage the use of KVML #201

Merged
merged 9 commits into from
Sep 10, 2022

Conversation

Hallberg-NOAA
Copy link
Member

@Hallberg-NOAA Hallberg-NOAA commented Sep 5, 2022

This is a series of commits designed to add new capabilities to handle the
near-surface viscous coupling between thin near-surface layers when there is a
wind stress, and to strongly discourage the use of the KVML-derived viscosities
that scale with the inverse of the distance from the free surface squared.
These new capabilities have been determined to work as intended in variants of
the double gyre test case with additional thin layers added in the lightest
density range. These changes should allow us to address the source of the
problems that have plaguing runs with an ice-shelf that do not use a bulk
mixed layer.

In addition, the friction velocity, forces%ustar, is now being set with several
idealized wind forcing prescriptions where it previously had not been set.
Also, the von Karman constant had been used as a hard-coded constant in several
places, and it has now been replaced with variables that can be set via run-time
parameters.

All answers are bitwise identical in the MOM6-examples test suite, and are
unlikely to change in any realistic configurations, but there are new or
corrected entries in the MOM_parameter_doc files.

The commits in this PR include:

  • 59b8b06a3 +Made the von Karman constant a runtime parameter
  • 318303ae3 +(*)Set ustar with wind_forcing_2gyre
  • 5b53ff998 +Add FIXED_DEPTH_LOTW_ML and LOTW_VISCOUS_ML_FLOOR
  • f2674629e Refactor boundary layer code in find_coupling_coef
  • 4ca424aea +Replace KVML with KV_ML_INVZ2
  • fa6d8e314 +Spell HARMONIC right in PORBAR_ETA_INTERP docs
  • 107d36714 +(*)Replace KVBBL with KV_EXTRA_BBL
  • 39f8ee08a (*)+Rename KDML to KD_ML_TOT and restrict its use

  Added a new argument to set_diffusivity_init and bkgnd_mixing_init to specify
when a physically based ocean surface boundary layer mixing scheme, like KPP,
ePBL or a bulk mixed layer is in use, and use this to restrict when a constant
diffusivity is used as a crude parameterization of the surface boundary layer.
This constant mixed layer diffusivity was formerly set with KDML, but is now set
with KD_ML_TOT, but KDML will still work for input but is no longer logged and
triggers a warning message if it is used.  Also removed KDML from the
description of the ADIABATIC option.  This leads to changes in the entries of
several MOM_parameter_doc files, and it could lead to answer changes that
set a non-default value of KDML and use ePBL or KPP, but it seems unlikely that
any such cases would exist.
  Replaced the runtime parameter KVBBL, which sets the total viscosity in the
bottom boundary layer when BOTTOMDRAGLAW is false, with KV_EXTRA_BBL, which sets
the viscosity anomaly relative to KV or other turbulent viscosities, and has a
default value of 0 m2/s, instead of the previous nonzero default for KVBBL.
Specifying KVBBL will still give equivalent results, but is no longer logged and
triggers a warning message if it is used.  This leads to changes in the entries
of several MOM_parameter_doc files, and while all existing solutions are bitwise
identical, by changing the definition of KVBBL there could be some changes at
the level of roundoff for cases that do not use BOTTOMDRAGLAW = True.
  Corrected a spelling error, from HARMOINIC to HARMONIC, in the get_param
description of one of the valid options for PORBAR_ETA_INTERP, and a few other
spelling errors in comments in MOM_porous_barriers.F90.  All answers are bitwise
identical, but an entry in some MOM_parameter_doc files will change.
  Renamed the runtime parameter KVML with KV_ML_INVZ2 and modified the comments
describing it to more clearly indicate what it does and to explicitly discourage
its use. Specifying KVML will still give identical results, but is no longer
logged and triggers a warning message if it is used.  The two descriptions of
the HBBL runtime parameter in MOM_vert_friction and MOM_set_viscosity were also
made consistent.  Also added units to several comments describing real variables
and corrected some spelling errors in comments in MOM_vert_friction.F90.  This
commit leads to changes in the entries of several MOM_parameter_doc files, but
all existing solutions are bitwise identical.
  Refactored the way that find_coupling_coef sets the viscous coupling in the
surface boundary layer, in preparation for adding new options.  All answers are
bitwise identical.
  Added the new runtime parameters FIXED_DEPTH_LOTW_ML and LOTW_VISCOUS_ML_FLOOR
to turn on a law-of-the-wall based scheme to specify the viscosity in a boundary
layer of thickness HMIX_FIXED, and to apply a law-of-the-wall based lower bound
on the viscous coupling strengths across interfaces that are within the surface
boundary layer thickness, as determined in one of several different ways.
Because these are false by default, all answers are bitwise identical, but there
are new entries in some MOM_parameter_doc files.
  Set the friction velocity, ustar, when the wind stresses are specified via
wind_forcing_2gyre and wind_forcing_2gyre.  This was done by adding the new
subroutine stresses_to_ustar to start to standardize the calculation of the
friction velocities from the wind stresses.  Neverworld_wind_forcing and
wind_forcing_gyres were already using the same expressions for ustar as are in
stresses_to_ustar, so the new routine is now used in these cases.  In other
routines that set ustar, the answers differ at roundoff due to the difference
between division by a reference density and multiplication by its reciprocal, so
using the new subroutine in those cases should be wrapped in an answer_date
flag, which is being left for a later commit.  This is being added now as a
result of a new commit that uses ustar as a part of the specification of
viscosities even in idealized cases.  All answers in the MOM6-examples test
suite are bitwise identical.
@codecov
Copy link

codecov bot commented Sep 5, 2022

Codecov Report

Merging #201 (98465af) into dev/gfdl (03bc321) will decrease coverage by 0.32%.
The diff coverage is 55.20%.

@@             Coverage Diff              @@
##           dev/gfdl     #201      +/-   ##
============================================
- Coverage     37.55%   37.23%   -0.33%     
============================================
  Files           262      262              
  Lines         71388    72590    +1202     
  Branches      13306    13564     +258     
============================================
+ Hits          26807    27026     +219     
- Misses        39625    40550     +925     
- Partials       4956     5014      +58     
Impacted Files Coverage Δ
src/core/MOM_porous_barriers.F90 32.77% <ø> (ø)
...rc/parameterizations/vertical/MOM_diabatic_aux.F90 61.33% <0.00%> (ø)
...rameterizations/vertical/MOM_diapyc_energy_req.F90 0.00% <0.00%> (ø)
...parameterizations/vertical/MOM_set_diffusivity.F90 53.30% <33.33%> (-0.12%) ⬇️
...rc/parameterizations/vertical/MOM_bkgnd_mixing.F90 29.94% <39.13%> (+0.38%) ⬆️
...ig_src/drivers/solo_driver/MOM_surface_forcing.F90 24.42% <50.00%> (+0.44%) ⬆️
...arameterizations/vertical/MOM_bulk_mixed_layer.F90 48.45% <50.00%> (+0.03%) ⬆️
...c/parameterizations/vertical/MOM_vert_friction.F90 59.14% <57.35%> (-1.91%) ⬇️
src/core/MOM.F90 50.65% <100.00%> (ø)
...ameterizations/lateral/MOM_mixed_layer_restrat.F90 73.46% <100.00%> (+0.18%) ⬆️
... and 6 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

  Made the von Karman constant into a runtime parameter, specified with
VON_KARMAN_CONST or VON_KARMAN_BBL, replacing a hard-coded value in multiple
places.  By default, all answers are bitwise identical, but there are one or
two new entries in the MOM_parameter_doc files.
@marshallward
Copy link
Member

Gaea regression: https://gitlab.gfdl.noaa.gov/ogrp/MOM6/-/pipelines/16719 ✔️ 🟡

@marshallward marshallward merged commit de3f260 into NOAA-GFDL:dev/gfdl Sep 10, 2022
@marshallward
Copy link
Member

I may have merged this prematurely, since @MJHarrison-GFDL was still reviewing it.

@MJHarrison-GFDL
Copy link

I was not assigned as a reviewer, so no foul. I am examining these changes in the context of some ice shelf configurations. The LOTW profile for the viscosities and layer coupling coefficient are working as intended. Since There is no explicit floor on u*, the coupling between massless layers and the finite underlying layer could potentially be zero in some configurations.

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

Successfully merging this pull request may close these issues.

3 participants