# Problem

From: Mathew Freeman <mattfree0180_at_nyahnyahspammersnyahnyah>
Date: Fri, 12 Jun 2009 09:42:33 -0700 (PDT)

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
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->a=v1
end

thankyou

matt

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Jun 12 2009 - 10:42:33 MDT

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