Project

General

Profile

regridding with only lat and plev dimensions

Added by Jan Streffing about 4 years ago

I would like to regrid epflux that I saved from ncl. The file contains only lat and plev dimensions. It has 480 lat values and I need to to have 160 to compare the epflux with a lower resolution run.
Is this possible with cdo? I've been unable to use the griddes.nc that I generated from the lower resoltion file:

cdo remapbil,griddes.nc epf_16_ensmean.nc epf_16_ensmean_remap.nc

Error (gridDefine): xsize undefined!

Here is what the file looks like:

ncdump -h epf_16_ensmean.nc 
netcdf epf_16_ensmean {
dimensions:
    time = UNLIMITED ; // (12 currently)
    lat = 480 ;
    plev = 13 ;
variables:
    double time(time) ;
        time:standard_name = "time" ;
        time:units = "hours since 2000-6-1 00:00:00" ;
        time:calendar = "proleptic_gregorian" ;
        time:axis = "T" ;
    double lat(lat) ;
        lat:standard_name = "latitude" ;
        lat:long_name = "latitude" ;
        lat:units = "degrees_north" ;
        lat:axis = "Y" ;
    double plev(plev) ;
        plev:standard_name = "air_pressure" ;
        plev:long_name = "pressure" ;
        plev:units = "Pa" ;
        plev:positive = "down" ;
        plev:axis = "Z" ;
    double Fphi(time, plev, lat) ;
        Fphi:long_name = "Meridional EP Flux: scaled by sqrt(P0/plvl)" ;
        Fphi:_FillValue = 9.96920996838687e+36 ;
        Fphi:missing_value = 9.96920996838687e+36 ;
        Fphi:tag = "magnification factor at <= 100 hPa: magf=5" ;
    double Fp(time, plev, lat) ;
        Fp:long_name = "Vertical EP Flux: scaled by sqrt(P0/plvl)" ;
        Fp:_FillValue = 9.96920996838687e+36 ;
        Fp:missing_value = 9.96920996838687e+36 ;
        Fp:tag = "magnification factor at <= 100 hPa: magf=5" ;
    double EPdiv(time, plev, lat) ;
        EPdiv:long_name = "EP flux divergence" ;
        EPdiv:_FillValue = 9.96920996838687e+36 ;
        EPdiv:missing_value = 9.96920996838687e+36 ;
    double dudt(time, plev, lat) ;
        dudt:long_name = "acceleration of zonal wind" ;
        dudt:units = "m/s2" ;
        dudt:_FillValue = 9.96920996838687e+36 ;
        dudt:missing_value = 9.96920996838687e+36 ;

// global attributes:
        :CDI = "Climate Data Interface version 1.9.5 (http://mpimet.mpg.de/cdi)" ;
        :Conventions = "None" ;


Replies (1)

RE: regridding with only lat and plev dimensions - Added by Karin Meier-Fleischer about 4 years ago

Hi Jan,

here is a way to add the missing x-axis (one value) to the file but maybe there is a better solution.

Create a grid description file:

cat << EOF > gridfile.txt
gridtype  = lonlat
gridsize  = 480
xsize     = 1
xlongname = "longitude" 
xunits    = "degrees_east" 
xname     = lon
xdimname  = "X" 
xvals     = 0.0
ysize     = 480
yname     = lat
ylongname = "latitude" 
yunits    = "degrees_north" 
ydimname  = "Y" 
yfirst    = -89.8125
yinc      = 0.375
EOF

Set to new grid:

cdo -setgrid,gridfile.txt epf_11_ensmean.nc tmp.nc

Re-order the dimensions (time,plev,lat,lon) using ncpdq from NCO:

ncpdq -a time,plev,lat,lon tmp.nc epf_11_ensmean_with_xaxis.nc

-Karin

    (1-1/1)