0

I am looping over a model that outputs daily netcdf files. I have a 7-year time series of daily files that, ideally, I would like to append into a single file at the end of each loop but it seems that, using nco tools, the best way to merge the data into one file is to concatenate. Each daily file is called test.t.nc and is renamed as the date of the daily file e.g. 20070102.nc, except the first one that I create with

ncks -O --mk_rec_dmn time test.t.nc 2007-01-01.nc

to make time the record dimension for concatenation. If I try to concatenate the first two files such as

ncrcat -O -h 2007-01-01.nc 2007-01-02.nc out.nc

I get the error message

ncrcat: symbol lookup error: /usr/local/lib/libudunits2.so.0: undefined symbol: XML_ParserCreate

I don't understand what this means and, looking at all the help online, ncrcat should be a straightforward process. Does anyway understand what's happening?

Just in case this helps, the ncdump -h for 20070101.nc is

netcdf \20070101 {
dimensions:
time = UNLIMITED ; // (8 currently)
y = 1 ;
x = 1 ;
tile = 9 ;
soil = 4 ;
nt = 2 ;

and 20070102.nc

netcdf \20070102 {
dimensions:
x = 1 ;
y = 1 ;
tile = 9 ;
soil = 4 ;
time = UNLIMITED ; // (8 currently)
nt = 2 ;

This is part of a bigger shell script and I don't have much flexibility over the naming of files - just in case this matters!

SnowFrog
  • 1,162
  • 4
  • 19
  • 38
  • NCO may not have installed properly given that error message - what platform are you using and how did you install it? – N1B4 Jun 02 '16 at 14:37
  • I'm on Ubuntu 12.04. I installed it a long time ago but I can't remember how. – SnowFrog Jun 02 '16 at 14:53
  • Full documentation here: http://nco.sourceforge.net/. `aptitude install nco` should do the trick. – N1B4 Jun 02 '16 at 16:33
  • NCO is already installed. Do I not risk messing things up given it's already installed? I use `ncdump` a lot and I need this, at least, to work! – SnowFrog Jun 02 '16 at 16:52
  • Either or both your NCO and UDUnits packages are broken or are installed in multiple locations (/usr and /usr/local) that cause conflicts. @N1B4 gives good advice. I would remove the old NCO/UDUnits and re-install NCO as he/she suggests. – Charlie Zender Jun 02 '16 at 18:28
  • @N1B4 @Charlie Zender I removed `nco` with `aptitude remove --purge nco` and reinstalled it as you suggested but I'm still getting the same error message. – SnowFrog Jun 03 '16 at 13:32
  • Should anyone else experience the same problem, I managed to concatenate files using `cdo mergetime` instead. It doesn't solve the NCO question though. – SnowFrog Jun 06 '16 at 12:37

0 Answers0