wrf_user_latlon_to_ij
** Finds the nearest model grid indices (i,j) to the specific location.
Available in version 4.3.1 or later.
Prototype
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl" function wrf_user_latlon_to_ij ( nc_file : file, latitude : numeric, longitude : numeric ) return_val [2] : integer
Arguments
nc_fileReference to an input netCDF file opened with addfile.
latitudelongitude
Scalars for specific latitude,longitude points. If the input values are outside the model domain, then the appropriate return values will be set to missing (-999).
Return value
An integer array with 2 elements that holds the closest y/x position to the input latitude/longitude. The first element will be associated with latitude, and the second with longitude.
Description
** Note: As of version 5.1.0, this function is obsolete. Use wrf_user_ll_to_ij instead.
This function locations the closest y/x point to the input latitude/longitude. If the input values are outside the model domain, then the appropriate return values will be set to missing (-999).
wrf_user_latlon_to_ij is part of a library of functions and procedures in WRFUserARW.ncl written to help users plot ARW WRF model data.
WRF-related questions should be sent to wrfhelp@ucar.edu.
See Also
Examples
Example 1
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl" a = addfile("wrfout_d01_2000-01-24_12:00:00.nc","r") loc = wrf_user_latlon_to_ij(a, 40.0, -100.0) print("Y/X location is: " +loc)You can see some other example scripts and their resultant images at:
http://www.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/