[Met_help] [rt.rap.ucar.edu #79010] History for MRMS for verification in MET

John Halley Gotway via RT met_help at ucar.edu
Wed Jan 18 09:56:17 MST 2017


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

Hello met_help:

I'm looking to incorporate support for using MRMS 0.01-deg GRIB2 grids for verifying WRF GRIB2 output from the UPP.
I prepared the MRMS GRIB2 files to have a name of "APCP" by using the wgrib2mrms utility to rename the GRIB2 field.

So I thought I had everything in order to have it remap the fcst APCP to the MRMS observed 0.01-deg grid.  However, when I run it through regrid_data_plane, I get an error about unexpected earth shape.  I figure that the MRMS GRIB2 file is the offender, but perhaps you might have more insight into the cause and how I can fix it?  FYI, I'm using met-v5.1 and the sample output from regrid_data_plane is shown below.

Sincerely,
Jon @ NASA/SPoRT


MET > /data/sport/apps/MET/met-5.1/bin/regrid_data_plane /raid1/sport/people/casejl/MET/SEUS_APCPf01.grb2 /raid1/sport/people/casejl/MET/gridData/mrms_met_2016111500.grb2 /raid1/sport/people/casejl/MET/gridData/forecastEnd_APCP_obsgrid -field 'name="APCP"; level="A1";' -method BUDGET -width 2 -v 1000            DEBUG 1: Reading data file: /raid1/sport/people/casejl/MET/SEUS_APCPf01.grb2
DEBUG 4: Met2dDataFileFactory::new_met_2d_data_file() -> created new Met2dDataFile object of type "FileType_Gb2".
DEBUG 4: Switching the GRIB2 radius of the earth value of 6371.23 km to 6371.2 km for internal consistency.
DEBUG 4:
DEBUG 4: Lambert Conformal Grid Data:
DEBUG 4:   scale_lat_1: 31
DEBUG 4:   scale_lat_2: 31
DEBUG 4:       lat_pin: 22.434
DEBUG 4:       lon_pin: 98.513
DEBUG 4:         x_pin: 0
DEBUG 4:         y_pin: 0
DEBUG 4:    lon_orient: 87
DEBUG 4:          d_km: 12
DEBUG 4:          r_km: 6371.2
DEBUG 4:            nx: 200
DEBUG 4:            ny: 150
DEBUG 4:
DEBUG 2: Input grid: Projection: Lambert Conformal Nx: 200 Ny: 150 Lat_LL: 22.434 Lon_LL: 98.513 Lon_orient: 87.000 Alpha: 1184.854 Cone: 0.515 Bx: 99.5145 By: 958.1355
DEBUG 3: Use the grid defined by file "/raid1/sport/people/casejl/MET/gridData/mrms_met_2016111500.grb2".
DEBUG 4: Met2dDataFileFactory::new_met_2d_data_file() -> created new Met2dDataFile object of type "FileType_Gb2".
ERROR  :
ERROR  : MetGrib2DataFile::data_plane() - unexpected earth shape (2)
ERROR  :


***********************************************
Jonathan Case;  Research Meteorologist at ENSCO, Inc./NASA
Short-term Prediction Research and Transition (SPoRT) Center
320 Sparkman Dr., Room 3008; Huntsville, AL 35805
Emails: Jonathan.Case-1 at nasa.gov<mailto:Jonathan.Case-1 at nasa.gov> (preferred) or case.jonathan at ensco.com<mailto:case.jonathan at ensco.com>
Voice: 256.961.7504  ;  Fax: 256.961.7788
http://weather.msfc.nasa.gov/sport/
*****************************************************************



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

Subject: MRMS for verification in MET
From: John Halley Gotway
Time: Thu Dec 22 14:11:39 2016

Jon,

Sorry for the delay in getting back to you.  Several of our staff are
out
over the holidays.

I see you're having trouble with the shape the earth.  The source of
the
issue is MET reading data from this file:
   /raid1/sport/people/casejl/MET/SEUS_APCPf01.grb2

That GRIB2 file is assuming the earth to be an oblate spheroid (i.e.
value
of 2):
   http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_table3-2.shtml

In MET version 5.1, this situation results in an error on line 740 of
this
file:
   met-5.1/src/libcode/vx_data2d_grib2/data2d_grib2.cc

    734    switch( gfld->igdtmpl[0] ){
    735       case 0:     r_km = 6367.470;  break;
    736       //  parse earth radius from header
    737       case 1:     r_km = gfld->igdtmpl[2] / 1000.0; break;
    738       case 6:     r_km = 6371.229;  break;
    739       default:
    740          mlog << Error << "\nMetGrib2DataFile::data_plane() -
unexpected earth shape ("
    741               << gfld->igdtmpl[0] << ")\n\n";
    742          exit(1);
    743    }

However in MET version 5.2 we switch that ERROR to an information
message:

    802    switch( gfld->igdtmpl[0] ){
    803       case 0:     r_km = 6367.470;  break;
    804       //  parse earth radius from header
    805       case 1:     r_km = gfld->igdtmpl[2] / 1000.0; break;
    806       case 6:     r_km = 6371.229;  break;
    807       default:
    808          mlog << Debug(3)
    809               << "Unexpected earth shape (" << gfld-
>igdtmpl[0]
    810               << ").  Assuming spherical earth with radius "
    811               << grib_earth_radius_km
    812               << " km for internal consistentcy.\n";
    813          r_km = grib_earth_radius_km;
    814    }

We looked closely at NCEP's code and found that they don't actually do
anything different based on the shape of the earth.  Their code always
assumes the earth to be a sphere with radius = 6371.20 km.  And that's
why
we decided to remove this error condition.

To fix this you could either switch to met-5.2 or patch lines 740-742
of
the 5.1 version of that file with lines 808-813 of the 5.2 version of
that
file and then recompile.

Hope that helps.

Thanks,
John Halley Gotway


On Wed, Dec 21, 2016 at 6:09 AM, Case, Jonathan[ENSCO INC] via RT <
met_help at ucar.edu> wrote:

>
> Wed Dec 21 06:09:51 2016: Request 79010 was acted upon.
> Transaction: Ticket created by jonathan.case-1 at nasa.gov
>        Queue: met_help
>      Subject: MRMS for verification in MET
>        Owner: Nobody
>   Requestors: jonathan.case-1 at nasa.gov
>       Status: new
>  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=79010 >
>
>
> Hello met_help:
>
> I'm looking to incorporate support for using MRMS 0.01-deg GRIB2
grids for
> verifying WRF GRIB2 output from the UPP.
> I prepared the MRMS GRIB2 files to have a name of "APCP" by using
the
> wgrib2mrms utility to rename the GRIB2 field.
>
> So I thought I had everything in order to have it remap the fcst
APCP to
> the MRMS observed 0.01-deg grid.  However, when I run it through
> regrid_data_plane, I get an error about unexpected earth shape.  I
figure
> that the MRMS GRIB2 file is the offender, but perhaps you might have
more
> insight into the cause and how I can fix it?  FYI, I'm using met-
v5.1 and
> the sample output from regrid_data_plane is shown below.
>
> Sincerely,
> Jon @ NASA/SPoRT
>
>
> MET > /data/sport/apps/MET/met-5.1/bin/regrid_data_plane
> /raid1/sport/people/casejl/MET/SEUS_APCPf01.grb2
> /raid1/sport/people/casejl/MET/gridData/mrms_met_2016111500.grb2
> /raid1/sport/people/casejl/MET/gridData/forecastEnd_APCP_obsgrid
-field
> 'name="APCP"; level="A1";' -method BUDGET -width 2 -v 1000
DEBUG
> 1: Reading data file:
/raid1/sport/people/casejl/MET/SEUS_APCPf01.grb2
> DEBUG 4: Met2dDataFileFactory::new_met_2d_data_file() -> created new
> Met2dDataFile object of type "FileType_Gb2".
> DEBUG 4: Switching the GRIB2 radius of the earth value of 6371.23 km
to
> 6371.2 km for internal consistency.
> DEBUG 4:
> DEBUG 4: Lambert Conformal Grid Data:
> DEBUG 4:   scale_lat_1: 31
> DEBUG 4:   scale_lat_2: 31
> DEBUG 4:       lat_pin: 22.434
> DEBUG 4:       lon_pin: 98.513
> DEBUG 4:         x_pin: 0
> DEBUG 4:         y_pin: 0
> DEBUG 4:    lon_orient: 87
> DEBUG 4:          d_km: 12
> DEBUG 4:          r_km: 6371.2
> DEBUG 4:            nx: 200
> DEBUG 4:            ny: 150
> DEBUG 4:
> DEBUG 2: Input grid: Projection: Lambert Conformal Nx: 200 Ny: 150
Lat_LL:
> 22.434 Lon_LL: 98.513 Lon_orient: 87.000 Alpha: 1184.854 Cone: 0.515
Bx:
> 99.5145 By: 958.1355
> DEBUG 3: Use the grid defined by file "/raid1/sport/people/casejl/
> MET/gridData/mrms_met_2016111500.grb2".
> DEBUG 4: Met2dDataFileFactory::new_met_2d_data_file() -> created new
> Met2dDataFile object of type "FileType_Gb2".
> ERROR  :
> ERROR  : MetGrib2DataFile::data_plane() - unexpected earth shape (2)
> ERROR  :
>
>
> ***********************************************
> Jonathan Case;  Research Meteorologist at ENSCO, Inc./NASA
> Short-term Prediction Research and Transition (SPoRT) Center
> 320 Sparkman Dr., Room 3008; Huntsville, AL 35805
> Emails: Jonathan.Case-1 at nasa.gov<mailto:Jonathan.Case-1 at nasa.gov>
> (preferred) or
case.jonathan at ensco.com<mailto:case.jonathan at ensco.com>
> Voice: 256.961.7504  ;  Fax: 256.961.7788
> http://weather.msfc.nasa.gov/sport/
> *****************************************************************
>
>
>

------------------------------------------------
Subject: RE: [rt.rap.ucar.edu #79010] MRMS for verification in MET
From: Case, Jonathan[ENSCO INC]
Time: Mon Jan 09 08:44:07 2017

Thanks John!

I'll work in the code change into our MET v5.1 and test it out
shortly.

-JonC

-----Original Message-----
From: John Halley Gotway via RT [mailto:met_help at ucar.edu]
Sent: Thursday, December 22, 2016 3:12 PM
To: Case, Jonathan (MSFC-ZP11)[ENSCO INC] <jonathan.case-1 at nasa.gov>
Subject: Re: [rt.rap.ucar.edu #79010] MRMS for verification in MET

Jon,

Sorry for the delay in getting back to you.  Several of our staff are
out over the holidays.

I see you're having trouble with the shape the earth.  The source of
the issue is MET reading data from this file:
   /raid1/sport/people/casejl/MET/SEUS_APCPf01.grb2

That GRIB2 file is assuming the earth to be an oblate spheroid (i.e.
value of 2):
   http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_table3-2.shtml

In MET version 5.1, this situation results in an error on line 740 of
this
file:
   met-5.1/src/libcode/vx_data2d_grib2/data2d_grib2.cc

    734    switch( gfld->igdtmpl[0] ){
    735       case 0:     r_km = 6367.470;  break;
    736       //  parse earth radius from header
    737       case 1:     r_km = gfld->igdtmpl[2] / 1000.0; break;
    738       case 6:     r_km = 6371.229;  break;
    739       default:
    740          mlog << Error << "\nMetGrib2DataFile::data_plane() -
unexpected earth shape ("
    741               << gfld->igdtmpl[0] << ")\n\n";
    742          exit(1);
    743    }

However in MET version 5.2 we switch that ERROR to an information
message:

    802    switch( gfld->igdtmpl[0] ){
    803       case 0:     r_km = 6367.470;  break;
    804       //  parse earth radius from header
    805       case 1:     r_km = gfld->igdtmpl[2] / 1000.0; break;
    806       case 6:     r_km = 6371.229;  break;
    807       default:
    808          mlog << Debug(3)
    809               << "Unexpected earth shape (" << gfld-
>igdtmpl[0]
    810               << ").  Assuming spherical earth with radius "
    811               << grib_earth_radius_km
    812               << " km for internal consistentcy.\n";
    813          r_km = grib_earth_radius_km;
    814    }

We looked closely at NCEP's code and found that they don't actually do
anything different based on the shape of the earth.  Their code always
assumes the earth to be a sphere with radius = 6371.20 km.  And that's
why we decided to remove this error condition.

To fix this you could either switch to met-5.2 or patch lines 740-742
of the 5.1 version of that file with lines 808-813 of the 5.2 version
of that file and then recompile.

Hope that helps.

Thanks,
John Halley Gotway


On Wed, Dec 21, 2016 at 6:09 AM, Case, Jonathan[ENSCO INC] via RT <
met_help at ucar.edu> wrote:

>
> Wed Dec 21 06:09:51 2016: Request 79010 was acted upon.
> Transaction: Ticket created by jonathan.case-1 at nasa.gov
>        Queue: met_help
>      Subject: MRMS for verification in MET
>        Owner: Nobody
>   Requestors: jonathan.case-1 at nasa.gov
>       Status: new
>  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=79010
> >
>
>
> Hello met_help:
>
> I'm looking to incorporate support for using MRMS 0.01-deg GRIB2
grids
> for verifying WRF GRIB2 output from the UPP.
> I prepared the MRMS GRIB2 files to have a name of "APCP" by using
the
> wgrib2mrms utility to rename the GRIB2 field.
>
> So I thought I had everything in order to have it remap the fcst
APCP
> to the MRMS observed 0.01-deg grid.  However, when I run it through
> regrid_data_plane, I get an error about unexpected earth shape.  I
> figure that the MRMS GRIB2 file is the offender, but perhaps you
might
> have more insight into the cause and how I can fix it?  FYI, I'm
using
> met-v5.1 and the sample output from regrid_data_plane is shown
below.
>
> Sincerely,
> Jon @ NASA/SPoRT
>
>
> MET > /data/sport/apps/MET/met-5.1/bin/regrid_data_plane
> /raid1/sport/people/casejl/MET/SEUS_APCPf01.grb2
> /raid1/sport/people/casejl/MET/gridData/mrms_met_2016111500.grb2
> /raid1/sport/people/casejl/MET/gridData/forecastEnd_APCP_obsgrid
-field
> 'name="APCP"; level="A1";' -method BUDGET -width 2 -v 1000
DEBUG
> 1: Reading data file:
/raid1/sport/people/casejl/MET/SEUS_APCPf01.grb2
> DEBUG 4: Met2dDataFileFactory::new_met_2d_data_file() -> created new
> Met2dDataFile object of type "FileType_Gb2".
> DEBUG 4: Switching the GRIB2 radius of the earth value of 6371.23 km
> to
> 6371.2 km for internal consistency.
> DEBUG 4:
> DEBUG 4: Lambert Conformal Grid Data:
> DEBUG 4:   scale_lat_1: 31
> DEBUG 4:   scale_lat_2: 31
> DEBUG 4:       lat_pin: 22.434
> DEBUG 4:       lon_pin: 98.513
> DEBUG 4:         x_pin: 0
> DEBUG 4:         y_pin: 0
> DEBUG 4:    lon_orient: 87
> DEBUG 4:          d_km: 12
> DEBUG 4:          r_km: 6371.2
> DEBUG 4:            nx: 200
> DEBUG 4:            ny: 150
> DEBUG 4:
> DEBUG 2: Input grid: Projection: Lambert Conformal Nx: 200 Ny: 150
Lat_LL:
> 22.434 Lon_LL: 98.513 Lon_orient: 87.000 Alpha: 1184.854 Cone: 0.515
Bx:
> 99.5145 By: 958.1355
> DEBUG 3: Use the grid defined by file "/raid1/sport/people/casejl/
> MET/gridData/mrms_met_2016111500.grb2".
> DEBUG 4: Met2dDataFileFactory::new_met_2d_data_file() -> created new
> Met2dDataFile object of type "FileType_Gb2".
> ERROR  :
> ERROR  : MetGrib2DataFile::data_plane() - unexpected earth shape (2)
> ERROR  :
>
>
> ***********************************************
> Jonathan Case;  Research Meteorologist at ENSCO, Inc./NASA Short-
term
> Prediction Research and Transition (SPoRT) Center
> 320 Sparkman Dr., Room 3008; Huntsville, AL 35805
> Emails: Jonathan.Case-1 at nasa.gov<mailto:Jonathan.Case-1 at nasa.gov>
> (preferred) or
case.jonathan at ensco.com<mailto:case.jonathan at ensco.com>
> Voice: 256.961.7504  ;  Fax: 256.961.7788
> http://weather.msfc.nasa.gov/sport/
> *****************************************************************
>
>
>



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


More information about the Met_help mailing list