Re: NCL wrf_ll_to_ij / wrf_user_ll_to_ij error?

From: Correia, James <james.correia_at_nyahnyahspammersnyahnyah>
Date: Wed Mar 03 2010 - 16:18:22 MST

Hi-
I think you have your I's and j's mixed here:
Yours:
print("Requested: (" + pointLat + "," + pointLon + "), got (" +
lat2d(ival,jval) + "," + lon2d(ival,jval) + ")")

Mine:
print("Requested: (" + pointLat + "," + pointLon + "), got (" +
     lat2d(jval,ival)+","+lon2d(jval,ival)+")")

The compare you are doing is slightly different because the 2 functions are slightly different.
Jimmyc

On 3/3/10 3:07 PM, "Jeff Steward" <jeffsteward@gmail.com> wrote:

Hi,

I have a 25km/5km/1km nested WRF model with a Lambert conformal
mapping projection that I am working with. I am trying to find the
nearest grid point to a met tower that I have access to in order to
validate the model. I am using the NCL function wrf_user_ll_to_ij but
I am getting a result that is significantly different than I expect.
Am I doing something wrong or is there a bug?

(Note that I have also tried this with the wrf_ll_to_ij function but
get the same result).

--------------------
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"

begin

path_to_domain_3_output_file = ".........."

a = addfile(path_to_domain_3_output_file,"r")

lat2d = a->XLAT(0,:,:)
lon2d = a->XLONG(0,:,:)

opt = True
opt@returnInt = True

print(opt)

pointLon = -87.9949
pointLat = 41.7012

loc = wrf_user_ll_to_ij (a, pointLon, pointLat, opt )

ival = loc(0)
jval = loc(1)

print("i: " + ival + ", jval: " + jval)

print("Requested: (" + pointLat + "," + pointLon + "), got (" +
lat2d(ival,jval) + "," + lon2d(ival,jval) + ")")

ival2 = ival-6
jval2 = jval+4

print("Compare: (" + lat2d(ival2,jval2) + "," + lon2d(ival2,jval2) + ")")

end
--------------------

The result I get is:

--------------------
(0) i: 192, jval: 187
(0) Requested: (41.7012,-87.9949), got (41.76,-88.0333)
(0) Compare: (41.7014,-87.9899)
--------------------

Note that the first distance between the point I requested and the
point I received is is 7.2814 km while the distance between the
requested and comparison points is only 0.4162 km according to the
distance calculator found here:

http://jan.ucc.nau.edu/~cvm/latlongdist.html

I would expect to get the comparison values instead of the values I
received. Am I doing something wrong?

Best wishes,

Jeff
_______________________________________________
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-talk
Received on Wed Mar 3 16:17:54 2010

This archive was generated by hypermail 2.1.8 : Thu Mar 04 2010 - 15:07:06 MST