[ncl-talk] Merging two .nc file

Alan Brammer abrammer at albany.edu
Tue Jun 9 09:29:55 MDT 2015


This can be done in about 7 lines in ncl (less if really desired). This
should be used a pseudocode and edited to work.  If you don't understand
the below look at the documentation. For bigger files this would not be the
best solution but for data ~1MB this should be fine.
This relies on the the data being consistent and only time changing.


filenames = (/"tasmax...","tasmax..."/)
infiles = addfiles(filenames, "r")
listSetType(infiles, "cat")

var = "variable_name"
data = infiles[:]->$var$

ncout = addfile("tasmax_all.nc","c")
ncout->$var$ = data




On 9 June 2015 at 10:09, amit timilsina <timilsinaamit87 at huskers.unl.edu>
wrote:

>
> The attached two files contain three co-ordinates with similar latitude
> and longitude co-ordinates but differ in time periods (1981-1990 and
> 1991-2000). Now I want to merge two files to get new file with values of
> tasmax from 1981-2000 for same latitude and longitude combination. Any link
> and suggestions to go through will be highly appreciated.
>
> Regards,
> Amit Prasad Timilsina
> Ph D student
>
> _______________________________________________
> 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/20150609/3daa1b57/attachment.html 


More information about the ncl-talk mailing list