I have only used IDL to create netCDF3 files, not netCDF4 files. However, I
suspect that the code needs to be changed similar to the following:
From
ncdf_attput, lat_id, 'standard_name’, ‘latitude’
to
ncdf_attput, lat_id, 'standard_name’, ‘latitude’, /char
The /char means to store the data as a byte array, rather than a string. It is
possible that the existing code is explicitly using the /string keyword, which
would need to be replaced with /char.
Mark
From: netcdfgroup-bounces@xxxxxxxxxxxxxxxx
[mailto:netcdfgroup-bounces@xxxxxxxxxxxxxxxx] On Behalf Of Ajay Krishnan - NOAA
Affiliate
Sent: Wednesday, May 13, 2015 3:02 PM
To: netcdfgroup@xxxxxxxxxxxxxxxx
Subject: [netcdfgroup] Using IDL to generate NetCDF 4 files
Hi everyone,
One of the data producers that I am working with is using IDL to generate
NetCDF-4 files.
I am not sure about the code that he is using to generate these files but I am
unable to read them in THREDDS.
An ncdump of the file looks like this:
netcdf baa_b05kmnn_20150101 {
dimensions:
time = 1 ;
lat = 3600 ;
lon = 7200 ;
variables:
int time(time) ;
string time:long_name = "reference time of sst field" ;
string time:standard_name = "time" ;
string time:axis = "T" ;
string time:calendar = "Gregorian" ;
string time:units = "seconds since 1981-01-01 00:00:00" ;
string time:comment = "Nominal time of Level 4 analysis" ;
string time:coverage_content_type = "coordinate" ;
float lat(lat) ;
string lat:long_name = "latitude" ;
string lat:standard_name = "latitude" ;
string lat:units = "degrees_north" ;
string lat:axis = "Y" ;
lat:valid_min = -90.f ;
lat:valid_max = 90.f ;
string lat:comment = "equirectangular projection" ;
string lat:coverage_content_type = "coordinate" ;
string lat:grid_mapping = "crs" ;
float lon(lon) ;
string lon:long_name = "longitude" ;
string lon:standard_name = "longitude" ;
string lon:units = "degrees_east" ;
string lon:axis = "X" ;
lon:valid_min = -180.f ;
lon:valid_max = 180.f ;
string lon:comment = "equirectangular projection" ;
string lon:coverage_content_type = "coordinate" ;
string lon:grid_mapping = "crs" ;
byte surface_flag(lat, lon) ;
string surface_flag:long_name = "Pixel characteristics flag
array" ;
string surface_flag:units = "none" ;
string surface_flag:coordinates = "lon lat" ;
string surface_flag:comment = "An array in the same dimension
as the data array classifies land, missing, and ice pixels that are all flaged
by the same missing_value in the data array(s)." ;
surface_flag:flag_values = 0s, 1s, 2s, 4s ;
string surface_flag:flag_meanings =
"valid-water,land,missing,ice" ;
string surface_flag:coverage_content_type =
"thematicClassification" ;
string surface_flag:grid_mapping = "crs" ;
I guess the issue is arriving from the prefix 'string' which probably crept in
while generating the attributes. When I get rid of the 'string' and recreate
the NetCDF file, it works absolutely fine.
Since I don't have an idea as to how IDL works, can someone here guide me as to
how this can be avoided while generating the netcdf file from IDL?
This issue arises only when the data provided creates NetCDF 4 files. The
NetCDF 3 files run just fine.
Any help / documentation would be appreciated.
Thanks,
Ajay