Contatenating .nc4 files with ncrcat

47 Views Asked by At

I have two CMIP5 .nc4 files containing daily precipitation data but for different years. I want to combine the two files into one using nco. They contain the same variables and information, it's just the time stamp that differs.

I've installed nco on a Windows system using Anaconda, but I'm a coding noob and therefore struggling to figure out how to use the simple command: ncrcat file1.nc4 file2.nc4 out

I've tried the code below on Anaconda Terminal: ncrcat C:\Users\Admin\Documents\pr_day_rcp60_20060101_20101231.nc4 C:\Users\Admin\Documents\pr_day_rcp60_20110101_20201231.nc4 C:\Users\Admin\Documents\combine_pr.nc4

But receive the following error message: "ncrcat: ERROR file C:/Users/Admin/Documents/pr_day_rcp60_20060101_20101231.nc4 not found. It does not exist on the local filesystem, nor does it match remote filename patterns (e.g., http://foo or foo.bar.edu:file). ncrcat: HINT file-not-found errors usually arise from filename typos, incorrect paths, missing files, or capricious gods. Please verify spelling and location of requested file. If the file resides on a High Performance Storage System (HPSS) accessible via the 'hsi' command, then add the --hpss option and re-try command."

I've also tried the following using a Jupyter Notebook, but the following code results in a syntax error for the 4th line.

output_file = "C:/Users/Admin/Documents/combine_pr.nc4" input_file1 = "C:/Users/Admin/Documents/pr_day_rcp60_20060101_20101231.nc4" input_file2 = "C:/Users/Admin/Documents/pr_day_rcp60_20110101_20201231.nc4" ncrcat file1.nc4 file2.nc4 out

What am I doing wrong?

0

There are 0 best solutions below