[ncl-talk] CAPE from ascii

Theomar Trindade theomar_trindade at hotmail.com
Mon Feb 6 13:09:09 MST 2017


Dear NCL's users,

I'm trying to calculate CAPE from a list of ASCII profiles. In the example below I was trying just in one profile, although the answer is not the same as in the picture. How can I have the CAPE value of my data? Any other suggestion is welcome too.


------------------------------------------------------------------------------------------------------------------------------------------------------------
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/skewt_func.ncl"

begin

data = asciiread("~/Francisco/FEV2014/PTU_e_WIND_00Z/RS2014020100.txt",(/429,9/),"float")

P=data(:,2)
T=data(:,4)
q=data(:,5)
TD=data(:,6)
wsp=data(:,7)
wdr=data(:,8)

; --- Read Data ------------;

  p    = P
  q    = q
  tc   = T
  tdc  = TD
  wspd = wsp
  wdir = wdr

;*************************
; create plot
;*************************
  wks  = gsn_open_wks ("png", "skewt")  ; send graphics to PNG file

; --- Create background skew-T and plot sounding----------------

  skewtOpts                 = True
  skewtOpts at DrawColAreaFill = True    ; default is False

  dataOpts           = True     ; options describing data and ploting
  dataOpts at Wthin     = 3        ; plot every n-th wind barb
  dataOpts at hemisphere    = "SH"

  skewtOpts at tiMainString    = "ATS Rawindsonde: degC + Thin wind"
  skewtOpts at DrawFahrenheit  = False   ; default is True

  skewt_bkgd = skewT_BackGround (wks, skewtOpts)
  skewt_data = skewT_PlotData   (wks, skewt_bkgd, p,tc,tdc,z \
                                    , wspd,wdir, dataOpts)
  draw (skewt_bkgd)
  draw (skewt_data)
  frame(wks)

   skewT = True
   cape = skewT at Cape
   pwat = skewT at Pwat

  print(cape)
  print(pwat)

 end

------------------------------------------------------------------------------------------------------------------------------------------------------------



Thanks in advance,


--
Dr. Theomar Trindade de A. T. Neves
UEA Researcher | Pesquisador da UEA
Doutor em meteorologia|Doctor in Meteorology
Phone: 55(83)996255666
email: theomar_trindade at hotmail.com<mailto:theomar_trindade at hotmail.com>
          neves.<mailto:theomar.neves at cptec.inpe.br>theomar<mailto:theomar.neves at cptec.inpe.br>@gmail.com<mailto:theomar.neves at cptec.inpe.br>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170206/ce950d99/attachment.html 


More information about the ncl-talk mailing list