f = addfile("IBTrACS.NI.v04r00.nc","r") ;==== Select the duration year = f->season print("Year begins : " + min(year)) print("Year ends : " + max(year)) startYear = 2000 endYear = 2015 iStart = ind(year.eq.startYear) iEnd = ind(year.eq.endYear) dimiend = dimsizes(iEnd) ;==== Read the required storm years stormYear = f->season(iStart(0):iEnd(dimiend-1)) uniq_year = get_unique_values(stormYear) nuniq = dimsizes(uniq_year) print(stormYear) print(nuniq) ;===== Read MSW msw = short2flt(f->newdelhi_wind(iStart(0):iEnd(dimiend-1),:)) printVarSummary(msw) dim_msw = dimsizes(msw) maxwind = new(dim_msw(0),float,0) ;--Print MSW of each storm do i=0,dim_msw(0)-1 maxwind(i) = max(msw(i,:)) end do print(maxwind) ;--Remove missing values igood = ind(.not.ismissing(maxwind)) maxWind = maxwind(igood) print(maxWind) dim_msW = dimsizes(maxWind) print(dim_msW) ;===== Bin all escs category from all storms years escs = new(dim_msW(0),float,0) N = endYear - startYear + 1 cont = new((/N,2/),float,0) m = 0 do i=startYear,endYear k=0 do j=0,dim_msW(0)-1 if (stormYear(j).eq.i) then if (maxWind(j).ge.90 .and. maxWind(j) .le. 119) then escs(j) = maxWind(j) k = k+1 end if end if end do cont(m,0)=i cont(m,1)=k m = m + 1 end do print(cont(:,0)) print(cont(:,1)) wks = gsn_open_wks("png","csve") res = True res@gsnXYBarChart = True ; Create bar plot res@trYMinF = 0 res@trYMaxF = 3 res@tmYLTickSpacingF = 1 res@gsnXYBarChartColors = "blue" res@gsnXYBarChartBarWidth = 0.55 res@vpHeightF = 0.5 res@vpWidthF = 0.6 res@vpXF = 0.1 plot = gsn_csm_xy(wks,cont(:,0),cont(:,1),res)