<div dir="ltr"><div class="gmail_default" style="font-size:small"><font face="arial, helvetica, sans-serif">Hi Nafiseh,</font></div><div class="gmail_default" style="font-size:small"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default" style="font-size:small"><font face="arial, helvetica, sans-serif">Thanks for your patience. I was unable to respond to this question until I had a chance to look at the documentation.</font></div><div class="gmail_default" style="font-size:small"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default" style="font-size:small"><font face="arial, helvetica, sans-serif">You are correct, this function is confusing. I admit I wasn't familiar with it until I started looking at the internal code and tried to figure out why the restriction is placed on it.</font></div><div class="gmail_default" style="font-size:small"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default" style="font-size:small"><font face="arial, helvetica, sans-serif">As far as I can tell, there's no reason the two sets of arguments should have the weird set of restrictions of dimensionality placed on them. </font></div><div class="gmail_default" style="font-size:small"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default" style="font-size:small"><font face="arial, helvetica, sans-serif">The first two input arrays should be allowed to be any dimensionality of lat/lon points that you want to loop through and check if it's on the given lat/lon great circle, specified by the second two arguments.</font></div><div class="gmail_default" style="font-size:small"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default" style="font-size:small"><font face="arial, helvetica, sans-serif">I've created a trouble-ticket for this, NCL-2717, and marked it as a high priority for NCL V6.5.0.</font></div><div class="gmail_default" style="font-size:small"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default" style="font-size:small"><font face="arial, helvetica, sans-serif">Meanwhile, the only work-around I can think of is to loop through each of your points and pass them individually to gc_onarc. This means you will need to create the output array before you call the function, and then subscript it as you go. Something like this (UNTESTED, because I'm not sure of the exact dimensionality of your arrays):</font></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style=""><font face="monospace, monospace" style="">npts = dimsizes(<span style="color:rgb(0,0,0)">lat_2d_outer_core_to_</span><wbr style="color:rgb(0,0,0)"><span style="color:rgb(0,0,0)">1d)</span></font></div><div class="gmail_default" style=""><font face="monospace, monospace"><span style="color:rgb(0,0,0)">onarc_outer_core = new(npts</span><span style="color:rgb(0,0,0)">,logical)</span><br></font></div><div class="gmail_default" style=""><span style="color:rgb(0,0,0)"><font face="monospace, monospace"><br></font></span></div><div class="gmail_default" style=""><span style="color:rgb(0,0,0)"><font face="monospace, monospace">do n=0,npts-1</font></span></div><div class="gmail_default" style=""><font face="monospace, monospace"><span style="color:rgb(0,0,0)"> onarc_outer_core(n) = gc_onarc(lat_2d_outer_core_to_</span><wbr style="color:rgb(0,0,0)"><span style="color:rgb(0,0,0)">1d(n),lon_2d_outer_core_to_1d(n),</span><wbr style="color:rgb(0,0,0)"><span style="color:rgb(0,0,0)">clat_outer_core_2d,clon_outer_</span><wbr style="color:rgb(0,0,0)"><span style="color:rgb(0,0,0)">core_2d)</span><br style="color:rgb(0,0,0)"></font></div><div class="gmail_default" style=""><span style="color:rgb(0,0,0)"><font face="monospace, monospace" style="">end do</font></span></div><div class="gmail_default" style="font-size:small"><span style="color:rgb(0,0,0);font-family:serif;font-size:13.3333px"><br></span></div><div class="gmail_default" style="font-size:small"><span style="color:rgb(0,0,0);font-size:13.3333px"><font face="arial, helvetica, sans-serif">This is going to be slower than calling the function once, but hopefully it still works.</font></span></div><div class="gmail_default" style="font-size:small"><span style="color:rgb(0,0,0);font-size:13.3333px"><font face="arial, helvetica, sans-serif"><br></font></span></div><div class="gmail_default" style="font-size:small"><span style="color:rgb(0,0,0);font-size:13.3333px"><font face="arial, helvetica, sans-serif">--Mary</font></span></div><div class="gmail_default" style="font-size:small"><span style="color:rgb(0,0,0);font-size:13.3333px"><font face="arial, helvetica, sans-serif"><br></font></span></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 17, 2018 at 11:41 PM, nafiseh pegahfar via ncl-talk <span dir="ltr"><<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
<div style="font-size:13.3333px;font-family:serif;color:rgb(0,0,0);font-weight:400;font-style:normal">
To whom it may concern,</div>
<div style="font-size:13.3333px;font-family:serif;color:rgb(0,0,0);font-weight:400;font-style:normal">
I decided to use wrf outputs and a tropical cyclone center location (from
JTWC) to define some circular nests around TC center with fixed radiuses. To
this aim, I used nggcog and gc_inout functions to define the circular nest
and determine the points that are in the defined circle. Now I need to now
which points are located on the circle. So I used gc_onarc function, but
defining the inputs for this function confused me. the two rightmost inputs
for gc_onarc are nggcog out puts with (/72,2/)dimension and dimension of the
last two left gc_onarc inputs are 3600. I do highly appreciate if help me.
The sample of code are attached as below:<br>
<br>
<br>
<br>
;<wbr>oooooooooooooooooooooooooooooo<wbr>oooooooooooooooooooooooooooo**<wbr>*************<br>
;<br>
;<br>
load "/usr/share/ncarg/nclscripts/<wbr>csm/gsn_code.ncl"<br>
load "/usr/share/ncarg/nclscripts/<wbr>csm/gsn_csm.ncl"<br>
load "/usr/share/ncarg/nclscripts/<wbr>csm/contributed.ncl"<br>
load "/usr/share/ncarg/nclscripts/<wbr>csm/shea_util.ncl"<br>
load "/usr/share/ncarg/nclscripts/<wbr>wrf/WRFUserARW.ncl"<br>
load "/usr/share/ncarg/nclscripts/<wbr>csm/skewt_func.ncl"<br>
<br>
begin<br>
;<wbr>oooooooooooooooooooooooooooooo<wbr>oooooooooooooooooooooooooooo**<wbr>************<br>
; add data from file<br>
;<wbr>ooooooooooooooooooooooooooooo*<wbr>********<br>
DATADir =
"/home/pegahfar/inio/haiyan/<wbr>data/wrfout_18_6_haiyan_MPI_8/<wbr>"<br>
FILES = systemfunc (" ls -1 " + DATADir +"wrfout*")<br>
print ("FILES="+FILES)<br>
<br>
lat_center = (/(/5.8, 5.8, 6.1, 6.1,6.1, 6.2, 6.3, 6.5,6.5, 6.5, 6.9,
7.1,7.3, 7.6, 7.9, 8.2,8.7, 9.3, 10.2, 10.6,11.0, 11.4, 11.9, 12.2,12.3,
13.5, 14.4, 15.4,16.5, 17.9, 19.4, 20.4,21.5, 22.4, 22.4 , 22.4/)/)<br>
;;;print (lat_center)<br>
<br>
lon_center =
(/(/157.2,157.2,155.5,153.3,<wbr>152.2,150.4,148.8,147.2,145.9,<wbr>144.6,142.9,141.3,139.7,138.0,<wbr>136.2,134.4,132.8,131.1,129.1,<wbr>126.9,124.8,122.5,120.5,118.0,<wbr>116.6,114.8,113.1,111.4,110.3,<wbr>109.0,108.0,107.5,107.1,107.7,<wbr>107.7,107.7/)/)<br>
<br>
do ifil =1,35,1<br>
<br>
a= addfile(FILES(ifil),"r") ; Open the next file<br>
times := wrf_user_getvar(a,"times",-1) ; get all times in
the file<br>
ntimes = dimsizes(times) ;
number of times in the file<br>
<br>
lat_wrf := a->XLAT(0,:,:)<br>
lon_wrf := a->XLONG(0,:,:)<br>
<br>
radius_outer_core=(7*RMW_km(<wbr>ifil))/110<br>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;;;;;;;;<br>
;;;;;;;;; /\ /\ /\ /\ start of define circle sized structure /\
/\ /\ /\ /\;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;;;;;;;;<br>
<br>
npoint_outer_core=144<br>
<br>
clat_outer_core = new(npoint_outer_core,float) ; arrays
to hold great circle<br>
clon_outer_core = new(npoint_outer_core,float)<br>
<br>
lat_location = lat_center(ifil) <br>
lon_location = lon_center(ifil)<br>
<br>
nggcog(lat_location,lon_<wbr>location,radius_outer_core,<wbr>clat_outer_core,clon_outer_<wbr>core)
; Calculate great circle<br>
<br>
min_lat_outer_core = min(clat_outer_core)
<br>
min_lon_outer_core = min(clon_outer_core)<br>
max_lat_outer_core = max(clat_outer_core)<br>
max_lon_outer_core = max(clon_outer_core)<br>
<br>
extrem_outer_core_lat=(/min_<wbr>lat_outer_core , max_lat_outer_core /)<br>
extrem_outer_core_lon=(/min_<wbr>lon_outer_core , max_lon_outer_core /)<br>
<br>
extrem_outer_core_inds=getind_<wbr>latlon2d (lat_wrf,lon_wrf,
extrem_outer_core_lat, extrem_outer_core_lon)<br>
<br>
;---Subset the desired rectagle of data<br>
<br>
loc_outer_core_circle:= getind_latlon2d (lat_wrf,lon_wrf, clat_outer_core,
clon_outer_core)<br>
<br>
lat_ind_over_c=loc_outer_core_<wbr>circle(:,0)<br>
lon_ind_over_c=loc_outer_core_<wbr>circle(:,1)<br>
<br>
;---Set points that are outside of the circle of data to missing<br>
<br>
lat_2d_outer_core:=lat_wrf(<wbr>extrem_outer_core_inds
(0,0):extrem_outer_core_inds(<wbr>1,0),extrem_outer_core_inds(0,<wbr>1):extrem_outer_core_inds(1,1)<wbr>)<br>
lon_2d_outer_core:=lon_wrf(<wbr>extrem_outer_core_inds
(0,0):extrem_outer_core_inds(<wbr>1,0),extrem_outer_core_inds(0,<wbr>1):extrem_outer_core_inds(1,1)<wbr>)<br>
<br>
in_circle_outer_core :=
gc_inout(lat_2d_outer_core,<wbr>lon_2d_outer_core,clat_outer_<wbr>core,clon_outer_core)<br>
<br>
size_in_circle_outer_core=<wbr>dimsizes(in_circle_outer_core)<br>
<br>
;;;;;;;;;;;;;; on arc ;;;;;;;;;;;<br>
<br>
clat_outer_core_size = dimsizes(clat_outer_core)<br>
print("clat_outer_core_size="+<wbr>clat_outer_core_size)<br>
<br>
clat_outer_core_2d=reshape(<wbr>clat_outer_core,(/<wbr>floattointeger(clat_outer_<wbr>core_size/2),2/))<br>
clon_outer_core_2d=reshape(<wbr>clon_outer_core,(/<wbr>floattointeger(clat_outer_<wbr>core_size/2),2/))<br>
<br>
size_lat_2d_outer_core=<wbr>dimsizes(lat_2d_outer_core)<br>
<br>
lat_2d_outer_core_reshape =
reshape(lat_2d_outer_core,(/<wbr>size_lat_2d_outer_core(0)*<wbr>size_lat_2d_outer_core(1),2/))<br>
lon_2d_outer_core_reshape =
reshape(lon_2d_outer_core,(/<wbr>size_lat_2d_outer_core(0)*<wbr>size_lat_2d_outer_core(1),2/))<br>
<br>
lat_2d_outer_core_to_1d = ndtooned(lat_2d_outer_core)<br>
lon_2d_outer_core_to_1d = ndtooned(lon_2d_outer_core)<br>
<br>
onarc_outer_core =
gc_onarc(lat_2d_outer_core_to_<wbr>1d,lon_2d_outer_core_to_1d,<wbr>clat_outer_core_2d,clon_outer_<wbr>core_2d)<br>
<br>
;;;;;;;;;;;;; on arc ;;;;;;;;;;;<br>
<br>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;;;;;;;;<br>
;;;;;;;;; /\ /\ /\ /\ end of define circle sized structure /\
/\ /\ /\ /\;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;;;;;;;;<br>
end</div>
<div style="font-size:13.3333px;font-family:serif;color:rgb(0,0,0);font-weight:400;font-style:normal">
</div>
<div style="font-size:13.3333px;font-family:serif;color:rgb(0,0,0);font-weight:400;font-style:normal">
</div>
<div style="font-size:13.3333px;font-family:serif;color:rgb(0,0,0);font-weight:400;font-style:normal">
</div>
<div style="font-size:13.3333px;font-family:serif;color:rgb(0,0,0);font-weight:400;font-style:normal">
</div>
<div style="font-family:serif;color:rgb(0,0,0);font-size:13.3333px;font-weight:400;font-style:normal">
Best Regards<br>
==============================<wbr>===<br>
Nafiseh Pegahfar<br>
Assistant Professor<br>
Iranian National Institute for Oceanography and Atmospheric Science<br>
(<a href="http://www.inio.ac.ir" target="_blank">http://www.inio.ac.ir</a>)<br>
Phone: (0098)21- 66944873-5 Ext. 224<br>
Fax: (0098)21- 66944869<br>
Email: (<a href="mailto:pegahfar@inio.ac.ir" target="_blank">pegahfar@inio.ac.ir</a>)<br>
(<a href="mailto:pegahfar@ut.ac.ir" target="_blank">pegahfar@ut.ac.ir</a>)<br>
==============================<wbr>===</div>
</div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>