Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Bug in ncdump or ncgen ?

G'Day

I generated the cdl file appended at the end of this message using ncdump 
(lets call it sample.cdl). When I try ncgen sample.cdl I get:

        sample.cdl line 7: syntax error

It appears its beacause it doesn't like spaces in names since I can fix the
cdl file by changing:

        Universal Time to Universal_Time

and doing the same with the other variables. Now however I get the error:

        sample.cdl line 12: syntax error

The only way to fix this seems to be to get rid of the "dummy" variables
instrument and history. After this it still gave me an error at the beginning
of the global attribute definitions, but I gave up at this point. How come
ncdump generates a cdl file which ncgen can't handle ? Is this a bug or have
I done something wrong ?

        regards
                Ata <(|)>.

netcdf sample {
dimensions:
        fakeDim0 = 1 ;
        fakeDim1 = 1 ;
        fakeDim2 = 4 ;
        fakeDim3 = 17 ;
        Universal Time = UNLIMITED ; // (4 currently)
        Magnetic Field = 3 ;

variables:
        char instrument(fakeDim0) ;
                instrument:00_name = "00_Flux Gate Magnetometer" ;
                instrument:01_acronym = "01_FGM" ;
                instrument:02_mode = "02_Nominal" ;
        char history(fakeDim1) ;
                history:Sun Feb 17 03:59:04 1991
 = "Created by A. Etemadi @ ICSTM" ;
        char Universal Time(fakeDim2, fakeDim3) ;
                Universal Time:long_name = "Universal Time" ;
                Universal Time:units = "Universal Time" ;
                Universal Time:format = "%s" ;
                Universal Time:cordsys = "YYYYDDDHHMMSS.MLS" ;
                Universal Time:_FillValue = "$" ;
        float AMPTE-UKS Magnetic Field Data(Universal Time, Magnetic Field) ;
                AMPTE-UKS Magnetic Field Data:long_name = "B_x B_y B_z" ;
                AMPTE-UKS Magnetic Field Data:units = "nanoTesla" ;
                AMPTE-UKS Magnetic Field Data:format = "%7.3f %7.3f %7.3f" ;
                AMPTE-UKS Magnetic Field Data:cordsys = "GSE" ;
                AMPTE-UKS Magnetic Field Data:scale_factor = 0. ;
                AMPTE-UKS Magnetic Field Data:scale_factor_err = 0. ;
                AMPTE-UKS Magnetic Field Data:add_offset = 0. ;
                AMPTE-UKS Magnetic Field Data:add_offset_err = 0. ;
                AMPTE-UKS Magnetic Field Data:calibrated_nt = 20 ;
                AMPTE-UKS Magnetic Field Data:_FillValue = 10000.f ;

// global attributes:
                :00_version = "00-1.0" ;
                :01_descriptor = "01-Magnetic Field Data" ;
                :02_title = "02-Magnetic Field Data" ;
                :03_mission = "03-AMPTE" ;
                :04_project = "04-ESA-ISTP" ;
                :05_discipline = "05-Solar Terrestrial Physics" ;
                :06_datatype = "06-Calibrated" ;
                :07_averaging = "07-Spin" ;
                :08_spacecraft = "08-UKS" ;
                :09_sourcesite = "09-ICSTM" ;
                :10_datasite = "10-ICSTM" ;
                :11_investigator = "11-D.J.Southwood" ;
                :12_supplier = "12-A.Etemadi" ;
                :13_coordinate = "13-GSE" ;

data:

 instrument = "" ;

 history = "" ;

 Universal Time
  "1984242121817.051",
  "1984242121822.050",
  "1984242121828.050",
  "1984242121833.051" ;

 AMPTE-UKS Magnetic Field Data
  -3.91 , 2.92 , -0.69 ,
  -4.91 , 0.65 , 0.01 ,
  -4.99 , -0.09 , 0.07 ,
  -4.73 , 0.03 , -0.06  ;
}


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690