[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #TQX-377690]: integer attributes with LL



I am not sure what you mean by valid when you say
"valid netcdf file (see the log below)"?
If you mean it matches the file
https://owncloud.gwdg.de/index.php/s/qzfgrHxgnIsNAMv
then you are correct. That latter file has these attributes
as 32bit integers. 
Or does valid mean it should produce a netcdf-3 file?


> The LL suffix means that the value should be interpreted
> as a signed long long integer (e.g. 64 bits).
> I cannot speak to the python interface, but ncgen should be able
> to handle the LL suffixes.
> 
> Dennis -
> 
> Thanks for this. The issue is precisely that I can not make an ncdump/ncgen 
> round trip and get a valid netcdf file (see the log below). I think it’d be 
> ok to use either integer representation if we could make this round-trip.
> 
> - Robert
> 
> 
> 
> My concern is that I gather you want the inferred type of these
> attributes to be a 32 bit signed integer rather than a 64 bit signed
> integer. I suspect this requires python-foo.
> 
> Hello netCDF and Python folks -
> 
> I’m trying to use the netCDF4 python module to write an empty but heavily 
> formatted set of netCDF files for submission as part of CMIP6. The script I’m 
> using is on Github 
> (https://github.com/RobertPincus/RFMIP-IRF-Scripts/blob/master/generate-output-file-templates.py);
>  it requires a file you can find at 
> https://owncloud.gwdg.de/index.php/s/qzfgrHxgnIsNAMv.
> 
> If you run the script you’ll see that integer global attributes have a 
> trailing LL designation, e.g.
> (CMOR) bash-3.2$ ncdump -h rld.nc | grep LL
> :physics_index = 1LL ;
> :realization_index = 1LL ;
> :initialization_index = 1LL ;
> :forcing_index = 1LL ;
> 
> I’m not sure what this means but I do not that if I ncdump the file, ncgen 
> will not create a valid netcdf file. That’s a worry.
> 
> You’ll not that I’ve tried explicitly setting the type of the attribute 
> ("realization_index"   :int(1).
> 
> Can you tell me what it means for these attributes to be labeled “LL”? Is 
> there a way to ensure that these values are recorded as straight ints?
> ---
> Robert Pincus
> University of Colorado/NOAA Earth System Research Lab
> http://cires.colorado.edu/researcher/robert-pincus
> 
> 
> 
> =Dennis Heimbigner
> Unidata
> 
> 
> Ticket Details
> ===================
> Ticket ID: TQX-377690
> Department: Support netCDF
> Priority: Normal
> Status: Open
> ===================
> NOTE: All email exchanges with Unidata User Support are recorded in the 
> Unidata inquiry tracking system and then made publicly available through the 
> web.  If you do not want to have your interactions made available in this 
> way, you must let us know in each email you send to us.
> 
> 
> [Homebody:RFMIP/sampled-global-mean/RFMIP-IRF-Scripts] robert% ncdump -h 
> rld.nc > test.cdl
> [Homebody:RFMIP/sampled-global-mean/RFMIP-IRF-Scripts] robert%  more test.cdl
> netcdf rld {
> dimensions:
> expt = 18 ;
> site = 100 ;
> level = 61 ;
> variables:
> float lat(site) ;
> lat:long_name = "ERA-Interim latitude" ;
> lat:units = "degree_north" ;
> lat:standard_name = "latitude" ;
> float lon(site) ;
> lon:long_name = "ERA-Interim longitude" ;
> lon:units = "degree_east" ;
> lon:standard_name = "longitude" ;
> float time(site) ;
> time:long_name = "ERA-Interim fractional day of the year 2014" ;
> time:units = "days since 2014-1-1 0:0:0" ;
> time:standard_name = "time" ;
> time:calendar = "gregorian" ;
> float plev(site, level) ;
> plev:standard_name = "air_pressure" ;
> plev:units = "Pa" ;
> plev:coordinates = "lon lat" ;
> plev:long_name = "Pressure at layer edge" ;
> float rld(expt, site, level) ;
> rld:variable_id = "rld" ;
> rld:standard_name = "downwelling_longwave_flux_in_air" ;
> rld:units = "W m-2" ;
> rld:coordinates = "lon lat time" ;
> float profile_weight(site) ;
> profile_weight:title = "profile weight to recover global mean" ;
> profile_weight:units = "1" ;
> profile_weight:coordinates = "lon lat" ;
> profile_weight:long_name = "profile weight to recover global mean" ;
> 
> // global attributes:
> :activity_id = "RFMIP" ;
> :product = "model-output" ;
> :experiment_id = "rad-irf" ;
> :table_id = "Efx" ;
> :frequency = "fx" ;
> :sub_experiment_id = "none" ;
> :data_specs_version = "01.00.29" ;
> :physics_index = 1LL ;
> :Conventions = "CF-1.7 CMIP-6.2" ;
> :mip_era = "CMIP6" ;
> :experiment = "rad_irf" ;
> :sub_experiment = "none" ;
> :realization_index = 1LL ;
> :initialization_index = 1LL ;
> :source_type = "RAD" ;
> :nominal_resolution = "10 km" ;
> :realm = "atmos" ;
> :grid_label = "gn" ;
> :grid = "columns sampled from ERA-Interim, radiative fluxes computed 
> independently" ;
> :institution_id = "AER" ;
> :institution = "Research and Climate Group, Atmospheric and Environmental 
> Research, 131 Hartwell Avenue, Lexington, MA 02421, USA" ;
> :source_id = "LBLRTM-12-8" ;
> :version = "12.8" ;
> :source = "LBLRTM 12.8 (2017): \naerosol: none\natmos: none\natmosChem: 
> none\nland: none\nlandIce: none\nocean: none\nocnBgchem: none\nseaIce: none" ;
> :further_info_url = 
> "https://furtherinfo.es-doc.org/CMIP6.AER.LBLRTM-12-8.rad-irf.none.r1i1p1f1"; ;
> :forcing_index = 1LL ;
> :license = "CMIP6 model data produced by AER is licensed under a Creative 
> Commons Attribution-NonCommercial-ShareAlike 4.0 International License 
> (https://creativecommons.org/licenses). Consult 
> https://pcmdi.llnl.gov/CMIP6/TermsOfUse for terms of use governing CMIP6 
> output, including citation requirements and proper acknowledgment. Further 
> information about this data, including some limitations, can be found via the 
> further_info_url (recorded as a global attribute in this file) and at 
> https://pcmdi.llnl.gov/.The data producers and data providers make no 
> warranty, either express or implied, including, but not limited to, 
> warranties of merchantability and fitness for a particular purpose.All 
> liabilities arising from the supply of the information (including any 
> liability arising in negligence) are excluded to the fullest extent permitted 
> by law." ;
> :creation_date = "2019-02-06T20:05:52Z" ;
> :tracking_id = "hdl:21.14100/f81c3152-0673-4460-ab38-9b1b284a0e28" ;
> :variant_label = "r1i1p1f1" ;
> :variable_id = "rld" ;
> }
> [Homebody:RFMIP/sampled-global-mean/RFMIP-IRF-Scripts] robert% ncgen -o 
> test.nc test.cdl
> ncgen: cdl line 44; NetCDF: Not a valid data type or _FillValue type mismatch
> (/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_netcdf/netcdf/work/netcdf-c-4.6.1/ncgen/genbin.c:541)
> 
> 

=Dennis Heimbigner
  Unidata


Ticket Details
===================
Ticket ID: TQX-377690
Department: Support netCDF
Priority: Normal
Status: Open
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.