<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> Longitude = data(:,1)<br>ncl 29> Latitude = data(:,0) <br>ncl 30> TotCH4_A = data(:,2) <br>ncl 31> ncdf = addfile("/home/kunal/<a href="http://simple1.nc">simple1.nc</a>","c")<br>ncl 32> filedimdef(ncdf,"time",-1,True) <br>ncl 33> TotCH4_A!0 = "Latitude"<br>ncl 34> TotCH4_A!1 = "Longitude"<br><b>fatal:Variable (TotCH4_A) has (1) dimensions can not write to dimension (1)<br>fatal:["Execute.c":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 & 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"><<a href="mailto:meier-fleischer@dkrz.de" target="_blank">meier-fleischer@dkrz.de</a>></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 'output netcdf' 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)">("/bin/rm -f <a href="http://simple.nc" target="_blank">simple.nc</a>") ; 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("<a href="http://simple.nc" target="_blank">simple.nc</a>" ,"c") ; 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,"time",-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 = "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!1 = "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">values&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&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->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 <<a href="mailto:kunal.bali9@gmail.com" target="_blank">kunal.bali9@gmail.com</a>>:<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 & 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>