<div dir="auto">Use CDO..(seasmean, seasmon, splityear etc.)<div dir="auto">Explore on net..</div><div dir="auto"><br></div><div dir="auto">Thanks,</div><div dir="auto">Soma</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 13, 2019, 19:17 Adriana via ncl-talk <<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi everyone<br>
<br>
I have different .nc daily files and I want to calculate the seasonal <br>
(JJA) for several year and save in one variable that contain all the <br>
years for this three months. I did one code ncl that works for one year <br>
but after I don't realize how to continue. I think the problem is <br>
because I add time dimension after using dim_avg_n and the index doesn't <br>
change. I will put part of my code to be clear<br>
<br>
<br>
year1=2005<br>
year2=2007<br>
nyear=year2-year1<br>
<br>
month1=6<br>
month2=8<br>
nmonths=month2-month1+1<br>
<br>
do i = 1,nyear<br>
y= i+year1-1<br>
do j = 1,nmonths<br>
print(nmonths)<br>
if (month1+j-1 .ge. 10) then<br>
mois=10<br>
else<br>
mois="0"+(j-1+month1) ; ver aqui<br>
end if<br>
printVarSummary(mois)<br>
<br>
<br>
file1 := systemfunc(" ls <br>
/PROJETS/MOUSSON-NEW/MAM7_CMIP6_CAMS/MAM7_test10_MERRA2.cam.h0."+y+"-"+mois+"-*.nc")<br>
<br>
print(file1)<br>
setfileoption("nc","SuppressClose", False)<br>
f = addfiles(file1,"r")<br>
<br>
ListSetType (f, "cat")<br>
<br>
<br>
After I read different variables and for calculate the seasonal average <br>
I do the next:<br>
<br>
;------------------<br>
if (j .eq. 1) then ;for JUN<br>
CO_press_JUN = new ((/60*nyear,nlev,nlat,nlon/),"float",CO_2@_FillValue)<br>
CO_press_JUN(60*(i-1):60*(i)-1,:,:,:) = CO_2<br>
CO_JUN_avg = CO_press_JUN(0:0,:,:,:)<br>
CO_JUN_avg(0,:,:,:) = (/ dim_avg_n(CO_press_JUN,0)/)<br>
printMinMax(CO_JUN_avg, True)<br>
printVarSummary(CO_JUN_avg)<br>
<br>
<br>
if (j .eq. 2) then ; for JUL<br>
CO_press_JUL = new ((/62*nyear,nlev,nlat,nlon/),"float",CO_2@_FillValue)<br>
CO_press_JUL(62*(i-1):62*(i)-1,:,:,:) = CO_2<br>
CO_JUL_avg = CO_press_JUL(0:0,:,:,:)<br>
CO_JUL_avg(0,:,:,:) = (/dim_avg_n(CO_press_JUL,0)/)<br>
printMinMax(CO_JUL_avg, True)<br>
printVarSummary(CO_JUL_avg)<br>
<br>
if (j .eq. 3) then ; For AUG<br>
CO_press_AUG = new ((/62*nyear,nlev,nlat,nlon/),"float",CO_2@_FillValue)<br>
CO_press_AUG(62*(i-1):62*(i)-1,:,:,:) = CO_2<br>
CO_AUG_avg = CO_press_AUG(0:0,:,:,:)<br>
CO_AUG_avg(0,:,:,:) = (/dim_avg_n(CO_press_AUG,0)/)<br>
printMinMax(CO_AUG_avg, True)<br>
printVarSummary(CO_AUG_avg)<br>
<br>
end do ; boucle mois<br>
;---------<br>
<br>
Now I want to create a variable<br>
CO_JJA = new((/nyear,nlev,nlat,nlon/),"float")<br>
which contain the number of year and the values CO_JUN_avg, CO_JUL_avg, <br>
CO_AUG_avg of each year<br>
However I didn't arrive to this because I think that the problem is due <br>
to this CO_AUG_avg = CO_press_AUG(0:0,:,:,:) and the index is always 0.<br>
<br>
I'm stuck with this! Can anyone give me any advice or help?<br>
<br>
I really appreciate<br>
<br>
Thank you in advance<br>
<br>
Adriana<br>
-- <br>
Adriana Bossolasco<br>
LPC2E UMR 7328 (CNRS, Université d'Orléans)<br>
3A avenue de la Recherche Scientifique<br>
45071 Orléans Cedex 2 - FRANCE<br>
Tel +33 (0)2 38 25 52 85<br>
e-mail: <a href="mailto:adriana.bossolasco@cnrs-orleans.fr" target="_blank" rel="noreferrer">adriana.bossolasco@cnrs-orleans.fr</a><br>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank" rel="noreferrer">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>