Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: passing in 0 for maxdist to get_close_init() results in unintelligible error #626

Closed
nancycollins opened this issue Jan 24, 2024 · 2 comments · Fixed by #712
Closed
Assignees

Comments

@nancycollins
Copy link
Collaborator

🐛 passing in a maxdist of 0 to get_close_init() should be caught right away

Describe the bug

  1. check out the zero_dist branch
  2. cd into developer_tests/location/threed_sphere and quickbuild
  3. 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.
  4. go into assimilation_code/location/threed_sphere and copy location_mod_fix.f90 to location_mod.f90
  5. 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

@nancycollins
Copy link
Collaborator Author

i've moved the dist_zero branch to my fork of the DART repo.

@hkershaw-brown
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants