<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<STYLE type=text/css> <!--@import url(scrollbar.css); --></STYLE>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<STYLE>                        body{FONT-SIZE:12pt; FONT-FAMILY:宋体,serif;}                </STYLE>
<META name=GENERATOR content="MSHTML 10.00.9200.16660"><BASE
target=_blank></HEAD>
<BODY
style="BORDER-LEFT-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN: 12px; LINE-HEIGHT: 1.3; BORDER-TOP-WIDTH: 0px"
marginheight="0" marginwidth="0">
<DIV><FONT color=#000000 size=3 face=宋体>Adam,</FONT></DIV>
<DIV><FONT color=#000000 size=3> Thanks for your responding. I have
added what you mentioned, but the error is still there.</FONT></DIV>
<DIV><FONT color=#000000 size=3>(0)
19930101</FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#000000 size=3>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</FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#000000 size=3>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</FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#000000 size=3>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</FONT></DIV>
<DIV><FONT color=#000000 size=3></FONT> </DIV>
<DIV>The newer code is</DIV>
<DIV> </DIV>
<DIV><FONT color=#0000ff>do nt=nb,ne<BR> time=in[:]
->time(nt-1)<BR> utc_date = cd_calendar(time,
-3)<BR> print(""+utc_date)<BR>
<BR>;************************************************<BR>; read in zonal [u] and
meridional [v] winds
<BR>;************************************************<BR>
tmp =
in[:]->UGRD_10maboveground(nt-1,:,:)<BR>
u =
tmp({lat_min:lat_max},{lon_min:lon_max})/100.0<BR>
tmp =
in[:]->VGRD_10maboveground(nt-1,:,:)<BR>
v =
tmp({lat_min:lat_max},{lon_min:lon_max})/100.0<BR> speed
= sqrt(u^2 + v^2)<BR> <FONT
color=#ff0000>copy_VarCoords(u,speed)<BR></FONT>
<BR> </FONT><A href="mailto:vcres@tiMainString"><FONT
color=#0000ff>vcres@tiMainString</FONT></A><FONT
color=#0000ff> = "Wind 10m
above ground"<BR> </FONT><A
href="mailto:vcres@gsnLeftString"><FONT
color=#0000ff>vcres@gsnLeftString</FONT></A><FONT
color=#0000ff> =
utc_date<BR> </FONT><A
href="mailto:vcres@gsnRightString"><FONT
color=#0000ff>vcres@gsnRightString</FONT></A><FONT
color=#0000ff> = "m/s"</FONT></DIV>
<DIV><FONT color=#0000ff></FONT> </DIV>
<DIV><FONT color=#0000ff> wks = gsn_open_wks(wks_type
,"wind_"+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> <FONT
color=#ff0000>plot=gsn_csm_vector_scalar_map_ce(wks,u(NbLatitudes|:,NbLongitudes|:),v(NbLatitudes|:,NbLongitudes|:),speed(NbLatitudes|:,NbLongitudes|:),vcres)</FONT>
; create plot<BR> end do</FONT></DIV>
<DIV> </DIV>
<DIV align=left><FONT color=#c0c0c0 size=2 face=Verdana>2013-09-06</FONT></DIV>
<DIV align=left><FONT size=2 face=Verdana>
<HR id=SignNameHR style="HEIGHT: 2px; WIDTH: 122px" align=left SIZE=2>
</FONT></DIV>
<DIV align=left><FONT color=#c0c0c0 size=2 face=Verdana><SPAN
id=_FlashSignName>朱学明</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Verdana>
<HR>
</FONT></DIV>
<DIV><FONT size=2 face=Verdana><STRONG>发件人:</STRONG>Adam Phillips
<asphilli@ucar.edu></FONT></DIV>
<DIV><FONT size=2
face=Verdana><STRONG>发送时间:</STRONG>2013-09-06 02:56</FONT></DIV>
<DIV><FONT size=2 face=Verdana><STRONG>主题:</STRONG>Re: [ncl-talk]
check_for_y_lat_coord</FONT></DIV>
<DIV><FONT size=2
face=Verdana><STRONG>收件人:</STRONG>"朱学明"<557xiaozhu@163.com></FONT></DIV>
<DIV><FONT size=2 face=Verdana><STRONG>抄送:</STRONG>"ncl-talk@ucar.edu
USERS"<ncl-talk@ucar.edu></FONT></DIV>
<DIV><FONT size=2 face=Verdana></FONT> </DIV>
<DIV><FONT size=2 face=Verdana>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>
<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 size=3 face=宋体>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
href="mailto:vcres@tiMainString" moz-do-not-send="true"><FONT color=#0000ff
face="Times New Roman">vcres@tiMainString</FONT></A><FONT color=#0000ff
face="Times New Roman">
= "Geostrophic Current Field"<BR> </FONT><A
href="mailto:vcres@gsnLeftString" moz-do-not-send="true"><FONT color=#0000ff
face="Times New Roman">vcres@gsnLeftString</FONT></A><FONT color=#0000ff
face="Times New Roman"> =
utc_date<BR> </FONT><A
href="mailto:vcres@gsnRightString" moz-do-not-send="true"><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 size=2
face=Verdana>2013-09-06</FONT></DIV><FONT size=2 face=Verdana>
<HR id=SignNameHR style="HEIGHT: 2px; WIDTH: 122px" align=left SIZE=2>
</FONT>
<DIV><FONT color=#c0c0c0 size=2 face=Verdana><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></FONT></DIV></BODY></HTML>