MESAHub / mesa

Modules for Experiments in Stellar Astrophysics
http://mesastar.org
GNU Lesser General Public License v2.1
145 stars 39 forks source link

fpe in skye_thermodynamics.f90 when computing d_dlnT(i_phase) for ideal_gas #338

Closed rjfarmer closed 2 years ago

rjfarmer commented 3 years ago

https://logs.mesastar.org/28bdc2e7cf4bef67dfdff32994a198189dad54b1/cannon_conroy_intel/hot_cool_wind/err.txt

https://github.com/MESAHub/mesa/blob/5aea0772f514430a1cd6668cfeaa5e687578ae29/eos/private/skye_thermodynamics.f90#L177

phase%d1val1 is a nan (temp%val is 115.5299633036653) in fact all of the components of phase are nan

adamjermyn commented 3 years ago

phase was missing an initialization in ideal. I've just pushed a fix. Can you let me know if this is still broken?

rjfarmer commented 3 years ago

Yes that fixed that one, untill the next one occurs :)

https://logs.mesastar.org/22a0d3c8d5b14be31ddb898760f2f8ada11a245c/cannon_conroy_intel/hot_cool_wind/err.txt

#1  0xad6d28 in __math_pown_MOD_powm1_
    at ../private/math_pown.f90:92
#2  0xa0024b in __auto_diff_real_2var_order3_module_MOD_div_self
    at ../private/auto_diff_real_2var_order3_module.f90:2575
#3  0x8a6dc3 in __skye_ideal_MOD_compute_f_rad
    at ../private/skye_ideal.f90:22
#4  0x8a2fd4 in ideal_eos
    at ../private/ideal.f90:175
../private/skye_ideal.f90:22
22        Frad = -crad * pow4(temp) / (3d0 * den)

temp is 39913.152606476753 but the den_in is 6.7995873730963249e-89

and we try to evaluate:

#1  0x000000000144fc69 in auto_diff_real_2var_order3_module::div_self (x=..., y=...)
    at ../private/auto_diff_real_2var_order3_module.f90:2575
2575          q21 = powm1(pow4(y%val))

with y%val being the very low den (who knows why we are trying to evaluate rho=6d-89)

adamjermyn commented 2 years ago

I feel like we're just going to play whack-a-mole with EOS fpe's unless we place some guardrails on EOS calls... We've got an open issue for that (#285), so I'm going to close this one and suggest that EOS fpe's resulting from ridiculous points in (rho, T) go in that discussion.