Dear NCL users,
I want to calculate lat vs time precipitation with the help GPCP daily data. So, when I running my code it appears some errors given below. So for your convenience my code and variable print repot is also given below.
Further with this question I want to calculate the comparison between the two years with the help of this GPCP daily mean data (in the form of line graph and Rainfall vs time i.e. day, months etc). Anyone please, could you guide me in this regard?
Thanks a lot in advance,
kalim
**********************************************************
begin
setfileoption ("bin", "ReadByteOrder", "BigEndian")
dir="/disk1/home/dm/GPCP1dd/"
a0 = fbindirread(dir+"gpcp_1dd_v1.1_p1d.200306",0, (/180,360/), "float")
a1 = fbindirread(dir+"gpcp_1dd_v1.1_p1d.200306",1, (/180,360/), "float")
a2 = fbindirread(dir+"gpcp_1dd_v1.1_p1d.200306",2, (/180,360/), "float")
a3 = fbindirread(dir+"gpcp_1dd_v1.1_p1d.200306",3, (/180,360/), "float")
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
a90 = fbindirread(dir+"gpcp_1dd_v1.1_p1d.200308",29, (/180,360/), "float")
a91 = fbindirread(dir+"gpcp_1dd_v1.1_p1d.200308",30, (/180,360/), "float")
a = (/a0+a1+……………+a91/)
printVarSummary(a)
a!0 = "lat"
a!1 = "lon"
lat = fspan(-89.5,89.5,180)
lat@units = "degrees_north"
lat!0 = "lat"
lon = fspan(0.5,359.5,360)
lon@units = "degrees_east"
lon!0 = "lon"
a&lat = lat
a&lon = lon
a@long_name = "Daily precipitation"
a@units = "mm/d"
*****************************
; Convert time values to year, month, day, hour, minutes, seconds.
time = a&time
utc = ut_calendar(time,0) ; yr, mo, dy, hr, mn, sc
mons = floattoint(utc(:,1)) ; Values from 1 to 12
days = floattoint(utc(:,2)) ; Values from 1 to 31
;
; Get indexes that represent first day of the month.
;
; This is where we'll put the month label on the Y axis. If you
; want to label the middle of the month, then you can use the
; days_in_month calendar to get that value, and use that instead
; of the "1" in the "ind" call (or, you can just use something
; close, like 15).
;
day_1 = ind(days.eq.1)
mon_1 = mons(day_1) ; Get the months corresponding to these days.
nticks = dimsizes(day_1)
;
; Get the original time values at these indices, and convert
; to "MMM" labels.
;
smonths = (/"", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", \
"Aug", "Sep", "Aug", "Nov", "Dec"/)
tm_major_values = time(day_1)
tm_major_labels = smonths(mon_1)
wks = gsn_open_wks ("x11", "hov" )
gsn_define_colormap(wks,"BlAqGrYeOrRe")
;*******************************
res = True
res@cnFillOn = True
res@cnLinesOn = False
res@tmYLMode = "Explicit" ; Define own tick mark labels.
res@tmYLValues = tm_major_values
res@tmYLLabels = tm_major_labels
res@tmYLMinorThicknessF = 2.0
res@tmYLMajorOutwardLengthF = 0.01
res@tmYLMajorLengthF = 0.01
res@cnLevelSelectionMode = "ManualLevels"
res@cnMinLevelValF = 10. ; min level
res@cnMaxLevelValF = 300. ; max leve
res@cnLevelSpacingF = 50 ; contour spacing
res@gsnSpreadColors = True ; use full range of color map
res@gsnLeftString = "Acc.GPCP(mm/d)"
res@gsnRightString = "(JJA) 2007"
res@lbOrientation = "Vertical" ; Label bar to side
plot = gsn_csm_hov(wks,a(:,{30:120}), res)
end
*************************************
Variable: a
Type: float
Total Size: 259200 bytes
64800 values
Number of Dimensions: 2
Dimensions and sizes: [180] x [360]
Coordinates:
fatal:(time) is not a named dimension in variable (a).
fatal:Execute: Error occurred at or near line 251 in file pd1.ncl
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Jan 13 22:11:31 2010
This archive was generated by hypermail 2.1.8 : Mon Feb 01 2010 - 08:05:34 MST