[Met_help] [rt.rap.ucar.edu #89617] History for error w/ MET 8.0 regrid_data_plane when using the "read_NRL_binary.py" routine and specifying multiple fields

John Halley Gotway via RT met_help at ucar.edu
Fri Apr 5 14:41:06 MDT 2019


----------------------------------------------------------------
  Initial Request
----------------------------------------------------------------

Dear Sir/Ma'am:

Using MET-8.0, I'm attempting to run "regrid_data_plane"  with a direct read 
of two NRL binary fields (using "read_NRL_binary.py"), with the intent of 
putting the two fields into a single .nc file.  The two fields are the same 
variable (500 hPa geopotential height) but they are valid for different dates. 
When doing this, I get an error related to the fact that the fields have the 
same "name":

-bash-4.1$ regrid_data_plane PYTHON_NUMPY G003 verifecmwf.nc \
> -field 'name="./read_NRL_binary.py 
> verifecmwf/hold/geopht_pre_0500.0_0000.0_glob360x181_2016121500_00000000_fcstfld"; 
> level="P500";' \
> -field 'name="./read_NRL_binary.py 
> verifecmwf/hold/geopht_pre_0500.0_0000.0_glob360x181_2016121512_00000000_fcstfld"; 
> level="P500";'
DEBUG 1: Reading data file: PYTHON_NUMPY
Input File: 
'verifecmwf/hold/geopht_pre_0500.0_0000.0_glob360x181_2016121500_00000000_fcstfld'
Data Shape: (181, 360)
Data Type:  dtype('float64')
Data Range: 4754.70703125 to 5931.92578125
Attributes: {'long_name': 'UNKNOWN', 'init': '20161215_000000', 'valid': 
'20161215_000000', 'grid': {'delta_lat': 1.0, 'lon_ll': 0.0, 'name': 'Global 1 
Degree', 'Nlat': 181, 'lat_ll': -90.0, 'delta_lon': 1.0, 'type': 'LatLon', 
'Nlon': 360}, 'name': 'geopht', 'lead': '0', 'level': 'pre_0500.0', 'units': 
'UNKNOWN', 'accum': '00'}
DEBUG 2: Input grid: Projection: Lat/Lon Nx: 360 Ny: 181 lat_ll: -90.000 
lon_ll: -0.000 delta_lat: 1.000 delta_lon: 1.000
DEBUG 2: Output grid: Projection: Lat/Lon Nx: 360 Ny: 181 lat_ll: -90.000 
lon_ll: -0.000 delta_lat: 1.000 delta_lon: 1.000
DEBUG 2: Interpolation options: method = NEAREST, width = 1, shape = SQUARE, 
vld_thresh = 0.5
DEBUG 2: Range of input data (name="./read_NRL_binary.py 
verifecmwf/hold/geopht_pre_0500.0_0000.0_glob360x181_2016121500_00000000_fcstfld"; 
level="P500";) is 4754.71 to 5931.93.
DEBUG 2: Range of regridded data (name="./read_NRL_binary.py 
verifecmwf/hold/geopht_pre_0500.0_0000.0_glob360x181_2016121500_00000000_fcstfld"; 
level="P500";) is 4754.71 to 5931.93.
Input File: 
'verifecmwf/hold/geopht_pre_0500.0_0000.0_glob360x181_2016121512_00000000_fcstfld'
Data Shape: (181, 360)
Data Type:  dtype('float64')
Data Range: 4775.9365234375 to 5930.9365234375
Attributes: {'long_name': 'UNKNOWN', 'init': '20161215_120000', 'valid': 
'20161215_120000', 'grid': {'delta_lat': 1.0, 'lon_ll': 0.0, 'name': 'Global 1 
Degree', 'Nlat': 181, 'lat_ll': -90.0, 'delta_lon': 1.0, 'type': 'LatLon', 
'Nlon': 360}, 'name': 'geopht', 'lead': '0', 'level': 'pre_0500.0', 'units': 
'UNKNOWN', 'accum': '00'}
DEBUG 2: Range of input data (name="./read_NRL_binary.py 
verifecmwf/hold/geopht_pre_0500.0_0000.0_glob360x181_2016121512_00000000_fcstfld"; 
level="P500";) is 4775.94 to 5930.94.
DEBUG 2: Range of regridded data (name="./read_NRL_binary.py 
verifecmwf/hold/geopht_pre_0500.0_0000.0_glob360x181_2016121512_00000000_fcstfld"; 
level="P500";) is 4775.94 to 5930.94.
terminate called after throwing an instance of 
'netCDF::exceptions::NcNameInUse'
  what():  NetCDF: String match to name in use
file: ncGroup.cpp  line:496
Aborted


In the example above, presumably "name" is referring to either "geopht" or 
"Global 1 Degree".  I see that it does read the two binary files successfully, 
it just has a problem writing the second field to the .nc file.

Can you suggest any workarounds to this?  Ultimately, I would like to be able 
to store more than one field of a given variable in a single .nc file, it's 
just cleaner and makes for better bookkeeping.

Sincerely,
Justin McLay






----------------------------------------------------------------
  Complete Ticket History
----------------------------------------------------------------

Subject: error w/ MET 8.0 regrid_data_plane when using the "read_NRL_binary.py" routine and specifying multiple fields
From: John Halley Gotway
Time: Fri Apr 05 12:23:40 2019

Justin,

Unfortunately, the MET NetCDF format is not set up to handle the time
dimension.  By way of example, here's a sample NetCDF output from
MET's
pcp_combine tool:

        float APCP_24(lat, lon) ;
                APCP_24:name = "APCP_24" ;
                APCP_24:long_name = "Total precipitation" ;
                APCP_24:level = "A24" ;
                APCP_24:units = "kg/m^2" ;
                APCP_24:_FillValue = -9999.f ;
                APCP_24:init_time = "20050808_000000" ;
                APCP_24:init_time_ut = "1123459200" ;
                APCP_24:valid_time = "20050808_000000" ;
                APCP_24:valid_time_ut = "1123459200" ;
                APCP_24:accum_time = "240000" ;
                APCP_24:accum_time_sec = 86400 ;

Note that the timing information is stored as variable attributes...
not
using a time dimension.  This is a bad design, and we would like to
transition from MET using the existing convention to using the NetCDF
Climate Forecast (CF) convention instead.

So you're stuck with running regrid_data_plane separately for each
output
time.

Hope that helps clarify.

Thanks,
John

On Fri, Apr 5, 2019 at 12:07 PM McLay, Dr. Justin via RT
<met_help at ucar.edu>
wrote:

>
> Fri Apr 05 12:07:28 2019: Request 89617 was acted upon.
> Transaction: Ticket created by Justin.McLay at nrlmry.navy.mil
>        Queue: met_help
>      Subject: error w/ MET 8.0 regrid_data_plane when using the
> "read_NRL_binary.py" routine and specifying multiple fields
>        Owner: Nobody
>   Requestors: Justin.McLay at nrlmry.navy.mil
>       Status: new
>  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=89617 >
>
>
> Dear Sir/Ma'am:
>
> Using MET-8.0, I'm attempting to run "regrid_data_plane"  with a
direct
> read
> of two NRL binary fields (using "read_NRL_binary.py"), with the
intent of
> putting the two fields into a single .nc file.  The two fields are
the
> same
> variable (500 hPa geopotential height) but they are valid for
different
> dates.
> When doing this, I get an error related to the fact that the fields
have
> the
> same "name":
>
> -bash-4.1$ regrid_data_plane PYTHON_NUMPY G003 verifecmwf.nc \
> > -field 'name="./read_NRL_binary.py
> >
>
verifecmwf/hold/geopht_pre_0500.0_0000.0_glob360x181_2016121500_00000000_fcstfld";
>
> > level="P500";' \
> > -field 'name="./read_NRL_binary.py
> >
>
verifecmwf/hold/geopht_pre_0500.0_0000.0_glob360x181_2016121512_00000000_fcstfld";
>
> > level="P500";'
> DEBUG 1: Reading data file: PYTHON_NUMPY
> Input File:
>
>
'verifecmwf/hold/geopht_pre_0500.0_0000.0_glob360x181_2016121500_00000000_fcstfld'
> Data Shape: (181, 360)
> Data Type:  dtype('float64')
> Data Range: 4754.70703125 to 5931.92578125
> Attributes: {'long_name': 'UNKNOWN', 'init': '20161215_000000',
'valid':
> '20161215_000000', 'grid': {'delta_lat': 1.0, 'lon_ll': 0.0, 'name':
> 'Global 1
> Degree', 'Nlat': 181, 'lat_ll': -90.0, 'delta_lon': 1.0, 'type':
'LatLon',
> 'Nlon': 360}, 'name': 'geopht', 'lead': '0', 'level': 'pre_0500.0',
> 'units':
> 'UNKNOWN', 'accum': '00'}
> DEBUG 2: Input grid: Projection: Lat/Lon Nx: 360 Ny: 181 lat_ll:
-90.000
> lon_ll: -0.000 delta_lat: 1.000 delta_lon: 1.000
> DEBUG 2: Output grid: Projection: Lat/Lon Nx: 360 Ny: 181 lat_ll:
-90.000
> lon_ll: -0.000 delta_lat: 1.000 delta_lon: 1.000
> DEBUG 2: Interpolation options: method = NEAREST, width = 1, shape =
> SQUARE,
> vld_thresh = 0.5
> DEBUG 2: Range of input data (name="./read_NRL_binary.py
>
verifecmwf/hold/geopht_pre_0500.0_0000.0_glob360x181_2016121500_00000000_fcstfld";
>
> level="P500";) is 4754.71 to 5931.93.
> DEBUG 2: Range of regridded data (name="./read_NRL_binary.py
>
verifecmwf/hold/geopht_pre_0500.0_0000.0_glob360x181_2016121500_00000000_fcstfld";
>
> level="P500";) is 4754.71 to 5931.93.
> Input File:
>
>
'verifecmwf/hold/geopht_pre_0500.0_0000.0_glob360x181_2016121512_00000000_fcstfld'
> Data Shape: (181, 360)
> Data Type:  dtype('float64')
> Data Range: 4775.9365234375 to 5930.9365234375
> Attributes: {'long_name': 'UNKNOWN', 'init': '20161215_120000',
'valid':
> '20161215_120000', 'grid': {'delta_lat': 1.0, 'lon_ll': 0.0, 'name':
> 'Global 1
> Degree', 'Nlat': 181, 'lat_ll': -90.0, 'delta_lon': 1.0, 'type':
'LatLon',
> 'Nlon': 360}, 'name': 'geopht', 'lead': '0', 'level': 'pre_0500.0',
> 'units':
> 'UNKNOWN', 'accum': '00'}
> DEBUG 2: Range of input data (name="./read_NRL_binary.py
>
verifecmwf/hold/geopht_pre_0500.0_0000.0_glob360x181_2016121512_00000000_fcstfld";
>
> level="P500";) is 4775.94 to 5930.94.
> DEBUG 2: Range of regridded data (name="./read_NRL_binary.py
>
verifecmwf/hold/geopht_pre_0500.0_0000.0_glob360x181_2016121512_00000000_fcstfld";
>
> level="P500";) is 4775.94 to 5930.94.
> terminate called after throwing an instance of
> 'netCDF::exceptions::NcNameInUse'
>   what():  NetCDF: String match to name in use
> file: ncGroup.cpp  line:496
> Aborted
>
>
> In the example above, presumably "name" is referring to either
"geopht" or
> "Global 1 Degree".  I see that it does read the two binary files
> successfully,
> it just has a problem writing the second field to the .nc file.
>
> Can you suggest any workarounds to this?  Ultimately, I would like
to be
> able
> to store more than one field of a given variable in a single .nc
file,
> it's
> just cleaner and makes for better bookkeeping.
>
> Sincerely,
> Justin McLay
>
>
>
>
>
>

------------------------------------------------
Subject: RE: [rt.rap.ucar.edu #89617] error w/ MET 8.0 regrid_data_plane when using the "read_NRL_binary.py" routine and specifying multiple fields
From: McLay, Dr. Justin
Time: Fri Apr 05 12:57:29 2019

I see, thanks for the explanation and quick response.  It's no bother
in the grand scheme.

Justin


-----Original Message-----
From: John Halley Gotway via RT [mailto:met_help at ucar.edu]
Sent: Friday, April 5, 2019 11:24 AM
To: McLay, Dr. Justin
Subject: Re: [rt.rap.ucar.edu #89617] error w/ MET 8.0
regrid_data_plane when using the "read_NRL_binary.py" routine and
specifying multiple fields

Justin,

Unfortunately, the MET NetCDF format is not set up to handle the time
dimension.  By way of example, here's a sample NetCDF output from
MET's
pcp_combine tool:

        float APCP_24(lat, lon) ;
                APCP_24:name = "APCP_24" ;
                APCP_24:long_name = "Total precipitation" ;
                APCP_24:level = "A24" ;
                APCP_24:units = "kg/m^2" ;
                APCP_24:_FillValue = -9999.f ;
                APCP_24:init_time = "20050808_000000" ;
                APCP_24:init_time_ut = "1123459200" ;
                APCP_24:valid_time = "20050808_000000" ;
                APCP_24:valid_time_ut = "1123459200" ;
                APCP_24:accum_time = "240000" ;
                APCP_24:accum_time_sec = 86400 ;

Note that the timing information is stored as variable attributes...
not
using a time dimension.  This is a bad design, and we would like to
transition from MET using the existing convention to using the NetCDF
Climate Forecast (CF) convention instead.

So you're stuck with running regrid_data_plane separately for each
output
time.

Hope that helps clarify.

Thanks,
John

On Fri, Apr 5, 2019 at 12:07 PM McLay, Dr. Justin via RT
<met_help at ucar.edu>
wrote:

>
> Fri Apr 05 12:07:28 2019: Request 89617 was acted upon.
> Transaction: Ticket created by Justin.McLay at nrlmry.navy.mil
>        Queue: met_help
>      Subject: error w/ MET 8.0 regrid_data_plane when using the
> "read_NRL_binary.py" routine and specifying multiple fields
>        Owner: Nobody
>   Requestors: Justin.McLay at nrlmry.navy.mil
>       Status: new
>  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=89617 >
>
>
> Dear Sir/Ma'am:
>
> Using MET-8.0, I'm attempting to run "regrid_data_plane"  with a
direct
> read
> of two NRL binary fields (using "read_NRL_binary.py"), with the
intent of
> putting the two fields into a single .nc file.  The two fields are
the
> same
> variable (500 hPa geopotential height) but they are valid for
different
> dates.
> When doing this, I get an error related to the fact that the fields
have
> the
> same "name":
>
> -bash-4.1$ regrid_data_plane PYTHON_NUMPY G003 verifecmwf.nc \
> > -field 'name="./read_NRL_binary.py
> >
>
verifecmwf/hold/geopht_pre_0500.0_0000.0_glob360x181_2016121500_00000000_fcstfld";
>
> > level="P500";' \
> > -field 'name="./read_NRL_binary.py
> >
>
verifecmwf/hold/geopht_pre_0500.0_0000.0_glob360x181_2016121512_00000000_fcstfld";
>
> > level="P500";'
> DEBUG 1: Reading data file: PYTHON_NUMPY
> Input File:
>
>
'verifecmwf/hold/geopht_pre_0500.0_0000.0_glob360x181_2016121500_00000000_fcstfld'
> Data Shape: (181, 360)
> Data Type:  dtype('float64')
> Data Range: 4754.70703125 to 5931.92578125
> Attributes: {'long_name': 'UNKNOWN', 'init': '20161215_000000',
'valid':
> '20161215_000000', 'grid': {'delta_lat': 1.0, 'lon_ll': 0.0, 'name':
> 'Global 1
> Degree', 'Nlat': 181, 'lat_ll': -90.0, 'delta_lon': 1.0, 'type':
'LatLon',
> 'Nlon': 360}, 'name': 'geopht', 'lead': '0', 'level': 'pre_0500.0',
> 'units':
> 'UNKNOWN', 'accum': '00'}
> DEBUG 2: Input grid: Projection: Lat/Lon Nx: 360 Ny: 181 lat_ll:
-90.000
> lon_ll: -0.000 delta_lat: 1.000 delta_lon: 1.000
> DEBUG 2: Output grid: Projection: Lat/Lon Nx: 360 Ny: 181 lat_ll:
-90.000
> lon_ll: -0.000 delta_lat: 1.000 delta_lon: 1.000
> DEBUG 2: Interpolation options: method = NEAREST, width = 1, shape =
> SQUARE,
> vld_thresh = 0.5
> DEBUG 2: Range of input data (name="./read_NRL_binary.py
>
verifecmwf/hold/geopht_pre_0500.0_0000.0_glob360x181_2016121500_00000000_fcstfld";
>
> level="P500";) is 4754.71 to 5931.93.
> DEBUG 2: Range of regridded data (name="./read_NRL_binary.py
>
verifecmwf/hold/geopht_pre_0500.0_0000.0_glob360x181_2016121500_00000000_fcstfld";
>
> level="P500";) is 4754.71 to 5931.93.
> Input File:
>
>
'verifecmwf/hold/geopht_pre_0500.0_0000.0_glob360x181_2016121512_00000000_fcstfld'
> Data Shape: (181, 360)
> Data Type:  dtype('float64')
> Data Range: 4775.9365234375 to 5930.9365234375
> Attributes: {'long_name': 'UNKNOWN', 'init': '20161215_120000',
'valid':
> '20161215_120000', 'grid': {'delta_lat': 1.0, 'lon_ll': 0.0, 'name':
> 'Global 1
> Degree', 'Nlat': 181, 'lat_ll': -90.0, 'delta_lon': 1.0, 'type':
'LatLon',
> 'Nlon': 360}, 'name': 'geopht', 'lead': '0', 'level': 'pre_0500.0',
> 'units':
> 'UNKNOWN', 'accum': '00'}
> DEBUG 2: Range of input data (name="./read_NRL_binary.py
>
verifecmwf/hold/geopht_pre_0500.0_0000.0_glob360x181_2016121512_00000000_fcstfld";
>
> level="P500";) is 4775.94 to 5930.94.
> DEBUG 2: Range of regridded data (name="./read_NRL_binary.py
>
verifecmwf/hold/geopht_pre_0500.0_0000.0_glob360x181_2016121512_00000000_fcstfld";
>
> level="P500";) is 4775.94 to 5930.94.
> terminate called after throwing an instance of
> 'netCDF::exceptions::NcNameInUse'
>   what():  NetCDF: String match to name in use
> file: ncGroup.cpp  line:496
> Aborted
>
>
> In the example above, presumably "name" is referring to either
"geopht" or
> "Global 1 Degree".  I see that it does read the two binary files
> successfully,
> it just has a problem writing the second field to the .nc file.
>
> Can you suggest any workarounds to this?  Ultimately, I would like
to be
> able
> to store more than one field of a given variable in a single .nc
file,
> it's
> just cleaner and makes for better bookkeeping.
>
> Sincerely,
> Justin McLay
>
>
>
>
>
>



------------------------------------------------


More information about the Met_help mailing list