asheef_ik
asheef_ik

Reputation: 43

Merging netCDF files in anaconda prompt using NCO?

i am really at a loss about how to merge netcdf files of different times in windows 10, especially merging all nc files in folder. Usually in my ubuntu system i use CDO and the code cdo mergetime *.nc output.nc and that does the job. Unfortunately, in windows, that's a whole different case for me. I went through these websites for solutions:

  1. http://dvalts.io/data/modelling/2018/01/16/NetCDF-merging.html
  2. http://wiki.seas.harvard.edu/geos-chem/index.php/Working_with_netCDF_data_files
  3. Combine multiple NetCDF files into timeseries multidimensional array python

Utilizing codes mentioned there, i came through diversity of errors, these are some the of the codes i ran, which i embedded as image titles, after running them i got these errors:

ncecat ssh_global-reanalysis-phy-001-030-daily_1993-2013.nc ssh_global-reanalysis-phy-001-030-daily_2014-18.nc -O precip_all.nc

ncecat -hO ssh_global-reanalysis-phy-001-030-daily_1993-2013.nc ssh_global-reanalysis-phy-001-030-daily_2014-18.nc -O precip_all.nc

ncecat *.nc -O merged.nc

ncecat *nc -O merged.nc

This is probably happening cause my programming knowledge is very basic. Should i try running the codes in jupyter notebook or maybe spyder ? I would be really grateful if someone takes a look at this and refer me a possible solutions and help me merging netcf files with nco in windows.

this is the version i am using for nco

Upvotes: 1

Views: 996

Answers (2)

ClimateUnboxed
ClimateUnboxed

Reputation: 8077

Under windows 10, it is now really easy to install ubuntu as a full subsystem, and then you can use your CDO methods completely as usual. You get a terminal then which is full ubuntu, and can install CDO as usual with sudo apt-get install (i.e. not a wineserver or cygwin). Just google "install ubuntu in windows 10" and you will find numerous guides with the steps to follow.

Upvotes: 1

Charlie Zender
Charlie Zender

Reputation: 6322

First, if you are trying to concatentate along the time dimension, use ncrcat not ncecat. In any case, it appears you are attempting to provide the input list using shell wildcards (i.e. *.nc) that do not work in Windows DOS shells. Try instead explicitly specifying the input filenames (e.g., 1.nc 2.nc 3.nc). It's not ideal because globbing or using standar input would be easier. One way to avoid having to explicitly specify input filenames on Windows is to use filename patterns from which NCO can construct the input list itself. This and other methods are documented here. Also, based on the error messages you received, you should first unpack (with 'ncpdq -U in.nc out.nc') the input files before attempting to concatenate them.

Upvotes: 2

Related Questions