# [ncl-talk] integrate underground vertical level

Dennis Shea shea at ucar.edu
Mon Oct 16 08:46:46 MDT 2017

```I believe so.
------
There is no '*simpne_n*' version of the function so you will have to use
dimension reordering.

Both of the following return:

result(ntim,nlat,mlon)
-----

[a] depth[*]

result  = *simpne*(depth,f(time|:,lat|:,lon|:,depth|:))

[b] depth(time,depth,lat,lon)

result  = *simpne*(depth(time|:,lat|:,lon|:,depth|:) \
,    f(time|:,lat|:,lon|:,depth|:) )

-----

result at long_name = "vertical integral: "+f at long_name
result at units     = "..."

===

copy_VarCoords(f(:,0,:,:), result)

---

printVarSummary(result)

printMinMax(result, 0)

On Sun, Oct 15, 2017 at 1:56 PM, sunmin park <mireiyue at gmail.com> wrote:

> Thank you Dennis!
> Is the function "simpne" works like that??
>
> Sun-
>
>
>
> <https://mailtrack.io/> Sent with Mailtrack
>
> 2017-10-13 7:08 GMT-07:00 Dennis Shea <shea at ucar.edu>:
>
>> Simple Integration is :    SUM( x*dx)
>>
>> Does the file have any variable like:
>>      SOIL_LAYER_THICKNESS(time, soil_layers) ;
>>      X (time, soil_layers ydim, xdim)           ;  (0,1,2,3) <=dimension
>> numbers
>> ---
>> f = *addfile*("..." , "r")
>>
>> slt = f->SOIL_LAYER_THICKNESS
>> x   = f->X
>>
>> SLT = *conform*( x, slt, (/0,1/) )    ; convenience, clarity
>> XI    = *dim_sum_n*( x*SLT, *1*)     ; sum (integrate) the product;
>> (ntim,nlat,mlon)
>> *copy_VarCoords*(X(:,0,:,:), XI)   ; copy any coordinsate
>> XI at long_name = "Integration: "+x at long_name
>> XI at units  = "..."
>> *printVarSummary*(XI)
>>
>> ----
>> if you do not have a 'SOIL_LAYER_THICKNESS' variable, you will have to
>> create one.
>>
>> good luck
>>
>> On Thu, Oct 12, 2017 at 2:02 PM, sunmin park <mireiyue at gmail.com> wrote:
>>
>>> Hello NCL users
>>>
>>> I have dataset which is soil moisture and it has 15 vertical levels. I
>>> need to integrate the levels to the levels I want. I have been looking for
>>> a function but so far I can find functions for pressure interpolation. Is
>>> there any function that integrate underground values?
>>>
>>> Thank you
>>> Sun-
>>>
>>> --
>>>
>>> Sunmin Park,
>>>
>>> PhD Candidate, Department of Earth Science,
>>>
>>> University of California Riverside
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> <https://mailtrack.io/> Sent with Mailtrack
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>>
>>
>
>
> --
>
> Sunmin Park,
>
> PhD Candidate, Department of Earth Science,
>
> University of California Riverside
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171016/d1538d3f/attachment.html>
```