<div dir="ltr"><div class="gmail_default" style="font-size:small">My guess is you need to do the same thing for the &quot;zi&quot; variable that you did for the &quot;grid&quot; variable.  </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</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 Fri, Dec 18, 2015 at 4:29 PM, Adv <span dir="ltr">&lt;<a href="mailto:advita6@gmail.com" target="_blank">advita6@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hi,<br>I added these lines . Then also same error. <br>grid!0=&quot;lat&quot;<br>grid!1=&quot;lon&quot;<br>grid&amp;lat = latt <br>grid&amp;lon = lonn<br>grid&amp;lat@units=&quot;degrees_north&quot;<br>grid&amp;lon@units=&quot;degrees_east&quot;<br><br></div>Could you please help me to fix this isssue. <br><br></div>Thank you<br><div><div><br><br><br><br></div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 18, 2015 at 2:41 AM, Karin Meier-Fleischer <span dir="ltr">&lt;<a href="mailto:meier-fleischer@dkrz.de" target="_blank">meier-fleischer@dkrz.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    Hi Adv,<br>
    <br>
    have you read the warning messages NCL returned? Your latitude and
    longitude arrays do not have the correct units like degrees_north or
    degrees_east. The solution is to add the units attribute to lat and
    lon, so NCL will know how to handle them.<br>
    <br>
    lat@units = &quot;degrees_north&quot;<br>
    lon@units = &quot;degrees_east&quot;<br>
    <br>
    Bye,<br>
    Karin<br>
    <br>
    <div>Am 18.12.15 um 08:24 schrieb Adv:<br>
    </div>
    <blockquote type="cite"><div><div>
      <div dir="ltr">
        <div>
          <div>Hi,<br>
          </div>
          I have been trying to do objective analysis only over the
          region of longitude from -116 to -90.35 and latitude of  40.01
          to 49. While plotting the output, the values are spreaded over
          the global region. I don&#39;t understand where is wrong. It&#39;s
          been long I am kinda stuck with this objective analysis. I
          have attached here the output figure and code too. Could
          someone please help me to fix this? <br>
          <br>
          begin<br>
           strll  = asciiread(&quot;stationmac.txt&quot;, -1, &quot;string&quot;) ;<br>
            print(strll)   ; STATION&quot;,&quot;STATION_NAME&quot;, &quot;LAT&quot;, &quot;LON&quot;<br>
            print(&quot;=====&quot;)<br>
          <br>
          sloc = str_get_field(strll , 2, &quot;,&quot;)<br>
            lat  = tofloat( str_get_field(strll , 3, &quot;,&quot;)  )<br>
            lon  = tofloat( str_get_field(strll , 4, &quot;,&quot;)  )<br>
            print(sloc +&quot; : &quot;+lat+&quot; &quot;+lon)<br>
          mnlat=(min(lat))<br>
          mxlat=(max(lat))<br>
          mnlon=(min(lon))<br>
          mxlon=(max(lon))<br>
          ;print(lon)<br>
          print(mnlon)<br>
          print(mxlon)<br>
          print(mnlat)<br>
          print(mxlat)<br>
          mlon = 390<br>
          dlon = -90.35 / mlon<br>
          lonn  = fspan (-116, (mlon - 1) * dlon, mlon)<br>
          print(lonn)<br>
          mlat = 390<br>
          dlat = 49.0 / mlat<br>
          latt  = fspan (40.01, (mlat - 1) * dlat, mlat)<br>
          print(latt)<br>
          ;gcdist = gc_latlon(mnlat,mnlon, mxlat,mxlon, 300,2)<br>
          ;print(gcdist)<br>
          ;print (gcdist@gclat+&quot;  &quot;+gcdist@gclon )<br>
          ;return<br>
          ;latt=gcdist@gclat<br>
          ;lonn=gcdist@gclon<br>
          ;print(min(latt))<br>
          ;print(max(latt))<br>
          ;print(max(lonn))<br>
          ;print(min(lonn))<br>
          diri=&quot;/home/dailysimms/prec-obs/01/&quot;<br>
          z1 = asciiread(diri+&quot;PrecJan1965-2014&quot;,-1,&quot;float&quot;)<br>
          ;print(z1)<br>
          ;printVarSummary(z1)<br>
          ;a = (/1,2,3,4,5,6,7,8/)<br>
          ;390 rows by 50 columns<br>
          a0 = onedtond(z1,(/390,50/))<br>
          ;print(a0)<br>
          x=dim_avg(a0)<br>
          print(x)<br>
          set_default_fillvalue(&quot;string&quot;,  &quot;&quot;)<br>
          zi = natgrid(lon, lat, x, lonn, latt)<br>
          print(zi)<br>
          zi!0=&quot;lat&quot;<br>
          zi!1=&quot;lon&quot;<br>
          zi&amp;lat=latt<br>
          zi&amp;lon=lonn<br>
          printVarSummary(zi)<br>
          print(zi)<br>
            opt    = True<br>
          opt@timing = True<br>
            rscan  = (/20,15,10, 5,3 /)<br>
          grid   = obj_anal_ic_deprecated(lon, lat, x, lonn, latt,
          rscan, opt)<br>
          printVarSummary(grid)<br>
          print(grid)<br>
          print(min(grid))<br>
          print(max(grid))<br>
          grid!0=&quot;lt&quot;<br>
          grid!1=&quot;ln&quot;<br>
          grid&amp;lt=latt<br>
          grid&amp;ln=lonn<br>
          printVarSummary(grid)<br>
          ;return<br>
