Skip to content

Commit

Permalink
Merge pull request #341 from Benjamin-Gunn/bugfix-nan-netcdf
Browse files Browse the repository at this point in the history
Bug fix - Fixes issue if FillValue is NaN
  • Loading branch information
hkershaw-brown authored Apr 5, 2022
2 parents ff407c2 + f5e1983 commit 2d3f153
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ individual files.

The changes are now listed with the most recent at the top.

**April 5 2022 :: Bug-fix for NetCDF variables with NaN attributes. Tag: v9.16.2**

- Fix for checking attributes of NetCDF variables that have a NaN as the missing or _FillValue.

**April 1 2022 :: Per-obs-type localization for 3D Cartesian location_mod. Tag: v9.16.1**

- Optional per-obs-type localization for 3D Cartesian location
Expand Down
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 (ret_spvalR4 /= 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 (ret_spvalR8 /= 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
4 changes: 2 additions & 2 deletions build_templates/mkmf.template.pgi.linux
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ LD = pgf90

INCS = -I$(NETCDF)/include
LIBS = -L$(NETCDF)/lib -lnetcdff -lnetcdf
FFLAGS = -O -Mbackslash $(INCS)
FFLAGS = -O -Mbackslash -Kieee $(INCS)
LDFLAGS = $(FFLAGS) $(LIBS)

# for development or debugging, use this for flags:
# FFLAGS = -g -gopt -Mbounds -Mchkfpstk -Mchkptr -Mchkstk -Mpgicoff \
# -Mdclchk -Meh_frame -traceback -Minform=inform \
# -Mflushz -Ktrap=fp -pc 64 -Mbackslash $(INCS)
# -Mflushz -Ktrap=fp -pc 64 -Mbackslash -Kieee $(INCS)

# <next few lines under version control, do not edit>
# $URL$
Expand Down
4 changes: 2 additions & 2 deletions build_templates/mkmf.template.pgi.osx
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ LD = pgf90

INCS = -I$(NETCDF)/include
LIBS = -L$(NETCDF)/lib -lnetcdff -lnetcdf
FFLAGS = -O -Mbackslash $(INCS)
FFLAGS = -O -Mbackslash -Kieee $(INCS)
LDFLAGS = $(FFLAGS) $(LIBS)

# for development or debugging, use this for flags:
#FFLAGS = -g -Mbackslash -Ktrap=fp -pc 64 $(INCS)
#FFLAGS = -g -Mbackslash -Kieee -Ktrap=fp -pc 64 $(INCS)

# <next few lines under version control, do not edit>
# $URL$
Expand Down
2 changes: 1 addition & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
author = 'Data Assimilation Research Section'

# The full version, including alpha/beta/rc tags
release = '9.16.1'
release = '9.16.2'
master_doc = 'README'

# -- General configuration ---------------------------------------------------
Expand Down

0 comments on commit 2d3f153

Please sign in to comment.