Project

General

Profile

lcc grid description

Added by Pere Quintana about 8 years ago

Hello,

I'm new to cdo and I found a problem with a custom grid I'm using.

I want to regrid a datafile which, originally, is in a custom lcc grid.

cdo remapbil doesn't work (Grid type >generic< unsupported!) and I, as far as I understand, there is the possibility to tell to CDO how my grid is done, but I don't know how to build the grid description file.

The Proj4 string for my grid is:
+proj=lcc +lat_1=30 +lat_2=60 +lat_0=39.7755394 +lon_0=-3 +x_0=0 +y_0=0 +a=6370997 +b=6370997 +units=m +no_defs

An example file is attached.

Is it possible to create a grid description file that cdo can understand?

Thank you,

Pere


Replies (2)

RE: lcc grid description - Added by Jaison-Thomas Ambadan about 8 years ago

try something like:

cat > mygrid <<EOF
gridtype  = lcc2
gridsize  = 90000
xname     = x
xlongname = x coordinate of projection
xunits    = m
yname     = y
ylongname = y coordinate of projection
yunits    = m
xsize     = 300
ysize     = 300
a         = 6370997
lon_0     = -3
lat_0     = 39.7755394
lat_1     = 30
lat_2     = 60
xfirst    = -747500
xinc      = 5000
yfirst    = -746118
yinc      = 5000
EOF

then use

cdo -setgrid,mygrid safran-Downward_Shortwave_Radiation-12h-short-timmean.nc ifle.nc

you may have to set setgridtype,curvilinear before the remapbil operator

RE: lcc grid description - Added by Pere Quintana about 8 years ago

Thank you for your complete answer Jaison!

I tried what you said, but without success.

I created the mygrid file, as you suggested.

Then I tried:

cdo -remapbil,grid safran-Downward_Shortwave_Radiation-12h-short-timmean-with-grid.nc safran-Downward_Shortwave_Radiation-12h-short-timmean-with-grid-eragrid.nc

where grid is a file that contains the information of the destination grid (ERA-Interim).

And I got the following error.

cdo remapbil (Abort): Unsupported grid type: lcc2

As you also suggested, I tried to use setgridtype,curvilinear

cdo -setgridtype,curvilinear safran-Downward_Shortwave_Radiation-12h-short-timmean-with-grid.nc ifle.nc

But, the version of cdo I'm using doesn't have the proj4 options.

cdo setgridtype (Abort): proj4 support not compiled in!

I'm using cdo 1.7.0.

cdo --version
Climate Data Operators version 1.7.0 (http://mpimet.mpg.de/cdo)

Maybe I didn't compile it with the right options.

Before trying to install it again, do you think that compiling it with support for proj4 would be enough?

Thanks!

    (1-2/2)