[ncl-talk] Why cannot run my script for a long time

Alan Brammer abrammer at albany.edu
Mon Sep 11 08:38:35 MDT 2017


Quick suggestion.  

Seems like everything is within time loops.  That would suggest you don’t need to read in all of the values at once. 

At the top of each time loop read in the msl for that time.  That may make it a little slower but will reduce your memory usage massively.  
e.g. 
>  do gg =0,ntime-1
	 z =l->msl(gg,::-1,:)
> 
>       do j =26,nlat-7



Also nested looping through lats and lons is pretty slow in NCL and typically not actually needed.  If you can make it array based it’ll be significantly quicker. 

Drop some print() or printVarSummary() statements in there so you can tell how the code is progressing and where the issue is. It could be the data read in as I’ve suggested above.  It could be the loops that are taking forever.  It could simply by a workstation size problem that arises on plotting.  Without some kind of rudimentary debugging info it’s hard to say. 


Alan




##############################
Alan Brammer,
Post-Doc Researcher

Department of Atmospheric and Environmental Sciences,
University at Albany, State University of New York, Albany, NY, 12222
abrammer at albany.edu
##############################

> On 11 Sep 2017, at 10:30, Guido Cioni <guidocioni at gmail.com> wrote:
> 
>>  l =addfile("/home/aida/Desktop/Newfolder/dec10-14.nc <http://dec10-14.nc/>","r")
>>  z =l->msl(:,::-1,:)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170911/08b0be98/attachment.html>


More information about the ncl-talk mailing list