[ncl-talk] looping

Sri nandini bax8609 at uni-hamburg.de
Tue Aug 18 02:19:24 MDT 2020


Hello ncl users

I am trying to create a loop to analyze my data but it is a bit 
confusing for me. Can someone have a look at my codes?

What i want to archive is corrected trends over my 100 member ensemble 
experiment: subtracting long term trend over each ensemble member which 
has its own starting date from an initialized experiment from my 
original dataset ==>[time, ens|100, lat, lon]

for e.g. take member #50, it is initialized with the control state at 
year 3140 while member #1 at control year 1898. (i have all the start 
years in a separate table).
To correct #50 you multiply the 1242 yrs difference with the trend S and 
subtract this from #50
**
*a) corrected data #50=original data #50 -(picontrol trend*** (3140 -  
1898)) *
*
*
Is there a way to make it faster and efficient with a loop?*
*

Hist_trend_corrected_ensemble#1=ensemble#1 [time,1,lat,lon] - (PI_trend 
[lat,lon] *ensemble#1 starting year-ensemble#1 starting year)

Hist_trend_corrected_ensemble#2=ensemble#2 [time,2,lat,lon] - (PI_trend 
[lat,lon] *ensemble#2 starting year-ensemble#1 starting year)

Hist_trend_corrected_ensemble#3=ensemble#3 [time,3,lat,lon] - (PI_trend 
[lat,lon] *ensemble#3 starting year-ensemble#1 starting year)

.....

Hist_trend_corrected_ensemble#99=ensemble#99 [time,99,lat,lon] - 
(PI_trend [lat,lon] *ensemble#99 starting year-ensemble#1 starting year)

Thanx

Sri

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200818/db91c36a/attachment.html>


More information about the ncl-talk mailing list