<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    If you are still getting that error message then your
    latitude/longitude coordinate variables do not have valid units
    attributes, as is stated in the error message.  Please refer to the
    FAQ I previously sent. You may have to do something like this:<br>
    <br>
    u&amp;NbLongitudes@units = "degrees_east"<br>
    u&amp;NbLatitudes@units = "degrees_north"<br>
    v&amp;NbLongitudes@units = "degrees_east"<br>
    v&amp;NbLatitudes@units = "degrees_north"<br>
    speed&amp;NbLongitudes@units = "degrees_east"<br>
    speed&amp;NbLatitudes@units = "degrees_north"<br>
    <br>
    If that doesn't fix the issue let ncl-tal know. <br>
    Adam<br>
    <br>
    <div class="moz-cite-prefix">On 09/05/2013 01:21 PM, 朱学明 wrote:<br>
    </div>
    <blockquote
      cite="mid:44343ad1.4f.140ef9231f8.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>                        body{FONT-SIZE:12pt; FONT-FAMILY:宋体,serif;}                </style>
      <meta name="GENERATOR" content="MSHTML 10.00.9200.16660">
      <base target="_blank">
      <div><font color="#000000" face="宋体" size="3">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
          &gt; 180, but<br>
          (0)                     didn't set mpCenterLonF. Setting
          mpCenterLonF to 194.5</font></div>
      <div> </div>
      <div>The newer code is</div>
      <div> </div>
      <div><font color="#0000ff">do nt=nb,ne<br>
               time=in[:] -&gt;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[:]-&gt;UGRD_10maboveground(nt-1,:,:)<br>
               u     = tmp({lat_min:lat_max},{lon_min:lon_max})/100.0<br>
               tmp   = in[:]-&gt;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 moz-do-not-send="true"
          href="mailto:vcres@tiMainString"><font color="#0000ff">vcres@tiMainString</font></a><font
          color="#0000ff">          = "Wind 10m above ground"<br>
               </font><a moz-do-not-send="true"
          href="mailto:vcres@gsnLeftString"><font color="#0000ff">vcres@gsnLeftString</font></a><font
          color="#0000ff">         = utc_date<br>
               </font><a moz-do-not-send="true"
          href="mailto:vcres@gsnRightString"><font color="#0000ff">vcres@gsnRightString</font></a><font
          color="#0000ff">        = "m/s"</font></div>
      <div> </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" face="Verdana" size="2">2013-09-06</font></div>
      <div align="left"><font face="Verdana" size="2">
          <hr id="SignNameHR" style="HEIGHT: 2px; WIDTH: 122px"
            align="left" size="2">
        </font></div>
      <div align="left"><font color="#c0c0c0" face="Verdana" size="2"><span
            id="_FlashSignName">朱学明</span></font></div>
      <div><font face="Verdana" size="2">
          <hr>
        </font></div>
      <div><font face="Verdana" size="2"><strong>发件人:</strong>Adam
          Phillips <a class="moz-txt-link-rfc2396E" href="mailto:asphilli@ucar.edu">&lt;asphilli@ucar.edu&gt;</a></font></div>
      <div><font face="Verdana" size="2"><strong>发送时间:</strong>2013-09-06 02:56</font></div>
      <div><font face="Verdana" size="2"><strong>主题:</strong>Re:
          [ncl-talk] check_for_y_lat_coord</font></div>
      <div><font face="Verdana" size="2"><strong>收件人:</strong>"朱学
          明"<a class="moz-txt-link-rfc2396E" href="mailto:557xiaozhu@163.com">&lt;557xiaozhu@163.com&gt;</a></font></div>
      <div><font face="Verdana" size="2"><strong>抄送:</strong><a class="moz-txt-link-rfc2396E" href="mailto:ncl-talk@ucar.eduUSERS">"ncl-talk@ucar.edu
          USERS"</a><a class="moz-txt-link-rfc2396E" href="mailto:ncl-talk@ucar.edu">&lt;ncl-talk@ucar.edu&gt;</a></font></div>
      <div> </div>
      <div><font face="Verdana" size="2">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 moz-do-not-send="true" 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" 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 &gt; 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-&gt;Grid_0001<br>
                       u     = tmp({lon_min:lon_max},{lat_min:lat_max})
                  ;/100.0<br>
                       tmp   = in-&gt;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> </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 moz-do-not-send="true" 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 moz-do-not-send="true" 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 moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.cgd.ucar.edu/cas/asphilli">http://www.cgd.ucar.edu/cas/asphilli</a>
</pre>
        </font></div>
      <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>