Hello,
I'm attempting to extract hourly wind speed from a specific location
at a height of 80 meters. I get an error "Subscript out of range,
error in subscript #1 An error occurred reading z on line 39 which is:
z = wrf_user_getvar(a,"z",time)
I cannot figure out how to fix this error. Here is my code:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
begin
all_files = systemfunc("ls wrfout_d02*") + ".nc"
a = addfiles(all_files,"r")
ListSetType (a,"cat")
;print(all_files)
;print(a)
times = wrf_user_list_times(a)
ntimes = dimsizes(times)
wind80 = new(ntimes,float)
;print(ntimes)
do it = 0,ntimes-1
;print("Working on time " + it )
time = it
llres = True
;Return integer values
llres@ReturnInt = True
locij = wrf_user_ll_to_ij(a, 65.1521,-220.1548, llres)
;array pointers in NCL space
locij = locij - 1
locX = locij(0)
locY = locij(1)
print(locX)
print(locY)
;grid point height
z = wrf_user_getvar(a,"z",time)
z_point = z(:,locY,locX)
;print(z_point)
uvmet = wrf_user_getvar(a,"uvmet",time)
uvmet_point = uvmet(:,locY,locX)
;print(uvmet_point)
wind80(it) = wrf_interp_1d(uvmet_point,z_point,80)
print(U80(it))
end do
asciiwrite("wind80.dat",wind80(it))
delete(a)
end
Thank you,
Nick Dawson
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Jun 27 17:32:30 2012
This archive was generated by hypermail 2.1.8 : Fri Jun 29 2012 - 15:46:14 MDT