<div dir="ltr"><div>Dear NCL user <br></div>I tried this script from NCL but still getting error <br><div><div><br>ncl 28&gt; Longitude = data(:,1)<br>ncl 29&gt; Latitude = data(:,0)  <br>ncl 30&gt; TotCH4_A = data(:,2)  <br>ncl 31&gt; ncdf = addfile(&quot;/home/kunal/<a href="http://simple1.nc">simple1.nc</a>&quot;,&quot;c&quot;)<br>ncl 32&gt; filedimdef(ncdf,&quot;time&quot;,-1,True)              <br>ncl 33&gt; TotCH4_A!0 = &quot;Latitude&quot;<br>ncl 34&gt; TotCH4_A!1 = &quot;Longitude&quot;<br><b>fatal:Variable (TotCH4_A) has (1) dimensions can not write to dimension (1)<br>fatal:[&quot;Execute.c&quot;:8565]:Execute: Error occurred at or near line 34<br></b><br><br><br></div></div></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr"><div>Kunal Bali<br></div><div>Research Scholar <br></div><div>Radio &amp; Atmospheric Science Division <br></div><div>CSIR - National Physical Laboratory<br></div><div>New Delhi - 110012<br><br></div><div><br></div><div><br></div><div><br></div><div><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;border-collapse:collapse;font-family:Tahoma,Verdana;font-size:12px"><font color="#1F497D"><br></font></p></div></div></div>
<br><div class="gmail_quote">On Mon, Sep 22, 2014 at 5:32 PM, 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 dir="auto"><div>Hi Kunal,</div><div><br></div><div>Please, take a look at the &#39;output netcdf&#39; examples page, method_1</div><div><br></div><div><a href="http://ncl.ucar.edu/Applications/method_1.shtml" target="_blank">http://ncl.ucar.edu/Applications/method_1.shtml</a><br><br>Try this:</div><div><br></div><div><br></div><div>lat = data(:,0)</div><div>lat = data(:,1)</div><div>values= data(:,2)</div><div><a href="http://ncl.ucar.edu/Document/Functions/Built-in/system.shtml" style="margin:0px;padding:0px;text-decoration:none" target="_blank"><span style="margin:0px;padding:0px">system</span></a><span style="background-color:rgba(255,255,255,0)">(&quot;/bin/rm -f <a href="http://simple.nc" target="_blank">simple.nc</a>&quot;)   ; remove any pre-existing file </span></div><div><pre style="margin-top:0px;margin-bottom:0px;padding:0px;border-style:solid;border-width:0px 0px 15px;border-color:transparent"><font face="UICTFontTextStyleBody"><span style="white-space:normal;background-color:rgba(255,255,255,0)">ncdf     = addfile(&quot;<a href="http://simple.nc" target="_blank">simple.nc</a>&quot; ,&quot;c&quot;)  ; output netCDF file</span></font></pre><pre style="margin-top:0px;margin-bottom:0px;padding:0px;border-style:solid;border-width:0px 0px 15px;border-color:transparent"><a href="http://ncl.ucar.edu/Document/Functions/Built-in/filedimdef.shtml" style="white-space:normal;font-family:UICTFontTextStyleBody;margin:0px;padding:0px;text-decoration:none" target="_blank"><span style="margin:0px;padding:0px">filedimdef</span></a><span style="background-color:rgba(255,255,255,0);white-space:normal;font-family:UICTFontTextStyleBody">(ncdf,&quot;time&quot;,-1,True) ; recommended</span></pre><pre style="margin-top:0px;margin-bottom:0px;padding:0px;border-style:solid;border-width:0px 0px 15px;border-color:transparent"><span style="background-color:rgba(255,255,255,0);white-space:normal;font-family:UICTFontTextStyleBody">values!0    = &quot;lat&quot;</span></pre><pre style="margin-top:0px;margin-bottom:0px;padding:0px;border-style:solid;border-width:0px 0px 15px;border-color:transparent"><span style="background-color:rgba(255,255,255,0);font-family:UICTFontTextStyleBody;white-space:normal">values!1    = &quot;lon&quot;</span></pre><pre style="margin-top:0px;margin-bottom:0px;padding:0px;border-style:solid;border-width:0px 0px 15px;border-color:transparent"><span style="background-color:rgba(255,255,255,0);font-family:UICTFontTextStyleBody;white-space:normal">values&amp;lat  = lat</span></pre><pre style="margin-top:0px;margin-bottom:0px;padding:0px;border-style:solid;border-width:0px 0px 15px;border-color:transparent"><span style="background-color:rgba(255,255,255,0);font-family:UICTFontTextStyleBody;white-space:normal">values&amp;lon  = lon </span></pre><pre style="margin-top:0px;margin-bottom:0px;padding:0px;border-style:solid;border-width:0px 0px 15px;border-color:transparent"><span style="background-color:rgba(255,255,255,0);font-family:UICTFontTextStyleBody;white-space:normal">ncdf-&gt;values = values</span></pre></div><div><br></div><div>Bye, Karin</div><div><div><br></div></div><div><br>Am 22.09.2014 um 11:40 schrieb Kunal Bali &lt;<a href="mailto:kunal.bali9@gmail.com" target="_blank">kunal.bali9@gmail.com</a>&gt;:<br><br></div><div><div class="h5"><blockquote type="cite"><div><div dir="ltr"><div><div><div><div><div>Dear NCL users<br><br></div>I want to convert ASCII to .nc file format. Could any one please provides me the link for this query or give any detail about this ??<br><br></div>I have data in 3 column ( Latitude Longitude Values)<br></div>More Detail<br><br><b>Variable: data<br>Type: float<br>Total Size: 777600 bytes<br>            194400 values<br>Number of Dimensions: 2<br>Dimensions and sizes:    [64800] x [3]<br>Coordinates: <br>Number Of Attributes: 1<br>  _FillValue :    9.96921e+36<br><br><br></b></div><b>So is there any ways to convert ASCII to netcdf format ???<br><br></b></div><b>Thank You<br></b><div><div><div><br clear="all"><div><div><div><div><div><div dir="ltr"><div>Kunal Bali<br></div><div>Research Scholar <br></div><div>Radio &amp; Atmospheric Science Division <br></div><div>CSIR - National Physical Laboratory<br></div><div>New Delhi - 110012<br><br></div><div><br></div><div><br></div><div><br></div><div><p style="margin:0px;border-collapse:collapse;font-family:Tahoma,Verdana;font-size:12px"><font color="#1F497D"><br></font></p></div></div></div>
</div></div></div></div></div></div></div></div>
</div></blockquote></div></div><blockquote type="cite"><div><span>_______________________________________________</span><br><span>ncl-talk mailing list</span><br><span>List instructions, subscriber options, unsubscribe:</span><br><span><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></span><br></div></blockquote></div></blockquote></div><br></div>