<div dir="ltr"><div dir="ltr"><div>Try this<br></div><div><br></div><div><br></div><div> f = addfile("<span style="color:rgb(0,0,255)"><b>inputfile</b></span>.nc","r")<br> x = f-><b><span style="color:rgb(255,0,0)">variable_name</span></b><br> printVarSummary(x)<br><br> opt = True<br> opt@nval_crit = 12 ; require at least 12 values for the "avg" is calculated.<br> <br> xMon = <span style="color:rgb(0,0,255)"><b>calculate_monthly_values</b></span> (x, "avg", 0,opt) ; convert daily to monthly<br> printVarSummary(xMon)<br> <br></div><div> ; for generating output in netcdf if it is required<br></div><div> diro = "./"<br> filo = "<a href="http://merge2.nc">merge2.nc</a>"<br> ncdf = addfile(diro+filo ,"c")<br> filedimdef(ncdf,"time",-1,True)<br> ncdf->xMon=xMon</div><div><br></div><div><br></div><div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>---<br></div><div><font size="2"><span>Kunal Bali<br></span></font></div><br><div><b><br></b></div><div><br></div><div><p style="margin:0px;border-collapse:collapse;font-family:Tahoma,Verdana;font-size:12px"><font color="#1F497D"><br></font></p></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 11, 2019 at 11:00 AM Soma Roy <<a href="mailto:somaroy892@gmail.com">somaroy892@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Hello,<div dir="auto"><span style="font-family:sans-serif;font-size:12.8px">I have 1980 to 2005 daily JJAS (122 days) data in a file..from that I want to calculate monthly means for each year in ncl (not CDO) so that output file will be 104 (ntime), nlat, nlon.</span></div><div dir="auto"><font face="sans-serif"><span style="font-size:12.8px"><br></span></font><div dir="auto" style="font-family:sans-serif;font-size:12.8px">Which function should I use in ncl to get the above output?</div><div dir="auto" style="font-family:sans-serif;font-size:12.8px"><br></div><div dir="auto" style="font-family:sans-serif;font-size:12.8px"><br></div><div dir="auto" style="font-family:sans-serif;font-size:12.8px">Thanks,</div><div dir="auto" style="font-family:sans-serif;font-size:12.8px">Soma</div></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div>