cholla-hydro / cholla

A GPU-based hydro code
https://github.com/cholla-hydro/cholla/wiki
MIT License
60 stars 32 forks source link

Patch to fix logic of floor warning messages #373

Closed helenarichie closed 4 months ago

helenarichie commented 4 months ago

As raised in Issue #372, the previous version of the warning messages for the temperature, density, and scalar floors only worked when the temperature_floor, density_floor, and scalar_floor parameters were set in the input parameter file. The intended behavior is for them to be thrown when the parameters are not set or are set to zero by checking whether their values in the header are zero (the default value). I moved the check and error messages outside of Parse_Param after it is called. Otherwise, the warning is thrown multiple times as Parse_Param loops over the other parameters. Let me know if it looks okay.

Thanks @brantr for catching this!

evaneschneider commented 4 months ago

Looks good to me! Did you test the new behavior with/without the parameters set in the input file?

helenarichie commented 4 months ago

I did! It throws the warning when they're set to zero/not set and does nothing when the parameters are there and set to something other than zero.

evaneschneider commented 4 months ago

Great, I'll merge it in and close the issue.