[ncl-talk] Missing outputs from the function int2p

Dennis Shea shea at ucar.edu
Thu Mar 17 16:46:39 MDT 2016


Hello,

The 'p_in' are monotonically decreasing: 1008,. 1002.5, ....
The 'p_out' are monotonically increasing:

Change
        p_out1 = fspan(87.5,987.5,37)
To
        p_out1 = fspan(987.5, 87.5,37)    ; match monotonicity order of p_in

 Hopefully, this works.
===
The underlying code should handle the situation. A bug report will will
have to be filed.


On Thu, Mar 17, 2016 at 11:54 AM, Wei-Jen Tseng <tseng.weijen at gmail.com>
wrote:

> Dear NCL users,
> I use the function "int2p" to interpolate data to the specified pressure
> levels.
> I expect that there is no missing value in my output.
>
> But I found something strange:
> [1] There are 3 or 4 missing outputs but they all have values before
> interpolate.
> [2] Some output become missing when I change the range of interpolation.
> (new pressure level set 237.5)
>
>
> This is data:
> pressure (FillValue 9999):
> (0) 1008
> (1) 1002.5
> [SNIP]
> (524) 48.1
> (525) 47.8
>
> altitude (FillValue 99999):
> (0) 4
> (1) 52.5
> [SNIP]
> (524) 20839.2
> (525) 20884.3
>
>
> This is my script:
> begin
> ;--- load data ---;
> iFil = addfile("sounding_zc081041.nc","r")
> p_in = iFil->pressure
> a_in = iFil->altitude
>
> ;--- new pressure levels ---;
> p_out1 = fspan(87.5,987.5,37)
> p_out2 = fspan(112.5,987.5,36)
>
> ;--- interpolate to new pressure levels ---;
> a_out1= int2p(p_in,a_in,p_out1,2)
> a_out2= int2p(p_in,a_in,p_out2,2)
>
> ;-- results ---;
> print("Result: 1")
> print(p_out1+" "+a_out1)
> print(" ")
> print("Result: 2")
> print(p_out2+" "+a_out2)
> end
> ;---end of the script ---;
>
> This is the output.
> Most of the outputs looks well.
> I use the brackets to highlight strange outputs.
>
> (0) Result: 1
> (0) 87.5 17311.2
> (1) 112.5 15936.5
> [SNIP]
> (5) 212.5 12072.7
> (6) 237.5 99999 <=== [1,2]
> (7) 262.5 10648.4
> (8) 287.5 10014.1
> (9) 312.5 9419.78
> (10) 337.5 99999 <=== [1]
> (11) 362.5 8336.37
> (12) 387.5 99999 <=== [1]
> (13) 412.5 7364.7
> [SNIP]
> (24) 687.5 3296.85
> (25) 712.5 99999 <=== [1]
> (26) 737.5 2708.44
> [SNIP]
> (35) 962.5 414.551
> (36) 987.5 187.77
> (0)
> (0) Result: 2
> (0) 112.5 15936.5
> (1) 137.5 14779.8
> [SNIP]
> (4) 212.5 12072.7
> (5) 237.5 11330 <=== [2]
> (6) 262.5 10648.4
> (7) 287.5 10014.1
> (8) 312.5 9419.78
> (9) 337.5 99999 <=== [1]
> (10) 362.5 8336.37
> (11) 387.5 99999 <=== [1]
> (12) 412.5 7364.7
> [SNIP]
> (23) 687.5 3296.85
> (24) 712.5 99999 <=== [1]
> (25) 737.5 2708.44
> [SNIP]
> (34) 962.5 414.551
> (35) 987.5 187.77
>
> And I checked the source data.
> The source data looks well.
>
> $ ncl
>  NCAR Command Language Version 6.3.0
> ncl 0> f=addfile("sounding_zc081041.nc","r")
> ncl 1> p=f->pressure
> ncl 2> a=f->altitude
> ncl 3> print(p+" "+a)
> (0) 1008 4
> (1) 1002.5 52.5
> [SNIP]
> (82) 715.4 2964
> (83) 712.5 2998.3 <===
> (84) 709.5 3034.1
> [SNIP]
> (219) 389.2 7804.3
> (220) 387.5 7839 <===
> (221) 385.6 7875.7
> [SNIP]
> (245) 339.4 8821.9
> (246) 337.5 8863.1 <===
> (247) 335.4 8908.6
> [SNIP]
> (305) 239.1 11286.2
> (306) 237.5 11330 <===
> (307) 236 11375
> [SNIP]
> (524) 48.1 20839.2
> (525) 47.8 20884.3
>
> I uploaded my data to ftp.cgd.ucar.edu.
> File name is "sounding_zc081041.nc".
>
> I also put same data on the dropbox.
> https://www.dropbox.com/s/lj3l1lj70r2n95w/sounding_zc081041.nc?dl=0
>
> Thank you for any suggestion.
>
> best regards,
> Wei-Jen
>
> --
>
> Wei-Jen Tseng
>
> Department of Atmosphere Sciences, National Taiwan University
>
> Email: tseng.weijen at gmail.com
>
>
> _______________________________________________
> 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/20160317/340ad786/attachment.html 


More information about the ncl-talk mailing list