# [ncl-talk] Problem with interpolation

Sun Jun 10 19:03:18 MDT 2018

```Dear Sir,
I have a problem to interpolate potential vorticity to isentropic levels. All the data is derived from NCEP-DOE Reanalysis 2. The potential vorticity is obtained via the function "pot_vort_isobaric", and so as to the potential temperature. And the interpolation is done by the function "int2p_n". However, plenty of undefined grids appear in the the potential vorticity field at an isentropic level, see 350K. And the undefined grids, which locate at the same position for all time, are not coherent with the topography. I have no idea that how does those undefined grids appear and how to deal with it? Thank you for your attention to this matter.
The version of NCL I used is 6.4. And my system is Ubuntu 16.0 on windows 10. My script is as following and the image is attached.
;==========================================================================
begin

pv = f1->pv
time = f1->time
theta = f2->pt

; lvl = ispan(270,400,10)*1.
lvl  = (/ 300, 350, 400/)                              ; user specified inentropic levels
lvl at description = "isentropic level"           ; add meta data
lvl at units       = theta at units
lvl!0           = "lvl"
lvl&lvl         =  lvl

; pv2 = int2p(theta(time|:,lat|:,lon|:,level|:), \
;             pv(time|:,lat|:,lon|:,level|:), lvl, 1)
pv2 = int2p_n(theta, pv, lvl, 1, 1)

pv2!0    = "time"                      ; name dimensions
pv2!2    = "lat"
pv2!3    = "lon"
pv2!1    = "lvl"
pv2&time =  time                    ; assign coordinates
pv2&lvl  =  lvl                          ; isentropic levels
pv2&lat  =  pv&lat
pv2&lon  =  pv&lon
pv2 at long_name = pv at long_name           ; attributes
pv2 at units     = pv at units

;------output
fNameo = "/mnt/e/NCEP/NCEP-R2/Daily/pv_pt/pv.2010.nc<http://pv.2010.nc>"
system("/bin/rm -f " + fNameo)
fout at title = " potential vorticity"
fout at creation_date = systemfunc("date")
filedimdef(fout,"time",-1,True)
fout->pv = pv2

end

;==========================================================================

Yours,
Nanshui

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180611/687f0ec0/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pv in pv.2010-350K.png
Type: image/png
Size: 844894 bytes
Desc: pv in pv.2010-350K.png
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180611/687f0ec0/attachment-0001.png>
```