0

I have a high number of daily WRF outputs, each one consisting of 24 time steps for every single hour of the day. Now I would like to combine these single output files to one resulting file that comprises the entire time period by using cdo mergetime. I have done this before with some other output files in another context and it worked well.

When I apply this command for example: cdo mergetime wrf_file1.nc wrf_file2.nc output_file.nc

I get the following message many times: Warning (cdfInqContents): Coordinates variable XTIME can't be assigned!

Since it is only a warning and not an error, the process continues. But it takes way too much time and the resulting output file is way too big. For example, when the two input files are about 6 GB, the resulting output file is above 40 GB, which does not make sense at all.

Anybody with an idea how to solve this?

climsaver
  • 341
  • 2
  • 15
  • It is hard to tell what you mean by "it takes way too much time". CDO is writing 40 GB, so that should take a while. What is the run time? – Robert Wilson Apr 20 '22 at 16:46
  • The run time was about ten minutes and it makes absolutely sense that it takes so much time to write 40 GB. The problem is, that the output is not supposed to be that large and the writing process thereby not to be that long. – climsaver Apr 22 '22 at 09:00
  • As I've answered below, you are merging two 6 GB files that are probably compressed. CDO does not compress output by default, so I would expect something like 40 GB. 10 minutes does not seem like a particularly long run time given how large the files are. It's roughly what I would expect, unless you are working with an ultra-fast SSD – Robert Wilson Apr 22 '22 at 09:56

1 Answers1

3

The merged files are probably large because CDO does not, by default, compress the output file. And the WRF files are probably compressed.

You can modify your call to compress the output as follows:

cdo -z zip -mergetime wrf_file1.nc wrf_file2.nc output_file.nc
Robert Wilson
  • 3,192
  • 11
  • 19
  • 1
    Sorry for the late reaction to this answer, the calculation just finished and it turned out that it works! It took quite a long time (3.400 seconds) but the output file is exactly what was expected and of 13 GB size, which is also expectable. In the meanwhile I have found another way to solve this issue: when you extract the variables needed at the first step (they should all share the same coordinates) then all cdo commands can be conducted as usual quite fast and without troubles. – climsaver Apr 22 '22 at 10:14