<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_ym19_1_1488451967136_36098">Dear ncl users,</div><div id="yui_3_16_0_ym19_1_1488451967136_36098"><br></div><div id="yui_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 &nbsp;complete my script. Thank you</div><div id="yui_3_16_0_ym19_1_1488451967136_36098" dir="ltr"><br></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36654"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36655">[model-user@model-vm
~]$ ncl<o:p id="yui_3_16_0_ym19_1_1488451967136_36656"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36657"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36658">&nbsp;Copyright (C) 1995-2015 - All Rights Reserved<o:p id="yui_3_16_0_ym19_1_1488451967136_36659"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36660"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36661">&nbsp;University Corporation for Atmospheric
Research<o:p id="yui_3_16_0_ym19_1_1488451967136_36662"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36663"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36664">&nbsp;NCAR Command Language Version 6.3.0<o:p id="yui_3_16_0_ym19_1_1488451967136_36665"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36666"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36667">&nbsp;The use of this software is governed by a
License Agreement.<o:p id="yui_3_16_0_ym19_1_1488451967136_36668"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36669"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36670">&nbsp;See http://www.ncl.ucar.edu/ for more details.<o:p id="yui_3_16_0_ym19_1_1488451967136_36671"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36672"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36673">ncl 0&gt; time =
("julian day")<o:p id="yui_3_16_0_ym19_1_1488451967136_36674"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36675"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36676">ncl 1&gt; ntim =
dimsizes("time")&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <o:p id="yui_3_16_0_ym19_1_1488451967136_36677"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36678"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36679">ncl 2&gt; lev =
("350")&nbsp; <o:p id="yui_3_16_0_ym19_1_1488451967136_36680"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36681"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36682">ncl 3&gt; klev =
dimsizes("lev")<o:p id="yui_3_16_0_ym19_1_1488451967136_36683"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36684"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36685">ncl 4&gt; lat =
("8.32")<o:p id="yui_3_16_0_ym19_1_1488451967136_36686"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36687"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36688">ncl 5&gt; nlat =
dimsizes ("lat")<o:p id="yui_3_16_0_ym19_1_1488451967136_36689"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36690"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36691">ncl 6&gt; lon =
("4.34")<o:p id="yui_3_16_0_ym19_1_1488451967136_36692"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36693"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36694">ncl 7&gt; nlon =
dimsizes ("lon")<o:p id="yui_3_16_0_ym19_1_1488451967136_36695"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36696"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36697">ncl 8&gt; diri =
"/home/model-user/"<o:p id="yui_3_16_0_ym19_1_1488451967136_36698"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36699"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36700">ncl 9&gt; fili =
"Thirteen.nc"<o:p id="yui_3_16_0_ym19_1_1488451967136_36701"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36702"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36703">ncl 10&gt;
system("/bin/rm -f " + diri + fili)<o:p id="yui_3_16_0_ym19_1_1488451967136_36704"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36705"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36706">ncl 11&gt; fout =
addfile (diri + fili, "c")<o:p id="yui_3_16_0_ym19_1_1488451967136_36707"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36708"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36709">ncl 12&gt;
setfileoption(fout,"DefineMode",True)<o:p id="yui_3_16_0_ym19_1_1488451967136_36710"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36711"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36712">ncl 13&gt; fAtt =
True<o:p id="yui_3_16_0_ym19_1_1488451967136_36713"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36714"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36715">ncl 14&gt;
fAtt@title = "netCDF creation"<o:p id="yui_3_16_0_ym19_1_1488451967136_36716"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36717"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36718">ncl 15&gt;
fAtt@source_file = "original-file.nc"<o:p id="yui_3_16_0_ym19_1_1488451967136_36719"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36720"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36721">ncl 16&gt;
fAtt@Conventions = "None"<o:p id="yui_3_16_0_ym19_1_1488451967136_36722"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36723"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36724">ncl 17&gt;
fAtt@creation_date = systemfunc ("date")<o:p id="yui_3_16_0_ym19_1_1488451967136_36725"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36726"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36727">ncl 18&gt;
fileattdef(fout, fAtt)<o:p id="yui_3_16_0_ym19_1_1488451967136_36728"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36729"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36730">ncl 19&gt; dimNames
= (/"time", "lat", "lon", "lev"/)<o:p id="yui_3_16_0_ym19_1_1488451967136_36731"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36732"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36733">ncl 20&gt; dimSizes
= (/-1, nlat, nlon, klev/) <o:p id="yui_3_16_0_ym19_1_1488451967136_36734"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36735"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36736">ncl 21&gt;&nbsp; dimUnlim =(/True, False, False, False/)<o:p id="yui_3_16_0_ym19_1_1488451967136_36737"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36738"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36739">ncl 22&gt; filedimdef(fout,dimNames,dimSizes,dimUnlim)<o:p id="yui_3_16_0_ym19_1_1488451967136_36740"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36741"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36742">ncl 23&gt;
filevardef(fout, "time", typeof(time),getvardims(time))<o:p id="yui_3_16_0_ym19_1_1488451967136_36743"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36744"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36745">fatal:["Execute.c":8573]:Execute:
Error occurred at or near line 23<o:p id="yui_3_16_0_ym19_1_1488451967136_36746"></o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36747"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36748"><o:p id="yui_3_16_0_ym19_1_1488451967136_36749">&nbsp;</o:p></span></div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" id="yui_3_16_0_ym19_1_1488451967136_36750"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36751">ncl 24&gt;
filevardef(fout,"time", typeof(time),getvardims(time))&nbsp; <o:p id="yui_3_16_0_ym19_1_1488451967136_36752"></o:p></span></div><div id="yui_3_16_0_ym19_1_1488451967136_36098" dir="ltr">

































































</div><div style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none" dir="ltr" id="yui_3_16_0_ym19_1_1488451967136_36753"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" id="yui_3_16_0_ym19_1_1488451967136_36754">fatal:["Execute.c":8573]:Execute:
Error occurred at or near line 24<o:p id="yui_3_16_0_ym19_1_1488451967136_36755"></o:p></span></div></div></body></html>