NCL Home > Documentation > Functions > General applied math

# dim_sum_n_Wrap

Computes the arithmetic sum of a variable's given dimensions at all other dimensions and retains metadata.

## Prototype

```load "\$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"  ; This library is automatically loaded
; from NCL V6.2.0 onward.
; No need for user to explicitly load.

function dim_sum_n_Wrap (
x        : numeric,
dims [*] : integer
)

return_val  :  float or double
```

## Arguments

x

A variable of numeric type and any dimensionality.

dims

The dimension(s) of x on which to calculate the sum. Must be consecutive and monotonically increasing.

## Description

This function is identical to dim_sum_n, except the return value will have metadata added based on metadata attached to x. See the dim_sum_n page for full documentation and examples.
{"ft_lang_label":"__label__en","ft_lang_prob":0.69126683,"math_prob":0.7936923,"size":808,"snap":"2019-13-2019-22","text_gpt3_token_len":183,"char_repetition_ratio":0.11318408,"word_repetition_ratio":0.0,"special_character_ratio":0.21287128,"punctuation_ratio":0.13970588,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9740462,"pos_list":[0,1,2],"im_url_duplicate_count":[null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-05-25T23:06:38Z\",\"WARC-Record-ID\":\"<urn:uuid:81015800-22bd-403f-a233-dcd077329661>\",\"Content-Length\":\"14849\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:6da78aad-87eb-4117-a690-e5ef0aab814b>\",\"WARC-Concurrent-To\":\"<urn:uuid:c945b1cf-18f6-4ff9-8d45-eeeff51a9ae1>\",\"WARC-IP-Address\":\"128.117.225.48\",\"WARC-Target-URI\":\"http://ncl.ucar.edu/Document/Functions/Contributed/dim_sum_n_Wrap.shtml\",\"WARC-Payload-Digest\":\"sha1:OGMW6ATLGPWYFBSVOXJI7YQQZ6UPKCYK\",\"WARC-Block-Digest\":\"sha1:EP2TI36DTVYH6GP5DFBICSC7II3UMEAY\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-22/CC-MAIN-2019-22_segments_1558232258453.85_warc_CC-MAIN-20190525224929-20190526010929-00470.warc.gz\"}"}