<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Dear NCL group,<div>I tried to extract hourly air temperature data from wrf out and used the following scripts. would you figure out if there is any errors in it because when i run it it stops with showing time information and then pressing q several times it can execute the script but it is too time consuming and difficult to work because i have to press q for the size of times in file. I look foward for kind response</div><div><br></div><div><br><div> ; -------------- LOAD FUNCTIONS AND PROCEDURES ----------------</div><div><br></div><div> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</div><div> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"</div><div> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"</div><div> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"</div><div><br></div><div> ; -------------- BEGINING OF NCL SCRIPT ----------------</div><div>begin</div><div>DATADir = "/mnt/gpfs1/data/private/fgvy024/Build_WRF/WRFV3/run/"</div><div>FILES = systemfunc (" ls -1 " + DATADir + "wrfout_d03* ")</div><div>numFILES = dimsizes(FILES)</div><div>a = addfiles(FILES+".nc","r")</div><div>;times = wrf_user_list_times(a) ; get times in the file</div><div>ntimes = 4320 ; number of times in the file</div><div>temp = new(ntimes,float) </div><div>do it = 0, ntimes-1 ;Loop for the time: </div><div>time = it</div><div>;************************************************</div><div> ; - Select lon & lat of the point of interest -</div><div> ;************************************************</div><div> ; - The function wrf_user_ll_to_ij find the nearest grid point for a specific lat and lon</div><div><br></div><div>Latitude = 27.959167 ;phakding</div><div>Longitude = 86.81278</div><div>res = True </div><div>res@returnInt = True </div><div>point = wrf_user_ll_to_ij(a,Longitude,Latitude,res) </div><div>x = point(0)-1</div><div>y = point(1)-1</div><div>;tc2 = wrf_user_getvar(a,"HGT",it) ; heigth extraction</div><div>tc2 = wrf_user_getvar(a,"T2",it) ; temp extraction</div><div>tc2 = tc2 -273.16</div><div><br></div><div>temp(it) = tc2(y,x) </div><div>end do</div><div><br></div><div> npts=ntimes</div><div> fName = "pyramid_1km.txt"</div><div> data = new( npts, "string")</div><div> </div><div> </div><div> print(" Time temp ")</div><div> </div><div> do it = 0, ntimes-1 ;ntimes-1</div><div><br></div><div> print (sprintf("%5.0f",it) +" " \</div><div> +sprintf("%21.2f", temp(it)) +" " )</div><div><br></div><div> end do ; end of time loop</div><div><br></div><div> do it = 0,ntimes-1 ;ntimes-1</div><div><br></div><div> data (it)= (sprintf("%5.0f",it) +" " \</div><div> +sprintf("%21.2f", temp(it)) +" " )</div><div><br></div><div> end do ; end of time loop</div><div> asciiwrite (fName , data)</div><div>end</div><i><div><i><br></i></div>Regards<br>Ramchandra Karki</i><div><i>PhD Student, </i></div><div><i>Institute of Geography, </i><i style="font-size:12pt;">University of Hamburg</i></div><div><i style="font-size:12pt;">Bundesstrase 55, Hamburg Germany</i></div><div><i><br></i></div></div>                                            </div></body>
</html>