Could some colleagues please suggest an effective way to read compound variables in (hierarchical) netCDF files, (one of the capabilities of the new netCDF4 format), in the R system.
I have a file of this type (using ‘ncdump', where the 'group: tracks-000*' repeats several times):
group: tracks-0006 {
types:
compound track_dtype {
int CycloneNumber ;
double Datetime ;
float TimeElapsed ;
double Longitude ;
double Latitude ;
double Speed ;
double Bearing ;
double CentralPressure ;
double EnvPressure ;
double rMax ;
}; // track_dtype
dimensions:
time = UNLIMITED ; // (13 currently)
variables:
double time(time) ;
time:units = "hours since 1900-01-01 00:00" ;
time:calendar = "julian" ;
track_dtype track(time) ;
track:long_name = "Tropical cyclone track data" ;
track:time_units = "hours since 1900-01-01 00:00" ;
track:calendar = "julian" ;
track:lon_units = "degrees east" ;
track:lat_units = "degrees north" ;
track:pressure_units = "hPa" ;
track:speed_units = "m/s" ;
track:length_units = "km" ;
track:trackId = "(6, 33)" ;
data:
time = 43116601, 43116602, 43116603, 43116604, 43116605, 43116606,
43116607, 43116608 ;
track =
{6, 43116601, 0, 258.600006103516, 10.8000001907349, 31.6361141204834, 278, 1002, 1005.63439941406, 51.3120727539062},
{6, 43116602, 1, 258.312957763672, 10.8394889831543, 35.2432289123535, 272.674530029297, 1002.35272216797, 1006.88269042969, 74.1966857910156},
{6, 43116603, 2, 257.990386962891, 10.8541202545166, 22.5748672485352, 275.178649902344, 1002.25671386719, 1006.89263916016, 74.0333557128906},
{6, 43116604, 3, 257.784362792969, 10.8723878860474, 15.8934631347656, 261.810882568359, 1002.39923095703, 1006.91198730469, 74.2270736694336},
{6, 43116605, 4, 257.640228271484, 10.8519821166992, 5.5399956703186, 262.884246826172, 1002.57611083984, 1006.93743896484, 74.4559326171875},
{6, 43116606, 5, 257.58984375, 10.8458023071289, 9.16022682189941, 271.360168457031, 1003.10247802734, 1006.98248291016, 75.1571273803711},
{6, 43116607, 6, 257.505920410156, 10.8477478027344, 4.37964916229248, 272.071868896484, 1003.06762695312, 1006.97888183594, 75.1133499145508},
{6, 43116608, 7, 257.4658203125, 10.8491697311401, 7.56261444091797, 285.567169189453, 1003.12829589844, 1006.98022460938, 75.1968688964844}
I am trying to read it using 'library(ncdf4)' and I got an error message:
>library("ncdf4")
>sesa_wnd Error in ncvar_type_to_string(rc$precint) :
Error, unrecognized type code of variable supplied: -1
Is there an R package (or an NCO tool) to read this type of netCDF files?
Thanks for any help you can provide.
Rgrs,
Augusto