Project

General

Profile

Combining several year of .nc file to one file

Added by Somsubhra Chattopadhyay over 8 years ago

Dear CDO users,
I have daily future Bias Corrected and Spatially Downscaled (BCSD) data for 30 years (2070-2099). However, each of these years are separate netcdf files. I have a MATLAB code that can convert these to text files and extract the files for my watershed. However, it is cumbersome to do that for each single year of data. Is there a way CDO can help me to merge all the netcdf files so that in the end I only get a single time series of daily values for 30 years? I suspect it will be a challenging task, because the netcdf files have the data for whole US and are approximately 40 MB of size. Is this possible to do using any of the commands? My computer specifications are: Processor: Intel(R)Xenon(R)CPU. Memory (RAM) 6GB. 64 BIT operating system. I installed the program but upon running it said "cygcurl-4.dll" is missing from the computer. What should be done so that if combining the netcdf is possible I can run the program? I just uploaded one GCM data file as an example in case..

Thanks a lot for your suggestion in advance,
Regards
Som


Replies (4)

RE: Combining several year of .nc file to one file - Added by Matt Thompson over 8 years ago

Som,

This sounds like you want to use the "mergetime" operator (https://code.zmaw.de/projects/cdo/embedded/index.html#x1-840002.2.5).

You could do something like:

  cdo mergetime hadgem2-rcp85_r1i1p1.daily.pr.20*.nc hadgem2-rcp85_r1i1p1.daily.pr.2070-2099.nc

and that should merge all the separate year files into one large file.

Your other error seems to be a Cygwin issue, and I'm no Cygwin guru. My guess is you need cURL or some cURL package installed.

Matt

RE: Combining several year of .nc file to one file - Added by Somsubhra Chattopadhyay over 8 years ago

Hi Matt,

Thanks a ton for the reply. I did install cygwin in my machine properly and made sure that I have the cURL packages (libcurl 14 and others) also installed. However, unfortunately the same error persists. Any other ideas so as to fix the error which says "cygcurl-4.dll" is missing from your computer?

Thanks again,
Som

RE: Combining several year of .nc file to one file - Added by Somsubhra Chattopadhyay over 8 years ago

I forgot to mention that I am using cdo 1.7.1-cygwin64-dynamic. I tried to unzip and run it several times from the scratch after installing the required cygwin packages but to no avail.

Som

RE: Combining several year of .nc file to one file - Added by Matt Thompson over 8 years ago

Well, it seems like it can't find the dll. If you know where it is, as a test you can copy that dll to the directory where the cdo executable is. That should allow it to find it.

The real solution is you probably have to do something that is the Cygwin equivalent of LD_LIBRARY_PATH: https://cygwin.com/cygwin-ug-net/setup-env.html

    (1-4/4)