[ncl-talk] Custom season for month_to_season
Dennis Shea
shea at ucar.edu
Thu Jun 23 13:46:59 MDT 2016
Untested . make adjustments for 3D array
Recommendation ... if used often ... make into a function
===
xmo(time,lev,lat,lon) ; monthly series of some variable
dim_xmo = dimsizes(xmo)
ntim = dim_xmo(0)
klev = dim_xmo(1)
nlat = dim_xmo(2)
mlon = dim_xmo(3)
N = ntim/12
xMJ = new( (/ N, klev,nlat,mlon/), typeof(xmo), xmo at _FillValue)
do nt=4,ntim-1,12 ; NCL uses 0-based indexing;nt=4 --> May
xMJ(nt) = 0.5*(x(nt,:,:,:) + x(nt+1,:,:,:))
end do
xMJ at long_name = "May-June: "+xmo at long_name
xMJ at units = xmo at units
copy_VarCoords(xmo(0,:,:,:), xMJ(0,:,:,:)) ; spatial dimension information
printVarSummary(xMJ)
xMJ!0 = "time" ; add temporal information
xMJ&time = xmo&time(4::12) ; use 'May' time (arbitrary)
printVarSummary(xMJ)
HTH
On Thu, Jun 23, 2016 at 1:26 PM, Lee, Ji-Woo <lee1043 at llnl.gov> wrote:
> Hello users,
>
> I am trying to get seasonal mean time series from monthly data for MJ
> (May-June). It looks month_to_season function is only available for
> predefined three month seasons like JJA, DJF, etc. Is there any trick that
> I can subtract custom season like MJ mean time series easily?
>
> Thank you very much,
> Jiwoo
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> 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/20160623/a4d14870/attachment.html
More information about the ncl-talk
mailing list