;------------------------------------------------------------------<br>
          ; plot<br>
;------------------------------------------------------------------<br>
            wks      = gsn_open_wks(&quot;pdf&quot;,&quot;rdm2grid&quot;)<br>
            gsn_define_colormap(wks,&quot;amwg&quot;)<br>
           plot     = new(2,graphic)<br>
          <br>
            res                     = True<br>
            res@gsnDraw             = False           ; don&#39;t draw<br>
            res@gsnFrame            = False           ; don&#39;t advance
          frame<br>
            res@cnFillOn            = True            ; turn on color<br>
           ;res@cnLinesOn           = False           ; turn off contour
          lines<br>
            res@cnLineLabelsOn      = False           ; turn off contour
          line labels<br>
            res@gsnSpreadColors     = True            ; spread out color
          table<br>
            res@lbLabelBarOn        = False           ; turn off
          individual cb&#39;s<br>
          <br>
          <br>
          res@gsnCenterString = &quot;Original grid&quot;<br>
            plot(0) = gsn_csm_contour_map_ce(wks,zi,res)<br>
          <br>
            plot(1) = gsn_csm_contour_map_ce(wks,grid,res)<br>
          ;************************************************<br>
          ; create panel<br>
          ;************************************************<br>
            resP                     = True                ; modify the
          panel plot<br>
           ;resP@txString            = title<br>
            resP@gsnMaximize         = True                ; make large<br>
            resP@gsnPanelLabelBar    = True                ; add common
          colorbar<br>
            resP@lbLabelAutoStride   = True                ; Let NCL
          decide spacing<br>
           ;resP@lbLabelStride       = 2                   ; force every
          other label<br>
           ;resP@lbLabelFontHeightF  = 0.0125              ; make labels
          smaller [0.2 default]<br>
          <br>
            gsn_panel(wks,plot,(/2,1/),resP)            ; now draw as
          one plot<br>
          <br>
          end<br>
          <br>
        </div>
        Warning message:<br>
        (0)    check_for_y_lat_coord: Warning: Data either does not
        contain a valid latitude coordinate array or doesn&#39;t contain one
        at all.<br>
        (0)    A valid latitude coordinate array should have a &#39;units&#39;
        attribute equal to one of the following values: <br>
        (0)        &#39;degrees_north&#39; &#39;degrees-north&#39; &#39;degree_north&#39;
        &#39;degrees north&#39; &#39;degrees_N&#39; &#39;Degrees_north&#39; &#39;degree_N&#39; &#39;degreeN&#39;
        &#39;degreesN&#39; &#39;deg north&#39;<br>
        (0)    check_for_lon_coord: Warning: Data either does not
        contain a valid longitude coordinate array or doesn&#39;t contain
        one at all.<br>
        (0)    A valid longitude coordinate array should have a &#39;units&#39;
        attribute equal to one of the following values: <br>
        (0)        &#39;degrees_east&#39; &#39;degrees-east&#39; &#39;degree_east&#39; &#39;degrees
        east&#39; &#39;degrees_E&#39; &#39;Degrees_east&#39; &#39;degree_E&#39; &#39;degreeE&#39; &#39;degreesE&#39;
        &#39;deg east&#39;<br>
        (0)    check_for_y_lat_coord: Warning: Data either does not
        contain a valid latitude coordinate array or doesn&#39;t contain one
        at all.<br>
        (0)    A valid latitude coordinate array should have a &#39;units&#39;
        attribute equal to one of the following values: <br>
        (0)        &#39;degrees_north&#39; &#39;degrees-north&#39; &#39;degree_north&#39;
        &#39;degrees north&#39; &#39;degrees_N&#39; &#39;Degrees_north&#39; &#39;degree_N&#39; &#39;degreeN&#39;
        &#39;degreesN&#39; &#39;deg north&#39;<br>
        (0)    check_for_lon_coord: Warning: Data either does not
        contain a valid longitude coordinate array or doesn&#39;t contain
        one at all.<br>
        (0)    A valid longitude coordinate array should have a &#39;units&#39;
        attribute equal to one of the following values: <br>
        (0)        &#39;degrees_east&#39; &#39;degrees-east&#39; &#39;degree_east&#39; &#39;degrees
        east&#39; &#39;degrees_E&#39; &#39;Degrees_east&#39; &#39;degree_E&#39; &#39;degreeE&#39; &#39;degreesE&#39;
        &#39;deg east&#39;<br>
        <br>
        <div><br>
          <br>
          <br>
          <br>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><pre>_______________________________________________
ncl-talk mailing list
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>
List instructions, subscriber options, unsubscribe:
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a>
</pre>
    </blockquote>
  </div>

<br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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></blockquote></div><br></div>
</div></div><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></blockquote></div><br></div>