[ncl-talk] Convert Matlab code to NCL

Arnold.Sullivan at csiro.au Arnold.Sullivan at csiro.au
Thu Oct 5 17:37:34 MDT 2017


Dear all ncl users,

Could someone help me to convert Matlab code using sum to NCL

R is [time] [lat] [lon] [m1]

Q is [time] [lat] [lon] [m1] [m2] [m3]

For m=5:-1:1
    R(:,:,:,m) = sum( sum( sum( Q(:,:,:,m:end,m:end,m:end), 4), 5), 6);
    if m < 5
        R(:,:,:,m) = R(:,:,:,m) - sum( R(:,:,:,(m+1):end), 4);
end
end

Is that the same way to use dim_sum_n_Wrap ?

Regards,

Arnold
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171005/245c736b/attachment.html>


More information about the ncl-talk mailing list