[ncl-talk] coordinate subscripting in curvilinear data

Jyothi Lingala jyothirao.lingala at gmail.com
Mon Oct 29 12:34:08 MDT 2018


Hii..

I am trying to plot a time series at specific location from model output.
Attached is my model file. I suppose my input data is on a curvilinear
grid, where I cannot use "{" and "}" for coordinate subscripting. The
following script works when I specify the lat and lon indices manually.
Instead of doing this, I would like to specify the lat and lon values
directly(eg, 9N 67E). Kindly correct me where I am going wrong.

*SCRIPT*
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/time_axis_labels.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"

dir    =
"/incois_ncmrwfx/incois/hycom/hwrf_output/pytmp/HYCOMcoupled_gsi/2017120100/03B/runwrf/"
files  = systemfunc("ls " + dir + "wrfout_d01_2017-12-*_*_00_00") ; one of
the files is attached
a      = addfiles(files,"r")
 wrfout_d01_2017-12-01_00_00_00
<https://drive.google.com/file/d/1CO8FnR_N82jlcOSeb2OlKImJAqXRjT40/view?usp=drive_web>

ListSetType(a,"cat")
vNames = getfilevarnames(a[0])
;print(vNames)

;----- Read character variable Times -  Convert to units of "hours since"
for plotting purposes

  times     = a[:]->Times
  Time      = wrf_times_c(a[:]->Times, 0)  ; convert to "hours since"
;  print(Time)

 sst                = a[:]->SST
 sst                = sst-273.15
 lat                 = a[:]->HLAT
 lon                = a[:]->HLON
 sst at lon2d        = lon
 sst at lat2d        = lat

utc_date =  cd_calendar(Time, 0)
year        =  tointeger(utc_date(:,0))
month     =  tointeger(utc_date(:,1))
day         =  tointeger(utc_date(:,2))
date_str   =  sprinti("%0.4i-",year)+sprinti("%0.2i-", month) + \
            sprinti("%0.2i", day);+sprinti("%0.2i", hour)

wks = gsn_open_wks("png","timeseries_WRF")

res                          = True
res at gsnMaximize              = True
res at vpWidthF                 = 0.65
res at vpHeightF                = 0.3
restick                      = True
restick at ttmFormat            = "%D/%c"
time_axis_labels(Time,res,restick)

plot = gsn_csm_xy(wks,Time,sst(:,291,151),res);;;;:::::::::::This line is
working. Here I want to specify the lat and lon values directly(eg. 9N 67E).

Thanks and regards
Jyothi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20181030/1bd92834/attachment.html>


More information about the ncl-talk mailing list