Bug in int2nc

Topics related to the utilities available in the WPS/util/ directory
Post Reply
bartbrashers
Posts: 59
Joined: Wed Aug 08, 2018 2:21 pm

Bug in int2nc

Post by bartbrashers » Thu Apr 16, 2020 4:45 pm

I have written a program (ghrsst-to-intermediate, beta testers wanted) that reads JPL PODAAC GHRSST netCDF files, and writes WPS Intermediate version 5 files. Another program interpolates Intermediate files in time (interp-intermediate).

Following the advice from this thread: https://forum.mmm.ucar.edu/phpBB3/viewt ... =31&t=9032, the program first writes the SST field, then the LANDSEA mask (found in the GHRSST files) to the SST:YYYY-MM-DD_HH output file.

If I run int2nc.exe on the SST file, it reports both fields:

Code: Select all

% /usr/local/src/wrf/WPS-4.1/util/int2nc.exe SST:2013-12-14_12
 OPENING FILE: SST:2013-12-14_12
 Reading Field, Level: SST, 200100
 Reading Field, Level: LANDSEA, 200100
 SUCCESSFUL COMPLETION OF PROGRAM INT2NC, SST:2013-12-14_12.nc WRITTEN.
However, in the netCDF file, the LANDSEA field values are from the SST field:

Code: Select all

% ncks -s "%0.6f\n" -H -v SST__0200100 SST:2013-12-14_12.nc | head
276.412994
276.407990
276.408997
276.412994
276.417999
276.424988
276.432983
276.441986
276.451996
276.462982
% ncks -s "%0.6f\n" -H -v LANDSEA__0200100 SST:2013-12-14_12.nc | head
276.412994
276.407990
276.408997
276.412994
276.417999
276.424988
276.432983
276.441986
276.451996
276.462982
If I run interp-intermediate in debug mode to write out a point over water, I see that the values look correct (look for the "data = " lines below):

Code: Select all

%interp-intermediate --debug --ij 2000 2000 -i SST:2013-12-14_12 SST:2013-12-15_12 -o SST:2013-12-14_18
 Debug mode turned on.
 Read infile1:
   hdate = 2013-12-14_12:00:00
   field = SST
   units = K
   desc  = Sea Surface Temperature
   nx,ny =         10202         5602
   iproj =             0
   I,J   =          2000         2000
   data  =     292.5640
 Read infile2:
   hdate = 2013-12-15_12:00:00
   field = SST
   units = K
   desc  = Sea Surface Temperature
   nx,ny =         10202         5602
   iproj =             0
   I,J   =          2000         2000
   data  =     293.5480
 Writing to outfile:
   hdate = 2013-12-14_18:00:00
   field = SST
   units = K
   desc  = Sea Surface Temperature
   nx,ny =         10202         5602
   iproj =             0
   I,J   =          2000         2000
   data  =     292.8100

 Read infile1:
   hdate = 2013-12-14_12:00:00
   field = LANDSEA
   units =
   desc  = Land Sea Mask
   nx,ny =         10202         5602
   iproj =             0
   I,J   =          2000         2000
   data  =     0.000000
 Read infile2:
   hdate = 2013-12-15_12:00:00
   field = LANDSEA
   units =
   desc  = Land Sea Mask
   nx,ny =         10202         5602
   iproj =             0
   I,J   =          2000         2000
   data  =     0.000000
 Writing to outfile:
   hdate = 2013-12-14_18:00:00
   field = LANDSEA
   units =
   desc  = Land Sea Mask
   nx,ny =         10202         5602
   iproj =             0
   I,J   =          2000         2000
   data  =     0.000000
I looked at utils/src/int2nc.F, but the bug is not obvious.

I have uploaded sample SST:* and SST:*.nc file to the nextcloud.mmm.ucar.edu "Upload files to admin", named "SST_files_showing_int2nc_bug.zip".

I'll post my ghrsst-to-intermediate and interp-intermediate codes to Github shortly.


kwerner
Posts: 1926
Joined: Wed Feb 14, 2018 9:21 pm

Re: Bug in int2nc

Post by kwerner » Thu Apr 16, 2020 9:27 pm

Bart,
First, I would like to thank you for your contributions to our code, and also for helping out with forum inquiries. Your efforts are greatly appreciated!

I am forwarding this inquiry to the person who wrote the int2nc program and hopefully they will be able to respond soon.

-Kelly
NCAR/MMM

Post Reply

Return to “WPS Utilities”