[Met_help] [rt.rap.ucar.edu #87654] History for MODE-TD segmentation fault

John Halley Gotway via RT met_help at ucar.edu
Tue Jul 9 12:07:18 MDT 2019


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

Dear Sir/Madam,
I am Lintao, trying to use MODE-TD to analyse wrf performance in Canada.
However, I got the error message as:
Segmentation fault (core dumped)

I run MET on Cheyenne, using the follow code as an example:
mtd -fcst
/glade/scratch/lintao/paper/data/cut_test/ca4km/cut_regridded_2004-09-01_06:00:
00.nc \
/glade/scratch/lintao/paper/data/cut_test/ca4km/cut_regridded_2004-09-01_07:00:
00.nc \
-obs /glade/scratch/lintao/paper/data/cut_test/capa/cut_2004-09-01_06:00:
00.nc \
/glade/scratch/lintao/paper/data/cut_test/capa/cut_2004-09-01_07:00:00.nc \
-config /glade/scratch/lintao/paper/data/MTDConfig \
-outdir /glade/scratch/lintao/paper/data/mtd \
-v 1
###############################

The raw observation data are: /glade/scratch/lintao/paper/data/capa/2004*,
which has 0.125 degree spatial resolution;
And the raw wrf output are: /glade/scratch/lintao/paper/data/ca4km/2004*,
which has spatial resolution around 4km.
To run MTD, I first regridded the wrf output to the observations, using the
following code:
cd /glade/scratch/lintao/paper/data/ca4km
for file in 2004*; do
    regrid_data_plane \
    /glade/scratch/lintao/paper/data/ca4km/$file \
    "latlon 543 211 46.0938 -150.9238 0.125 0.125" \
    /glade/scratch/lintao/paper/data/regrid/python_$file \
    -field 'name="PREC"; level="(0,*,*)"; file_type=NETCDF_NCCF;' \
    -method NEAREST -width 1
done

I got the segmentation fault when I run MTD using this regridded fcst data
and the obs data at: /glade/scratch/lintao/paper/data/capa/2004*. It seems
the above regrid process has some problems. The fcst data (wrf output) has
2-Dimension lon lat info, and the obs data has 1-D lon, lat info. Perhaps
due to this inconsistency, the regridded data are masked in the surrounding
area, and only have values closing to the center area.

#########################################
So my first question is: How should I regrid data with 2-D lon, lat info to
data with 1-D lon, lat info?
My second question is: for the above mtd code, I made obs and fcst data
having exactly the same spatial info. However, I still got the segmentation
fault. Why?

Please feel free to go to my /glade directory and have a look, or to copy
the files to your working directory.

Thank you very much

Best regards,
Lintao


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

Subject: MODE-TD segmentation fault
From: John Halley Gotway
Time: Mon Nov 05 15:25:11 2018

Lintao,

I see you're getting a segfault when running the mtd tool.  Thanks for
sending me a command to replicate the error.  I was able to see the
exact
behavior your describe.  Also, I was able to replicate this behavior
running your data through any other MET tools as well.  So the problem
is
not specific to MTD.

Looking closely at the metadata in your file, I see the problem:

ncdump -h cut_regridded_2004-09-01_06:00:00.nc
dimensions:
        lat = 190 ;
        lon = 251 ;
...
                :Nlat = "211 grid_points" ;
                :Nlon = "536 grid_points" ;

The lat/lon dimensions are defined as 190x251 but the grid information
is
defined as 211x536.  MET tries to read 211x536 = 113,096 data values
from
the NetCDF variable but only 190x251 = 47,690 are actually present.
And
that causes this error message:


*terminate called after throwing an instance of
'netCDF::exceptions::NcEdge'  what():  NcEdge: Edge+start exceeds
dimension
bound*

So the problem is that your grid definition is not consistent with
your
data.  Since this is a lat/lon grid, it's easy to figure out:
Latitudes range from 46.1875 to 69.8125 and are spaced 0.1250 degrees
apart.
Longitudes range from -133.3125 to -120.0625 and are spaced 0.1250
degrees
apart.
So your grid definition should be this:

                :Projection = "LatLon" ;
                :lat_ll = "46.1875 degrees_north" ;
                :lon_ll = "-133.3125 degrees_east" ;
                :delta_lat = "0.125 degrees" ;
                :delta_lon = "0.125 degrees" ;
                :Nlat = "190 grid_points" ;
                :Nlon = "251 grid_points" ;

Please try updating the grid definition in these files and rerunning
MTD.

Thanks,
John Halley Gotway






On Mon, Nov 5, 2018 at 10:14 AM Lintao Li via RT <met_help at ucar.edu>
wrote:

>
> Mon Nov 05 10:14:26 2018: Request 87654 was acted upon.
> Transaction: Ticket created by lintaoli168 at gmail.com
>        Queue: met_help
>      Subject: MODE-TD segmentation fault
>        Owner: Nobody
>   Requestors: lintaoli168 at gmail.com
>       Status: new
>  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=87654 >
>
>
> Dear Sir/Madam,
> I am Lintao, trying to use MODE-TD to analyse wrf performance in
Canada.
> However, I got the error message as:
> Segmentation fault (core dumped)
>
> I run MET on Cheyenne, using the follow code as an example:
> mtd -fcst
>
> /glade/scratch/lintao/paper/data/cut_test/ca4km/cut_regridded_2004-
09-01_06:00:
> 00.nc \
>
> /glade/scratch/lintao/paper/data/cut_test/ca4km/cut_regridded_2004-
09-01_07:00:
> 00.nc \
> -obs /glade/scratch/lintao/paper/data/cut_test/capa/cut_2004-09-
01_06:00:
> 00.nc \
> /glade/scratch/lintao/paper/data/cut_test/capa/cut_2004-09-
01_07:00:00.nc
> \
> -config /glade/scratch/lintao/paper/data/MTDConfig \
> -outdir /glade/scratch/lintao/paper/data/mtd \
> -v 1
> ###############################
>
> The raw observation data are:
/glade/scratch/lintao/paper/data/capa/2004*,
> which has 0.125 degree spatial resolution;
> And the raw wrf output are:
/glade/scratch/lintao/paper/data/ca4km/2004*,
> which has spatial resolution around 4km.
> To run MTD, I first regridded the wrf output to the observations,
using the
> following code:
> cd /glade/scratch/lintao/paper/data/ca4km
> for file in 2004*; do
>     regrid_data_plane \
>     /glade/scratch/lintao/paper/data/ca4km/$file \
>     "latlon 543 211 46.0938 -150.9238 0.125 0.125" \
>     /glade/scratch/lintao/paper/data/regrid/python_$file \
>     -field 'name="PREC"; level="(0,*,*)"; file_type=NETCDF_NCCF;' \
>     -method NEAREST -width 1
> done
>
> I got the segmentation fault when I run MTD using this regridded
fcst data
> and the obs data at: /glade/scratch/lintao/paper/data/capa/2004*. It
seems
> the above regrid process has some problems. The fcst data (wrf
output) has
> 2-Dimension lon lat info, and the obs data has 1-D lon, lat info.
Perhaps
> due to this inconsistency, the regridded data are masked in the
surrounding
> area, and only have values closing to the center area.
>
> #########################################
> So my first question is: How should I regrid data with 2-D lon, lat
info to
> data with 1-D lon, lat info?
> My second question is: for the above mtd code, I made obs and fcst
data
> having exactly the same spatial info. However, I still got the
segmentation
> fault. Why?
>
> Please feel free to go to my /glade directory and have a look, or to
copy
> the files to your working directory.
>
> Thank you very much
>
> Best regards,
> Lintao
>
>

------------------------------------------------
Subject: MODE-TD segmentation fault
From: Lintao Li
Time: Mon Nov 05 19:02:37 2018

Hello John,

Thanks a lot for your reply.
1) Based on your suggestion, I updated the grid info. However, I still
got
the seg fault by using the same command.

