Home

Awesome

SeaDataCloud

Tools and interfaces to work with DIVA interpolation software tool.

Re-gridding

Re-gridding is the action of interpolation a field from a grid to another grid, usually with a higher resolution.
nco provides a tool ncremap for this purpose.

Installation

  1. Download and compile ESMF
  2. Download a recent version of nco.

Usage

ncremap -i data.nc -d grid.nc -o data_regridded.nc

where:

The grid file looks like:

dimensions:
	longitude = 851 ;
	latitude = 321 ;
variables:
	float longitude(longitude) ;
		longitude:units = "degrees east" ;
	float latitude(latitude) ;
		latitude:units = "degrees north" ;
}

Note that the input file needs to have lon and lat as coordinates. If that's not te case, one can always use ncrename, for instance:

ncrename -d x,lon -v x,lon in.nc

Troubleshooting

NetCDF

If you get errors related to netCDF, define the environment variables as in:
http://www.earthsystemmodeling.org/esmf_releases/last_built/ESMF_usrdoc/node9.html#SECTION00093200000000000000

Grid file

It seems that the dimensions should be named longitude and latitude, otherwise the result is strange.