[ncl-talk] problem with wrf_times_c in ncl 6.4.0
E Mobarak
mobarak_e at yahoo.com
Sat Jul 14 13:31:45 MDT 2018
HiI recently have made the ncl update to 6.4.0 , i had to remove this line to run ncl scripts
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl
now it runs but there is this error message
Undefined identifier: (wrf_times_c) is undefined, can't continue
i want extract data by day and hourthanks for help
this is ncl scripts
begin
a = addfile("199803/wrfout_d01_1998-03-26_12:00:00.nc","r")
times = wrf_user_list_times(a) ; "2008-09-29_18:30:00", etc
tk2 = wrf_user_getvar(a,"T2",-1) ; T2 in Kelvin
rain1 = wrf_user_getvar(a,"RAINC",-1) ; get t2 for all times
rain2 = wrf_user_getvar(a,"RAINNC",-1) ; get t2 for all times
Times = wrf_user_getvar(a,"Times",-1)
Times = wrf_times_c(a->Times, 3)
times = wrf_user_list_times(a)
ntimes = dimsizes(times)
; print("ntimes = " + ntimes)
;---Calculate i,j locations of data closest to set of lat/lon points
ip_locs = (/ "Borojurd", "Alighodarz" ,"Khoramabad" , "Dezful" , "Kohrang" /)
ip_lats = (/ 33.55, 33.24 ,33.26 , 32.24 ,32.26/)
ip_lons = (/ 48.45, 49.42 , 48.17 ,48.23 , 50.07/)
do ip = 0, 4 ; LOOP through above 20 station
opt = True
loc = wrf_user_ll_to_ij( a, ip_lons(ip), ip_lats(ip), opt)
loc = loc-1
locs = ip_locs(ip)
;
t2t = tk2(:,loc(1),loc(0))
raint1 = rain1(:,loc(1),loc(0))
raint2 = rain2(:,loc(1),loc(0))
rain3=raint1+raint2
slist = [/ " station " + " longitude " + " latitude " + "Times" + " temprature" + " rain1 " + "rain2 " + "rain3" /]
write_table("filename", "a", slist, "%s")
alist=[/ip_locs(ip), ip_lons(ip), ip_lats(ip), times , t2t-273 , raint1 , raint2 , rain3 /]
write_table("filename","a" ,alist, "%s %8.2f %8.2f %s %8.2f %8.2f %8.2f %8.2f " )
end do
end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180714/1c11667c/attachment.html>
More information about the ncl-talk
mailing list