DART
DART copied to clipboard
bug: passing in 0 for maxdist to get_close_init() results in unintelligible error
:bug: passing in a maxdist of 0 to get_close_init() should be caught right away
Describe the bug
- check out the zero_dist branch
- cd into developer_tests/location/threed_sphere and quickbuild
- run the code. if compiled without debug flags, it prints the cryptic msg below. compiled with debug flags, it crashes in an acos() call in find_del_lon.
- go into assimilation_code/location/threed_sphere and copy location_mod_fix.f90 to location_mod.f90
- recompile and run the test again. it errors out with a clear error message
this case showed up in user code that was passing in 0 by mistake instead of the intended value for maxdist.
Error Message
get_close_init Contact Dart Developers: this error should not happen
ERROR FROM:
source : threed_sphere/location_mod.f90
routine: get_close_init
message: location outside grid boxes, index value: -2147483647
Which model(s) are you working with?
anything using threed_sphere
Version of DART
main branch version 11.0.1 fix and developer_test code is on zero_dist branch
Have you modified the DART code?
Yes assimilation_code/location/threed_sphere/location_mod_fix.f90 on this branch has an added test for an invalid maxdist and a clear error message developer_tests/location/threed_sphere has a quickbuild test to verify the fix.
Build information
tested on derecho, intel compiler
i've moved the dist_zero branch to my fork of the DART repo.
if (maxdist <= 0.0_r8) then
write(msgstring, *) 'bad maxdist value ', maxdist, ' , must be > 0'
call error_handler(E_ERR, 'get_close_init', msgstring, source)
endif