[ncl-talk] killed occurence

Mary Haley haley at ucar.edu
Tue Dec 19 09:40:09 MST 2017


Dear Ehsan,

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.

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.

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.

Nested do loops shouldn't cause your script to fail, but they could cause
your script to be much slower than needed.

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
​ 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.

Here's a very simple example:

;---Generate some dummy integer and float data.
   npts = 100
   i    = ispan(1,npts,1)
   j    = generate_unique_indices(npts)
   k    = generate_unique_indices(npts)
   x    = random_uniform(-10,10,npts)
   y    = random_uniform(0,1000.,npts)

  write_table("file2.txt","w",[/j,x,i,y,k/], "string_%03i %8.2f %4.0i
%8.1f     string_%03i")

For more examples of using write_table to write multiple lines of text to
an ASCII file, see this examples page:

http://www.ncl.ucar.edu/Applications/write_csv.shtml

This page is for writing CSV files, but these examples can be used for any
kind of ASCII file.

If you continue to have problems with your script, please respond back to
ncl-talk at ucar.edu and provide more information, like where you think the
script is failing, and what you are trying to accomplish with it.

Thanks,

--Mary


​






On Tue, Dec 19, 2017 at 1:56 AM, Ehsan Taghizadeh via ncl-talk <
ncl-talk at ucar.edu> wrote:

> Hi,
> I try to run attached script (main.nc), however each time it counters
> killed, without any error.
> 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.
>
> *Sincerely*
> *Ehsan*
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171219/ef149409/attachment.html>


More information about the ncl-talk mailing list