Re: Subscript out of range, error in subscript #2

From: <brownrig_at_nyahnyahspammersnyahnyah>
Date: Sat Jun 07 2014 - 17:32:59 MDT

Hi Vanucia,

"Subscript out of range" is exactly what it means -- an attempt to
index into an array beyond its bounds. NCL should have also reported
a line number into your script along with the error message (?) You
might try adding some print statements just before that point to make
sure the indices and the array bounds are what you think they are.

Rick

On Fri, 6 Jun 2014 23:28:59 +0000
  Vanúcia Schumacher <vanucia-schumacher@hotmail.com> wrote:
> Hi users,
> I do not understand this error:
> Subscript out of range, error in subscript #2fatal:Memory allocation
>failure:[errno=12]
> fils=systemfunc("ls pgbhnl.gdas.*.grb2")f = addfiles(fils, "r")
> ListSetType(f,"join")
> t1=f[:]->TMP_P0_L100_GLL0(:,{85000},{-35:-25},{-60:-45})t2=f[:]->TMP_P0_L100_GLL0(:,{50000},{-35:-25},{-60:-45})ur1=f[:]->RH_P0_L100_GLL0(:,{85000},{-35:-25},{-60:-45})ur2=f[:]->RH_P0_L100_GLL0(:,{70000},{-35:-25},{-60:-45})
> t1c=t1-273.15t2c=t2-273.15
> td = dewtemp_trh(t1c,ur1) copy_VarCoords( t1c, td)fils1 =
>systemfunc("ls pgbhnl.gdas.*.grb2")f1 = addfiles(fils1, "r")
> ListSetType(f1,"join")
> t3=f[:]->TMP_P0_L100_GLL0(:,{85000},{-35:-25},{-60:-45})t4=f[:]->TMP_P0_L100_GLL0(:,{50000},{-35:-25},{-60:-45})ur3=f[:]->RH_P0_L100_GLL0(:,{85000},{-35:-25},{-60:-45})ur4=f[:]->RH_P0_L100_GLL0(:,{70000},{-35:-25},{-60:-45})
> t3c=t3-273.15t4c=t4-273.15 td1= dewtemp_trh(t3c,ur3)
> copy_VarCoords( t3c, td1 ) tt=(t1c+td)-2*t2c
> tt1=(t3c+td1)-2*t4c media= dim_avg_n_Wrap(tt, 0) media1=
>dim_avg_n_Wrap(tt1, 0) anomalia= media - media1copy_VarCoords(media,
>anomalia)
> wks = gsn_open_wks("png","tt-anomalia-inv-dia-0")
> opcao = True opcao@gsnAddCyclic =
>False opcao@mpMinLatF = -35 opcao@mpMaxLatF =
>-25 opcao@mpMinLonF = -60 opcao@mpMaxLonF = -45
> plot =
>gsn_csm_contour_map(wks,anomalia({9000},{-35:-25},{-60:-45}),opcao)end
>
>
>
>
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Jun 07 11:33:12 2014

This archive was generated by hypermail 2.1.8 : Wed Jul 23 2014 - 15:33:46 MDT