2) By the way, I did not see error message like:
*terminate called after throwing an instance of
'netCDF::exceptions::NcEdge'  what():  NcEdge: Edge+start exceeds
dimension
bound*
May I ask how did you get this message please?

3) I still want to know how to regrid data with 2-D lat, lon info to
data
with 1-D lat, lon info.

Thank you.
Best regards,
Lintao


On Mon, Nov 5, 2018 at 3:25 PM John Halley Gotway via RT
<met_help at ucar.edu>
wrote:

> Lintao,
>
> I see you're getting a segfault when running the mtd tool.  Thanks
for
> sending me a command to replicate the error.  I was able to see the
exact
> behavior your describe.  Also, I was able to replicate this behavior
> running your data through any other MET tools as well.  So the
problem is
> not specific to MTD.
>
> Looking closely at the metadata in your file, I see the problem:
>
> ncdump -h cut_regridded_2004-09-01_06:00:00.nc
> dimensions:
>         lat = 190 ;
>         lon = 251 ;
> ...
>                 :Nlat = "211 grid_points" ;
>                 :Nlon = "536 grid_points" ;
>
> The lat/lon dimensions are defined as 190x251 but the grid
information is
> defined as 211x536.  MET tries to read 211x536 = 113,096 data values
from
> the NetCDF variable but only 190x251 = 47,690 are actually present.
And
> that causes this error message:
>
>
> *terminate called after throwing an instance of
> 'netCDF::exceptions::NcEdge'  what():  NcEdge: Edge+start exceeds
dimension
> bound*
>
> So the problem is that your grid definition is not consistent with
your
> data.  Since this is a lat/lon grid, it's easy to figure out:
> Latitudes range from 46.1875 to 69.8125 and are spaced 0.1250
degrees
> apart.
> Longitudes range from -133.3125 to -120.0625 and are spaced 0.1250
degrees
> apart.
> So your grid definition should be this:
>
>                 :Projection = "LatLon" ;
>                 :lat_ll = "46.1875 degrees_north" ;
>                 :lon_ll = "-133.3125 degrees_east" ;
>                 :delta_lat = "0.125 degrees" ;
>                 :delta_lon = "0.125 degrees" ;
>                 :Nlat = "190 grid_points" ;
>                 :Nlon = "251 grid_points" ;
>
> Please try updating the grid definition in these files and rerunning
MTD.
>
> Thanks,
> John Halley Gotway
>
>
>
>
>
>
> On Mon, Nov 5, 2018 at 10:14 AM Lintao Li via RT <met_help at ucar.edu>
> wrote:
>
> >
> > Mon Nov 05 10:14:26 2018: Request 87654 was acted upon.
> > Transaction: Ticket created by lintaoli168 at gmail.com
> >        Queue: met_help
> >      Subject: MODE-TD segmentation fault
> >        Owner: Nobody
> >   Requestors: lintaoli168 at gmail.com
> >       Status: new
> >  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=87654 >
> >
> >
> > Dear Sir/Madam,
> > I am Lintao, trying to use MODE-TD to analyse wrf performance in
Canada.
> > However, I got the error message as:
> > Segmentation fault (core dumped)
> >
> > I run MET on Cheyenne, using the follow code as an example:
> > mtd -fcst
> >
> >
> /glade/scratch/lintao/paper/data/cut_test/ca4km/cut_regridded_2004-
09-01_06:00:
> > 00.nc \
> >
> >
> /glade/scratch/lintao/paper/data/cut_test/ca4km/cut_regridded_2004-
09-01_07:00:
> > 00.nc \
> > -obs /glade/scratch/lintao/paper/data/cut_test/capa/cut_2004-09-
01_06:00:
> > 00.nc \
> > /glade/scratch/lintao/paper/data/cut_test/capa/cut_2004-09-
01_07:00:
> 00.nc
> > \
> > -config /glade/scratch/lintao/paper/data/MTDConfig \
> > -outdir /glade/scratch/lintao/paper/data/mtd \
> > -v 1
> > ###############################
> >
> > The raw observation data are:
> /glade/scratch/lintao/paper/data/capa/2004*,
> > which has 0.125 degree spatial resolution;
> > And the raw wrf output are:
/glade/scratch/lintao/paper/data/ca4km/2004*,
> > which has spatial resolution around 4km.
> > To run MTD, I first regridded the wrf output to the observations,
using
> the
> > following code:
> > cd /glade/scratch/lintao/paper/data/ca4km
> > for file in 2004*; do
> >     regrid_data_plane \
> >     /glade/scratch/lintao/paper/data/ca4km/$file \
> >     "latlon 543 211 46.0938 -150.9238 0.125 0.125" \
> >     /glade/scratch/lintao/paper/data/regrid/python_$file \
> >     -field 'name="PREC"; level="(0,*,*)"; file_type=NETCDF_NCCF;'
\
> >     -method NEAREST -width 1
> > done
> >
> > I got the segmentation fault when I run MTD using this regridded
fcst
> data
> > and the obs data at: /glade/scratch/lintao/paper/data/capa/2004*.
It
> seems
> > the above regrid process has some problems. The fcst data (wrf
output)
> has
> > 2-Dimension lon lat info, and the obs data has 1-D lon, lat info.
Perhaps
> > due to this inconsistency, the regridded data are masked in the
> surrounding
> > area, and only have values closing to the center area.
> >
> > #########################################
> > So my first question is: How should I regrid data with 2-D lon,
lat info
> to
> > data with 1-D lon, lat info?
> > My second question is: for the above mtd code, I made obs and fcst
data
> > having exactly the same spatial info. However, I still got the
> segmentation
> > fault. Why?
> >
> > Please feel free to go to my /glade directory and have a look, or
to copy
> > the files to your working directory.
> >
> > Thank you very much
> >
> > Best regards,
> > Lintao
> >
> >
>
>

