<html aria-label="message body"><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">Hi Ian,<div><br></div><div>it would be great if you could review the related PR 968 on github. Basically I copied the stic_solve4fluxes.F code and modified to avoid solving the quadratic equation for salinity S_b twice. I think this works, but it would be great, if you had a look.</div><div><br></div><div>Martin<br id="lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On 23. Jan 2026, at 20:54, Dimitris Menemenlis <dmenemenlis@gmail.com> wrote:</div><br class="Apple-interchange-newline"><div>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<div>
<div style="line-break:after-white-space">Thank you Ian.  Your notes are super helpful.  Kayhan and I did run into an ocean-salinity = 0 case during initialization of ice shelf cavities for an llc4320 set-up.  This is probably excessive initial melting and
 undershoot, as you suggest.
<div><br>
</div>
<div>Dimitris</div>
<div><br id="x_lineBreakAtBeginningOfMessage">
<div><br>
<blockquote type="cite">
<div>On Jan 23, 2026, at 10:46 AM, Fenty, Ian G (US 329B) <ian.fenty@jpl.nasa.gov> wrote:</div>
<br class="x_Apple-interchange-newline">
<div>
<div>
<div style="direction:ltr; font-family:Aptos,Arial,Helvetica,sans-serif; font-size:12pt">
Martin and Dimitris,</div>
<div style="direction:ltr; font-family:Aptos,Arial,Helvetica,sans-serif; font-size:12pt">
<br>
</div>
<div style="direction:ltr; font-family:Aptos,Arial,Helvetica,sans-serif; font-size:12pt">
I may have missed this if the discussion, but if the ocean salinity is zero and the salinity of the ice is zero, then the assumptions of the three-equation model break down. In that case, there is no boundary layer at the ocean/ice interface. The melting expression
 simplifies to</div>
<div style="direction:ltr; font-family:Aptos,Arial,Helvetica,sans-serif; font-size:12pt">
<br>
</div>
<div style="direction:ltr; font-family:Aptos,Arial,Helvetica,sans-serif; font-size:12pt">
Step 1, find the local melting point: </div>
<div style="direction:ltr; font-family:Aptos,Arial,Helvetica,sans-serif; font-size:12pt">
      T_f = c_0 + b_0 p</div>
<div style="direction:ltr; font-family:Aptos,Arial,Helvetica,sans-serif; font-size:12pt">
<br>
</div>
<div style="direction:ltr; font-family:Aptos,Arial,Helvetica,sans-serif; font-size:12pt">
Step 2, calculate the heat flux to the ice</div>
<div style="direction:ltr; font-family:Aptos,Arial,Helvetica,sans-serif; font-size:12pt">
      <w’T’> = \gamma_T (T_o - T_f)</div>
<div style="direction:ltr; font-family:Aptos,Arial,Helvetica,sans-serif; font-size:12pt">
<br>
</div>
<div style="direction:ltr; font-family:Aptos,Arial,Helvetica,sans-serif; font-size:12pt">
Step 3, calculate the freshwater flux from melting:</div>
<div style="direction:ltr; font-family:Aptos,Arial,Helvetica,sans-serif; font-size:12pt">
Case a: no heat conduction through the ice</div>
<div style="direction:ltr; font-family:Aptos,Arial,Helvetica,sans-serif; font-size:12pt">
      \rho_w c_{\pw}  <w’T’> = -Lq </div>
<div style="direction:ltr; font-family:Aptos,Arial,Helvetica,sans-serif; font-size:12pt">
<br>
</div>
<div style="direction:ltr; font-family:Aptos,Arial,Helvetica,sans-serif; font-size:12pt">
Case b: heat conduction through the ice</div>
<div style="direction:ltr; font-family:Aptos,Arial,Helvetica,sans-serif; font-size:12pt">
      \rho_w c_{\pw}  <w’T’> + \rho_i c_{pi}  \kappa_i (T_i - Tf_f) D_i = -Lq </div>
