load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl" begin f=addfile("./wrfout_d04_2009-07-10_00:00:00.nc","r") times = wrf_user_getvar(f,"times",-1) ; get all times in the file ntimes = dimsizes(times) ; number of times in the file do it = 0,ntimes-1,1 ; TIME LOOP ;u = wrf_user_getvar(f,"ua",it) ; u averaged to mass points ;v = wrf_user_getvar(f,"va",it) ; v averaged to mass points tsk = wrf_user_getvar(f,"TSK",it) loc = wrf_user_ll_to_ij(f, 36.85693, 2.53115, True) mx = loc(0) - 1 ny = loc(1) - 1 lat1 = f->XLAT(0,ny,mx) ; the is the nearest grid point lon1 = f->XLONG(0,ny,mx) res = True res@tiMainString = "WRF: All Times: grid point ["+sprintf("%5.2f",lat1)+" , "+sprintf("%5.2f",lon1) +"]" ;wspd1= ndtooned( sqrt(u(2,ny,mx)^2 + v(2,ny,mx)^2) ) ;wdir1= ndtooned( atan2(u(2,ny,mx),v(2,ny,mx))/0.01745329 +180. ) ;print("Working on time: " + times(it) + " wind_speed="+wspd1) tsk1= ndtooned(tsk(ny,mx)) print("Working on time: " + times(it) + " surface_temp="+tsk) end do end