[ncl-talk] Conform a multi-dimensional array to another multi-dimensional array

Giorgio Graffino g.graffino at tim.it
Fri Apr 21 06:20:53 MDT 2023


Dear NCL folks,
 
I have two multi-dimensional arrays: array a is 12x100 and array b is 
11x100. I want to conform them to make their dimensions the same. I'm 
sure there is an easy way to do it, but so far I failed all attempts.
 
For now, I mainly tried to add a row of missing values to array b to get 
an array c with dimensions 12x100 (the same of array a). Here is a list 
of the things I tried with their error message.
 
c = conform(a,b,1)                ; fatal:conform: The array to be 
conformed must have the same number of dimensions as indicated by the 
length of the last argument
 
c = (/b,new(dimsizes(b(0,:)),typeof(b),b at _FillValue)/)          ; 
fatal:_NclBuildArray: each element of a literal array must have the same 
number of dimensions
 
c = 
array_append_record(b,new(dimsizes(b(0,:)),typeof(b),b at _FillValue),0)   
               ; array_append_record: ranks not equal: rank_x1=2 
 rank_x2=1
 
c = table_attach_rows(b,new(dimsizes(b(0,:)),typeof(b),b at _FillValue),0) 
            ; fatal:Number of dimensions in parameter (1) of 
(table_attach_rows) is (1), (2) dimensions were expected
 
Please let me know what else I can try or what I've done wrong.
 
Thanks,
Giorgio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20230421/25352211/attachment.htm>


More information about the ncl-talk mailing list