Re: Problem

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Fri, 12 Jun 2009 11:59:35 -0600

What is the memory available on the machine you are using?

If you are reading a variable of 6GB and you have less machine
memory, then you will have to processing in parts.

Rather than trying to read a 6GB variable into memory,
I would suggest:

f=addfile("ap_0904.nc","r")
print("dimp="+filevardimsizes(f, "precip")
print("ptype="+*getfilevartypes*(f,"precip"))

Mary Haley wrote:
> 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
>

-- 
======================================================
Dennis J. Shea                  tel: 303-497-1361    |
P.O. Box 3000                   fax: 303-497-1333    |
Climate Analysis Section                             |
Climate & Global Dynamics Div.                       |
National Center for Atmospheric Research             |
Boulder, CO  80307                                   |
USA                        email: shea 'at' ucar.edu |
======================================================
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Jun 12 2009 - 11:59:35 MDT

This archive was generated by hypermail 2.2.0 : Mon Jun 15 2009 - 08:53:05 MDT