<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Hi Jody, thanks for the reply.</p>
<p><br>
</p>
<p>If you look on line 390 in kpp_calc.F (<a href="http://lxr.mitgcm.org/lxr2/source/MITgcm/pkg/kpp/kpp_calc.F" class="OWAAutoLink" id="LPlnk260358" previewremoved="true">http://lxr.mitgcm.org/lxr2/source/MITgcm/pkg/kpp/kpp_calc.F</a>), there is a comment that
 says</p>
<p><br>
</p>
<p>bo = -g *( alpha * surfaceForcingT + beta * surfaceforcingS) / rho</p>
<p><br>
</p>
<p>which is what lead me to assume that the equation of state was hardcoded to be linear. </p>
<p><br>
</p>
<p>However, that assumption is wrong because I see a little while later that the expansion coefficient, alpha, is calculated via a function that talks with the equation of state. This means that alpha could be positive or negative which takes care of the case
 when you have an inverse stratification. </p>
<p><br>
</p>
<p>I guess I just didn't look far enough. </p>
<p><br>
</p>
<p>Thanks</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> MITgcm-support <mitgcm-support-bounces@mitgcm.org> on behalf of Jody Klymak <jklymak@uvic.ca><br>
<b>Sent:</b> January 3, 2020 3:31:57 PM<br>
<b>To:</b> mitgcm-support@mitgcm.org<br>
<b>Subject:</b> Re: [MITgcm-support] KPP with inverse stratification</font>
<div> </div>
</div>
<div>Hi Andrew,
<div class=""><br class="">
</div>
<div class="">I didn’t spend a lot of time looking, but KPP seems to call `FIND_RHO_2D` to calcualate (for instance) `dbloc`, which should return whatever density you specified in your equation of state. </div>
<div class=""><br class="">
</div>
<div class="">Where did you see that it is hardcoded? </div>
<div class=""><br class="">
</div>
<div class="">Cheers,   Jody<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 3 Jan 2020, at 11:32, Andrew Grace <<a href="mailto:andrew.grace@uwaterloo.ca" class="">andrew.grace@uwaterloo.ca</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div id="divtagdefaultwrapper" dir="ltr" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-size: 12pt; font-family: Calibri, Helvetica, sans-serif;" class="">
<div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Helvetica, sans-serif, serif, EmojiFont;" class="">
Hi all, </div>
<div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Helvetica, sans-serif, serif, EmojiFont;" class="">
<br class="">
</div>
<div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Helvetica, sans-serif, serif, EmojiFont;" class="">
I'm trying to use the KPP package in a freshwater setup but the water temperatures are all below the density maximum, meaning that cooler water over warm water is stable. I noticed that in kpp_calc.F, the surface buoyancy is calculated using a hardcoded linear
 equation of state, and therefore, when then code determines the stability of the water column, it is deemed unstable when it should not be. This is how I understand it.  </div>
<div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Helvetica, sans-serif, serif, EmojiFont;" class="">
<br class="">
</div>
<div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Helvetica, sans-serif, serif, EmojiFont;" class="">
I just want to confirm that the KPP package requires modification before it can be used in situations where an inverse stratification is stable. I also apologize if this question has been asked before. </div>
<div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Helvetica, sans-serif, serif, EmojiFont;" class="">
<br class="">
</div>
<div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Helvetica, sans-serif, serif, EmojiFont;" class="">
Thanks in advance.</div>
<div id="x_Signature" style="font-family: Calibri, Helvetica, sans-serif, serif, EmojiFont;" class="">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; font-family: Calibri, Helvetica, sans-serif, Helvetica, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;" class="">
<p style="margin-top: 0px; margin-bottom: 0px;" class=""><span style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px;" class=""></span></p>
</div>
</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class="">
</div>
<div id="Signature" class="">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; font-family: Calibri, Helvetica, sans-serif, Helvetica, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;" class="">
<div style="margin-top: 0px; margin-bottom: 0px;" class=""><span style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px;" class="">Andrew P. Grace</span><br style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px;" class="">
<span style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px;" class="">Graduate Student</span><br style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px;" class="">
<span style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px;" class="">Department of Applied Mathematics</span><br style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px;" class="">
<span style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px;" class="">University of Waterloo</span><br class="">
</div>
</div>
</div>
</div>
<span style="caret-color: rgb(0, 0, 0); font-family: LucidaSans-Typewriter; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: LucidaSans-Typewriter; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family: LucidaSans-Typewriter; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">MITgcm-support
 mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: LucidaSans-Typewriter; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<a href="mailto:MITgcm-support@mitgcm.org" style="font-family: LucidaSans-Typewriter; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">MITgcm-support@mitgcm.org</a><br style="caret-color: rgb(0, 0, 0); font-family: LucidaSans-Typewriter; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<a href="http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support" style="font-family: LucidaSans-Typewriter; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support</a></div>
</blockquote>
</div>
<br class="">
<div class=""><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: 'Lucida Sans Typewriter'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px;">
<div style="word-wrap: break-word;" class=""><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: 'Lucida Sans Typewriter'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px;">
<div class="">--</div>
<div class="">Jody Klymak    </div>
<div class=""><a href="http://web.uvic.ca/~jklymak/" class="">http://web.uvic.ca/~jklymak/</a></div>
<div class=""><br class="khtml-block-placeholder">
</div>
<div class=""><br class="khtml-block-placeholder">
</div>
<br class="Apple-interchange-newline">
</span></div>
</span><br class="Apple-interchange-newline">
</div>
<br class="">
</div>
</div>
</body>
</html>