Dear Ncl users,
I don't know what is wrong the following script.
I am trying to calculate CAPE using NCEP/NCAR realnalys data.
But I am getting this error message
"Segmentation fault "
Many 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
f1 = addfile("M00_JJA_air.1999.nc", "r")
f2 = addfile("M00_JJA_hgt.1999.nc", "r")
f3 = addfile("hgt.sfc.nc", "r")
f4 = addfile("M00_JJA_pres.sfc.1999.nc", "r")
f5 = addfile("M00_JJA_shum.1999.nc", "r")
lon = f1->lon
lat = f1->lat
time = f1->time
plvl = f1->level
tk = f1->air
z = f2->hgt
pp = conform(tk, plvl, 1) ; make p same shape/rank/size as T
shum = f5->shum
sfc = f3->hgt(0, :, :) ; A scalar or array containing surface height [m]
psfc = 100*(f4->pres) ; A scalar or array containing surface pressures (hPa)
zsfc = conform(psfc, sfc, (/1, 2/)) ; make sfc same shape/rank/size as zsfc
cinfo = wrf_cape_2d(pp, tk, shum, z, zsfc, psfc, False)
cape = cinfo(0,:,:,:)
; cin = cinfo(1,:,:,:)
; lcl = cinfo(2,:,:,:)
; lfc = cinfo(3,:,:,:)
cape@long_name= " convective available potential energy"
; cin@long_name= " convective inhibition"
; lcl@long_name= "lifted condensation level"
; lfc@long_name="level of free convection"
delete(z)
delete(pp)
delete(shum)
; output the regressed fields to a file
system("rm -f cape_ncep_M00_JJA.1999.nc")
outfile = addfile("cape_ncep_M00_JJA.1999.nc", "c")
outfile->cape = cape
; outfile->cin = cin
; outfile->lcl = lcl
; outfile->lfc = lfc
end
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Sep 6 04:05:43 2010
This archive was generated by hypermail 2.1.8 : Thu Sep 16 2010 - 11:05:25 MDT