Re: How to use rip_cape_2d with radiosonde dataset?

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Sun, 02 Nov 2008 12:29:51 -0700

Louis

You did not read the documentation for either functions
that you are using.

[1]
http://www.ncl.ucar.edu/Document/Functions/Built-in/mixhum_ptd.shtml

The units must be Pa and K
You input hPa and C

[2]
http://www.ncl.ucar.edu/Document/Functions/Built-in/rip_cape_2d.shtml

The units of T must be K, you input C

=======================
Using the correct units, the returned answers are:

Variable: cinfo
Type: float
Total Size: 16 bytes
             4 values
Number of Dimensions: 3
Dimensions and sizes: [4] x [1] x [1]
Coordinates:
(0,0,0) 1999.005 0=CAPE
(1,0,0) 1.973167 1=CIN
(2,0,0) 930.4729 2=LCL
(3,0,0) 1326.761 3-LFC

louis Vonder wrote:
>
> Thank you for your help Denis,
>
> Sending my files through ftp link failed.
>
> So I attached a zipped file containing data which I am using.
>
> Louis

>
> louis Vonder wrote:
> >
> > Thank you Mary,
> >
> > Here errors appearing when I am trying to use rip_cape_2d
> >
> > Copyright (C) 1995-2007 - All Rights Reserved
> > University Corporation for Atmospheric Research
> > NCAR Command Language Version 5.0.0
> > The use of this software is governed by a License Agreement.
> > See http://www.ncl.ucar.edu/ for more details.
> > *** glibc detected *** ncl: double free or corruption (out): 0x0aeb87d8
> ***
> > ======= Backtrace: =========
> > /lib/libc.so.6[0xb7d25c37]
> > /lib/libc.so.6(cfree+0x89)[0xb7d278f9]
> > ncl(NclFree+0x21)[0x810922f]
> > ncl(rip_cape_2d_W+0xf0a)[0x8200b5a]
> > ncl(CallINTRINSIC_FUNC_CALL+0x47)[0x817f2c0]
> > ncl(_NclExecute+0x377)[0x8182305]
> > ncl(yyparse+0x76b)[0x80bdbed]
> > ncl(main+0xbc4)[0x80b9464]
> > /lib/libc.so.6(__libc_start_main+0xe0)[0xb7cd4450]
> > ncl(vfprintf+0x9fd)[0x80b8811]
> > ======= Memory map: ========
> > 08048000-08d6b000 r-xp 00000000 08:05 4162260 /usr/local/ncl/bin/ncl
> > 08d6b000-08e9a000 rwxp 00d22000 08:05 4162260 /usr/local/ncl/bin/ncl
> > 08e9a000-0aee8000 rwxp 08e9a000 00:00 0 [heap]
> > b7b00000-b7b21000 rwxp b7b00000 00:00 0
> > b7b21000-b7c00000 ---p b7b21000 00:00 0
> > b7c6b000-b7c75000 r-xp 00000000 08:05 987649 /lib/libgcc_s.so.1
> > b7c75000-b7c76000 rwxp 0000a000 08:05 987649 /lib/libgcc_s.so.1
> > b7c9a000-b7c9b000 rwxp b7c9a000 00:00 0
> > b7c9b000-b7c9f000 r-xp 00000000 08:05 3772997 /usr/lib/libXdmcp.so.6.0.0
> > b7c9f000-b7ca0000 rwxp 00003000 08:05 3772997 /usr/lib/libXdmcp.so.6.0.0
> > b7ca0000-b7ca1000 rwxp b7ca0000 00:00 0
> > b7ca1000-b7ca3000 r-xp 00000000 08:05 3772995 /usr/lib/libXau.so.6.0.0
> > b7ca3000-b7ca4000 rwxp 00001000 08:05 3772995 /usr/lib/libXau.so.6.0.0
> > b7ca4000-b7cbb000 r-xp 00000000 08:05 3772904 /usr/lib/libxcb.so.1.0.0
> > b7cbb000-b7cbc000 rwxp 00016000 08:05 3772904 /usr/lib/libxcb.so.1.0.0
> > b7cbc000-b7cbd000 r-xp 00000000 08:05 3772908
> /usr/lib/libxcb-xlib.so.0.0.0
> > b7cbd000-b7cbe000 rwxp 00000000 08:05 3772908
> /usr/lib/libxcb-xlib.so.0.0.0
> > b7cbe000-b7df1000 r-xp 00000000 08:05 987776 /lib/libc-2.7.so
> > b7df1000-b7df2000 r-xp 00133000 08:05 987776 /lib/libc-2.7.so
> > b7df2000-b7df4000 rwxp 00134000 08:05 987776 /lib/libc-2.7.so
> > b7df4000-b7df7000 rwxp b7df4000 00:00 0
> > b7df7000-b7df9000 r-xp 00000000 08:05 987782 /lib/libdl-2.7.so
> > b7df9000-b7dfb000 rwxp 00001000 08:05 987782 /lib/libdl-2.7.so
> > b7dfb000-b7e1e000 r-xp 00000000 08:05 987783 /lib/libm-2.7.so
> > b7e1e000-b7e20000 rwxp 00022000 08:05 987783 /lib/libm-2.7.so
> > b7e20000-b7e21000 rwxp b7e20000 00:00 0
> > b7e21000-b7e2e000 r-xp 00000000 08:05 3773011 /usr/lib/libXext.so.6.4.0
> > b7e2e000-b7e2f000 rwxp 0000d000 08:05 3773011 /usr/lib/libXext.so.6.4.0
> > b7e2f000-b7f13000 r-xp 00000000 08:05 3772912 /usr/lib/libX11.so.6.2.0
> > b7f13000-b7f16000 rwxp 000e4000 08:05 3772912 /usr/lib/libX11.so.6.2.0
> > b7f34000-b7f3c000 rwxp b7f34000 00:00 0
> > b7f3c000-b7f3d000 r-xp b7f3c000 00:00 0 [vdso]
> > b7f3d000-b7f57000 r-xp 00000000 08:05 3817509 /lib/ld-2.7.so
> > b7f57000-b7f59000 rwxp 00019000 08:05 3817509 /lib/ld-2.7.so
> > bfa2b000-bfa65000 rwxp bffc6000 00:00 0 [stack]
> > Aborted (core dumped)
> >
> >
> > --- En date de : *Ven 31.10.08, Mary Haley /<haley_at_ucar.edu>/* a
> écrit :
> >
> > De: Mary Haley <haley_at_ucar.edu>
> > Objet: Re: [ncl-talk] How to use rip_cape_2d with radiosonde dataset?
> > À: appopson_at_yahoo.fr
> > Cc: "Dennis Shea" <shea_at_ucar.edu>
> > Date: Vendredi 31 Octobre 2008, 18h24

> >
> > On Oct 31, 2008, at 9:28 AM, louis Vonder wrote:
> >
> > > > Sorry Denis,
> > > > In a previous message I send the script.
> > > > > Here the script I am talking about
> > > > > Thanks
> > > > > > ;
> ***********************************************
> > > load
> "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> > > load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> > > load
> "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> > > load
> "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
> > > > ;************************************************
> > > > > begin
> > > nrow = numAsciiRow("pres_04_05_07")
> > > ncol = numAsciiCol("pres_04_05_07")
> > > > pres = asciiread("pres_04_05_07", (/nrow,
> ncol/),
> > "float") ; pressure values
> > > PP = new ( (/nrow, 1, 1/), typeof(pres), getFillValue(pres))
> > > > z = asciiread("z_04_05_07", (/nrow, ncol/),
> "float")
> > ; geopotential heights
> > > ZZ = new ( (/nrow, 1, 1/), typeof(z), getFillValue(z))
> > > > t = asciiread("t_04_05_07", (/nrow, ncol/),
> "float")
> > ; temperature values
> > > TT = new ( (/nrow, 1, 1/), typeof(t), getFillValue(t))
> > > > rhum = asciiread("rhum_04_05_07", (/nrow,
> ncol/),
> > "float") ; relative humidity
> > > td = asciiread("td_04_05_07", (/nrow, ncol/),
> > "float") ; dew point temperature
> > > > psfc = asciiread("psfc_04_05_07", (/1/),
> "float") ;
> > pressure at surface
> > > PS = new ( (/1, 1/), typeof(psfc), getFillValue(psfc))
> > > > zsfc = asciiread("zsfc_04_05_07", (/1/),
> "float") ;
> > geopotential at surface
> > > ZS = new ( (/1, 1/), typeof(zsfc), getFillValue(zsfc))
> > > > > q = mixhum_ptd (pres, td, 2) ; specific
> humidities
> > > QQ = new ( (/nrow, 1, 1/), typeof(q), getFillValue(q))
> > > > > cinfo = rip_cape_2d(PP, TT, QQ, ZZ, ZS, PS,
> True)
> > > > cape = cinfo(0)
> > > cin = cinfo(1)
> > > lcl = cinfo(2)
> > > lfc = cinfo(3)
> > > > print(cape)
> > > > end
> > > > > --- En date de : Ven 31.10.08, Dennis Shea
> <shea_at_ucar.edu> a écrit
> > :
> > > De: Dennis Shea <shea_at_ucar.edu>
> > > Objet: Re: [ncl-talk] How to use rip_cape_2d with radiosonde
> dataset?
> > > À: appopson_at_yahoo.fr
> > > Date: Vendredi 31 Octobre 2008, 14h02
> > > > Louis You did not send the script. Most of us are not
> paid by the NCL
> > project. We want to help people but we must do our own jobs also.
> Please try
> > print statements. That is what we would do. Then, sfter you have tried
> different
> > thing, send us a *clean* script. Often, people send us scripts with
> mnay
> > commented lines and the code is poor. Our time is valuable too.
> Regards D louis
> > Vonder wrote: > > Hi every body, > > Someone found what is
> wrong
> > with my script? > > Thanks > > --- En date de : *Mer
> 29.10.08, Mary
> > Haley /<haley_at_ucar.edu>/* a écrit : > > De: Mary Haley
> > <haley_at_ucar.edu> > Objet: Re: [ncl-talk] How to use
> rip_cape_2d with
> > radiosonde dataset? > À: "Dennis Shea"
> <shea_at_ucar.edu> >
> > Cc: appopson_at_yahoo.fr > Date: Mercredi 29 Octobre 2008, 19h31 >
> > Minor
> > correction, conform_dims is in V5.0.1, not 5.0.0. We hope to >
> release 5.0.1
> > in late November. > > --Mary > > > On Wed, 29 Oct 2008,
> Dennis
> > Shea wrote: > > > TT = new ( (/1,nlevel,1,1/), typeof(T),
> > getFillValue(T)) > > > or, with the yet to be released, 5.0.0
> > >
> > > TT = conform_dims( (/1,nlevel,1,1/), T, 1) > > > Good
> luck >
> > > > louis Vonder wrote: > >> >> Many Thanks
> Dennis, >
> > >> >> Data I am using is already ordered top to bottom as
> indicated
> > in the > document. > >> >> But, how to create
> nominal
> > multi-dimensional arrays ? > >> >> Thanks > >>
> >>
> > --- En date de : *Mer 29.10.08, Dennis Shea /<shea_at_ucar.edu>/* a
> >
> > écrit : > >> >> De: Dennis Shea <shea_at_ucar.edu>
> >
> > >> Objet: Re: [ncl-talk] How to use rip_cape_2d with radiosonde
> >
> > dataset? > >> À: appopson_at_yahoo.fr > >> Cc:
> ncl-talk_at_ucar.edu
> > > >> Date: Mercredi 29 Octobre 2008, 15h21 > >>
> >> As
> > noted in the documentation, there is very limited support >
> >> for this
> > routine. > >> >> [1] > >> You could create
> nominal
> > multi-dimensional arrays. > >> >> T[nlevel] ==>
> TT(nlevel,1,1)
> > or TT(1,nlevel,1,1) > >> etc > >> >> [2] >
> >>
> > >> As noted in the documentation, the data must be top to bottom
> >
> > [sfc] > >> >> if not, usee the ::-1 syntax to reverse
> the order.
> > > >> >> TT(:,0,0) = T(::-1) > >> >> Good
> luck >
> > >> >> louis Vonder wrote: > >> > Dear ncl
> users, >
> > >> > > I want to use the NCL "rip_cape_2d" to
> >
> > calculate CAPE and CIN. > >> > > For this purpose I am
> using a
> > radio sonde data. > >> > > But I found the following
> errors >
> > >> > > fatal:rip_cape_2d: The p, t, q, and z arrays must
> be > 3
> > or 4-dimensional > >> > fatal:Execute: Error occurred at
> or near
> > line 27 in file > cape_crash.ncl > >> > > This
> function
> > cannot be used for 1D dataset? > >> > > Here my script
> >
> > >> > > ; ***********************************************
> >
> > >> > load >
> > "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" >
> >> >
> > load > "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> > >> > load >
> > "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" >
> >>
> > > load >
> "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
> > > >> > >
> ;************************************************ >
> > >> > > > begin > >> > nrow =
> > numAsciiRow("pres_04_05_07") > >> > ncol =
> > numAsciiCol("pres_04_05_07") > >> > > pres =
> > asciiread("pres_04_05_07", > (/nrow, ncol/), >
> >>
> > "float") ; pressure values > >> > z =
> > asciiread("z_04_05_07", (/nrow, ncol/), >
> "float") >
> > >> ; geopotential heights > >> > t =
> > asciiread("t_04_05_07", (/nrow, ncol/), >
> "float") >
> > >> ; temperature values > >> > rhum =
> > asciiread("rhum_04_05_07", (/nrow, ncol/), > >>
> > "float") ; relative humidity > >> > td =
> > asciiread("td_04_05_07", (/nrow, ncol/), > >>
> > "float") ; dew point temperature > >> > >
> psfc =
> > asciiread("psfc_04_05_07", (/1/), > "float") ;
> >
> > >> pressure at surface > >> > zsfc =
> > asciiread("zsfc_04_05_07", (/1/), > "float") ;
> >
> > >> geopotential at surface > >> > > q =
> mixhum_ptd
> > (pres, td, 2) ; specific humidities > >> > > cinfo =
> > rip_cape_2d(pres, t, q, z, zsfc, psfc, > True) > >> >
> > cape =
> > cinfo(0) > >> > cin = cinfo(1) > >> > lcl =
> cinfo(2)
> > > >> > lfc = cinfo(3) > >> > > end >
> >> >
> > > Thanks > >> > > > > >
> >
> ------------------------------------------------------------------------ >
> > >> > > _______________________________________________
> > >>
> > > ncl-talk mailing list > >> > List instructions,
> subscriber
> > options, unsubscribe: > >> >
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk > >>
> >> >
> > > > >
> >
> ------------------------------------------------------------------------ >
> > > _______________________________________________ > ncl-talk
> mailing list
> > > List instructions, subscriber options, unsubscribe: >
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> > > > _______________________________________________
> > > ncl-talk mailing list
> > > List instructions, subscriber options, unsubscribe:
> > > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sun Nov 02 2008 - 12:29:51 MST

This archive was generated by hypermail 2.2.0 : Tue Nov 04 2008 - 10:41:27 MST