<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"><<a href="mailto:najibgal@yahoo.com" target="_blank">najibgal@yahoo.com</a>></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:"Tahoma","sans-serif"" 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:"Tahoma","sans-serif"" 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:"Tahoma","sans-serif"" 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:"Tahoma","sans-serif"" 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:"Tahoma","sans-serif"" 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:"Tahoma","sans-serif"" 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:"Tahoma","sans-serif"" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36673">ncl 0> time =
("julian day")<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:"Tahoma","sans-serif"" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36676">ncl 1> ntim =
dimsizes("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_36678"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36679">ncl 2> lev =
("350") <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:"Tahoma","sans-serif"" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36682">ncl 3> klev =
dimsizes("lev")<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:"Tahoma","sans-serif"" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36685">ncl 4> lat =
("8.32")<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:"Tahoma","sans-serif"" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36688">ncl 5> nlat =
dimsizes ("lat")<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:"Tahoma","sans-serif"" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36691">ncl 6> lon =
("4.34")<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:"Tahoma","sans-serif"" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36694">ncl 7> nlon =
dimsizes ("lon")<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:"Tahoma","sans-serif"" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36697">ncl 8> diri =
"/home/model-user/"<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:"Tahoma","sans-serif"" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36700">ncl 9> fili =
"Thirteen.nc"<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:"Tahoma","sans-serif"" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36703">ncl 10>
system("/bin/rm -f " + 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:"Tahoma","sans-serif"" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36706">ncl 11> fout =
addfile (diri + fili, "c")<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:"Tahoma","sans-serif"" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36709">ncl 12>
setfileoption(fout,"<wbr>DefineMode",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:"Tahoma","sans-serif"" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36712">ncl 13> 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:"Tahoma","sans-serif"" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36715">ncl 14>
fAtt@title = "netCDF creation"<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:"Tahoma","sans-serif"" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36718">ncl 15>
fAtt@source_file = "<a href="http://original-file.nc" target="_blank">original-file.nc</a>"<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:"Tahoma","sans-serif"" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36721">ncl 16>
fAtt@Conventions = "None"<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:"Tahoma","sans-serif"" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36724">ncl 17>
fAtt@creation_date = systemfunc ("date")<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:"Tahoma","sans-serif"" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36727">ncl 18>
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:"Tahoma","sans-serif"" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36730">ncl 19> dimNames
= (/"time", "lat", "lon", "lev"/)<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:"Tahoma","sans-serif"" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36733">ncl 20> 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:"Tahoma","sans-serif"" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36736">ncl 21> 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:"Tahoma","sans-serif"" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36739">ncl 22> 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:"Tahoma","sans-serif"" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36742">ncl 23>
filevardef(fout, "time", 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:"Tahoma","sans-serif"" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36745">fatal:["Execute.c":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:"Tahoma","sans-serif"" 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:"Tahoma","sans-serif"" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36751">ncl 24>
filevardef(fout,"time", 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:"Tahoma","sans-serif"" id="m_4304072937832428909yui_3_16_0_ym19_1_1488451967136_36754">fatal:["Execute.c":8573]:<wbr>Execute:
Error occurred at or near line 24<u></u><u></u></span></div></div></div></blockquote></div><br></div>