Dear Steve
To make sure I have the right grid point I always print out the latitude and longitude of the (i,j) ncl calculates. Something like:
print(XLAT(0,locY,locX)+" "+XLONG(0,locY,locX))
In your notation and check that these values match my station coordinates.
Andrea
---- Andrea N. Hahmann Senior Scientist Wind Energy Division Risų DTU Technical University of Denmark Risų National Laboratory for Sustainable Energy Frederikborgvej 399, P.O. Box 49 4000 Roskilde, Denmark Direct +45 4677 5471 Mobil: +45 2133 0550 ahah@risoe.dtu.dk http://www.risoe.dtu.dk From: steve kirby <thin_runner@yahoo.com<mailto:thin_runner@yahoo.com>> Reply-To: steve kirby <thin_runner@yahoo.com<mailto:thin_runner@yahoo.com>> Date: Tue, 20 Sep 2011 23:59:45 +0200 To: "ncl-talk@ucar.edu<mailto:ncl-talk@ucar.edu>" <ncl-talk@ucar.edu<mailto:ncl-talk@ucar.edu>> Subject: winds from WRF not matching RAOB Sorry - forgot to note, in the attached figure, WRF winds are in orange; RAOB winds are in black --Steve ----- Forwarded Message ----- From: steve kirby <thin_runner@yahoo.com<mailto:thin_runner@yahoo.com>> To: "ncl-talk@ucar.edu<mailto:ncl-talk@ucar.edu>" <ncl-talk@ucar.edu<mailto:ncl-talk@ucar.edu>> Sent: Tuesday, September 20, 2011 3:54 PM Subject: winds from WRF not matching RAOB Hi, I'm doing some plots of RAOB's vs WRF and the WRF-extracted winds aren't matching the RAOB. Here's the WRF portion -- ============================================================================================= load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/skewt_func.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl" ... a=addfile("./wrfout_d02_2010-07-16_20_00_00.nc","r"); ;get the variables wrftc=wrf_user_getvar(a,"tc",0) wrftd=wrf_user_getvar(a,"td",0) wrfp=wrf_user_getvar(a,"pressure",0) wrfz=wrf_user_getvar(a,"z",0) uvm=wrf_user_getvar(a,"uvmet",0) ;extract u and v from uvm array and convert to knots u=uvm(0,:,:,:)*1.94386 v=uvm(1,:,:,:)*1.94386 ;;;; ; get ij point in model domain for location of interest ; loc(1) is touth-north (y) and loc(0) is west-east (x) ; ensure this point is in the domain, as we are not checking ; we are interested in NCL array pointers, so subtract 1 loc=wrf_user_ll_to_ij(a,-106.93,32.28,True) ; it should read (a, lon,lat,True) is that right? locX=loc(0)-1 locY=loc(1)-1 dataOpts@colTemperature<mailto:dataOpts@colTemperature> = "red" dataOpts@colDewPt<mailto:dataOpts@colDewPt> = "magenta" ;new location for winds (default is 45) dataOpts@xpWind<mailto:dataOpts@xpWind> = 40. dataOpts@colWindP<mailto:dataOpts@colWindP> = "orange" skewT_data = skewT_PlotData (wks,skewt_bkgd,wrfp(:,locY,locX),\ wrftc(:,locY,locX),\ wrftd(:,locY,locX),\ wrfz(:,locY,locX),\ u(:,locY,locX),\ v(:,locY,locX),\ dataOpts) draw(skewT_data) ===================================================================================================== QUESTION - Do I have it right, that in the wrf_user_ll_to_ij( ) call that I use longitude, latitude (in that order) to locate the point of interest? I have done a couple of other plots of WRF winds vs. RAOB and the winds are not matching up with those either, so I was wondering if I had something wrong in code. Thanks, Steve _______________________________________________ ncl-talk mailing list List instructions, subscriber options, unsubscribe: http://mailman.ucar.edu/mailman/listinfo/ncl-talk _______________________________________________ ncl-talk mailing list List instructions, subscriber options, unsubscribe: http://mailman.ucar.edu/mailman/listinfo/ncl-talkReceived on Wed Sep 21 00:57:35 2011
This archive was generated by hypermail 2.1.8 : Mon Oct 10 2011 - 11:43:35 MDT