------------------------------------------------
Subject: MODE-TD segmentation fault
From: John Halley Gotway
Time: Tue Nov 06 14:15:12 2018

Lintao,

Sorry for not pointing this out in my last email... I was using MET's
plot_data_plane tool for testing.  When trying to get started with a
new
gridded dataset with MET, I usually start with plot_data_plane.  That
tool
reads the gridded field you request on the command line and it make a
PostScript plot of the data.  That's a great way of testing to see if
MET
is reading your data as expected.

Here's the commands I ran on cheyenne:


*module use /glade/p/ral/jntp/MET/MET_releases/modulefilesmodule load
met/8.0*
*plot_data_plane \*
*/glade/scratch/lintao/paper/data/cut_test/ca4km/cut_regridded_2004-
09-01_06:00:00.nc
<http://00.nc> \*
*fcst.ps <http://fcst.ps> \*
* 'name="PREC"; level="(*,*)";'*

After fixing the dimensions, plot_data_plane now seems happy.  So I
tested
your observations as well... but plot_data_plane isn't happy:

*plot_data_plane \*
*/glade/scratch/lintao/paper/data/cut_test/capa/cut_2004-09-
01_06:00:00.nc
<http://00.nc> \*
*obs.ps <http://obs.ps> \*
*'name="pr"; level="(0,0,*,*)";'*

