[ncl-talk] Merge data in ncl

Kunal Bali kunal.bali9 at gmail.com
Wed Feb 20 09:08:42 MST 2019


Soma,

you may try

all_files = systemfunc("ls /Users/kunalbali/*year*.nc")
fall=addfiles(all_files, "r")
ListSetType(fall, "cat")
ozone =fall[:]->AIRS3STM_006_O3_VMR_A
printVarSummary(ozone)
diro = "./"
filo = "merge.nc"
ncdf = addfile(diro+filo ,"c")
filedimdef(ncdf,"time",-1,True)
ncdf->AIRS3STM_006_O3_VMR_A=ozone



---
Kunal Bali





On Wed, Feb 20, 2019 at 8:36 PM Soma Roy <somaroy892 at gmail.com> wrote:

> There is need. I need to merge the netcdf files into single one using ncl
> only.
>
> This file will be utilized in other purpose.
> So processing through ncl is urgent.
>
> Soma
>
> On Wed, Feb 20, 2019, 20:19 Dennis Shea <shea at ucar.edu wrote:
>
>> Both CDO and NCO can easily merge (concatenate) the files. Still neither
>> is NCL as requested by the user.
>>
>> "I want to merge them into a single file *using ncl only*"
>>
>> In my opinion, if you are processing with NCL there is no need to
>> concatenate (merge) the files.
>>
>> fils = *systemfunc* <https://www.ncl.ucar.edu/Document/Functions/Built-in/systemfunc.shtml> ("ls TRMM_3B42_2013*.nc") ; file paths
>> print(fils)
>>
>> f  = *addfiles* <https://www.ncl.ucar.edu/Document/Functions/Built-in/addfiles.shtml> (fils, "r")
>> x = f*[:]*->variable_name
>>
>> *printVarSummary*(x)
>> *printMinMax(*x, 0)
>> ===
>>
>> You could create a netCDF using NCL's  *write_netcdf* <https://www.ncl.ucar.edu/Applications/write_netcdf.shtml> guide:
>>
>>
>> On Wed, Feb 20, 2019 at 4:49 AM Appo derbetini <appopson4 at gmail.com>
>> wrote:
>>
>>> Hi,
>>>
>>> You can proceed with  CDO
>>>
>>> cdo    mergetime  TRMM_3B42_20130611.nc    output.nc
>>>
>>> or  NCO
>>>
>>> ncrcat       TRMM_3B42_20130611.nc     output.nc
>>>
>>>
>>> Le mer. 20 févr. 2019 à 11:15, Soma Roy <somaroy892 at gmail.com> a écrit :
>>>
>>>> Hello,
>>>> I have several netcdf files containing daily data. I want to merge them
>>>> into a single file using ncl only.
>>>> Please kindly inform me about the above.
>>>>
>>>> Files are like;
>>>> TRMM_3B42_20130611.nc
>>>> TRMM_3B42_20130612.nc
>>>> TRMM_3B42_20130613.nc
>>>> and so on..
>>>>
>>>> Thanking you,
>>>> Soma
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> ncl-talk at ucar.edu
>>>> List instructions, subscriber options, unsubscribe:
>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>> _______________________________________________
> 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/20190220/374556d7/attachment.html>


More information about the ncl-talk mailing list