[ncl-talk] Fatal error

Maria Gehne - NOAA Affiliate maria.gehne at noaa.gov
Mon Sep 29 15:15:15 MDT 2014


Try a print(iday9) before the line you are getting the error. It is
possible that ddd9.eq.(nd9+1) is not true anywhere and iday9 is returned as
a missing value.

Responses to ncl-talk only please.

Maria

On Mon, Sep 29, 2014 at 11:53 AM, azizul haque <haque.azizul320 at yahoo.com>
wrote:

> Hi NCL User,
> I am facing big problem with GPCP daily data. I doing daily annual cycle
> with other CMIP5 models this work well. However, GPCP data gives following
> error message that I could not solve.Your kind help are appreciated
>
> Error are highlighted in the script below
>
> *************fatal:Subscript out of range, error in subscript #0
> fatal:An error occurred reading pr9Area***********
> Script for GPCP sub
> j =addfile
> ("/Users/ahaque/Desktop/CMIP5/historical/Daily/historical/jjas_hist_50y/jjas_hist_50y/
> GPCP_1DD_v1.2_199610-201312_sa.nc", "r")
>    pr9=j->PREC;(6301x16X21;x21;{lat1:lat2},{lon1:lon2})   ;
> (time,lat,lon)  (0,1,2)
>  time9     = i->time
> ;Convert kg to mm
>   pr9        = pr9*1.
>   pr9 at units  = "mm/day"
>   printVarSummary(pr9)
>   printMinMax(pr9,1)
>   clat9      = latRegWgt(pr9&lat, typeof(pr9), 0) ; create lat weights
>   pr9Area    = wgt_areaave_Wrap(pr9, clat9, 1, 0)  ; weighted area avg
>   ymdStrt9   = 199610 ; start yyyymmdd
>   ymdLast9   = 201312      ;last
>   yrStrt     = ymdStrt9/10000
>   yrLast     = ymdLast9/10000
>   nhar       = 4  ; no of fourier comp
>   var        = "pr"
>   TIME9      = cd_calendar(time9,0)   ; type of float
>   year9      = floattointeger( TIME9(:,0) )
>   month9     = floattointeger( TIME9(:,1) )
>   day9       = floattointeger( TIME9(:,2) )
>   ddd9       = day_of_year(year9, month9, day9)
>   yyyyddd9   = year9*1000 + ddd9
>   nday9      = 365
>   pday9      = new ( nday9, typeof(pr9), getFillValue(pr9))
>   do nd9      =0,nday9-2
>      iday9   = ind(ddd9.eq.(nd9+1))
>      pday9(nd9) = avg(pr9Area(iday9))
>      delete(iday9)                       ; may change next ireration
>     end do
>    pday9(nday9-1)= 0.5*(pday9(0)+pday9(nday9-2))
>    pr9AvgRegion  = avg(pr9Area)
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140929/b6876489/attachment.html 


More information about the ncl-talk mailing list