0

I can change the resolution of a netCDF file to a coarser one by doing something like this:

ncks --dmn lon,0,1384,5 --dmn lat,0,583,4 original.nc reduced.nc

How do I go the other way? I.e. change resolution of coarser scale netCDF to finer scale?

ClimateUnboxed
  • 7,106
  • 3
  • 41
  • 86
user308827
  • 21,227
  • 87
  • 254
  • 417

2 Answers2

3

Increasing resolution with NCO requires regridding, available in NCO 4.5.1+. This currently requires you have a SCRIP/ESMF-compliant mapfile, which can be generated from SCRIP-compliant gridfiles with, e.g., ESMF_RegridWeightGen. You would need to install ESMF, a simple package on many free OS's, e.g., on MacPorts 'port install esmf'.

Charlie Zender
  • 5,929
  • 14
  • 19
3

you can use the remapping facilities in cdo

cdo remapcon,gridfile.txt in.nc out.nc 

You need to specify a grid description in the gridfile.txt file, e.g. containing the first lat/lon, number of points and the increment:

gridtype = lonlat
xsize = nlon
ysize = nlat
xfirst = lon1
xinc = dlon
yfirst = lat1
yinc = dlat

or you can also set the grid specification directly

cdo remapcon,grid-specification in.nc out.nc 

so to remap to a regular 720 by 360 lon-lat grid you can do

cdo remapcon,r720x360 in.nc out.nc

Note that the "con" in "remapcon" stands for "conservative" remapping. There are other remapping options available, such as 2nd order conservative remapping (remapcon2), bilinear interpolation (remapbil), nearest neighbour remapping (remapnn) and more... see the documention for further details:

https://code.mpimet.mpg.de/projects/cdo/embedded/index.html

ClimateUnboxed
  • 7,106
  • 3
  • 41
  • 86