Mary,
It gives following:
+ f=addfile("ap_0904.nc","r")
+ print(f)
Variable: f (file variable)
filename: ap_0904
path: ap_0904.nc
file global attributes:
Conventions : COARDS
calendar : standard
comments : file created by grads using lats4d available from http://dao.gsfc.nasa.gov/software/grads/lats4d/
model : geos/das
center : gsfc
history : Fri Jun 12 11:16:23 2009: ncrcat 1970.nc 1971.nc 1972.nc 1973.nc 1974.nc 1975.nc 1976.nc 1977.nc 1978.nc 1979.nc 1980.nc 1981.nc 1982.nc 1983.nc 1984.nc 1985.nc 1986.nc 1987.nc 1988.nc 1989.nc 1990.nc 1991.nc 1992.nc 1993.nc 1994.nc 1995.nc 1996.nc 1997.nc 1998.nc 1999.nc 2000.nc 2001.nc 2002.nc -o ap_0904.nc
nco_openmp_thread_number : 1
dimensions:
time = 12045 // unlimited
longitude = 360
latitude = 220
variables:
double time ( time )
units : days since 1970-1-1 0
double longitude ( longitude )
units : degrees_east
long_name : Longitude
double latitude ( latitude )
units : degrees_north
long_name : Latitude
float precip ( time, latitude, longitude )
comments : Unknown1 variable comment
long_name : daily precipitation analysis interpolated into 0.25deg grids [mm/day]
units :
grid_name : grid-1
grid_type : linear
level_description : Earth surface
time_statistic : instantaneous
missing_value : -99.9
_FillValue : -99.9
float rstn ( time, latitude, longitude )
comments : Unknown1 variable comment
long_name : ratio of 0.05deg-grids with station [%]
units :
grid_name : grid-1
grid_type : linear
level_description : Earth surface
time_statistic : instantaneous
missing_value : -99.9
_FillValue : -99.9
+ t=f->time
+ v=f->precip
Segmentation fault
matt
________________________________
From: Mary Haley <haley_at_ucar.edu>
To: Mathew Freeman <mattfree0180_at_yahoo.com>
Cc: ncl-talk_at_ucar.edu
Sent: Friday, June 12, 2009 12:50:13 PM
Subject: Re: Problem
On Fri, 12 Jun 2009, Mathew Freeman wrote:
> Mary,
>
> Using "ncl -x a.ncl" without begin and end statements in script gives following lines:
>
> + f=addfile("ap_0904.nc","r")
> + t=f->time
> + v=f->precip
> Segmentation fault
How big are these variables? What does the following output:
f=addfile("ap_0904.nc","r")
print(f)
printVarSummary(f->time)
printVarSummary(f->precip)
--Mary
> The file size is 6GB. It works fine if i reduce it to 5 years to convert into months but i need a single file of all years (33 years).
>
> Please suggest.
>
> matt
>
>
>
>
> ________________________________
> From: Mary Haley <haley_at_ucar.edu>
> To: mattfree0180_at_yahoo.com
> Cc: ncl-talk_at_ucar.edu
> Sent: Friday, June 12, 2009 12:12:08 PM
> Subject: Re: Problem
>
>
> Mathew,
>
> You can also locate the seg fault by commenting out the main "begin"
> and "end" and running your script with "ncl -x your_script.ncl".
>
> If you are getting any error messages, it would help to include
> these in your email message too.
>
> --Mary
>
>
> On Fri, 12 Jun 2009, Adam Phillips wrote:
>
>> Hi Mathew,
>> Can you tell us which line is causing the segmentation fault? You can
>> use print statements to isolate the line. If the error occurs within the
>> double do loop, let us know the i and j values when the script fails.
>> (Again, you can use print statements for that.)
>> Adam
>>
>> Mathew Freeman wrote:
>>> Hello everyone,
>>>
>>> I am using the following script to convert the daily 0.25 degree data
>>> into monthly data but getting segmentation fault error. Can anyone
>>> please guide to this case. The script is as follows:
>>>
>>>
>>> begin
>>> f=addfile("0904.nc","r")
>>> t=f->time
>>> v=f->a
>>> v2=v(latitude|:,longitude|:,time|:)
>>> delete(v)
>>> t=fspan(0,dimsizes(t)-1,dimsizes(t))
>>> utc_date = ut_calendar(t, 0)
>>>
>>> year = floattointeger(utc_date(:,0))
>>> month = floattointeger(utc_date(:,1))
>>>
>>> dims=dimsizes(v2)
>>> v1=new((/12*(2002-1970+1),dims(0),dims(1)/),"float")
>>> time1=fspan(0,12*(2002-1970+1)-1,12*(2002-1970+1))
>>> time1_at_units="months since 1970-01-01"
>>> k=0
>>> do i=1970,2002
>>> do j=1,12
>>>
>>> indx = ind(year.eq.i.and. month.eq.j)
>>> printVarSummary(indx)
>>> print(max(indx))
>>> print(min(indx))
>>> v1(k,:,:)=dim_avg(v2(:,:,indx))
>>> delete(indx)
>>> ; if (j.eq.1) then
>>> print(i*100+j)
>>> ; end if
>>> k=k+1
>>> end do
>>> end do
>>>
>>> v1!0="time"
>>> v1&time=time1
>>> v1!1="lat" v1&lat=f->latitude
>>> v1!2="lon"
>>> v1&lon=f->longitude
>>>
>>> system("rm 0904_mon.nc")
>>> fo=addfile("0904_mon.nc","c")
>>> fo->a=v1
>>> end
>>>
>>> thankyou
>>>
>>> matt
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>> --
>> --------------------------------------------------------------
>> Adam Phillips asphilli_at_ucar.edu
>> National Center for Atmospheric Research tel: (303) 497-1726
>> ESSL/CGD/CAS 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
>>
>
>
>
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Jun 12 2009 - 12:01:12 MDT
This archive was generated by hypermail 2.2.0 : Mon Jun 15 2009 - 08:53:05 MDT