[ncl-talk] NCL addition/sum

Dennis Shea shea at ucar.edu
Wed Nov 20 09:37:17 MST 2019


Take advantage of NCL' dimension reduction.

T3 = T1 + conform(T1, T2(:,:,0,0), (/0,1/))

==
For background:
    printVarSummary(T2)    ; rank 4

then
   printVarSummary(T2(:,:,0,0))     ; rank 2


On Wed, Nov 20, 2019 at 8:06 AM Sri.durgesh Nandini-Weiss via ncl-talk <
ncl-talk at ucar.edu> wrote:

> Hello everyone,
>
> i have a simple question on addition/sum between two 4 dimension
> variables e.g. temperature1 and temperature 2
>
> How can i correctly perform the addition of:
>
> T3=T1 [240,100,45,90] + T2 [240,100,1,1]
>
> I want to have my result output T3 in the format [240,100,45,90] so i
> cannot use dim_sum_n_Wrap or array_append_record.
>
> Can someone please suggest a way to add the first 2 dimensions?
>
> Thanx
>
> Sri
>
>
>
> --
> Dr. Sri Nandini-Weiß
> Research Scientist
>
> Universität Hamburg
> Center for Earth System Research and Sustainability (CEN)
> Cluster of Excellence 'Climate, Climatic Change, and Society' (CLICCS)
>
> Bundesstrasse 53, 20146 Hamburg
> Tel: +49 (0) 40 42838 7472
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20191120/42a78c05/attachment.html>


More information about the ncl-talk mailing list