-
Notifications
You must be signed in to change notification settings - Fork 1
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
Adding the Danabasoglu & Marshal 2007 scheme #15
base: dev/cpt
Are you sure you want to change the base?
Adding the Danabasoglu & Marshal 2007 scheme #15
Conversation
* Remove dependency of use_VarMix on CS%KHTH_Slope_Cff > 0. * Fix a bug in the KH_v calculation via use_dm07
* Add option to diagnose dm07_ratio_u and dm07_ratio_v; * Trigger a fatal error when both KHTH_USE_EBT_STRUCT and USE_DANABASOGLU_MARSHALL and set to True; * Tirgger a fatal error when USE_DANABASOGLU_MARSHALL=True and USE_STORED_SLOPES=False, since both of these options must be enable; * Simplify subroutine calc_dm07 and cleans the code; * Fixes OMP directives.
* set ratio_u(k=1) and ratio_v(k=1) to 1. This assures KHTH will have the maximum value at the surface; * deleted unused variables.
Codecov Report
@@ Coverage Diff @@
## dev/cpt #15 +/- ##
===========================================
- Coverage 29.29% 29.26% -0.04%
===========================================
Files 235 235
Lines 70799 70909 +110
===========================================
+ Hits 20742 20749 +7
- Misses 50057 50160 +103
Continue to review full report at Codecov.
|
This PR adds the scheme for calculating the thickness diffusivity (KHTH) described by Danabasoglu & Marshall (2007).
Because the version implemented here must work on layer mode and in the absence of a surface boundary layer depth, the current implementation differs from the original one. Below is a brief description of what is implemented in this PR.
Calculate KHTH (or \kappa_{GM})
The scheme can be activated by setting
USE_DANABASOGLU_MARSHALL = True
Diffusivities are calculated using
,
where N^2 is the Brunt-Väisälä frequency and N^2_{ref} is the maximum N^2 value for a particular column (i,j point). Therefore, the ratio N^2/N^2_{ref} <= 1.0. \kappa_{GM} is a reference diffusivity prescribed by the user via the
DM07_KAPPA_REF
parameter. The lower bound on the diffusivities is controlled via the minimum ratio (N^2/N^2_{ref}) parameterDM07_MIN_RATIO
. We also set the density ratio at the top-most interface to one.The subroutine
vert_fill_rho
has been introduced to allow the calculation of N^2 in layer mode (stacked shallow water). In this mode, the target densities are prescribed by the user and can be extremely small (vanished) making the calculation of N^2 difficult because vanished layers are used in the denominator. To avoid this issue, we pass the thickness array and the density targets to subroutinevert_fill_rho
and fill the vanished layers with sensible density values by diffusing vertically with a small but constant diffusivity. We then calculate N2_u and N2_v using the "corrected" density profiles.TODO
Check if this implementation works in ALE mode.