Project

General

Profile

Help getting n47 Guassian grid that matches NCEP/NCAR Reanalysis grid.

Added by Brendan DeTracey about 2 years ago

Hi all,
I am trying to generate a grid that matches the Gaussian n47 grid used for the NCEP/NCAR Reanalysis. I need to generate interpolation weights to this target grid (but only for the northern hemisphere). However, the cdo n47 grid definition does not match the NCEP/NCAR. I have attached a sample file and ncdumped the lats and lons below. Note that NCEP/NCAR does not include grid cell bounds. :(
Any suggestions on how to use the NCEP/NCAR grid as a target would be helpful. Could I use the setgrid command? How does cdo behave when there are no grid bounds for proper interpolation?

$ ncdump air.2m.gauss.202001.n
netcdf air.2m.gauss.202001 {
dimensions:
        time = UNLIMITED ; // (1 currently)
        bnds = 2 ;
        lon = 192 ;
        lat = 94 ;
        level = 1 ;
variables:
        double time(time) ;
                time:standard_name = "time" ;
                time:long_name = "Time" ;
                time:bounds = "time_bnds" ;
                time:units = "hours since 1800-1-1 00:00:0.0" ;
                time:calendar = "standard" ;
                time:axis = "T" ;
        double time_bnds(time, bnds) ;
        float lon(lon) ;
                lon:standard_name = "longitude" ;
                lon:long_name = "Longitude" ;
                lon:units = "degrees_east" ;
                lon:axis = "X" ;
        float lat(lat) ;
                lat:standard_name = "latitude" ;
                lat:long_name = "Latitude" ;
                lat:units = "degrees_north" ;
                lat:axis = "Y" ;
        float level(level) ;
                level:long_name = "Level" ;
                level:units = "m" ;
                level:positive = "up" ;
                level:axis = "Z" ;
                level:actual_range = 2.f, 2.f ;
                level:coordinate_defines = "point" ;
        float air(time, level, lat, lon) ;
                air:standard_name = "air_temperature" ;
                air:long_name = "daily mean 6-Hourly Forecast of Air temperature at 2 m" ;
                air:units = "degK" ;
                air:CDI_grid_type = "gaussian" ;
                air:CDI_grid_num_LPE = 47 ;
                air:_FillValue = -9.96921e+36f ;
                air:missing_value = -9.96921e+36f ;
                air:precision = 2s ;
                air:least_significant_digit = 1s ;
                air:GRIB_id = 11s ;
                air:GRIB_name = "TMP" ;
                air:var_desc = "Air temperature" ;
                air:dataset = "NCEP/DOE AMIP-II Reanalysis (Reanalysis-2) Daily Averages" ;
                air:level_desc = "2 m" ;
                air:statistic = "Mean" ;
                air:parent_stat = "Individual Obs" ;
                air:actual_range = 186.3825f, 317.77f ;

// global attributes:
                :CDI = "Climate Data Interface version 1.9.10 (https://mpimet.mpg.de/cdi)" ;
                :Conventions = "CF-1.0" ;
                :source = "NCEP/DOE AMIP-II Reanalysis (Reanalysis-2) Model" ;
                :institution = "National Centers for Environmental Prediction" ;
                :title = "mean Daily NCEP/DOE Reanalysis 2" ;
                :comments = "Data is from \n",
                        "NCEP/DOE AMIP-II Reanalysis (Reanalysis-2)\n",
                        "(4x/day).  Data interpolated from model (sigma) surfaces to gaussian grid." ;
                :platform = "Model" ;
                :dataset_title = "NCEP-DOE AMIP-II Reanalysis" ;
                :References = "https://www.psl.noaa.gov/data/gridded/data.ncep.reanalysis2.html" ;
                :source_url = "http://www.cpc.ncep.noaa.gov/products/wesley/reanalysis2/" ;
                :history = "Mon Nov 14 08:38:18 2022: cdo seltimestep,1 air.2m.gauss.2020.nc air.2m.gauss.202001.nc\n",
                        "Wed Feb  3 16:19:33 2021: ncks -O -3 air.2m.gauss.2020.nc air.2m.gauss.2020.nc.1\n",
                        "created 2020/02 by NOAA/ESRL/PSD\n",
                        "Converted to chunked, deflated non-packed NetCDF4 2020/05" ;
                :NCO = "4.4.2" ;
                :CDO = "Climate Data Operators version 1.9.10 (https://mpimet.mpg.de/cdo)" ;
data:

 time = 1928472 ;

 time_bnds =
  1928472, 1928496 ;

 lon = 0, 1.875, 3.75, 5.625, 7.5, 9.375, 11.25, 13.125, 15, 16.875, 18.75,
    20.625, 22.5, 24.375, 26.25, 28.125, 30, 31.875, 33.75, 35.625, 37.5,
    39.375, 41.25, 43.125, 45, 46.875, 48.75, 50.625, 52.5, 54.375, 56.25,
    58.125, 60, 61.875, 63.75, 65.625, 67.5, 69.375, 71.25, 73.125, 75,
    76.875, 78.75, 80.625, 82.5, 84.375, 86.25, 88.125, 90, 91.875, 93.75,
    95.625, 97.5, 99.375, 101.25, 103.125, 105, 106.875, 108.75, 110.625,
    112.5, 114.375, 116.25, 118.125, 120, 121.875, 123.75, 125.625, 127.5,
    129.375, 131.25, 133.125, 135, 136.875, 138.75, 140.625, 142.5, 144.375,
    146.25, 148.125, 150, 151.875, 153.75, 155.625, 157.5, 159.375, 161.25,
    163.125, 165, 166.875, 168.75, 170.625, 172.5, 174.375, 176.25, 178.125,
    180, 181.875, 183.75, 185.625, 187.5, 189.375, 191.25, 193.125, 195,
    196.875, 198.75, 200.625, 202.5, 204.375, 206.25, 208.125, 210, 211.875,
    213.75, 215.625, 217.5, 219.375, 221.25, 223.125, 225, 226.875, 228.75,
    230.625, 232.5, 234.375, 236.25, 238.125, 240, 241.875, 243.75, 245.625,
    247.5, 249.375, 251.25, 253.125, 255, 256.875, 258.75, 260.625, 262.5,
    264.375, 266.25, 268.125, 270, 271.875, 273.75, 275.625, 277.5, 279.375,
    281.25, 283.125, 285, 286.875, 288.75, 290.625, 292.5, 294.375, 296.25,
    298.125, 300, 301.875, 303.75, 305.625, 307.5, 309.375, 311.25, 313.125,
    315, 316.875, 318.75, 320.625, 322.5, 324.375, 326.25, 328.125, 330,
    331.875, 333.75, 335.625, 337.5, 339.375, 341.25, 343.125, 345, 346.875,
    348.75, 350.625, 352.5, 354.375, 356.25, 358.125 ;

 lat = 88.542, 86.6531, 84.7532, 82.8508, 80.9473, 79.0435, 77.1394, 75.2351,
    73.3307, 71.4262, 69.5217, 67.6171, 65.7125, 63.8079, 61.9033, 59.9986,
    58.0939, 56.1893, 54.2846, 52.3799, 50.4752, 48.5705, 46.6658, 44.7611,
    42.8564, 40.9517, 39.047, 37.1422, 35.2375, 33.3328, 31.4281, 29.5234,
    27.6186, 25.7139, 23.8092, 21.9044, 19.9997, 18.095, 16.1902, 14.2855,
    12.3808, 10.47604, 8.57131, 6.66657, 4.76184, 2.8571, 0.952368,
    -0.952368, -2.8571, -4.76184, -6.66657, -8.57131, -10.47604, -12.3808,
    -14.2855, -16.1902, -18.095, -19.9997, -21.9044, -23.8092, -25.7139,
    -27.6186, -29.5234, -31.4281, -33.3328, -35.2375, -37.1422, -39.047,
    -40.9517, -42.8564, -44.7611, -46.6658, -48.5705, -50.4752, -52.3799,
    -54.2846, -56.1893, -58.0939, -59.9986, -61.9033, -63.8079, -65.7125,
    -67.6171, -69.5217, -71.4262, -73.3307, -75.2351, -77.1394, -79.0435,
    -80.9473, -82.8508, -84.7532, -86.6531, -88.542 ;
    76.875, 78.75, 80.625, 82.5, 84.375, 86.25, 88.125, 90, 91.875, 93.75,
    95.625, 97.5, 99.375, 101.25, 103.125, 105, 106.875, 108.75, 110.625,
    112.5, 114.375, 116.25, 118.125, 120, 121.875, 123.75, 125.625, 127.5,
    129.375, 131.25, 133.125, 135, 136.875, 138.75, 140.625, 142.5, 144.375,
    146.25, 148.125, 150, 151.875, 153.75, 155.625, 157.5, 159.375, 161.25,
    163.125, 165, 166.875, 168.75, 170.625, 172.5, 174.375, 176.25, 178.125,
    180, 181.875, 183.75, 185.625, 187.5, 189.375, 191.25, 193.125, 195,
    196.875, 198.75, 200.625, 202.5, 204.375, 206.25, 208.125, 210, 211.875,
    213.75, 215.625, 217.5, 219.375, 221.25, 223.125, 225, 226.875, 228.75,
    230.625, 232.5, 234.375, 236.25, 238.125, 240, 241.875, 243.75, 245.625,
    247.5, 249.375, 251.25, 253.125, 255, 256.875, 258.75, 260.625, 262.5,
    264.375, 266.25, 268.125, 270, 271.875, 273.75, 275.625, 277.5, 279.375,
    281.25, 283.125, 285, 286.875, 288.75, 290.625, 292.5, 294.375, 296.25,
    298.125, 300, 301.875, 303.75, 305.625, 307.5, 309.375, 311.25, 313.125,
    315, 316.875, 318.75, 320.625, 322.5, 324.375, 326.25, 328.125, 330,
    331.875, 333.75, 335.625, 337.5, 339.375, 341.25, 343.125, 345, 346.875,
    348.75, 350.625, 352.5, 354.375, 356.25, 358.125 ;

 lat = 88.542, 86.6531, 84.7532, 82.8508, 80.9473, 79.0435, 77.1394, 75.2351,
    73.3307, 71.4262, 69.5217, 67.6171, 65.7125, 63.8079, 61.9033, 59.9986,
    58.0939, 56.1893, 54.2846, 52.3799, 50.4752, 48.5705, 46.6658, 44.7611,
    42.8564, 40.9517, 39.047, 37.1422, 35.2375, 33.3328, 31.4281, 29.5234,
    27.6186, 25.7139, 23.8092, 21.9044, 19.9997, 18.095, 16.1902, 14.2855,
    12.3808, 10.47604, 8.57131, 6.66657, 4.76184, 2.8571, 0.952368,
    -0.952368, -2.8571, -4.76184, -6.66657, -8.57131, -10.47604, -12.3808,
    -14.2855, -16.1902, -18.095, -19.9997, -21.9044, -23.8092, -25.7139,
    -27.6186, -29.5234, -31.4281, -33.3328, -35.2375, -37.1422, -39.047,
    -40.9517, -42.8564, -44.7611, -46.6658, -48.5705, -50.4752, -52.3799,
    -54.2846, -56.1893, -58.0939, -59.9986, -61.9033, -63.8079, -65.7125,
    -67.6171, -69.5217, -71.4262, -73.3307, -75.2351, -77.1394, -79.0435,
    -80.9473, -82.8508, -84.7532, -86.6531, -88.542 ;
...}

These do not match the grid centers from the built-it cdo n47.
$ cdo -f nc topo,n47 test.nc
$ ncdump test.nc
netcdf test {
dimensions:
        lon = 188 ;
        lat = 94 ;
variables:
        double lon(lon) ;
                lon:standard_name = "longitude" ;
                lon:long_name = "longitude" ;
                lon:units = "degrees_east" ;
                lon:axis = "X" ;
        double lat(lat) ;
                lat:standard_name = "latitude" ;
                lat:long_name = "latitude" ;
                lat:units = "degrees_north" ;
                lat:axis = "Y" ;
        float topo(lat, lon) ;
                topo:units = "m" ;
                topo:CDI_grid_type = "gaussian" ;
                topo:CDI_grid_num_LPE = 47 ;

// global attributes:
                :CDI = "Climate Data Interface version 1.9.10 (https://mpimet.mpg.de/cdi)" ;
                :Conventions = "CF-1.6" ;
                :history = "Mon Nov 14 08:44:14 2022: cdo -f nc topo,n47 test.nc" ;
                :CDO = "Climate Data Operators version 1.9.10 (https://mpimet.mpg.de/cdo)" ;
data:

 lon = 0, 1.91489361702128, 3.82978723404255, 5.74468085106383,
    7.65957446808511, 9.57446808510638, 11.4893617021277, 13.4042553191489,
    15.3191489361702, 17.2340425531915, 19.1489361702128, 21.063829787234,
    22.9787234042553, 24.8936170212766, 26.8085106382979, 28.7234042553191,
    30.6382978723404, 32.5531914893617, 34.468085106383, 36.3829787234043,
    38.2978723404255, 40.2127659574468, 42.1276595744681, 44.0425531914894,
    45.9574468085106, 47.8723404255319, 49.7872340425532, 51.7021276595745,
    53.6170212765958, 55.531914893617, 57.4468085106383, 59.3617021276596,
    61.2765957446809, 63.1914893617021, 65.1063829787234, 67.0212765957447,
    68.936170212766, 70.8510638297872, 72.7659574468085, 74.6808510638298,
    76.5957446808511, 78.5106382978723, 80.4255319148936, 82.3404255319149,
    84.2553191489362, 86.1702127659574, 88.0851063829787, 90,
    91.9148936170213, 93.8297872340426, 95.7446808510638, 97.6595744680851,
    99.5744680851064, 101.489361702128, 103.404255319149, 105.31914893617,
    107.234042553192, 109.148936170213, 111.063829787234, 112.978723404255,
    114.893617021277, 116.808510638298, 118.723404255319, 120.63829787234,
    122.553191489362, 124.468085106383, 126.382978723404, 128.297872340426,
    130.212765957447, 132.127659574468, 134.042553191489, 135.957446808511,
    137.872340425532, 139.787234042553, 141.702127659574, 143.617021276596,
    145.531914893617, 147.446808510638, 149.36170212766, 151.276595744681,
    153.191489361702, 155.106382978723, 157.021276595745, 158.936170212766,
    160.851063829787, 162.765957446809, 164.68085106383, 166.595744680851,
    168.510638297872, 170.425531914894, 172.340425531915, 174.255319148936,
    176.170212765957, 178.085106382979, 180, 181.914893617021,
    183.829787234043, 185.744680851064, 187.659574468085, 189.574468085106,
    191.489361702128, 193.404255319149, 195.31914893617, 197.234042553192,
    199.148936170213, 201.063829787234, 202.978723404255, 204.893617021277,
    206.808510638298, 208.723404255319, 210.63829787234, 212.553191489362,
    214.468085106383, 216.382978723404, 218.297872340426, 220.212765957447,
    222.127659574468, 224.042553191489, 225.957446808511, 227.872340425532,
    229.787234042553, 231.702127659574, 233.617021276596, 235.531914893617,
    237.446808510638, 239.36170212766, 241.276595744681, 243.191489361702,
    245.106382978723, 247.021276595745, 248.936170212766, 250.851063829787,
    252.765957446809, 254.68085106383, 256.595744680851, 258.510638297872,
    260.425531914894, 262.340425531915, 264.255319148936, 266.170212765957,
    268.085106382979, 270, 271.914893617021, 273.829787234043,
    275.744680851064, 277.659574468085, 279.574468085106, 281.489361702128,
    283.404255319149, 285.31914893617, 287.234042553192, 289.148936170213,
    291.063829787234, 292.978723404255, 294.893617021277, 296.808510638298,
    298.723404255319, 300.63829787234, 302.553191489362, 304.468085106383,
    306.382978723404, 308.297872340426, 310.212765957447, 312.127659574468,
    314.042553191489, 315.957446808511, 317.872340425532, 319.787234042553,
    321.702127659575, 323.617021276596, 325.531914893617, 327.446808510638,
    329.36170212766, 331.276595744681, 333.191489361702, 335.106382978723,
    337.021276595745, 338.936170212766, 340.851063829787, 342.765957446809,
    344.68085106383, 346.595744680851, 348.510638297872, 350.425531914894,
    352.340425531915, 354.255319148936, 356.170212765957, 358.085106382979 ;

 lat = 88.5419501372975, 86.6531671712612, 84.7532299278375,
    82.8507724666685, 80.9473590380955, 79.0434830262188, 77.1393485086043,
    75.2350550220443, 73.3306568580251, 71.4261861337297, 69.5216630592775,
    67.6171009860561, 65.7125090882981, 63.8078938782031, 61.9032601063951,
    59.9986113201436, 58.0939502220327, 56.1892789076074, 54.2845990270979,
    52.3799118980861, 50.4752185856401, 48.5705199603727, 46.6658167412099,
    44.7611095273708, 42.8563988226079, 40.9516850538099, 39.0469685854431,
    37.1422497308786, 35.2375287613668, 33.33280591321, 31.4280813935466,
    29.523355385052, 27.6186280497899, 25.7138995323903, 23.8091699626917,
    21.9044394579537, 19.9997081247232, 18.0949760604204, 16.1902433546966,
    14.285510090607, 12.3807763456323, 10.4760421925768, 8.57130770036727,
    6.6665729347709, 4.76183795905, 2.85710283456696, 0.952367621352339,
    -0.952367621352339, -2.85710283456696, -4.76183795905, -6.6665729347709,
    -8.57130770036727, -10.4760421925768, -12.3807763456323,
    -14.285510090607, -16.1902433546966, -18.0949760604204,
    -19.9997081247232, -21.9044394579537, -23.8091699626917,
    -25.7138995323903, -27.6186280497899, -29.523355385052,
    -31.4280813935466, -33.33280591321, -35.2375287613668, -37.1422497308786,
    -39.0469685854431, -40.9516850538099, -42.8563988226079,
    -44.7611095273708, -46.6658167412099, -48.5705199603727,
    -50.4752185856401, -52.3799118980861, -54.2845990270979,
    -56.1892789076074, -58.0939502220327, -59.9986113201436,
    -61.9032601063951, -63.8078938782031, -65.7125090882981,
    -67.6171009860561, -69.5216630592775, -71.4261861337297,
    -73.3306568580251, -75.2350550220443, -77.1393485086043,
    -79.0434830262188, -80.9473590380955, -82.8507724666685,
    -84.7532299278375, -86.6531671712612, -88.5419501372975 ;

 topo =
...}
<pre>


Replies (2)

RE: Help getting n47 Guassian grid that matches NCEP/NCAR Reanalysis grid. - Added by Uwe Schulzweida about 2 years ago

Yes, you can use setgrid. If the bounds are needed they will be computed from the center coordinates. The bounds are then the mean values of the center points and the min/max values are -90/90 degrees.

    (1-2/2)