[ncl-talk] Daily mean to monthly mean
Kunal Bali
kunal.bali9 at gmail.com
Mon Mar 11 00:15:31 MDT 2019
then
changed
opt at nval_crit = 12
to
opt at nval_crit = 4
---
Kunal Bali
On Mon, Mar 11, 2019 at 11:21 AM Soma Roy <somaroy892 at gmail.com> wrote:
> Each year I have only 4 months (JJAS) daily data.. How can I set 12 in opt?
>
> Soma
>
> On Mon, Mar 11, 2019, 11:17 Kunal Bali <kunal.bali9 at gmail.com wrote:
>
>> Try this
>>
>>
>> f = addfile("*inputfile*.nc","r")
>> x = f->*variable_name*
>> printVarSummary(x)
>>
>> opt = True
>> opt at nval_crit = 12 ; require at least 12 values for the
>> "avg" is calculated.
>>
>> xMon = *calculate_monthly_values* (x, "avg", 0,opt) ;
>> convert daily to monthly
>> printVarSummary(xMon)
>>
>> ; for generating output in netcdf if it is required
>> diro = "./"
>> filo = "merge2.nc"
>> ncdf = addfile(diro+filo ,"c")
>> filedimdef(ncdf,"time",-1,True)
>> ncdf->xMon=xMon
>>
>>
>> ---
>> Kunal Bali
>>
>>
>>
>>
>>
>>
>> On Mon, Mar 11, 2019 at 11:00 AM Soma Roy <somaroy892 at gmail.com> wrote:
>>
>>> Hello,
>>> 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.
>>>
>>> Which function should I use in ncl to get the above output?
>>>
>>>
>>> Thanks,
>>> Soma
>>> _______________________________________________
>>> 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/20190311/1ce9f758/attachment.html>
More information about the ncl-talk
mailing list