[ncl-talk] Function return

Prashanth Bhalachandran prashanth.bhalachandran at gmail.com
Fri Oct 13 19:57:06 MDT 2017


Hello, 
I have a quick question regarding returning of arrays from functions. 

In my code, I have two arrays var0 and var01 that I want to return from my function. Their dimensionalities are as follows: 

var0      = new((/251/),float,1e+30
var01     = new((/251,73/),float,1e+30)
 	

At present, I am trying to return this using the command : 

return([/var0,var01/]) ; Note that the dimensions of var0 and var1 are different. 

As a result, in my wrapper script, when I receive the variables, it is becoming a confusing task. 

 wnout        = wn01(latvals,lonvals,lat1,lon1,speed)   
 var0         = wnout[0] 
 var1         = wnout[1]  

 The above return procedure is giving out an error since I don’t know how to define the dimensions of wnout. Is there any better way to return two arrays of varying dimensions in NCL? 

Thank you, 
Prashanth  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171013/7f6744ed/attachment.html>


More information about the ncl-talk mailing list