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: Checking equality of _FillValues that are NaNs in io_filenames_mod causes DART to exit. #323

Closed
hkershaw-brown opened this issue Jan 19, 2022 · 3 comments · Fixed by #341
Assignees
Labels
Bug Something isn't working

Comments

@hkershaw-brown
Copy link
Member

hkershaw-brown commented Jan 19, 2022

🐛 🐛 🐛

Describe the bug

Checking equality of _FillValues that are NaNs in io_filenames_mod causes DART to exit.

check_attribute_value is called to check _FillValue and missing_value with the following code (r4 and r8) versions:

if ( nf90_get_att(ncFile, ncVarID, att_string, ret_spvalR4) == NF90_NOERR ) then
   if (spvalR4 /= ret_spvalR4) then
      write(msgstring,*) ' variable attribute, ', trim(att_string), ' in state', spvalR4, &
                         ' does not match ', trim(att_string), ' ', ret_spvalR4, ' in ', trim(filename)
      call error_handler(E_ERR, 'check_attribute_value_r4', msgstring, source)
   endif
endif

If _FillValue is NaN then (spvalR4 /= ret_spvalR4) is always true.

Error Message

 ERROR FROM:

  source : io_filenames_mod.f90
  routine: check_attribute_value_r4
  message:   variable attribute, _FillValue in state            NaN  does not match _FillValue             NaN  in /glade/work/gharamti/wrfhydro_dart/florence/initial_ens/hybrid/init_ens/member_000/HYDRO_RST.2018-08-01_00:00_DOMAIN1

Which model(s) are you working with?

Found with wrf-hydro, will effect any netcdf variable that has a missing or fill value attribute that is NaN.

Version of DART

9.12 (been there since at least 2016 though)

Have you modified the DART code?

No

Note to myself: You can test for NaNs before testing /=, but why do we even have to check the missing/fill value attribute is the same? State vs. netcdf file. Input vs. Output. Query the missing/fill value before you write?

@hkershaw-brown hkershaw-brown added the Bug Something isn't working label Feb 3, 2022
@hkershaw-brown
Copy link
Member Author

hkershaw-brown commented Feb 24, 2022

@mgharamti do you have a wrf_hydro netcdf file with _Fill_Value=Nan on Cheyenne that I can grab? Not a problem if you don't.

note: possible good issue for Benjamin G.

@mgharamti
Copy link
Contributor

mgharamti commented Feb 24, 2022

@hkershaw-brown

Here: /glade/work/gharamti/wrfhydro_dart/florence/hydro_restart_fillval_nan.nc
Let me know if this is what you were looking for

@hkershaw-brown
Copy link
Member Author

perfect! thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants