<div dir="ltr"><div class="gmail_default" style="font-size:small">Dear Ehsan,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If you are asking us to look at your script and improve it for you, it helps to provide more details about what you expect the script to do and where it appears to be failing.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You included the script and some of the files, but not the NetCDF files, so there's no way for us to actually run the script to see what the problem is.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Did you try debugging your script to see where it might be failing? It would help to add more print statements, especially at the top of the do loops, so you can see how many iterations of the loops it completes before it fails.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small;display:inline">Nested do loops shouldn't cause your script to fail, but they could cause your script to be much slower than needed.</div><div><br></div><div>I see that you are trying to write data to a file called "GPM_R24_Grid.txt" and that you have a double do loop<div class="gmail_default" style="display:inline"> for writing individual rows to the file. You can write more than one row of data to the file without having to loop across each value, and this could greatly improve the speed of your script. </div></div><div><div class="gmail_default" style="display:inline"><br></div></div><div><div class="gmail_default" style="display:inline">Here's a very simple example:</div></div><div><div class="gmail_default" style="display:inline"><br></div></div><div><div class="gmail_default" style="display:inline"><div><font face="monospace, monospace">;---Generate some dummy integer and float data.</font></div><div><font face="monospace, monospace"> npts = 100</font></div><div><font face="monospace, monospace"> i = ispan(1,npts,1)</font></div><div><font face="monospace, monospace"> j = generate_unique_indices(npts)</font></div><div><font face="monospace, monospace"> k = generate_unique_indices(npts)</font></div><div><font face="monospace, monospace"> x = random_uniform(-10,10,npts)</font></div><div><font face="monospace, monospace"> y = random_uniform(0,1000.,npts)</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"> write_table("file2.txt","w",[/j,x,i,y,k/], "string_%03i %8.2f %4.0i %8.1f string_%03i")</font></div><div><br></div><div>For more examples of using write_table to write multiple lines of text to an ASCII file, see this examples page:</div><div><br></div><div><a href="http://www.ncl.ucar.edu/Applications/write_csv.shtml">http://www.ncl.ucar.edu/Applications/write_csv.shtml</a></div><div><br></div><div>This page is for writing CSV files, but these examples can be used for any kind of ASCII file.</div><div><br></div><div>If you continue to have problems with your script, please respond back to <a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a> and provide more information, like where you think the script is failing, and what you are trying to accomplish with it.</div><div><br></div><div>Thanks,</div><div><br></div><div>--Mary</div><div><br></div></div></div><div><br></div><div><div><br></div><div><br><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 19, 2017 at 1:56 AM, Ehsan Taghizadeh via ncl-talk <span dir="ltr"><<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</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="font-family:bookman old style,new york,times,serif;font-size:16px"><div>Hi,</div><div>I try to run attached script (<a href="http://main.nc" target="_blank">main.nc</a>), however each time it counters killed, without any error.</div><div>I've searched google for that and it seems because of nested loops. Is it true? Could you please help to make this script more efficient? Also I attached some part of printVarSummary.</div><div><br></div><div><i>Sincerely</i></div><span class="HOEnZb"><font color="#888888"><div><i>Ehsan</i></div></font></span></div></div><br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>