CAPE and CIN calculations showing all missing values?

From: A.J. Eiserloh <arthur.eiserloh_at_nyahnyahspammersnyahnyah>
Date: Fri Aug 09 2013 - 12:55:47 MDT

Hi,

I am trying to calculate CAPE and CIN values with the function wrf_cape_2d
for my WRF output file, but I keep getting all missing values for CAPE and
CIN. I try doing it the longer way by extracting, T, PH, QVAPOR, etc., and
using wrf_cape_2d to get CAPE and CIN; and I try doing it the other way by
using wrf_user_getvar() to get cape3d. Both ways give me the same values,
all missing values of CAPE and CIN. The missing value it gives me
is 9.96921e+36.

I checked in the first way by printing T,P,PH,z,QVAPOR, but all the values
seem to be valid, and none of the variables that are used to calculate CAPE
and CIN give me the missing value 9.96921e+36 or any missing value.

Why am I getting all these missing values for the CAPE and CIN calculations?

I am using NCL v6.1.1.

Here is the first half of my code:

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/wrf/WRF_contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"

begin
;
print("Working on WRF d03 CAPE")
; The WRF ARW input file.
  a = addfile("./wrfout_d03_2013-08-07_12:00:00.nc","r")

; We generate plots, but what kind do we prefer?
; type = "x11"
; type = "pdf"
  type = "ps"
; type = "ncgm"
; type = "png"
  type@wkOrientation= "landscape"
  wks = gsn_open_wks(type,"plt_CAPE")

; Set some Basic Plot options
  res = True
  res@MainTitle = " "
  res@Footer = False
  MTOPosF = -0.05

  pltres = True
  mpres = True
  mpres@gsnMaximize = True
  mpres@mpGeophysicalLineColor = "Black"
  mpres@mpNationalLineColor = "Black"
  mpres@mpUSStateLineColor = "Black"
  mpres@mpLimbLineColor = "Black"
  mpres@mpPerimLineColor = "Black"
  mpres@mpOutlineBoundarySets = "AllBoundaries"
  mpres@mpGeophysicalLineThicknessF = 2.0
  mpres@mpGridLineThicknessF = 2.0
  mpres@mpLimbLineThicknessF = 2.0
  mpres@mpNationalLineThicknessF = 2.0
  mpres@mpUSStateLineThicknessF = 2.0
  mpres@mpDataBaseVersion = "HighRes"
  mpres@mpDataSetName = "Earth..4"

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; What times and how many time steps are in the data set?
  times = wrf_user_list_times(a) ; get times in the file
  ntimes = dimsizes(times) ; number of times in the file

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  do it = 0,ntimes-1 ; TIME LOOP

    print("Working on time: " + times(it) )
    res@TimeLabel = times(it) ; Set Valid time to use on plots

T = a->T
  P = a->P
  PB = a->PB
  QV = a->QVAPOR
  PH = a->PH
  PHB = a->PHB
  HGT = a->HGT
  PSFC = a->PSFC
  T = T + 300.
  P = P + PB
  tk = wrf_tk( P , T )
  PH = PH + PHB
  z = wrf_user_unstagger(PH,PH@stagger)
  z = z/9.81

  ;print(tk(:,:,:,:))

  cinfo = wrf_cape_2d( P, tk, QV, z, HGT, PSFC, True )
  print(dimsizes(cinfo))

  mcape = cinfo(0,:,:,:)
  mcin = cinfo(1,:,:,:)
  ;lcl = cinfo(2,.....)
  ;lfc = cinfo(3,.....)

  print(mcape)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; First get the variables we will need
; cape2d = wrf_user_getvar(a,"cape_2d",it) ; CAPE
; cape3d = wrf_user_getvar(a,"cape_3d",it) ; CAPE

; cape = cape3d(0,:,:,:)
; cin = cape3d(1,:,:,:)
; mcape = cape2d(0,:,:)
; mcin = cape2d(1,:,:)
; lcl = cape2d(2,:,:)
; lfc = cape2d(3,:,:)

-- 
Arthur J. Eiserloh, Jr.
San Jose State University
Graduate Student
Dept. of Meteorology and Climate Science

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Aug 9 12:55:58 2013

This archive was generated by hypermail 2.1.8 : Wed Aug 14 2013 - 18:35:09 MDT