Project

General

Profile

Shift in longitude

Added by Lina Teckentrup over 1 year ago

Hi,

I'm trying to calculate an ensemble mean over several models. When I try this, it is obvious that there is a shift in longitudes despite the fact that the grid information is identical (ncdump -v,lat and ncdump -v,lon also gives the same values). The grid for file1 is

#
# gridID 1
#
gridtype  = gaussian
gridsize  = 8192
xsize     = 128
ysize     = 64
xname     = lon
xlongname = "longitude" 
xunits    = "degrees" 
yname     = lat
ylongname = "latitude" 
yunits    = "degrees" 
numLPE    = 32
xfirst    = -180
xinc      = 2.8125
yvals     = -87.8638 -85.09653 -82.31291 -79.5256 -76.7369 -73.94752 -71.15775 -68.36776 
            -65.57761 -62.78735 -59.99702 -57.20663 -54.4162 -51.62573 -48.83524 
            -46.04473 -43.2542 -40.46365 -37.67309 -34.88252 -32.09195 -29.30136 
            -26.51077 -23.72017 -20.92957 -18.13897 -15.34836 -12.55776 -9.767145 
            -6.976533 -4.18592 -1.395307 1.395307 4.18592 6.976533 9.767145 12.55776 
            15.34836 18.13897 20.92957 23.72017 26.51077 29.30136 32.09195 34.88252 
            37.67309 40.46365 43.2542 46.04473 48.83524 51.62573 54.4162 57.20663 
            59.99702 62.78735 65.57761 68.36776 71.15775 73.94752 76.7369 79.5256 
            82.31291 85.09653 87.8638

The grid information for file 2

#
# gridID 1
#
gridtype  = gaussian
gridsize  = 8192
xsize     = 128
ysize     = 64
xname     = lon
xlongname = "longitude" 
xunits    = "degrees" 
yname     = lat
ylongname = "latitude" 
yunits    = "degrees" 
numLPE    = 32
xfirst    = -180
xinc      = 2.8125
yvals     = -87.8638 -85.09653 -82.31291 -79.5256 -76.7369 -73.94752 -71.15775 -68.36776 
            -65.57761 -62.78735 -59.99702 -57.20663 -54.4162 -51.62573 -48.83524 
            -46.04473 -43.2542 -40.46365 -37.67309 -34.88252 -32.09195 -29.30136 
            -26.51077 -23.72017 -20.92957 -18.13897 -15.34836 -12.55776 -9.767145 
            -6.976533 -4.18592 -1.395307 1.395307 4.18592 6.976533 9.767145 12.55776 
            15.34836 18.13897 20.92957 23.72017 26.51077 29.30136 32.09195 34.88252 
            37.67309 40.46365 43.2542 46.04473 48.83524 51.62573 54.4162 57.20663 
            59.99702 62.78735 65.57761 68.36776 71.15775 73.94752 76.7369 79.5256 
            82.31291 85.09653 87.8638

I attached a figure of the resulting ensemble mean and both files. How can I fix this problem? I tried sellonlatbox,-180,180,-90,90, and setgrid/ or remapping file1, none of it worked. I'm using CDO version 2.0.5.

Thanks,
Lina


Replies (1)

RE: Shift in longitude - Added by Ralf Mueller over 1 year ago

hi!

my first analysis is, that the data in file1 is on the wrong location.

So I fixed file1 with

cdo setgrid,g1 file1.nc f1-fixed.nc
with g1 being a changed version of the initial grid description (changes xfirst = 0)

Another thing is that one file uses missing values on ocean locations and the other files has zeros. so you will have trouble comparing those two.

so long ...
ralf

fFire_in_file1.png (188 KB) fFire_in_file1.png
g1 (968 Bytes) g1 fixed griddes file of file1
f1-fixed.nc (95.7 KB) f1-fixed.nc fixed version of file1
    (1-1/1)