Project

General

Profile

cdo remap: in appropriate remap of variables

Added by Dennis Shea almost 14 years ago

The following is not a major issue for us. However, I thought the cdo developers might be interested in the following the issue.
---
The atmospheric component [CAM] for the CESM currently uses a finite volume dynamical core with approximately 0.25 degree resolution. An ncdump -h looks like

netcdf CAM_025d.sample.h0.1985-01 {
dimensions:
time = UNLIMITED ; // (1 currently)
lat = 768 ; <====
lon = 1152 ; <====
lev = 26 ;
slat = 767 ; <==== staggard
slon = 1152 ; <==== staggard
ilev = 27 ;
tbnd = 2 ;
[snip]
double lat(lat) ; <==== [ -90 .. 90]
double lon(lon) ; <==== [ 0 .. 359.6875]
double slat(slat) ; <==== [-89.88 .. 89.88]
double slon(slon) ; <==== [-0.15625 .. 359.53125]

Many variables are output. Most variables are dimensioned (time,lat,lon) or (time,mlev/ilev,lat,lon). Two variables are exceptions: US and VS. They are on a staggard grid.

I used the following to create conservative remapping weights:

cdo gencon,r360x180 CAM_025d.sample.h0.1985-01.nc SCRIP_025d_to_r360x180.nc

As noted in the documentation if multiple grids are on the input file, the CDO will generate weights for the first grid encountered. Here that
is the (... lat,lon) grid. This is fine for our purposes. I then applied the weights via

cdo remap,r360x180,SCRIP_025d_to_r360x180.nc CAM_025d.sample.h0.1985-01.nc CAM_r360x180.sample.h0.1985-01.nc

---
The variables US and VS which are not on (lat,lon) grid are interpolated: US and
VS. In my opinion, variables that are not the (lat,lon) grid should not be interpolated. Not sure if there is a simple general solution. One approach would be to look at the "src_grid_size" on the weight file [here, src_grid_size=884736] and the compare with
the variable being remapped. If (768*1152=884736) then remap; if it does not match do not remap. So for US the size does not match (767*1152=883584)
so skip US.
---
If interested, I created a small sub sample of the original CAM output file; the weight file; and the interpolated output at

ftp ftp.cgd.ucar.edu
anonymous
email
cd /ftp/pub/shea/AMWGD
prompt
mget *nc
quit

463517380 Jan 19 10:18 CAM_025d.sample.h0.1985-01.nc         sub sample
33964032 Jan 19 11:24 CAM_r360x180.sample.h0.1985-01.nc 1x1
140775200 Jan 19 11:23 SCRIP_025d_to_r360x180.nc wgt file

Replies (1)

RE: cdo remap: in appropriate remap of variables - Added by Uwe Schulzweida almost 14 years ago

Hi Dennis,

The idea is that

cdo gencon,targetgrid  ifile  weights.nc
cdo remap,targetgrid,weights.nc  ifile ofile
have to give the same result as
cdo remapcon,targetgrid  ifile ofile
Also if the inputfile contains data on different grids. The consequence is that remap reads the weights of one grid and will compute all other weights if necessary. I think this is not clear documented, so I will try to improve that.
Thanks for this report!

Best regards,
Uwe

    (1-1/1)