Re: Coordinate subscript type mismatch.

From: H.Dang <danghy_at_nyahnyahspammersnyahnyah>
Date: Wed Oct 10 2012 - 15:46:58 MDT

Hi Mary,

Thanks for your message. the nox_modelEY_ave_40_60NS is an variable that
I defined:

 nox_modelEY_ave_40_60NS = new(28,float)

vNOx is model output. It's float too.

Since the problem was caused by the type of "Subscript (0) ",
i.e., pre_MIPAS. It's expected to be float, but it had to be "double".
 This variable is pressure levels from another netcdf file and it came as
"double". My current solution is to read out these pressure levels from
the netcdf file, and make a new array in my NCL code:

 plev_MIPAS = (/300, 250, 200, 170, 150, 130, 115, 100, 90, 80, 70, 50, 30,
20, 15,10, 7, 5, 3, 2, 1.5, 1, 0.7, 0.5, 0.3, 0.2, 0.15, 0.1/)

In this way, the code works now. I met another similar problem in the same
code after this one is solved. I'll describe it in the email to Dave later.

Thanks.
Hongyan
On Wed, Oct 10, 2012 at 12:30 PM, Mary Haley <haley@ucar.edu> wrote:

> Hongyan,
>
> I don't think I've see this type of error before, so I don't fully
> understand it. (Dave, can you help out here?)
>
> Line 168 is
>
> > 168 nox_modelEY_ave_40_60NS(ipressure) =
> avg(vNOx({pre_MIPAS},{40:60},:))
>
> I need to see what those variables look like:
>
> printVarSummary(nox_modelEY_ave_40_60NS)
> printVarSummary(vNOx)
>
> My feeling is that there's an issue with the way you are subscripting
> vNOx, so
> I need to see what its coordinate arrays look like.
>
> --Mary
>
> On Oct 8, 2012, at 8:37 PM, H.Dang wrote:
>
> > Dear all,
> >
> > I got the following error information in my NCL code:
> >
> > fatal:Coordinate subscript type mismatch. Subscript (0) can not be
> coerced to type of coordinate variable
> > fatal:["Execute.c":7556]:Execute: Error occurred at or near line 168 in
> file obs_mdl.ncl
> >
> >
> > 161 do ipressure = 0,28 - 1
> > 162 pre_MIPAS = plev_MIPAS(ipressure)
> > 163 pre_MIPAS = dble2flt(plev_MIPAS(ipressure))
> > 164
> > 165 printVarSummary(pre_MIPAS)
> > 166 printVarSummary(ple40)
> > 167 ;
> > 168 nox_modelEY_ave_40_60NS(ipressure) =
> avg(vNOx({pre_MIPAS},{40:60},:))
> > 179 end do
> >
> > The summary of the variables are:
> >
> > Variable: pre_MIPAS
> > Type: double
> > Total Size: 8 bytes
> > 1 values
> > Number of Dimensions: 1
> > Dimensions and sizes: [1]
> > Coordinates:
> > Number Of Attributes: 7
> > typeConversion_op_ncl : double converted to float
> > units : hPa
> > long_name : pressure
> > axis : Z
> > positive : down
> > standard_name : air_pressure
> > plev : 300
> >
> > Variable: ple40
> > Type: float
> > Total Size: 160 bytes
> > 40 values
> > Number of Dimensions: 1
> > Dimensions and sizes: [ple | 40]
> > Coordinates:
> > ple: [964..0.1]
> > Number Of Attributes: 1
> > units : mb
> >
> > I though the error is caused by the variable type, but when I used
> "dble2flt" to convert the type from double to float, the error message is
> till the same. So is my idea of converting correct or not? How should I
> fix this problem? Thank you!
> >
> > Hongyan
> >
> > _______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Oct 10 15:47:52 2012

This archive was generated by hypermail 2.1.8 : Fri Oct 12 2012 - 15:38:19 MDT