[ncl-talk] append array

Rashed Mahmood rashidcomsis at gmail.com
Fri Apr 2 04:27:48 MDT 2021


This can be done in many ways, e.g.:

*method1*: (using function *dim_pad_extend:
https://www.ncl.ucar.edu/Document/Functions/Shea_util/dim_pad_extend.shtml
<https://www.ncl.ucar.edu/Document/Functions/Shea_util/dim_pad_extend.shtml>*
):

  nlev_X1 = 25
  nlev_X2 = 19
  nlev_tot = nlev_X1+nlev_X2
  nExt       = nlev_X2

  X1 := dim_pad_extend(X1,nExt,1,False)  ; note the reassignment operator *":";
this would extend the dimension of X1 by nExt.*

  X1(:,nlev_X1:nlev_tot-1,:,:)  = X2


*method 2:*
 Rearrange the dimensions (see
https://www.ncl.ucar.edu/Document/Language/reorder.shtml) and use the
function *array_append_record*.





On Fri, Apr 2, 2021 at 11:11 AM xxq via ncl-talk <ncl-talk at mailman.ucar.edu>
wrote:

> array_append_record
> Dear ncl-talkers,
> I want to append two multi-dimensional arrays(ntime*nlev*nlat*nlon) :
> X1(480*25*50*360) and X2(480*19*50*360) to Y(480*44*50*360), but I found
> that the function 'array_append_record(x1,x2,opt)' could only appends
> additional records [leftmost dimension] to a previously existing array. Is
> there any other functions available for my question?
>
> Best wishes,
> Fiona
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at mailman.ucar.edu
> List instructions, subscriber options, unsubscribe:
> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210402/65bac4d2/attachment.html>


More information about the ncl-talk mailing list