Re: Segmentation fault (CAPE)

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Tue Sep 07 2010 - 15:37:20 MDT

Hi Louis,
Can you put print statements in to identify which line the seg fault is
occurring? That would help the group in diagnosing what the issue is... Adam

On 09/06/2010 05:05 AM, louis Vonder wrote:
> 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

-- 
__________________________________________________
Adam Phillips 
asphilli@ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
Climate and Global Dynamics Division         fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000    http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Sep 7 14:37:25 2010

This archive was generated by hypermail 2.1.8 : Thu Sep 16 2010 - 11:05:24 MDT