<div dir="ltr"><div>Maybe this is a start:</div><div><br></div><div>=================<br></div><div>a(12,100),  b(11,100)     ? meta data<br></div><div>=================</div><div>  dima = dimsizes(a)</div><div>  dimb = dimsizes(b)</div><div><br></div><div>  na0   = dima(0)</div><div>  nb0   = dimb(0)</div><div><br></div><div>  c       = new(dima, typeof(a))</div><div>  c(0:nb0-1) = (/  b /)    ;   (/ ... /) means no meta data</div><div><br></div><div>; meta data</div><div><br></div><div>  copy_VatAtts(a,c)    <br></div><div><br></div><div>; If necessary, coordinate info (named dimensions and coordinate values) will hav e to be added <br></div><div>  <br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Apr 21, 2023 at 6:21 AM Giorgio Graffino via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu">ncl-talk@mailman.ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><p><span style="font-family:Arial;font-size:12pt">Dear NCL folks,</span></p><p> </p><p><span style="font-family:Arial;font-size:12pt">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.</span></p><p> </p><p><span style="font-family:Arial;font-size:12pt">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.</span></p><p> </p><p><span style="font-family:Arial;font-size:12pt">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</span></p><p> </p><p><span style="font-family:Arial;font-size:12pt">c = (/b,new(dimsizes(b(0,:)),typeof(b),b@_FillValue)/)          ; fatal:_NclBuildArray: each element of a literal array must have the same number of dimensions</span></p><p> </p><p><span style="font-family:Arial;font-size:12pt">c = array_append_record(b,new(dimsizes(b(0,:)),typeof(b),b@_FillValue),0)                  ; array_append_record: ranks not equal: rank_x1=2  rank_x2=1</span></p><p> </p><p><span style="font-family:Arial;font-size:12pt">c = table_attach_rows(b,new(dimsizes(b(0,:)),typeof(b),b@_FillValue),0)             ; fatal:Number of dimensions in parameter (1) of (table_attach_rows) is (1), (2) dimensions were expected</span></p><p> </p><p><span style="font-family:Arial;font-size:12pt">Please let me know what else I can try or what I've done wrong.</span></p><p> </p><p><span style="font-family:Arial;font-size:12pt">Thanks,</span></p><p><span style="font-family:Arial;font-size:12pt">Giorgio</span></p>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div>