<div dir="ltr"><div><div>Users can not just take some WWW sample and expect it to work. Users *must* look at the information they have available and make the appropriate changes. Your sample has lev, lat, lon. The ascii file has none of this information. How is NCL supposed to know what these are? You must eliminate these.<br><br></div><br></div><div>If you are new to NCL, please *carefully* read: <br>      <a href="http://www.ncl.ucar.edu/Document/Manuals/NCL_User_Guide/" target="_blank">http://www.ncl.ucar.edu/<wbr>Document/Manuals/NCL_User_<wbr>Guide/</a><br></div><div>These tutorials are very helpful.<br></div><div>===<br><br></div><div>Attached is an example script with your data. It created the simple netCDF file. You will have to add additional code (long_name, units, additional variables). The code has some links. Please read to the pages indicated.<br><br>===<br></div><div>The golden rules of data processing are (1) Look at you data; (2) Know your data<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 3, 2017 at 7:49 AM, Najib Yusuf <span dir="ltr">&lt;<a href="mailto:najibgal@yahoo.com" target="_blank">najibgal@yahoo.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><div style="color:#000;background-color:#fff;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px"><div id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36098">Dear ncl users,</div><div id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36098"><br></div><div id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36098" dir="ltr">I have some ascii files from observation data (see attached please), I want to convert these file to netCDF file for easy comparison with model data. I am writing the codes but came across some errors as can be seen below, please help to put me through to correct the error and  complete my script. Thank you</div><div id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36098" dir="ltr"><br></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36654"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36655">[model-user@model-vm
~]$ ncl<u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36657"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36658"> Copyright (C) 1995-2015 - All Rights Reserved<u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36660"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36661"> University Corporation for Atmospheric
Research<u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36663"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36664"> NCAR Command Language Version 6.3.0<u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36666"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36667"> The use of this software is governed by a
License Agreement.<u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36669"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36670"> See <a href="http://www.ncl.ucar.edu/" target="_blank">http://www.ncl.ucar.edu/</a> for more details.<u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36672"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36673">ncl 0&gt; time =
(&quot;julian day&quot;)<u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36675"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36676">ncl 1&gt; ntim =
dimsizes(&quot;time&quot;)       <u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36678"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36679">ncl 2&gt; lev =
(&quot;350&quot;)  <u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36681"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36682">ncl 3&gt; klev =
dimsizes(&quot;lev&quot;)<u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36684"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36685">ncl 4&gt; lat =
(&quot;8.32&quot;)<u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36687"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36688">ncl 5&gt; nlat =
dimsizes (&quot;lat&quot;)<u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36690"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36691">ncl 6&gt; lon =
(&quot;4.34&quot;)<u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36693"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36694">ncl 7&gt; nlon =
dimsizes (&quot;lon&quot;)<u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36696"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36697">ncl 8&gt; diri =
&quot;/home/model-user/&quot;<u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36699"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36700">ncl 9&gt; fili =
&quot;Thirteen.nc&quot;<u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36702"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36703">ncl 10&gt;
system(&quot;/bin/rm -f &quot; + diri + fili)<u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36705"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36706">ncl 11&gt; fout =
addfile (diri + fili, &quot;c&quot;)<u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36708"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36709">ncl 12&gt;
setfileoption(fout,&quot;<wbr>DefineMode&quot;,True)<u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36711"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36712">ncl 13&gt; fAtt =
True<u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36714"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36715">ncl 14&gt;
fAtt@title = &quot;netCDF creation&quot;<u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36717"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36718">ncl 15&gt;
fAtt@source_file = &quot;<a href="http://original-file.nc" target="_blank">original-file.nc</a>&quot;<u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36720"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36721">ncl 16&gt;
fAtt@Conventions = &quot;None&quot;<u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36723"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36724">ncl 17&gt;
fAtt@creation_date = systemfunc (&quot;date&quot;)<u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36726"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36727">ncl 18&gt;
fileattdef(fout, fAtt)<u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36729"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36730">ncl 19&gt; dimNames
= (/&quot;time&quot;, &quot;lat&quot;, &quot;lon&quot;, &quot;lev&quot;/)<u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36732"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36733">ncl 20&gt; dimSizes
= (/-1, nlat, nlon, klev/) <u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36735"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36736">ncl 21&gt;  dimUnlim =(/True, False, False, False/)<u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36738"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36739">ncl 22&gt; filedimdef(fout,dimNames,<wbr>dimSizes,dimUnlim)<u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36741"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36742">ncl 23&gt;
filevardef(fout, &quot;time&quot;, typeof(time),getvardims(time))<u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36744"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36745">fatal:[&quot;Execute.c&quot;:8573]:<wbr>Execute:
Error occurred at or near line 23<u></u><u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36747"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36748"><u></u> <u></u></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36750"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36751">ncl 24&gt;
filevardef(fout,&quot;time&quot;, typeof(time),getvardims(time))<wbr>  <u></u><u></u></span></div><div id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36098" dir="ltr">

































































</div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none" dir="ltr" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36753"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36754">fatal:[&quot;Execute.c&quot;:8573]:<wbr>Execute:
Error occurred at or near line 24<u></u><u></u></span></div></div></div></blockquote></div><br></div>