[MITgcm-support] Simulation with varying atmospheric pCO2

Jonathan Lauderdale jml1 at mit.edu
Fri Aug 6 13:25:16 EDT 2021


Dear Charline,

Thanks for your email, I’ll reply here for posterity. 

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. 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”...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,  but it wouldn’t hurt to check that the DIC package is indeed talking to the AIM package (for example, do you have "#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.

So, a couple of things to test:
(1) Can you post your "data.cpl" and "data.dic" files?

(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 around the crash you observe, you may be able to narrow down where geographically the issue is coming from (possibly a sea-ice region?).

(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.

(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. 

(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 “pkg/aim_v23/aim_do_co2.F” and “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 "CALC_PCO2_APPROX”.

Hope that helps!

Jonathan
___________________________________________________________________________
Dr. Jonathan M. Lauderdale
Research Scientist
Department of Earth, Atmosphere and Planetary Sciences 
Massachusetts Institute of Technology 
77 Massachusetts Avenue (54-1518)
Cambridge, MA 02139, USA 
Office: +1 617 324 1568 
Cell   : +1 617 304 5661
Email: mailto:jml1 at mit.edu <mailto:jml1 at mit.edu>
Web: http://paocweb.mit.edu/people/jml1 <http://paocweb.mit.edu/people/jml1>
Twitter: https://twitter.com/jon_lauderdale
 <https://twitter.com/jon_lauderdale>Blog: https://seamanticscience.wordpress.com/ <https://seamanticscience.wordpress.com/>
Git: https://github.com/seamanticscience <https://github.com/seamanticscience>
___________________________________________________________________________

> On Jul 19, 2021, at 8:09 AM, Charline Ragon <Charline.Ragon at unige.ch> wrote:
> 
> Dear all,
> 
> I'm performing simulations in a coupled atmosphere, ocean and sea-ice configuration, using the biogeochemical packages GCHEM, DIC and PTRACERS.
> 
> 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).
> 
> 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).
> 
> 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.
> 
> I'm wondering if someone know more about this, and maybe have suggestions for me ?
> 
> Thanks in advance for your help!
> 
> Best,
> Charline
> 
> 
> --
> Charline RAGON
> PhD Student
> Group of Applied Physics & Institute for Environmental Sciences
> University of Geneva, Switzerland
> <pCO2_atmos.png>_______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mitgcm.org/pipermail/mitgcm-support/attachments/20210806/57a53cd0/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1864 bytes
Desc: not available
URL: <http://mailman.mitgcm.org/pipermail/mitgcm-support/attachments/20210806/57a53cd0/attachment.p7s>


More information about the MITgcm-support mailing list