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 DATADir = "./" FILES = systemfunc (" ls -1 " + DATADir + "wrfout_d04* ") numFILES = dimsizes(FILES) print("numFILES = " + numFILES) print(FILES) print (" ") do j = 0,numFILES-1,1 a = addfiles(FILES(j)+".nc","r") times = wrf_user_getvar(a,"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(a,"ua",it) ; u averaged to mass points v = wrf_user_getvar(a,"va",it) ; v averaged to mass points loc = wrf_user_ll_to_ij(a[0], 36.85693, 2.53115, True) mx = loc(0) - 1 ny = loc(1) - 1 lat1 = a[0]->XLAT(0,ny,mx) ; the is the nearest grid point lon1 = a[0]->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) ) print("Working on time: " + times(it) + " wind_speed="+wspd1) end do end do end