<div style="direction:ltr; font-family:Aptos,Arial,Helvetica,sans-serif; font-size:12pt">
<br>
</div>
<div style="direction:ltr; font-family:Aptos,Arial,Helvetica,sans-serif; font-size:12pt">
q is the ice mass flux [kg s-1 m-2], which can be expressed in terms of velocity of water meltwater coming into the ocean (w_b) as</div>
<div style="direction:ltr; font-family:Aptos,Arial,Helvetica,sans-serif; font-size:12pt">
q = \rho_w_b</div>
<div style="direction:ltr; font-family:Aptos,Arial,Helvetica,sans-serif; font-size:12pt">
<br>
</div>
<div style="direction:ltr; font-family:Aptos,Arial,Helvetica,sans-serif; font-size:12pt">
But yea, it’s hard to imagine the case where the model comes up with a solution of S_b = 0 in the original three equation model.  </div>
<div style="direction:ltr; font-family:Aptos,Arial,Helvetica,sans-serif; font-size:12pt">
It can only happen if the heat transfer coefficient is infinite, if the salinity diffusion is zero, or the ocean salinity is zero. </div>
<div style="direction:ltr; font-family:Aptos,Arial,Helvetica,sans-serif; font-size:12pt">
If your ocean salinity is going to zero, it suggestions a different problem. Maybe a numerical artifact (undershoot/overshoot).</div>
<div style="direction:ltr; font-family:Aptos,Arial,Helvetica,sans-serif; font-size:12pt">
<br>
</div>
<div style="direction:ltr; font-family:Aptos,Arial,Helvetica,sans-serif; font-size:12pt">
I attached my three-equation model notes.  From page 3 on the variable names (the epsilons) are from the shellfire code (or at least some older version of it)</div>
<div style="direction:ltr; font-family:Aptos,Arial,Helvetica,sans-serif; font-size:12pt">
<br>
</div>
<div style="direction:ltr; font-family:Aptos,Arial,Helvetica,sans-serif; font-size:12pt">
Ian</div>
<div style="direction:ltr; font-family:Aptos,Arial,Helvetica,sans-serif; font-size:12pt">
<br>
</div>
<div style="direction:ltr; font-family:Aptos,Arial,Helvetica,sans-serif; font-size:12pt">
<br>
</div>
<div style="direction:ltr; font-family:Aptos,Arial,Helvetica,sans-serif; font-size:12pt">
<br>
</div>
<div id="x_mail-editor-reference-message-container">
<div class="x_ms-outlook-mobile-reference-message x_skipProofing" style="direction:ltr">
</div>
<div class="x_ms-outlook-mobile-reference-message x_skipProofing" style="text-align:left; padding:3pt 0in 0in; border-width:1pt medium medium; border-style:solid none none; border-color:rgb(181,196,223) currentcolor currentcolor; font-family:Aptos">
<span style="font-size:12pt"><b>From: </b>MITgcm-support <mitgcm-support-bounces@mitgcm.org> on
</span><span style="font-size:16pt">behalf</span><span style="font-size:12pt"> of Martin Losch <martin.losch@awi.de></span><span style="font-size:20pt"><br>
</span><span style="font-size:12pt"><b>Date: </b>Thursday, January 22, 2026 at 10:43 PM<br>
<b>To: </b>mitgcm-support@mitgcm.org <mitgcm-support@mitgcm.org><br>
<b>Subject: </b>[EXTERNAL] Re: [MITgcm-support] shelfice_thermodynamics.F crash<br>
<br>
</span></div>
<div class="x_ms-outlook-mobile-reference-message x_skipProofing" style="direction:ltr">
I don’t know. If both solutions give the same results, I’d go with SHELFICE_USE_HEATBALANCE_FOR_FRESHWATERFLUX defined, as this is in compact form what is implemented in pkg/steep_icecavity. I have no experience with this version. The other option is a hack
 that just avoids the division by zero, this is only physically correct if sLoc is really zero at the same time.</div>
