Hi, Aaron
I am sorry that a unrevised email has been send.
There are two tips avoiding loops.
If you have an array X(ntime, nlat, nlon) in which ntime = 468,
;=======tip 1=======================
TIME = yyyymm_time(1, 468/12,"integer") ; this just a sample, and you could use like yyyymm_time(1971, 2009,"integer"). It doesn't matter, and just keep the number of month equal 468.
Xout = X(ind( mod(TIME, 100).ge.5 .and. mod(TIME, 100).le.9 ), :, :) ;
;The time of Xout is from May to Sep. year by year. Its demensions are Xout(ntime, nlat, non)
;But I think these demensions are not suitable for operating. You had better convert it to Xout2(nyear, nmonth, nlat, nlon)
Xout2 = onedtond(Xout, (/39, 5, nlat,nlon/)) ;
Xout2!0 = "year"
Xout2!1 = "month"
;============================================
If you prefer the Xout2, you can do this job by a simpler tip like:
;============tip 2=========================
X_temp = onedtond(X, (/ntime/12, 12, nlat, nlon/)) ; look out the order of demensions.
; This is very useful tip to convert an nd array to other nd array. In NCL there is no "ndtond" function, but "onedtond" can do this job.
Xout = X_temp(:,4:8,:,:) ;
delete(X_temp)
Xout!0 = "year"
Xout!1 = "month"
Good luck.
Huang Ping
2010-01-14
HUANG, Ping
发件人: Aaron Goldner
发送时间: 2010-01-13 23:47:12
收件人: NCL help
抄送:
主题: [ncl-talk] 5_month_season
Hi,
If I have 468 monthly timesteps, starting with January at timestep 0. Is there a function in NCL that will subsect months may-sept for each year? Or will I have to create a do loop and pull out the subsequent months manually?
Thanks,
Aaron
Hotmail: Powerful Free email with security by Microsoft. Get it now.
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Jan 13 19:10:55 2010
This archive was generated by hypermail 2.1.8 : Fri Jan 15 2010 - 13:51:45 MST