Skip to content

Commit

Permalink
Bug fix - Fixes issue if FillValue is NaN
Browse files Browse the repository at this point in the history
Fixes NCAR#323
  • Loading branch information
Benjamin Gunn authored and Benjamin Gunn committed Apr 1, 2022
1 parent 90b6dcc commit 4d8a7e6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions assimilation_code/modules/io/io_filenames_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,9 @@ subroutine check_attribute_value_r4(ncFile, filename, ncVarID, att_string, spval
real(r4) :: ret_spvalR4

if ( nf90_get_att(ncFile, ncVarID, att_string, ret_spvalR4) == NF90_NOERR ) then
if (isnan(ret_spvalR4)) then
return
endif
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)
Expand All @@ -742,6 +745,9 @@ subroutine check_attribute_value_r8(ncFile, filename, ncVarID, att_string, spval
real(r8) :: ret_spvalR8

if ( nf90_get_att(ncFile, ncVarID, att_string, ret_spvalR8) == NF90_NOERR ) then
if (isnan(ret_spvalR8)) then
return
endif
if (spvalR8 /= ret_spvalR8) then
write(msgstring,*) ' variable attribute, ', trim(att_string), ' in state', spvalR8, &
' does not match ', trim(att_string), ' ', ret_spvalR8, ' in ', trim(filename)
Expand Down

0 comments on commit 4d8a7e6

Please sign in to comment.