<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Dear Charline,<div class=""><br class=""></div><div class="">Thanks for your email, I’ll reply here for posterity. </div><div class=""><br class=""></div><div class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">I’m not as familiar with the coupled set up as I would like, however we should be able to diagnose what’s going on. </span>In my experience, abrupt NaNs in output like this are usually the result of illegal values in a log call. There’s one in “pkg/aim_v23/phy_driver.F” and another in the pH solver for oceanic pCO2 in “pkg/dic/carbon_chem.F” that I would target. I can see how the former could be the issue if aim_pco2 is invalid (negative or zero), which could happen if there is an issue in “pkg/aim_v23/aim_do_co2.F”...<font color="#000000" class="">I think you’d get warnings/errors or immediate crashes if your variable choices were an issue, and also the pCO2 appears to be increasing in your run with “aim_select_pcO2 = 3”, not trending to zero,</font><font color="#000000" class="">  but it wouldn’t hurt to check that the DIC package is indeed talking to the AIM package (for example, do you have "</font>#define COMPONENT_MODULE” in your CPP_EEOPTIONS.h file?) On the other hand, the latter log-call is often at the root of many issues like this so I am wondering if the problem instead lies in the DIC package itself.</div><div class=""><br class=""></div><div class="">So, a couple of things to test:</div><div class="">(1) <span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">Can you post your "data.cpl" and "data.dic" files?</span></div><div class=""><font color="#000000" class=""><br class=""></font></div><div class=""><font color="#000000" class="">(2a) Have a look at the ocean DIC/surface pCO2 and see if there are NaNs propogating there too. If you have fine enough output frequency</font><font color="#000000" class=""> </font><span style="color: rgb(0, 0, 0);" class="">around the crash you observe, you may be able to narrow down where geographically the issue is coming from (possibly a sea-ice region?).</span></div><div class=""><br class=""></div><div class="">(2b) If you are using the default pCO2 solver (which can be bit finicky), I would recompile with "#define CARBONCHEM_SOLVESAPHE" in “DIC_OPTIONS.h” and set "selectPHsolver=1” in the “ABIOTIC_PARMS” section of “data.dic”. This uses a more robust (although possibly more expensive) pH/pCO2 solver.</div><div class=""><br class=""></div><div class="">(3) Have you tried restarting the model with variable absorption coefficient from the end of the run with constant absorption coefficient? I think sometimes there are too many moving parts which causes hard to pin-down erratic behavior as the model adjusts to the initial conditions. </div><div class=""><br class=""></div><div class="">(4) If the above doesnt work you could use the debug framework (#define ALLOW_DEBUG in CPP_OPTIONS.h, set debugMode = .TRUE. in “eedata” file, and set "debugLevel=5” in PARM01 section of your “data” file — lots of messages), plus adding a few print statements for identifying where the NaN first appears, such as maybe print out the relevant variables in <span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">“pkg/aim_v23/aim_do_co2.F” and </span><font color="#000000" class="">“pkg/aim_v23/phy_driver.F”, as well as in “pkg/dic/dic_atmos.F” and “hnew”, “gam” and “stuff” variables in “pkg/dic/carbon_chem.F” subroutine "</font><span style="color: rgb(0, 0, 0); caret-color: rgb(0, 0, 0);" class="">CALC_PCO2_APPROX”</span><span style="color: rgb(0, 0, 0);" class="">.</span></div><div class=""><font color="#000000" class=""><br class=""></font></div><div class=""><font color="#000000" class="">Hope that helps!</font></div><div class=""><font color="#000000" class=""><br class=""></font></div><div class=""><font color="#000000" class="">Jonathan</font></div><div class=""><div class=""><div style="color: rgb(0, 0, 0); word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="font-variant-ligatures: normal; font-variant-position: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; widows: 2; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">___________________________________________________________________________<br class="">Dr. Jonathan M. Lauderdale<br class="">Research Scientist<br class="">Department of Earth, Atmosphere and Planetary Sciences <br class="">Massachusetts Institute of Technology <br class="">77 Massachusetts Avenue (54-1518)<br class="">Cambridge, MA 02139, USA <br class="">Office: +1 617 324 1568 </div><div class="">Cell   : +1 617 304 5661<br class="">Email: <a href="mailto:jml1@mit.edu" class="">mailto:jml1@mit.edu</a></div><div class=""><span style="text-align: -webkit-auto;" class="">Web: </span><a href="http://paocweb.mit.edu/people/jml1" style="text-align: -webkit-auto;" class="">http://paocweb.mit.edu/people/jml1</a></div><div style="font-variant-ligatures: normal; font-variant-position: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; line-height: normal; text-align: -webkit-auto; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Twitter: <a href="https://twitter.com/jon_lauderdale" style="text-align: -webkit-auto;" class="">https://twitter.com/jon_lauderdale<br class=""></a><span style="text-align: -webkit-auto;" class="">Blog: </span><a href="https://seamanticscience.wordpress.com/" style="text-align: -webkit-auto;" class="">https://seamanticscience.wordpress.com/</a></div></div><div style="font-variant-ligatures: normal; font-variant-position: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; widows: 2; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Git: <a href="https://github.com/seamanticscience" class="">https://github.com/seamanticscience</a><br class=""><div class="">___________________________________________________________________________</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><div class=""><br class="webkit-block-placeholder"></div></div><div><blockquote type="cite" class=""><div class="">On Jul 19, 2021, at 8:09 AM, Charline Ragon <<a href="mailto:Charline.Ragon@unige.ch" class="">Charline.Ragon@unige.ch</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Dear all,<br class=""><br class="">I'm performing simulations in a coupled atmosphere, ocean and sea-ice configuration, using the biogeochemical packages GCHEM, DIC and PTRACERS.<br class=""><br class="">I would like to allow a CO2-flux between atmosphere and ocean but I have troubles as all diagnostics are suddenly moving to zero (NaN are appearing in standard outputs). I set parameters dic_int1 = 3 and aim_select_pCO2 = 3, but if I change the value of aim_select_pCO2, this problem is not appearing (at least, I haven't observed it).<br class=""><br class="">I had a look on, and attached to this e-mail, the evolution of atmospheric pCO2 in three similar simulations where I only change the aim_select_pCO2 value to 1, 2 or 3. These runs start from nIter0=0 and tracers are initialized by files. Note that, in my case aim_pCO2 = aim_ref_pCO2 = 320 ppm so it seems the absorption in CO2-band is constant and equals 4 also when aim_select_pCO2 = 1 (so, similar to aim_select_pCO2 = 0).<br class=""><br class="">As I understand it, when the absorption in CO2-band is prescribed the simulation no exhibits the problem even if partial pressure of CO2 is largely increasing in both atmosphere and ocean. So, the zero-appearing should be related to this coefficient but I'm unable to understand exactly what the problem is nor to solve it.<br class=""><br class="">I'm wondering if someone know more about this, and maybe have suggestions for me ?<br class=""><br class="">Thanks in advance for your help!<br class=""><br class="">Best,<br class="">Charline<br class=""><br class=""><br class="">--<br class="">Charline RAGON<br class="">PhD Student<br class="">Group of Applied Physics & Institute for Environmental Sciences<br class="">University of Geneva, Switzerland<br class=""><span id="cid:21A2FCEE-0DAE-4DC4-A958-F910246F6945"><pCO2_atmos.png></span>_______________________________________________<br class="">MITgcm-support mailing list<br class=""><a href="mailto:MITgcm-support@mitgcm.org" class="">MITgcm-support@mitgcm.org</a><br class="">http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support<br class=""></div></div></blockquote></div><br class=""></body></html>