But I get an error...
ERROR  : plot_data_plane -> file
"/glade/scratch/lintao/paper/data/cut_test/capa/cut_2004-09-
01_06:00:00.nc"
not a valid data file

Looking at your data, this is a very close to a CF-compliant NetCDF
file...
so I told MET to interpret it as such by adding *file_type =
NETCDF_NCCF;*

*plot_data_plane \*
* /glade/scratch/lintao/paper/data/cut_test/capa/cut_2004-09-
01_06:00:00.nc
<http://00.nc> \*
*obs.ps <http://obs.ps> \*
*'name="pr"; level="(0,0,*,*)"; file_type = NETCDF_NCCF;'*

I've attached PNG versions of the resulting images.

Please try using the attached MTD config file, which now uses the
file_type
option.

Thanks,
John


On Mon, Nov 5, 2018 at 7:03 PM Lintao Li via RT <met_help at ucar.edu>
wrote:

>
> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=87654 >
>
> Hello John,
>
> Thanks a lot for your reply.
> 1) Based on your suggestion, I updated the grid info. However, I
still got
> the seg fault by using the same command.
>
> 2) By the way, I did not see error message like:
> *terminate called after throwing an instance of
> 'netCDF::exceptions::NcEdge'  what():  NcEdge: Edge+start exceeds
dimension
> bound*
> May I ask how did you get this message please?
>
> 3) I still want to know how to regrid data with 2-D lat, lon info to
data
> with 1-D lat, lon info.
>
> Thank you.
> Best regards,
> Lintao
>
>
> On Mon, Nov 5, 2018 at 3:25 PM John Halley Gotway via RT <
> met_help at ucar.edu>
> wrote:
>
> > Lintao,
> >
> > I see you're getting a segfault when running the mtd tool.  Thanks
for
> > sending me a command to replicate the error.  I was able to see
the exact
> > behavior your describe.  Also, I was able to replicate this
behavior
> > running your data through any other MET tools as well.  So the
problem is
> > not specific to MTD.
> >
> > Looking closely at the metadata in your file, I see the problem:
> >
> > ncdump -h cut_regridded_2004-09-01_06:00:00.nc
> > dimensions:
> >         lat = 190 ;
> >         lon = 251 ;
> > ...
> >                 :Nlat = "211 grid_points" ;
> >                 :Nlon = "536 grid_points" ;
> >
> > The lat/lon dimensions are defined as 190x251 but the grid
information is
> > defined as 211x536.  MET tries to read 211x536 = 113,096 data
values from
> > the NetCDF variable but only 190x251 = 47,690 are actually
present.  And
> > that causes this error message:
> >
> >
> > *terminate called after throwing an instance of
> > 'netCDF::exceptions::NcEdge'  what():  NcEdge: Edge+start exceeds
> dimension
> > bound*
> >
> > So the problem is that your grid definition is not consistent with
your
> > data.  Since this is a lat/lon grid, it's easy to figure out:
> > Latitudes range from 46.1875 to 69.8125 and are spaced 0.1250
degrees
> > apart.
> > Longitudes range from -133.3125 to -120.0625 and are spaced 0.1250
> degrees
> > apart.
> > So your grid definition should be this:
> >
> >                 :Projection = "LatLon" ;
> >                 :lat_ll = "46.1875 degrees_north" ;
> >                 :lon_ll = "-133.3125 degrees_east" ;
> >                 :delta_lat = "0.125 degrees" ;
> >                 :delta_lon = "0.125 degrees" ;
> >                 :Nlat = "190 grid_points" ;
> >                 :Nlon = "251 grid_points" ;
> >
> > Please try updating the grid definition in these files and
rerunning MTD.
> >
> > Thanks,
> > John Halley Gotway
> >
> >
> >
> >
> >
> >
> > On Mon, Nov 5, 2018 at 10:14 AM Lintao Li via RT
<met_help at ucar.edu>
> > wrote:
> >
> > >
> > > Mon Nov 05 10:14:26 2018: Request 87654 was acted upon.
> > > Transaction: Ticket created by lintaoli168 at gmail.com
> > >        Queue: met_help
> > >      Subject: MODE-TD segmentation fault
> > >        Owner: Nobody
> > >   Requestors: lintaoli168 at gmail.com
> > >       Status: new
> > >  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=87654
> >
> > >
> > >
> > > Dear Sir/Madam,
> > > I am Lintao, trying to use MODE-TD to analyse wrf performance in
> Canada.
> > > However, I got the error message as:
> > > Segmentation fault (core dumped)
> > >
> > > I run MET on Cheyenne, using the follow code as an example:
> > > mtd -fcst
> > >
> > >
> >
> /glade/scratch/lintao/paper/data/cut_test/ca4km/cut_regridded_2004-
09-01_06:00:
> > > 00.nc \
> > >
> > >
> >
> /glade/scratch/lintao/paper/data/cut_test/ca4km/cut_regridded_2004-
09-01_07:00:
> > > 00.nc \
> > > -obs
> /glade/scratch/lintao/paper/data/cut_test/capa/cut_2004-09-01_06:00:
> > > 00.nc \
> > > /glade/scratch/lintao/paper/data/cut_test/capa/cut_2004-09-
01_07:00:
> > 00.nc
> > > \
> > > -config /glade/scratch/lintao/paper/data/MTDConfig \
> > > -outdir /glade/scratch/lintao/paper/data/mtd \
> > > -v 1
> > > ###############################
> > >
> > > The raw observation data are:
> > /glade/scratch/lintao/paper/data/capa/2004*,
> > > which has 0.125 degree spatial resolution;
> > > And the raw wrf output are:
> /glade/scratch/lintao/paper/data/ca4km/2004*,
> > > which has spatial resolution around 4km.
> > > To run MTD, I first regridded the wrf output to the
observations, using
> > the
> > > following code:
> > > cd /glade/scratch/lintao/paper/data/ca4km
> > > for file in 2004*; do
> > >     regrid_data_plane \
> > >     /glade/scratch/lintao/paper/data/ca4km/$file \
> > >     "latlon 543 211 46.0938 -150.9238 0.125 0.125" \
> > >     /glade/scratch/lintao/paper/data/regrid/python_$file \
> > >     -field 'name="PREC"; level="(0,*,*)";
file_type=NETCDF_NCCF;' \
> > >     -method NEAREST -width 1
> > > done
> > >
> > > I got the segmentation fault when I run MTD using this regridded
fcst
> > data
> > > and the obs data at:
/glade/scratch/lintao/paper/data/capa/2004*. It
> > seems
> > > the above regrid process has some problems. The fcst data (wrf
output)
> > has
> > > 2-Dimension lon lat info, and the obs data has 1-D lon, lat
info.
> Perhaps
> > > due to this inconsistency, the regridded data are masked in the
> > surrounding
> > > area, and only have values closing to the center area.
> > >
> > > #########################################
> > > So my first question is: How should I regrid data with 2-D lon,
lat
> info
> > to
> > > data with 1-D lon, lat info?
> > > My second question is: for the above mtd code, I made obs and
fcst data
> > > having exactly the same spatial info. However, I still got the
> > segmentation
> > > fault. Why?
> > >
> > > Please feel free to go to my /glade directory and have a look,
or to
> copy
> > > the files to your working directory.
> > >
> > > Thank you very much
> > >
> > > Best regards,
> > > Lintao
> > >
> > >
> >
> >
>
>

