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_fileInput netCDF file name.
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
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/