Number of subscripts do not match number of dimensions of variable

From: wei huang <whua27_at_nyahnyahspammersnyahnyah>
Date: Fri Feb 04 2011 - 09:37:49 MST

Dear NCL users,

I got an error during the panel plot: fatal:Number of subscripts do not
match number of dimensions of variable,(3) Subscripts used, (4) Subscripts
expected

fatal:Execute: Error occurred at or near line 16 in file

Any help will be appreciated about fixing the problem

Thanks in advance

wei

*********************************

= = = = = = =

= = = = = = =

= = = = = =

  times = wrf_user_list_times (a); get times in the file

  ntimes = dimsizes(times) ; number of times in the file

  FirstTime = res

  mdims = getfilevardimsizes(a,"P") ; get some dimension sizes for the file

  nd = dimsizes(mdims)

  plots = new (4 , graphic )

; Get the data

  z = wrf_user_getvar(a, "z",-1) ; grid point height

  p = wrf_user_getvar(a,"pressure",-1)

; Interpolate to pressure

  if (FirstTime) then

  zz = z/100.

  dims = dimsizes(zz)

  zmax = -999.

  do imax = 1,dims(0)-1

  *if ( .not.ismissing(zz(imax,1,1)) .and. zz(imax,1,1) .gt. zmax ) then*

  zmax = zz(imax,1,1)

  end if

  end do

  imax = floattoint(zmax)

  zmax = imax/10.

  print("Y labels set to: 0 - " + zmax + " km")

  FirstTime = False

end if

; Interpolate data vertically

  mpv_plane = wrf_user_intrp3d(mpv,p,"v",plane,0.,opts)

  eth_plane = wrf_user_intrp3d(eth,p,"v",plane,0.,opts)

 ;

  gmpv_plane = wrf_user_intrp3d(gmpv,p,"v",plane,0.,opts)

  ths_plane = wrf_user_intrp3d(ths,p,"v",plane,0.,opts)

  ; Options for XY Plots

  opts_xy = res

  opts_xy@tiYAxisString = "Pressure (hPa)"

  opts_xy@AspectRatio = 0.75

  opts_xy@cnMissingValPerimOn = True

  opts_xy@cnMissingValFillColor = 0

  opts_xy@cnMissingValFillPattern = 11

  opts_xy@tmYLMode = "Explicit"

  opts_xy@tmYLValues = fspan(0,100,10) ; over the 0-100 span of
the Y label

  opts_xy@tmYLLabels = fspan(1000,100,10); Corresponding 11
labels

  opts_xy@PlotOrientation = ths_plane@Orientation

; Plotting options for gmpv

  opts_gmpv = opts_xy

  opts_gmpv@ContourParameters = (/ - 4., 5., 1. /)

  opts_gmpv@cnFillOn = True

  opts_gmpv@lbLabelBarOn = False

  opts_gmpv@gsnSpreadColors = True

; Plotting options for Temperature

  opts_eth = opts_xy

  opts_eth@ContourParameters = (/ 270., 450., 4. /)

  opts_eth@cnInfoLabelOn = False ; Turn off individual label bars so we
can

; Plotting options for Equivalent Potential Temperature

  opts_ths = opts_xy

  opts_ths@ContourParameters = (/ 220., 330., 4. /)

; Get the contour info for the mpv and theta_e

  opts_xy@PlotOrientation = eth_plane@Orientation

  contour_eth = wrf_contour(a,wks,eth_plane(7,:,:),opts_eth)

  contour_mpv = wrf_contour(a,wks,mpv_plane(7,:,:),opts_gmpv)

  contour_eth1 = wrf_contour(a,wks,eth_plane(8,:,:),opts_eth)

  contour_mpv1 = wrf_contour(a,wks,mpv_plane(8,:,:),opts_gmpv)

; Get the contour info for the gmpv and ths

  opts_xy@PlotOrientation = ths_plane@Orientation

  contour_ths = wrf_contour(a,wks,ths_plane(7,:,:),opts_ths)

  contour_gmpv = wrf_contour(a,wks,gmpv_plane(7,:,:),opts_gmpv)

  contour_ths1 = wrf_contour(a,wks,ths_plane(8,:,:),opts_ths)

  contour_gmpv1 = wrf_contour(a,wks,gmpv_plane(8,:,:),opts_gmpv)

; MAKE PLOTS

  plots(0) = wrf_overlays(a,wks,(/contour_mpv,contour_eth/),pltres)

  plots(1) = wrf_overlays(a,wks,(/contour_gmpv,contour_ths/),pltres)

  plots(2) = wrf_overlays(a,wks,(/contour_mpv1,contour_eth1/),pltres)

  plots(3) = wrf_overlays(a,wks,(/contour_gmpv1,contour_ths1/),pltres)

; Delete options and fields, so we don't have carry over

  delete(opts_eth)

  delete(opts_ths)

  delete(opts_gmpv)

  delete(eth_plane)

  delete(mpv_plane)

  delete(ths_plane)

  delete(gmpv_plane)

 ; create panel

;************************************************

 ;Panel the WRF plots

  resP = True ; modify the panel plot

  resP@gsnFrame = False ; don't advance panel plot

  resP@gsnPanelLabelBar = True ; add common colorbar

  resP@gsnPanelScalePlotIndex = 1

  resP@gsnPanelBottom = 0.2 ; shrink panel plot by setting bottom
edge of plot

  resP@gsnPanelTop = 0.9

  gsn_panel(wks,(/plots/),(/2,2/),resP) ; now draw as one plot

  frame(wks)

  end

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Feb 4 09:37:57 2011

This archive was generated by hypermail 2.1.8 : Fri Feb 11 2011 - 16:11:42 MST