------------------------------------------------
Subject: MODE-TD segmentation fault
From: John Halley Gotway
Time: Tue Nov 06 14:22:29 2018

I should have mentioned, not using that "file_type" option was causing
the
segfault.  And I need to think of a better way of handling this
situation.

You can specify a list of gridded data files for MTD to process in two
ways...
(1) List them directly on the command line.
(2) Give an ascii file which contains a list of files to process.

The logic is currently this...
- try to read the string as a gridded data file.
- if successful, read all elements as gridded data files.
- if not successful, open it as an ascii file and process the
filenames
inside.

In your case, you defined gridded data filenames on the command line.
BUT
MET was unable to read the ones in the "-obs" list.  So it tried to
process
your NetCDF file as an ascii file, which led to a segfault.

Not sure what the best logic would be here.

Thanks,
John

On Tue, Nov 6, 2018 at 2:14 PM John Halley Gotway <johnhg at ucar.edu>
wrote:

> Lintao,
>
> Sorry for not pointing this out in my last email... I was using
MET's
> plot_data_plane tool for testing.  When trying to get started with a
new
> gridded dataset with MET, I usually start with plot_data_plane.
That tool
> reads the gridded field you request on the command line and it make
a
> PostScript plot of the data.  That's a great way of testing to see
if MET
> is reading your data as expected.
>
> Here's the commands I ran on cheyenne:
>
>
> *module use /glade/p/ral/jntp/MET/MET_releases/modulefilesmodule
load
> met/8.0*
> *plot_data_plane \*
> */glade/scratch/lintao/paper/data/cut_test/ca4km/cut_regridded_2004-
09-01_06:00:00.nc
> <http://00.nc> \*
> *fcst.ps <http://fcst.ps> \*
> * 'name="PREC"; level="(*,*)";'*
>
> After fixing the dimensions, plot_data_plane now seems happy.  So I
tested
> your observations as well... but plot_data_plane isn't happy:
>
> *plot_data_plane \*
> */glade/scratch/lintao/paper/data/cut_test/capa/cut_2004-09-
01_06:00:00.nc
> <http://00.nc> \*
> *obs.ps <http://obs.ps> \*
> *'name="pr"; level="(0,0,*,*)";'*
>
> But I get an error...
> ERROR  : plot_data_plane -> file
> "/glade/scratch/lintao/paper/data/cut_test/capa/cut_2004-09-
01_06:00:00.nc"
> not a valid data file
>
> Looking at your data, this is a very close to a CF-compliant NetCDF
> file... so I told MET to interpret it as such by adding *file_type =
> NETCDF_NCCF;*
>
> *plot_data_plane \*
> *
> /glade/scratch/lintao/paper/data/cut_test/capa/cut_2004-09-
01_06:00:00.nc
> <http://00.nc> \*
> *obs.ps <http://obs.ps> \*
> *'name="pr"; level="(0,0,*,*)"; file_type = NETCDF_NCCF;'*
>
> I've attached PNG versions of the resulting images.
>
> Please try using the attached MTD config file, which now uses the
> file_type option.
>
> Thanks,
> John
>
>
> On Mon, Nov 5, 2018 at 7:03 PM Lintao Li via RT <met_help at ucar.edu>
wrote:
>
>>
>> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=87654 >
>>
>> Hello John,
>>
>> Thanks a lot for your reply.
>> 1) Based on your suggestion, I updated the grid info. However, I
still got
>> the seg fault by using the same command.
>>
>> 2) By the way, I did not see error message like:
>> *terminate called after throwing an instance of
>> 'netCDF::exceptions::NcEdge'  what():  NcEdge: Edge+start exceeds
>> dimension
>> bound*
>> May I ask how did you get this message please?
>>
>> 3) I still want to know how to regrid data with 2-D lat, lon info
to data
>> with 1-D lat, lon info.
>>
>> Thank you.
>> Best regards,
>> Lintao
>>
>>
>> On Mon, Nov 5, 2018 at 3:25 PM John Halley Gotway via RT <
>> met_help at ucar.edu>
>> wrote:
>>
>> > Lintao,
>> >
>> > I see you're getting a segfault when running the mtd tool.
Thanks for
>> > sending me a command to replicate the error.  I was able to see
the
>> exact
>> > behavior your describe.  Also, I was able to replicate this
behavior
>> > running your data through any other MET tools as well.  So the
problem
>> is
>> > not specific to MTD.
>> >
>> > Looking closely at the metadata in your file, I see the problem:
>> >
>> > ncdump -h cut_regridded_2004-09-01_06:00:00.nc
>> > dimensions:
>> >         lat = 190 ;
>> >         lon = 251 ;
>> > ...
>> >                 :Nlat = "211 grid_points" ;
>> >                 :Nlon = "536 grid_points" ;
>> >
>> > The lat/lon dimensions are defined as 190x251 but the grid
information
>> is
>> > defined as 211x536.  MET tries to read 211x536 = 113,096 data
values
>> from
>> > the NetCDF variable but only 190x251 = 47,690 are actually
present.  And
>> > that causes this error message:
>> >
>> >
>> > *terminate called after throwing an instance of
>> > 'netCDF::exceptions::NcEdge'  what():  NcEdge: Edge+start exceeds
>> dimension
>> > bound*
>> >
>> > So the problem is that your grid definition is not consistent
with your
>> > data.  Since this is a lat/lon grid, it's easy to figure out:
>> > Latitudes range from 46.1875 to 69.8125 and are spaced 0.1250
degrees
>> > apart.
>> > Longitudes range from -133.3125 to -120.0625 and are spaced
0.1250
>> degrees
>> > apart.
>> > So your grid definition should be this:
>> >
>> >                 :Projection = "LatLon" ;
>> >                 :lat_ll = "46.1875 degrees_north" ;
>> >                 :lon_ll = "-133.3125 degrees_east" ;
>> >                 :delta_lat = "0.125 degrees" ;
>> >                 :delta_lon = "0.125 degrees" ;
>> >                 :Nlat = "190 grid_points" ;
>> >                 :Nlon = "251 grid_points" ;
>> >
>> > Please try updating the grid definition in these files and
rerunning
>> MTD.
>> >
>> > Thanks,
>> > John Halley Gotway
>> >
>> >
>> >
>> >
>> >
>> >
>> > On Mon, Nov 5, 2018 at 10:14 AM Lintao Li via RT
<met_help at ucar.edu>
>> > wrote:
>> >
>> > >
>> > > Mon Nov 05 10:14:26 2018: Request 87654 was acted upon.
>> > > Transaction: Ticket created by lintaoli168 at gmail.com
>> > >        Queue: met_help
>> > >      Subject: MODE-TD segmentation fault
>> > >        Owner: Nobody
>> > >   Requestors: lintaoli168 at gmail.com
>> > >       Status: new
>> > >  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=87654
>> >
>> > >
>> > >
>> > > Dear Sir/Madam,
>> > > I am Lintao, trying to use MODE-TD to analyse wrf performance
in
>> Canada.
>> > > However, I got the error message as:
>> > > Segmentation fault (core dumped)
>> > >
>> > > I run MET on Cheyenne, using the follow code as an example:
>> > > mtd -fcst
>> > >
>> > >
>> >
>> /glade/scratch/lintao/paper/data/cut_test/ca4km/cut_regridded_2004-
09-01_06:00:
>> > > 00.nc \
>> > >
>> > >
>> >
>> /glade/scratch/lintao/paper/data/cut_test/ca4km/cut_regridded_2004-
09-01_07:00:
>> > > 00.nc \
>> > > -obs
>> /glade/scratch/lintao/paper/data/cut_test/capa/cut_2004-09-
01_06:00:
>> > > 00.nc \
>> > > /glade/scratch/lintao/paper/data/cut_test/capa/cut_2004-09-
01_07:00:
>> > 00.nc
>> > > \
>> > > -config /glade/scratch/lintao/paper/data/MTDConfig \
>> > > -outdir /glade/scratch/lintao/paper/data/mtd \
>> > > -v 1
>> > > ###############################
>> > >
>> > > The raw observation data are:
>> > /glade/scratch/lintao/paper/data/capa/2004*,
>> > > which has 0.125 degree spatial resolution;
>> > > And the raw wrf output are:
>> /glade/scratch/lintao/paper/data/ca4km/2004*,
>> > > which has spatial resolution around 4km.
>> > > To run MTD, I first regridded the wrf output to the
observations,
>> using
>> > the
>> > > following code:
>> > > cd /glade/scratch/lintao/paper/data/ca4km
>> > > for file in 2004*; do
>> > >     regrid_data_plane \
>> > >     /glade/scratch/lintao/paper/data/ca4km/$file \
>> > >     "latlon 543 211 46.0938 -150.9238 0.125 0.125" \
>> > >     /glade/scratch/lintao/paper/data/regrid/python_$file \
>> > >     -field 'name="PREC"; level="(0,*,*)";
file_type=NETCDF_NCCF;' \
>> > >     -method NEAREST -width 1
>> > > done
>> > >
>> > > I got the segmentation fault when I run MTD using this
regridded fcst
>> > data
>> > > and the obs data at:
/glade/scratch/lintao/paper/data/capa/2004*. It
>> > seems
>> > > the above regrid process has some problems. The fcst data (wrf
output)
>> > has
>> > > 2-Dimension lon lat info, and the obs data has 1-D lon, lat
info.
>> Perhaps
>> > > due to this inconsistency, the regridded data are masked in the
>> > surrounding
>> > > area, and only have values closing to the center area.
>> > >
>> > > #########################################
>> > > So my first question is: How should I regrid data with 2-D lon,
lat
>> info
>> > to
>> > > data with 1-D lon, lat info?
>> > > My second question is: for the above mtd code, I made obs and
fcst
>> data
>> > > having exactly the same spatial info. However, I still got the
>> > segmentation
>> > > fault. Why?
>> > >
>> > > Please feel free to go to my /glade directory and have a look,
or to
>> copy
>> > > the files to your working directory.
>> > >
>> > > Thank you very much
>> > >
>> > > Best regards,
>> > > Lintao
>> > >
>> > >
>> >
>> >
>>
>>

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


More information about the Met_help mailing list