<div dir="ltr"><div class="gmail_default"><font face="arial, helvetica, sans-serif">You can only use coordinate subscripting with dimensions that are represented by 1-dimensional coordinate arrays that have the same dimension name as their variable name.</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">You are trying to access vozocrtx with latitude and longitude subscripting:</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><div style="color:rgb(0,0,0);line-height:16.8px"><font face="monospace, monospace">u = uin->vozocrtx(0,depth-1,{lat_min:lat_max},{lon_min:lon_max}) </font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">This variable is defined on the file as:</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="monospace, monospace"><span style="color:rgb(0,0,0);line-height:16.8px">float vozocrtx(time_counter, depthu, y, x) ;</span><br></font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">"time_counter" and "depthu" are 1-dimensional coordinate arrays:</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><span style="color:rgb(0,0,0);line-height:16.8px"><font face="monospace, monospace"> float depthu(depthu) ;<br> float time_counter(time_counter) ;</font></span><br></div><div><span style="color:rgb(0,0,0);line-height:16.8px"><font face="arial, helvetica, sans-serif"><br></font></span></div><div><span style="color:rgb(0,0,0);line-height:16.8px"><font face="arial, helvetica, sans-serif">but "y" and "x" are not. Y</font></span><span style="line-height:16.8px;color:rgb(0,0,0);font-family:arial,helvetica,sans-serif">our lat/lon variables are both 2-dimensional and called "nav_lat" and "nav_lon". To subscript an array based on 2D lat/lon arrays, you can use "getind_latlon2d". Please see the documentation for this function for some examples:</span></div><div><font color="#000000" face="arial, helvetica, sans-serif"><span style="line-height:16.8px"><br></span></font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><span style="line-height:16.8px"><a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/getind_latlon2d.shtml">http://www.ncl.ucar.edu/Document/Functions/Contributed/getind_latlon2d.shtml</a></span><br></font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><span style="line-height:16.8px"><br></span></font></div></div><div class="gmail_extra"><font face="arial, helvetica, sans-serif"><div class="gmail_default" style="font-size:small;display:inline">--Mary</div></font></div><div class="gmail_extra"><font face="arial, helvetica, sans-serif"><div class="gmail_default" style="font-size:small;display:inline"></div><br></font><div class="gmail_quote"><font face="arial, helvetica, sans-serif">On Tue, Jan 12, 2016 at 8:41 AM, 朱学明 <span dir="ltr"><<a href="mailto:557xiaozhu@163.com" target="_blank">557xiaozhu@163.com</a>></span> wrote:<br></font><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><font face="arial, helvetica, sans-serif"><u></u>
</font><div style="border-width:0px;color:rgb(0,0,0);margin:12px;line-height:1.5" marginheight="0" marginwidth="0"><font face="arial, helvetica, sans-serif"><u></u>
</font><div><font face="arial, helvetica, sans-serif">Hello all,</font></div>
<div><font face="arial, helvetica, sans-serif"> </font></div>
<div><font face="arial, helvetica, sans-serif"> I have got an error as follow,</font></div>
<div><font face="arial, helvetica, sans-serif"> </font></div>
<div><font face="arial, helvetica, sans-serif">fatal:["FileSupport.c":133]:Dimension (x) of file
(ext-PSY4V1R3_1dAV_201201_gridU) does not have an associated coordinate
variable<br>fatal:["Execute.c":8567]:Execute: Error occurred at or near line 184
in file mercator_vector_rectangle.ncl</font></div>
<div><font face="arial, helvetica, sans-serif"> </font></div>
<div><font face="arial, helvetica, sans-serif">Here is the line 184 in file mercator_vector_rectangle.ncl:</font></div>
<div><font face="arial, helvetica, sans-serif"> </font></div>
<div style="COLOR:#000000"><font face="arial, helvetica, sans-serif">u =
uin->vozocrtx(0,depth-1,{lat_min:lat_max},{lon_min:lon_max}) </font></div>
<div><font face="arial, helvetica, sans-serif"> </font></div>
<div><font face="arial, helvetica, sans-serif">The nc file head from command "ncdump -h <a href="http://aaa.nc" target="_blank">aaa.nc</a>" is as follow,</font></div>
<div><font face="arial, helvetica, sans-serif"> </font></div>
<div><font face="arial, helvetica, sans-serif">netcdf ext-PSY4V1R3_1dAV_201201_gridU {<br>dimensions:<br> y = 429
;<br> x = 566 ;<br> depthu = 50 ;<br> time_counter = UNLIMITED ;
// (1 currently)<br>variables:<br> short nav_lon(y, x)
;<br> nav_lon:units = "degrees_east"
;<br> nav_lon:valid_min = 98.f ;<br> nav_lon:valid_max =
146.f ;<br> nav_lon:add_offset = 0.f
;<br> nav_lon:scale_factor = 0.01f ;<br> nav_lon:long_name
= "Longitude" ;<br> nav_lon:nav_model = "Default grid"
;<br> short nav_lat(y, x) ;<br> nav_lat:units = "degrees_north"
;<br> nav_lat:valid_min = -6.f ;<br> nav_lat:valid_max =
30.f ;<br> nav_lat:add_offset = 0.f
;<br> nav_lat:scale_factor = 0.01f ;<br> nav_lat:long_name
= "Latitude" ;<br> nav_lat:nav_model = "Default grid"
;<br> float depthu(depthu) ;<br> depthu:units = "m"
;<br> depthu:positive = "unknown" ;<br> depthu:valid_min =
0.f ;<br> depthu:valid_max = 5728.f ;<br> depthu:title =
"depthu" ;<br> depthu:long_name = "Vertical U levels"
;<br> float time_counter(time_counter)
;<br> time_counter:calendar = "gregorian"
;<br> time_counter:title = "Time"
;<br> time_counter:long_name = "Time axis"
;<br> time_counter:units = "seconds since 2007-10-31 00:00:00"
;<br> time_counter:time_origin = "2007-OCT-31 00:00:00"
;<br> float vozocrtx(time_counter, depthu, y, x)
;<br> vozocrtx:units = "m/s" ;<br> vozocrtx:missing_value
= -32767s ;<br> vozocrtx:valid_min = -9999.99952502551
;<br> vozocrtx:valid_max = 9999.99952502551
;<br> vozocrtx:long_name = "Zonal Velocity"
;<br> vozocrtx:short_name = "vozocrtx"
;<br> vozocrtx:standard_name = "sea_water_x_velocity"
;<br> vozocrtx:online_operation = "N/A"
;<br> vozocrtx:axis = "TZYX"
;<br> vozocrtx:interval_operation = 432000.
;<br> vozocrtx:interval_write = 432000.
;<br> vozocrtx:associate = "time_counter depthu nav_lat nav_lon"
;<br> vozocrtx:coordinates = "nav_lon nav_lat depthu time_counter"
;</font></div>
<div><font face="arial, helvetica, sans-serif"> </font></div>
<div><font face="arial, helvetica, sans-serif">// global attributes:<br> :Conventions = "GDT 1.3"
;<br> :file_name = "ORCA12_LIM-T103_y2011m12d31_gridU.nc"
;<br> :production = "OPA9.0 beta" ;<br> :TimeStamp =
"2012-JAN-09 04:45:09 GMT+0000" ;<br> :NCO = "4.0.2"
;<br> :nco_openmp_thread_number = 1 ;<br>}</font></div>
<div><font face="arial, helvetica, sans-serif"> </font></div>
<div><font face="arial, helvetica, sans-serif"> How should I modify the ncl code or change the ncfile to fix the
problem? Thanks.</font></div>
<div><font face="arial, helvetica, sans-serif"> </font></div>
<div style="color:rgb(192,192,192)">
<div align="left"><font face="arial, helvetica, sans-serif">2016-01-12</font></div>
<hr style="BORDER-TOP:#c0c0c0 1px solid;min-height:1px;BORDER-RIGHT:0px;BORDER-BOTTOM:0px;BORDER-LEFT:0px;WIDTH:122px" align="left">
<span><font face="arial, helvetica, sans-serif">
<u></u>
<div>
<u></u>
<div>
<div>
<div>Xueming Zhu 朱学明<br>Key Laboratory of Research
on Marine Hazards Forecasting (LoMF), SOA<br>National Marine Environmental
Forecasting Center (NMEFC)<br>No.8, Dahuisi Road, Haidian District, Beijing,
100081<br>People's Republic of
China<br>Tel:<a href="tel:%2B86-10-82481923" value="+861082481923" target="_blank">+86-10-82481923</a></div></div></div><u></u></div><u></u></font></span></div><font face="arial, helvetica, sans-serif"><u></u></font></div><font face="arial, helvetica, sans-serif"><br>_______________________________________________<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/mailman/listinfo/ncl-talk</a><br>
<br></font></blockquote></div><br></div></div>