NCAR / DART

Data Assimilation Research Testbed
https://dart.ucar.edu/
Apache License 2.0
184 stars 139 forks source link

bug: the ncep error module crashes for obs with pressures < 1 mb if debug flags on #608

Open nancycollins opened 7 months ago

nancycollins commented 7 months ago

:bug: the ncep error module crashes for obs at pressures < 1 mb if debug flags on

Describe the bug

  1. check out the ncep_errors branch
  2. copy over the main branch observations/obs_converters/obs_error/ncep_obs_err_mod.f90
  3. build developer_tests/obs_converters/obs_error/work/obs_ncep_error_test WITH DEBUGGING FLAGS!!
  4. with the original ncep obs_error_mod.f90 it crashes when the pressure is < 1.0 when taking log(0)
  5. check out the ncep_obs_err_mod.f90 from this branch
  6. with the fixed ncep_obs_err_mod it doesn't crash

Error Message

it crashes when taking the log of 0 if debugging flags are on. it silently computes log(0) == 0 with the optimized flags which is why this probably hasn't been caught before. that happens to return a valid value, so this hasn't been a numerical problem. but if you turn on debugging flags to debug something else, you crash here instead.

Version of DART

the bug is on the main branch (and all others)

Have you modified the DART code?

Yes, the fixes are on the ncep_errors branch

hkershaw-brown commented 6 months ago

moved this branch to https://github.com/hkershaw-brown/DART/tree/ncep_errors

note this branch has airs_obs_mod.f90 changes unrelated to this issue

lines of code where log of zero occurs:https://github.com/NCAR/DART/blob/99ebec56a6efdd243ed026da24b29a1a45bb8cdd/observations/obs_converters/obs_error/ncep_obs_err_mod.f90#L549-L558