Project

General

Profile

How to regrid a coarse resolution raster in a finer resolution raster by applying elevation as weight

Added by zakir dahri over 8 years ago

Hi,
I am very new to CDO related stuff. I want to regrid/remap a precipitation from JRA55 dataset to one km resolution by elevation of hydroshed 1 km dem as weight for each coarse grid of the JRA55 datafile. I tried the following options:

cat > grid << EOF
gridtype = lonlat
gridsize = 2318625
xname = g4_lon_2
xlongname = longitude
xunits = degrees_east
yname = g4_lat_1
ylongname = latitude
yunits = degrees_north
xsize = 2025
ysize = 1145
xfirst = 67.223007
xinc = 0.0083333333
yfirst = 38.7477287015
yinc = -0.0083333333
EOF
cdo remapnn,grid 1970.nc 1970rg.nc

it worked perfectly but i want to redistribute the values of JRA55 (1970.nc) file according to the weights of elevations grids within that coarse grid. For this I tried:

cdo gennn,grid hsdem.nc hsdemwts.nc

to generate nearest neighbor remap weights on the above defined grid, and i got new ncfile (hsdemwts.nc). Now I tried

cdo remap,grid,hsdemwts.nc 1970.nc 1970.nc

to the above defined grid. but i got error message that the grid size of weighted file (hsdemwts) and input file (1970.nc) are different. Then I applied

cdo remap,grid,hsdemwts.nc 1970rg.nc 1970rmp.nc

this executed the command but the output file 1970rg.nc and 1970rmp.nc are exactly the same, whereas I want redistributed precipitation values using nearest neighbor interpolator and elevation as redistribution predictor. I am lost now. Can anyone pls help me???
I am attaching the two files 1) original JRA55 precipitation file for 1970 and 2) elevation from hydroshed
Thanks,
Zakir