netcdf rotated lat-lon grid

Berny Bisselink berny.bisselink at FALW.VU.NL
Tue May 27 06:24:03 EDT 2008


Hi GrADS users,
I am trying to read a NetCDF data file with a rotated lat-lon grid.
The ncdump file is as follows:

netcdf precip.KNMI-2003.ENS50.RT3 {
dimensions:
        rlon = 114 ;
        rlat = 124 ;
        gsize2 = 2 ;
        height = 1 ;
        time = UNLIMITED ; // (365 currently)
        tbnds = 2 ;
variables:
        float rlon(rlon) ;
                rlon:long_name = "rotated longitude" ;
                rlon:units = "degrees" ;
        float rlat(rlat) ;
                rlat:long_name = "rotated latitude" ;
                rlat:units = "degrees" ;
        float height(height) ;
                height:long_name = "height above the surface" ;
                height:units = "m" ;
        double time(time) ;
                time:bounds = "time_bnds" ;
                time:units = "days since 1950-01-01 00:00" ;
                time:calendar = "365_day" ;
        double time_bnds(time, tbnds) ;
                time_bnds:units = "days since 1950-01-01 00:00" ;
                time_bnds:calendar = "365_day" ;
        float lon(rlat, rlon) ;
                lon:long_name = "longitude" ;
                lon:units = "degrees_east" ;
        float lat(rlat, rlon) ;
                lat:long_name = "latitude" ;
                lat:units = "degrees_north" ;
        float dir(rlat, rlon) ;
                dir:long_name = "angle of rotation" ;
                dir:units = "degrees" ;
        int date_bnds(time, gsize2) ;
                date_bnds:long_name = "Verifying Date at Start and Finish
of Interval" ;
                date_bnds:units = "yyyymmdd" ;
        int hms_bnds(time, gsize2) ;
                hms_bnds:long_name = "Verifying Hour-Minute-Second at Start
and Finish of Interval" ;
                hms_bnds:units = "hhmnss" ;
        float precip(time, height, rlat, rlon) ;
                precip:long_name = "Total Precipitative Flux" ;
                precip:standard_name = "precipitation_flux" ;
                precip:units = "kg m-2 s-1" ;
                precip:cell_methods = "time: 24-hr averaged values" ;
                precip:grid_mapping_name = "rotated_latitude_longitude" ;

// global attributes:
                :CDI = "Climate Data Interface version 1.1.0" ;
                :Conventions = "CF-1.0" ;
                :history = "Fri Apr 18 17:20:35 2008: cdo -r selyear,2003
precip.KNMI-2001.ENS50.RT3.nc precip.KNMI-2003.ENS50.RT3.nc" ;
                :Source = "RACMO2" ;
                :Domain = "ENS50" ;
                :Experiment = "RT3" ;
                :Institution = "KNMI" ;
                :CreationDate = "Sat Nov  4 23:38:30 2006" ;
                :CDO = "Climate Data Operators version 1.1.0 available from
http://www.mpimet.mpg.de/cdo" ;
data:

 rlon = -28.21, -27.77, -27.33, -26.89, -26.45, -26.01, -25.57, -25.13,
    -24.69, -24.25, -23.81, -23.37, -22.93, -22.49, -22.05, -21.61, -21.17,
    -20.73, -20.29, -19.85, -19.41, -18.97, -18.53, -18.09, -17.65, -17.21,
    -16.77, -16.33, -15.89, -15.45, -15.01, -14.57, -14.13, -13.69, -13.25,
    -12.81, -12.37, -11.93, -11.49, -11.05, -10.61, -10.17, -9.73, -
9.289999,
    -8.849999, -8.409999, -7.969999, -7.529999, -7.089999, -6.649999,
    -6.209999, -5.769999, -5.329999, -4.889999, -4.449999, -4.009999,
    -3.569999, -3.129999, -2.689999, -2.249999, -1.809999, -1.369999,
    -0.9299992, -0.4899992, -0.04999924, 0.3900008, 0.8300008, 1.270001,
    1.710001, 2.150001, 2.590001, 3.030001, 3.470001, 3.910001, 4.350001,
    4.790001, 5.23, 5.670001, 6.110001, 6.550001, 6.990001, 7.430001,
    7.870001, 8.31, 8.750001, 9.190001, 9.630001, 10.07, 10.51, 10.95,
11.39,
    11.83, 12.27, 12.71, 13.15, 13.59, 14.03, 14.47, 14.91, 15.35, 15.79,
    16.23, 16.67, 17.11, 17.55, 17.99, 18.43, 18.87, 19.31, 19.75, 20.19,
    20.63, 21.07, 21.51 ;

 rlat = -26.73, -26.29, -25.85, -25.41, -24.97, -24.53, -24.09, -23.65,
    -23.21, -22.77, -22.33, -21.89, -21.45, -21.01, -20.57, -20.13, -19.69,
    -19.25, -18.81, -18.37, -17.93, -17.49, -17.05, -16.61, -16.17, -15.73,
    -15.29, -14.85, -14.41, -13.97, -13.53, -13.09, -12.65, -12.21, -11.77,
    -11.33, -10.89, -10.45, -10.01, -9.57, -9.129999, -8.69, -8.25,
    -7.809999, -7.37, -6.93, -6.49, -6.05, -5.61, -5.17, -4.73, -4.289999,
    -3.85, -3.41, -2.97, -2.53, -2.09, -1.65, -1.21, -0.7699997, -
0.3299997,
    0.1100003, 0.5500003, 0.9900003, 1.43, 1.87, 2.31, 2.75, 3.19, 3.63,
    4.07, 4.51, 4.95, 5.39, 5.83, 6.27, 6.71, 7.15, 7.59, 8.030001, 8.47,
    8.91, 9.35, 9.79, 10.23, 10.67, 11.11, 11.55, 11.99, 12.43, 12.87,
13.31,
    13.75, 14.19, 14.63, 15.07, 15.51, 15.95, 16.39, 16.83, 17.27, 17.71,
    18.15, 18.59, 19.03, 19.47, 19.91, 20.35, 20.79, 21.23, 21.67, 22.11,
    22.55, 22.99, 23.43, 23.87, 24.31, 24.75, 25.19, 25.63, 26.07, 26.51,
    26.95, 27.39 ;

 height = 0 ;

 time = 19345, 19346, 19347, 19348, 19349, 19350, 19351, 19352, 19353,
19354,
    19355, 19356, 19357, 19358, 19359, 19360, 19361, 19362, 19363, 19364,
    19365, 19366, 19367, 19368, 19369, 19370, 19371, 19372, 19373, 19374,
    19375, 19376, 19377, 19378, 19379, 19380, 19381, 19382, 19383, 19384,
    19385, 19386, 19387, 19388, 19389, 19390, 19391, 19392, 19393, 19394,
    19395, 19396, 19397, 19398, 19399, 19400, 19401, 19402, 19403, 19404,
    19405, 19406, 19407, 19408, 19409, 19410, 19411, 19412, 19413, 19414,
    19415, 19416, 19417, 19418, 19419, 19420, 19421, 19422, 19423, 19424,
    19425, 19426, 19427, 19428, 19429, 19430, 19431, 19432, 19433, 19434,
    19435, 19436, 19437, 19438, 19439, 19440, 19441, 19442, 19443, 19444,
    19445, 19446, 19447, 19448, 19449, 19450, 19451, 19452, 19453, 19454,
    19455, 19456, 19457, 19458, 19459, 19460, 19461, 19462, 19463, 19464,
    19465, 19466, 19467, 19468, 19469, 19470, 19471, 19472, 19473, 19474,
    19475, 19476, 19477, 19478, 19479, 19480, 19481, 19482, 19483, 19484,
    19485, 19486, 19487, 19488, 19489, 19490, 19491, 19492, 19493, 19494,
    19495, 19496, 19497, 19498, 19499, 19500, 19501, 19502, 19503, 19504,
    19505, 19506, 19507, 19508, 19509, 19510, 19511, 19512, 19513, 19514,
    19515, 19516, 19517, 19518, 19519, 19520, 19521, 19522, 19523, 19524,
    19525, 19526, 19527, 19528, 19529, 19530, 19531, 19532, 19533, 19534,
    19535, 19536, 19537, 19538, 19539, 19540, 19541, 19542, 19543, 19544,
    19545, 19546, 19547, 19548, 19549, 19550, 19551, 19552, 19553, 19554,
    19555, 19556, 19557, 19558, 19559, 19560, 19561, 19562, 19563, 19564,
    19565, 19566, 19567, 19568, 19569, 19570, 19571, 19572, 19573, 19574,
    19575, 19576, 19577, 19578, 19579, 19580, 19581, 19582, 19583, 19584,
    19585, 19586, 19587, 19588, 19589, 19590, 19591, 19592, 19593, 19594,
    19595, 19596, 19597, 19598, 19599, 19600, 19601, 19602, 19603, 19604,
    19605, 19606, 19607, 19608, 19609, 19610, 19611, 19612, 19613, 19614,
    19615, 19616, 19617, 19618, 19619, 19620, 19621, 19622, 19623, 19624,
    19625, 19626, 19627, 19628, 19629, 19630, 19631, 19632, 19633, 19634,
    19635, 19636, 19637, 19638, 19639, 19640, 19641, 19642, 19643, 19644,
    19645, 19646, 19647, 19648, 19649, 19650, 19651, 19652, 19653, 19654,
    19655, 19656, 19657, 19658, 19659, 19660, 19661, 19662, 19663, 19664,
    19665, 19666, 19667, 19668, 19669, 19670, 19671, 19672, 19673, 19674,
    19675, 19676, 19677, 19678, 19679, 19680, 19681, 19682, 19683, 19684,
    19685, 19686, 19687, 19688, 19689, 19690, 19691, 19692, 19693, 19694,
    19695, 19696, 19697, 19698, 19699, 19700, 19701, 19702, 19703, 19704,
    19705, 19706, 19707, 19708, 19709 ;
}
I am able to open the file with GrADS by using the .ddf file:

DSET ^precip.KNMI-2003.ENS50.RT3.nc
XDEF rlon
YDEF rlat
VARS 3
precip 1 -999 Total Precipitative Flux(kg m-2 s-1)
lat=>lati 0 -999 real latitude
lon=>longi 0 -999 real longitude
ENDVARS

With this .ddf I am able to open the netcdf file, but the precipitation is
plotting as a function of rlon and rlat and not as a function for the real
longitude/latitude. In other words, the data is plotting for the area west
Africa and the data is mentioned for Europe. My GrADS version is v1.8SL11
32-bit big-endian on a Solaris platform.
Does anybody know how to deal with this kind of netcdf file?

Kind Regards,
Berny



More information about the gradsusr mailing list