From: Radhika S on
"Brian Blanton" <blantonbo(a)gmail.com> wrote in message <hgrubh$gr$1(a)fred.mathworks.com>...
> "Thomas " <t_oksavik(a)hotmail.com> wrote in message <hcp63q$c2o$1(a)fred.mathworks.com>...
> > Hello
> >
> > I am trying to use read_grib on 64-bit matlab. It has worked fine before with 32-bit, but now i get this error:
> > "Undefined function or method 'BDS_unpack_mex5' for input arguments of type 'uint8'."
> >
> > I see that in my folder I have a file called BDS_unpack_mex5.mexw32, so I am guessing I need the similar file with extension mexw64, but I did not find it on the internet after a quick search.
> >
> > Does this file exist?
> >
> > Thomas
>
> I am the author of read_grib. You need to compile the mex c code BDS_unpack_mex5.c for the machine you are on. cd to the directory in which this file resides, and type mex BDS_unpack_mex5.c at the MATLAB prompt.
>
> Brian

Hi,

I am doing my research in Climate change and just started with the work. The (GCM)data seems to be available in .grb format and I would like to read it. I have unziped and saved 'read_grib' to toolbox folder of Matlab and set current folder to this ../toolbox/ read_grib and run 'mex BDS_unpack_mex5.c'.

Then I tried using

S=read_grib('CGMR_20C3M_3_G_ua850_1-1812.grb',-1)

which gave me the following error

Parameter Table set to NCEPOPER
Searching for first GRIB marker...
GRiB Record marker "GRIB" found at chars 1-4
GRiB header =
GRIB
GRec= 1 : FPos1= 4??? Undefined command/function 'BDS_unpack_mex5'.

Error in ==> read_grib.r3\private\extract_grib at 64
dataarray=BDS_unpack_mex5(bds_struct.bindata,...

Error in ==> read_grib at 301
[pds_struct,gds_struct,bms_struct,bds_struct,dataarray]=...

May I please get some help regarding this?
From: Steven_Lord on


"Radhika S" <radhikas.iitb(a)gmail.com> wrote in message
news:i3gdk0$3cp$1(a)fred.mathworks.com...
> "Brian Blanton" <blantonbo(a)gmail.com> wrote in message
> <hgrubh$gr$1(a)fred.mathworks.com>...

*snip*

>> I am the author of read_grib. You need to compile the mex c code
>> BDS_unpack_mex5.c for the machine you are on. cd to the directory in
>> which this file resides, and type mex BDS_unpack_mex5.c at the MATLAB
>> prompt. Brian
>
> Hi,
>
> I am doing my research in Climate change and just started with the work.
> The (GCM)data seems to be available in .grb format and I would like to
> read it. I have unziped and saved 'read_grib' to toolbox folder of Matlab
> and set current folder to this ../toolbox/ read_grib and run 'mex
> BDS_unpack_mex5.c'.
> Then I tried using
> S=read_grib('CGMR_20C3M_3_G_ua850_1-1812.grb',-1)
>
> which gave me the following error
>
> Parameter Table set to NCEPOPER
> Searching for first GRIB marker...
> GRiB Record marker "GRIB" found at chars 1-4
> GRiB header = GRIB
> GRec= 1 : FPos1= 4??? Undefined command/function
> 'BDS_unpack_mex5'.
>
> Error in ==> read_grib.r3\private\extract_grib at 64
> dataarray=BDS_unpack_mex5(bds_struct.bindata,...
>
> Error in ==> read_grib at 301
> [pds_struct,gds_struct,bms_struct,bds_struct,dataarray]=...
>
> May I please get some help regarding this?

Type the following command:

mexext

Then look for a file named BDS_unpack_mex5 with the extension returned by
that command. If you don't find one, you will need to perform the MEX step
Brian described above.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

From: Radhika S on
"Steven_Lord" <slord(a)mathworks.com> wrote in message <i3h47c$nm$1(a)fred.mathworks.com>...
>
>
> "Radhika S" <radhikas.iitb(a)gmail.com> wrote in message
> news:i3gdk0$3cp$1(a)fred.mathworks.com...
> > "Brian Blanton" <blantonbo(a)gmail.com> wrote in message
> > <hgrubh$gr$1(a)fred.mathworks.com>...
>
> *snip*
>
> >> I am the author of read_grib. You need to compile the mex c code
> >> BDS_unpack_mex5.c for the machine you are on. cd to the directory in
> >> which this file resides, and type mex BDS_unpack_mex5.c at the MATLAB
> >> prompt. Brian
> >
> > Hi,
> >
> > I am doing my research in Climate change and just started with the work.
> > The (GCM)data seems to be available in .grb format and I would like to
> > read it. I have unziped and saved 'read_grib' to toolbox folder of Matlab
> > and set current folder to this ../toolbox/ read_grib and run 'mex
> > BDS_unpack_mex5.c'.
> > Then I tried using
> > S=read_grib('CGMR_20C3M_3_G_ua850_1-1812.grb',-1)
> >
> > which gave me the following error
> >
> > Parameter Table set to NCEPOPER
> > Searching for first GRIB marker...
> > GRiB Record marker "GRIB" found at chars 1-4
> > GRiB header = GRIB
> > GRec= 1 : FPos1= 4??? Undefined command/function
> > 'BDS_unpack_mex5'.
> >
> > Error in ==> read_grib.r3\private\extract_grib at 64
> > dataarray=BDS_unpack_mex5(bds_struct.bindata,...
> >
> > Error in ==> read_grib at 301
> > [pds_struct,gds_struct,bms_struct,bds_struct,dataarray]=...
> >
> > May I please get some help regarding this?
>
> Type the following command:
>
> mexext
>
> Then look for a file named BDS_unpack_mex5 with the extension returned by
> that command. If you don't find one, you will need to perform the MEX step
> Brian described above.
>
> --
> Steve Lord
> slord(a)mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com

Hi,

Thank for the response.

mexext returns dll, and there is a file BDS_unpack_mex5.dll. I didnt understand what should be done if the file is present.

I have tried what Brian described, (set current to the directory in which this file resides, and type mex BDS_unpack_mex5.c at the MATLAB prompt.)This is going fine, however when I set current directory to d directory in which .grb file is residing and using the command

S=read_grib('CGMR_20C3M_3_G_ua850_1-1812.grb',-1)

I am getting the above said error, ie

Parameter Table set to NCEPOPER
Searching for first GRIB marker...
GRiB Record marker "GRIB" found at chars 1-4
GRiB header =
GRIB
GRec= 1 : FPos1= 4??? Undefined command/function 'BDS_unpack_mex5'.

Error in ==> read_grib.r3\private\extract_grib at 64
dataarray=BDS_unpack_mex5(bds_struct.bindata,...

Error in ==> read_grib at 301
[pds_struct,gds_struct,bms_struct,bds_struct,dataarray]=...

Where may b I going wrong?

Thanks for the help

Radhika