[ncl-talk] wrf_cape_2d errors

Bill Ladwig ladwig at ucar.edu
Tue Sep 13 10:08:50 MDT 2016


Hi Kai,

In your printVarSummary, your 'ps' variable is in units of Pa and this
needs to be hPa, so please multiply by .01 before passing it to the
wrf_cape_2d function and see if that helps.  (However, keep your 'p'
variable in units of Pa).  Also, many of your variables have a _FillValue
attribute which indicates that there might be missing/fill values in your
arrays.  You can check to see if you have any missing values in these
arrays by doing:

if(*any* <http://www.ncl.ucar.edu/Document/Functions/Built-in/any.shtml>(*ismissing*(your_array)))
then

    print ("found missing value")

end if


If none of that helps, and your data file isn't gigantic, you can FTP
following these instructions (taken from
http://www.ncl.ucar.edu/report_bug.shtml#HowToFTP):

*You can ftp larger datasets and files to:*

ftp ftp.cgd.ucar.edu
anonymous
<use your email address for the password>
cd incoming
put ...
put ...
.
.
.
quit

Note that for security reasons, you cannot list the contents of this
directory, and neither can we. We need to know the *exact* names of the
files in order to retrieve them.

After you've uploaded the file, send me an email directly to tell me
the name of the file.  If for some reason the file is too big to
upload, you can upload to dropbox, or some other file sharing service
and email me the link.

Regards,

Bill





On Mon, Sep 12, 2016 at 8:19 PM, Kai Zhang <kzkaizhang at gmail.com> wrote:

> Dear Bill,
>
> Thanks so much for your response!
>
> I've check in several ways that, all of the units are correct. And
> non missing value, non strange value. The problem still exists.
> Here are the result for printVarSummary on each of my input variables:
>
> Variable: p
>
> Type: float
>
> Total Size: 595200 bytes
>
>             148800 values
>
> Number of Dimensions: 4
>
> Dimensions and sizes: [hour | 8] x [lev | 24] x [lat | 31] x [lon | 25]
>
> Coordinates:
>
>             hour: [0..21]
>
>             lev: [10000..100000]
>
>             lat: [-48.31578947368421..8.526315789473685]
>
>             lon: [ 270.. 330]
>
> Number Of Attributes: 1
>
>   units : Pa
>
>
> Variable: T
>
> Type: float
>
> Total Size: 595200 bytes
>
>             148800 values
>
> Number of Dimensions: 4
>
> Dimensions and sizes: [hour | 8] x [lev | 24] x [lat | 31] x [lon | 25]
>
> Coordinates:
>
>             hour: [0..21]
>
>             lev: [10000..100000]
>
>             lat: [-48.31578947368421..8.526315789473685]
>
>             lon: [ 270.. 330]
>
> Number Of Attributes: 5
>
>   day : 1
>
>   year : 1
>
>   units : K
>
>   long_name : Temperature
>
>   _FillValue : 9.96921e+36
>
>
> Variable: Q
>
> Type: float
>
> Total Size: 595200 bytes
>
>             148800 values
>
> Number of Dimensions: 4
>
> Dimensions and sizes: [hour | 8] x [lev | 24] x [lat | 31] x [lon | 25]
>
> Coordinates:
>
>             hour: [0..21]
>
>             lev: [10000..100000]
>
>             lat: [-48.31578947368421..8.526315789473685]
>
>             lon: [ 270.. 330]
>
> Number Of Attributes: 5
>
>   day : 1
>
>   year : 1
>
>   units : kg/kg
>
>   long_name : Specific humidity
>
>   _FillValue : 9.96921e+36
>
>
> Variable: Z
>
> Type: float
>
> Total Size: 595200 bytes
>
>             148800 values
>
> Number of Dimensions: 4
>
> Dimensions and sizes: [hour | 8] x [lev | 24] x [lat | 31] x [lon | 25]
>
> Coordinates:
>
>             hour: [0..21]
>
>             lev: [10000..100000]
>
>             lat: [-48.31578947368421..8.526315789473685]
>
>             lon: [ 270.. 330]
>
> Number Of Attributes: 5
>
>   day : 1
>
>   year : 1
>
>   units : m
>
>   long_name : Geopotential Height (above sea level)
>
>   _FillValue : 9.96921e+36
>
>
> Variable: zs
>
> Type: float
>
> Total Size: 24800 bytes
>
>             6200 values
>
> Number of Dimensions: 3
>
> Dimensions and sizes: [8] x [31] x [25]
>
> Coordinates:
>
> Number Of Attributes: 2
>
>   units : m
>
>   _FillValue : 1e+15
>
>
> Variable: ps
>
> Type: float
>
> Total Size: 24800 bytes
>
>             6200 values
>
> Number of Dimensions: 3
>
> Dimensions and sizes: [8] x [31] x [25]
>
> Coordinates:
>
> Number Of Attributes: 1
>
>   units : Pa
>
>  capecalc3d: Outside of lookup table bounds. prs,thte=   925.000000000000
>
>
>    856.034700407579
>
>
> Thanks again!
>
> Best,
>
> Kai
>
> On Mon, Sep 12, 2016 at 10:41 AM, Bill Ladwig <ladwig at ucar.edu> wrote:
>
>> Hi Kai,
>>
>> wrf_cape_2d requires the pressure argument (first argument) to be in
>> units of Pa and the surface pressure argument (6th argument) to be in units
>> of hPa, so double check that.  Temperature needs to be in Kelvin.  Height
>> is in meters.  Water vapor mixing ratio is in units of kg/kg.  The error
>> message you are getting is indicating that theta-e is being calculated to
>> 856.03 K, which is obviously nonsensical, so one of your input arrays is in
>> the wrong units, contains missing values, or has a bogus number in it.
>> This algorithm relies on lookup tables, which is why things can go wrong in
>> a hurry if something is not right.  If you're still having problems, please
>> reply with the result for printVarSummary on each of your input variables.
>>
>> Hope this helps,
>>
>> Bill
>>
>> On Fri, Sep 9, 2016 at 8:34 PM, Kai Zhang <kzkaizhang at gmail.com> wrote:
>>
>>> Dear NCL support,
>>>
>>> I am currently using function wrf_cape_2d to calculate CIN and CAPE. But
>>> I cannot stop getting errors:
>>>
>>> "capecalc3d: Outside of lookup table bounds. prs,thte=
>>> 925.000000000000     856.034700407579"
>>>
>>> I am sure that I got units for each variable correctly.
>>>
>>> It is weird that, if I change "p (unit: Pa)" to "p (unit: hPa)", I can
>>> get it run smoothly. But the CIN and CAPE calculated are obviously wrong.
>>>
>>> Do you know why?
>>>
>>>
>>> Thanks a lot for your help!
>>>
>>> Best,
>>>
>>> Kai
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>>
>>
>
>
> --
> ------------------------------------------------------------
> -------------------
> Kai Zhang
> The University of Texas at Austin, TX (2012 - )
> Graduate Research Assistant,
> Jackson School of Geosciences
> BS, Peking University, China (2008 - 2012)
> Dept. Atmospheric and Oceanic Science, School of Physics
> Cellphone: +1 512 520 6902
> https://sites.google.com/site/kaizhanghomepage/
> Email: kzkaizhang at utexas.edu <zhangkai at utexas.edu>
>           kzkaizhang at gmail.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160913/a13a2e5b/attachment.html 


More information about the ncl-talk mailing list