Project

General

Profile

Interpolate a field and put it in an existing netcdf file

Added by Sébastien Barthélémy 6 months ago

Hello,

I have two netcdf files that have the same attributes and fields but at two different horizontal resolutions (the vertical resolution is the same). We call these two files HR.nc and LR.nc. I would like to interpolate the high-resolution fields of HR.nc and replace the low-resolution fields of LR.nc with the interpolated fields from HR.nc. At first I tried the following:

cdo -remapbic,$grid_file -selname,$vars HR.nc LR.nc

But the problem is that the file LR.nc is replaced by a new file that contains all the interpolated fields, but it does not contain all the non interpolated variables that were in the original file. Is there an option or a way to do what I would like to do?

Thanks for your help!
Sébastien


Replies (1)

RE: Interpolate a field and put it in an existing netcdf file - Added by Karin Meier-Fleischer 6 months ago

Hi Sebastien,

it is not clear what you want to do?

1. remap the data of the LR.nc file to the grid of HR.nc

cdo -remapbil,HR.nc LR.nc outfile.nc

2. remap the data of the HR.nc file to the grid of LR.nc

cdo -remapbil,LR.nc HR.nc outfile.nc
    (1-1/1)