<div class="x_ms-outlook-mobile-reference-message x_skipProofing" style="direction:ltr">
<br>
</div>
<div class="x_ms-outlook-mobile-reference-message x_skipProofing" style="direction:ltr">
M.</div>
<div class="x_ms-outlook-mobile-reference-message x_skipProofing" style="direction:ltr">
<br>
</div>
<blockquote>
<div class="x_ms-outlook-mobile-reference-message x_skipProofing" style="direction:ltr">
On 22. Jan 2026, at 21:05, Dimitris Menemenlis <dimitris.menemenlis@sjsu.edu> wrote:<br>
<br>
</div>
</blockquote>
<blockquote>
<div class="x_ms-outlook-mobile-reference-message x_skipProofing" style="direction:ltr">
Done.  I left a review.  Both options work.</div>
<div class="x_ms-outlook-mobile-reference-message x_skipProofing" style="direction:ltr">
Which one do you recommend that Kayhan and I use?</div>
<div class="x_ms-outlook-mobile-reference-message x_skipProofing" style="direction:ltr">
with or without SHELFICE_USE_HEATBALANCE_FOR_FRESHWATERFLUX defined?</div>
<div class="x_ms-outlook-mobile-reference-message x_skipProofing" style="direction:ltr">
<br>
</div>
<div class="x_ms-outlook-mobile-reference-message x_skipProofing" style="direction:ltr">
Thanks a million for super-quick turnaround on this request.</div>
<div class="x_ms-outlook-mobile-reference-message x_skipProofing" style="direction:ltr">
<br>
</div>
<div class="x_ms-outlook-mobile-reference-message x_skipProofing" style="direction:ltr">
D.</div>
<div class="x_ms-outlook-mobile-reference-message x_skipProofing" style="direction:ltr">
<br>
</div>
<div class="x_ms-outlook-mobile-reference-message x_skipProofing" style="direction:ltr">
<br>
</div>
<blockquote>
<div class="x_ms-outlook-mobile-reference-message x_skipProofing" style="direction:ltr">
On Jan 22, 2026, at 4:58 AM, Martin Losch <Martin.Losch@awi.de> wrote:</div>
<div class="x_ms-outlook-mobile-reference-message x_skipProofing" style="direction:ltr">
<br>
</div>
<div class="x_ms-outlook-mobile-reference-message x_skipProofing" style="direction:ltr; font-family:Helvetica; font-size:12px">
<span style="text-transform:none">Please have a look at PR #968</span></div>
<div class="x_ms-outlook-mobile-reference-message x_skipProofing" style="direction:ltr; text-align:left; text-indent:0px; text-transform:none; font-family:Helvetica; font-size:12px">
<a href="https://urldefense.us/v3/__https://github.com/MITgcm/MITgcm/pull/968__;!!PvBDto6Hs4WbVuu7!NJMtDwoC-xNdirXVV-Z-UZfpysl7_c7oQrii5iuN41ypBQpoyGEGyCxwEQZW9w2OcmeUGO-LgP7acoh3NpYJVPbeiTE$">https://github.com/MITgcm/MITgcm/pull/968</a></div>
<div class="x_ms-outlook-mobile-reference-message x_skipProofing" style="direction:ltr; text-align:left; text-indent:0px; text-transform:none; display:block; font-family:Helvetica; font-size:12px">
<br>
</div>
<div class="x_ms-outlook-mobile-reference-message x_skipProofing" style="direction:ltr; text-align:left; text-indent:0px; text-transform:none; display:block; font-family:Helvetica; font-size:12px">
@Dimitry, it would be great, if you could try this code in your little test, and also review it in github.</div>
<div class="x_ms-outlook-mobile-reference-message x_skipProofing" style="direction:ltr; text-align:left; text-indent:0px; text-transform:none; display:block; font-family:Helvetica; font-size:12px">
<br>
</div>
<div class="x_ms-outlook-mobile-reference-message x_skipProofing" style="direction:ltr; text-align:left; text-indent:0px; text-transform:none; display:block; font-family:Helvetica; font-size:12px">
M</div>
</blockquote>
<div class="x_ms-outlook-mobile-reference-message x_skipProofing" style="direction:ltr">
<br>
</div>
<div class="x_ms-outlook-mobile-reference-message x_skipProofing" style="direction:ltr">
_______________________________________________<br>
MITgcm-support mailing list<br>
MITgcm-support@mitgcm.org<br>
<a href="https://urldefense.us/v3/__http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support__;!!PvBDto6Hs4WbVuu7!NJMtDwoC-xNdirXVV-Z-UZfpysl7_c7oQrii5iuN41ypBQpoyGEGyCxwEQZW9w2OcmeUGO-LgP7acoh3NpYJuh3-YM0$">http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support</a></div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
<div style="line-break:after-white-space">
<div>
<div>
<blockquote type="cite">
<div>_______________________________________________<br>
MITgcm-support mailing list<br>
MITgcm-support@mitgcm.org<br>
http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support<br>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>

<span id="cid:e10cbc4a-d4b2-4077-8e31-4ded2b5c1f98@dmawi.de"><Three equation model v9.pdf></span></div></blockquote></div><br></div></body></html>