Project

General

Profile

cdo remap /remapgrid help

Added by Byman Hamududu over 14 years ago

I would like to remap or remap grid of netcdf files to get the usual lon lat degrees. The netcdf files have a rotated_pole:grid_mapping_name = "rotated_latitude_longitude" ; and I would like have the normal or standard grid system with lon & lat. I am analysing future climate in Southern Africa using these files and for me to map the data correctly I need the standard grid system. I have tried with the 2 operators and remapbil t42grid works but the resulting files are empty(NAs only). I think that I miss some thing somewhere. Please could anyone suggest the approach in cdo. Below is a header for one of the files (as an example)

netcdf PUNGWE_SMHIRCA30_B2_CCSM3_DM_50km_1961-1970_pr {
dimensions:
rlat = 80 ;
rlon = 100 ;
time = UNLIMITED ; // (3650 currently)
bnds = 2 ;
variables:
double lat(rlat, rlon) ;
lat:standard_name = "latitude" ;
lat:long_name = "latitude" ;
lat:units = "degrees_north" ;
double lon(rlat, rlon) ;
lon:standard_name = "longitude" ;
lon:long_name = "longitude" ;
lon:units = "degrees_east" ;
float pr(time, rlat, rlon) ;
pr:_FillValue = 1.e+30f ;
pr:standard_name = "precipitation_flux" ;
pr:long_name = "Precipitation" ;
pr:units = "kg m-2 s-1" ;
pr:coordinates = "lon lat" ;
pr:grid_mapping = "rotated_pole" ;
pr:cell_methods = "time: mean" ;
double rlat(rlat) ;
rlat:long_name = "latitude in rotated pole grid" ;
rlat:units = "degrees" ;
rlat:standard_name = "grid_latitude" ;
rlat:axis = "Y" ;
double rlon(rlon) ;
rlon:long_name = "longitude in rotated pole grid" ;
rlon:units = "degrees" ;
rlon:standard_name = "grid_longitude" ;
rlon:axis = "X" ;
c*har rotated_pole ;
rotated_pole:grid_mapping_name = "rotated_latitude_longitude" ;
rotated_pole:grid_north_pole_latitude = 60. ;
rotated_pole:grid_north_pole_longitude = 10. ;*
double time(time) ;
time:units = "days since 1950-01-01 00:00:00" ;
time:calendar = "365_day" ;
time:standard_name = "time" ;
time:long_name = "time" ;
time:bounds = "time_bnds" ;
time:axis = "T" ;
double time_bnds(time, bnds) ;
// global attributes:
:Conventions = "CF-1.4" ;
:institution = "SMHI, Rossby Centre" ;
:source = "RCA3.0" ;
:comment = "200610: RCA3.0 South Africa (PUNGWE) 50-km CCSM3 B2 L24
_
_Many thanks in advance...

Byman__


Replies (5)

RE: cdo remap /remapgrid help - Added by Uwe Schulzweida over 14 years ago

Dear Byman,
The approach for remapping with CDO is very simple. Here is an example for the bilinear interpolation:

cdo remapbil,targetgrid ifile ofile
So it could be a CDO or data problem, if the input file contains data and the resulting file is empty. To check it we need an example file.
Regards, Uwe

RE: cdo remap /remapgrid help - Added by Byman Hamududu over 14 years ago

Dear Uwe,

Thank you very much for your explanation. Now I know what I missed, its the target grid. Can you indicate to me the format of the targetgrid, i.e. how do I specify it, is it some parameters, is it a file?. I just read in the cdo user guide, but I dont seem to get very clearly, the targetgrid.
Here attached is a small selection of the data file for you to have a look at. I used sellonlatbox to extract a small box (reduced the size) and I check the extracted file & there is data. Strangely cdo can read the standard lon lat degrees when using sellonlatbox but when I use R cran (ncdf.open) to retrieve, the coordinates are somehow different. So I need to just make sure that I am extracting the right boxes in R. Please have a look at the attached file and help if you can

Thanks & waiting

Byman

RE: cdo remap /remapgrid help - Added by Uwe Schulzweida over 14 years ago

Dear Byman,
There are many different possibilities to specify the target grid for the remapping with CDO. Here is one example for a simple global regular 1 degree lonlat grid with an ASCII description file:

cat > mygrid << EOF
gridtype = lonlat
xsize    = 360
ysize    = 180
xfirst   = −179.5
xinc     = 1
yfirst   = -89.5
yinc     = 1
EOF

cdo remapbil,mygrid ifile ofile

Regards, Uwe

RE: cdo remap /remapgrid help - Added by Byman Hamududu over 14 years ago

Dear Uwe

Thank you very much, it worked superbly for me... I will now continue with my analysis... you saved my day

Many thanks

Best regards

Byman

RE: cdo remap /remapgrid help - Added by SANJUKTA RANI PADHI over 6 years ago

Hello uwe,
I am also having problem in substrat two file having different gridsize. How can i use that remapbil for set a gridsize to one of file. How to i creat a ascii file and use it.
Kindly help me. THANK YOU

    (1-5/5)