<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Thanks for sending printVarSummary's of your three arrays, as that
likely identifies the issue. Unlike your u and v arrays, your speed
array does not have any metadata/coordinate variables associated
with it. <br>
<br>
Try adding this after you create your speed array:<br>
copy_VarCoords(u,speed)<br>
<br>
Alternatively, you can do this:<br>
speed = u<br>
speed = (/ sqrt(u^2 + v^2) /) ; overwrite speed values, but leave
the metadata<br>
<br>
This is all assuming that your NbLongitudes / NbLatitudes have units
attributes set. See this FAQ here:<br>
<a class="moz-txt-link-freetext" href="http://www.ncl.ucar.edu/FAQ/#err_msgs_027">http://www.ncl.ucar.edu/FAQ/#err_msgs_027</a><br>
<br>
Finally, note that your u/v/speed arrays are dimensioned longitude
by latitude. The gsn_csm_vector_scalar_map_ce plotting function
expects the order to be latitude by longitude. Thus, you will have
to reorder your dimensions like this:<br>
plot=gsn_csm_vector_scalar_map_ce(wks,u(NbLatitudes|:,NbLongitudes|:),v(NbLatitudes|:,NbLongitudes|:),speed(NbLatitudes|:,NbLongitudes|:),vcres)
<br>
<br>
Hope that helps. If you have any further questions please respond
only to the ncl-talk email list.<br>
Adam<br>
<br>
<div class="moz-cite-prefix">On 09/05/2013 12:39 PM, 朱学明 wrote:<br>
</div>
<blockquote
cite="mid:325dcdf1.2f.140ef6bfde9.Coremail.557xiaozhu@163.com"
type="cite">
<style type="text/css"> <!--@import url(scrollbar.css); --></style>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<style>                        BLOCKQUOTE{margin-Top: 0px; margin-Bottom: 0px; margin-Left: 2em}                        body{FONT-SIZE:12.1pt; COLOR:#001; FONT-FAMILY:宋体,serif;}                </style>
<meta name="GENERATOR" content="MSHTML 10.00.9200.16660">
<base target="_blank">
<stationery>
<div><font color="#000000" face="宋体" size="3">Hi All,</font></div>
<div><font color="#000000" size="3"> I am trying to plot the
geostrophic current fields from aviso. And get some screen
output and error messages as follow,</font></div>
<div> </div>
<div>(0) 19930101</div>
<div> </div>
<div>Variable: u<br>
Type: float<br>
Total Size: 664692 bytes<br>
166173 values<br>
Number of Dimensions: 2<br>
Dimensions and sizes: [NbLongitudes | 579] x [NbLatitudes |
287]<br>
Coordinates:<br>
NbLongitudes:
[98.33333333332349..290.9999999999709]<br>
NbLatitudes:
[-17.79766126545592..60.88112837177402]<br>
Number Of Attributes: 5<br>
date : 1993-01-01 00:00:00.000000 UTC<br>
Date_CNES_JD : 15706<br>
units : cm/s<br>
long_name : U<br>
_FillValue : 1.844674e+19</div>
<div> </div>
<div>Variable: v<br>
Type: float<br>
Total Size: 664692 bytes<br>
166173 values<br>
Number of Dimensions: 2<br>
Dimensions and sizes: [NbLongitudes | 579] x [NbLatitudes |
287]<br>
Coordinates:<br>
NbLongitudes:
[98.33333333332349..290.9999999999709]<br>
NbLatitudes:
[-17.79766126545592..60.88112837177402]<br>
Number Of Attributes: 5<br>
_FillValue : 1.844674e+19<br>
long_name : V<br>
units : cm/s<br>
Date_CNES_JD : 15706<br>
date : 1993-01-01 00:00:00.000000 UTC</div>
<div> </div>
<div>Variable: speed<br>
Type: float<br>
Total Size: 664692 bytes<br>
166173 values<br>
Number of Dimensions: 2<br>
Dimensions and sizes: [579] x [287]<br>
Coordinates:<br>
Number Of Attributes: 1<br>
_FillValue : 1.844674e+19<br>
(0) check_for_y_lat_coord: Warning: Data either does not
contain a valid latitude coordinate array or doesn't contain
one at all.<br>
(0) A valid latitude coordinate array should have a
'units' attribute equal to one of the following values:<br>
(0) 'degrees_north' 'degrees-north' 'degree_north'
'degrees north' 'degrees_N' 'Degrees_north' 'degree_N'
'degreeN' 'degreesN' 'deg north'<br>
(0) check_for_lon_coord: Warning: Data either does not
contain a valid longitude coordinate array or doesn't contain
one at all.<br>
(0) A valid longitude coordinate array should have a
'units' attribute equal to one of the following values:<br>
(0) 'degrees_east' 'degrees-east' 'degree_east'
'degrees east' 'degrees_E' 'Degrees_east' 'degree_E' 'degreeE'
'degreesE' 'deg east'<br>
(0) gsn_csm_map_ce: Warning: you set mpMaxLonF to a value
> 180, but<br>
(0) didn't set mpCenterLonF. Setting
mpCenterLonF to 194.5<br>
</div>
<div>My code is as follow,</div>
<div> </div>
<div> <font color="#0000ff"> </font><font color="#0000ff"
face="Times New Roman">do nt=nb,ne<br>
in = addfile(infile(nt-1),"r")<br>
utc_date = str_get_cols(infile(nt-1),44,51)<br>
print(""+utc_date)<br>
<br>
;************************************************<br>
; read in zonal [u] and meridional [v] winds <br>
;************************************************<br>
tmp = in->Grid_0001<br>
u = tmp({lon_min:lon_max},{lat_min:lat_max})
;/100.0<br>
tmp = in->Grid_0002<br>
v = tmp({lon_min:lon_max},{lat_min:lat_max})
;/100.0<br>
speed = sqrt(u^2 + v^2)<br>
<br>
</font><a moz-do-not-send="true"
href="mailto:vcres@tiMainString"><font color="#0000ff"
face="Times New Roman">vcres@tiMainString</font></a><font
color="#0000ff" face="Times New Roman"> =
"Geostrophic Current Field"<br>
</font><a moz-do-not-send="true"
href="mailto:vcres@gsnLeftString"><font color="#0000ff"
face="Times New Roman">vcres@gsnLeftString</font></a><font
color="#0000ff" face="Times New Roman"> = utc_date<br>
</font><a moz-do-not-send="true"
href="mailto:vcres@gsnRightString"><font color="#0000ff"
face="Times New Roman">vcres@gsnRightString</font></a><font
color="#0000ff" face="Times New Roman"> = "m/s"</font></div>
<div> </div>
<div><font color="#ffff00" face="Times New Roman"><font
color="#0000ff"> wks = gsn_open_wks(wks_type
,"uv_"+utc_date) ; open a ps file<br>
gsn_define_colormap(wks,"rainbow")
;"BlAqGrYeOrRe") ; choose colormap<br>
printVarSummary(u)<br>
printVarSummary(v)<br>
printVarSummary(speed)<br>
plot=gsn_csm_vector_scalar_map_ce(wks,u,v,speed,vcres) ;
create plot<br>
end do</font><br>
</font></div>
<div><font face="Times New Roman"><font color="#000000">Anyone
can help me for figuring out the error? Thanks.</font></font></div>
<div><font face="Times New Roman"> </font></div>
<div align="left"><font color="#c0c0c0" face="Verdana" size="2">2013-09-06</font></div>
<font face="Verdana" size="2">
<hr id="SignNameHR" style="HEIGHT: 2px; WIDTH: 122px"
align="left" size="2">
</font>
<div><font color="#c0c0c0" face="Verdana" size="2"><span
id="_FlashSignName">朱学明</span></font></div>
</stationery><br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
<a class="moz-txt-link-freetext" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
______________________________________________________________
Adam Phillips <a class="moz-txt-link-abbreviated" href="mailto:asphilli@ucar.edu">asphilli@ucar.edu</a>
NCAR/Climate and Global Dynamics Division (303) 497-1726
P.O. Box 3000                                
Boulder, CO 80307-3000 <a class="moz-txt-link-freetext" href="http://www.cgd.ucar.edu/cas/asphilli">http://www.cgd.ucar.edu/cas/asphilli</a>
</pre>
</body>
</html>