[Thread Prev][Thread Next][Index]

Bug in isCoord? and prob with addXml.pl



Two things:

(1) netCDF allows scalar variables (having ndims==0). These, of course,
are not indexed by any coordinate variable. In LASNetCDF.pm, however,
the function isCoord() tries to get the name of the first dimension, unless
the variable has more than one dimension. This seems to be a bug. The fix
is to replace:
 return 0 if (scalar @dims > 1);
by:
 return 0 if (scalar @dims != 1);


(2) I have what I believe to be a COARDS-compliant netCDF but addXml.pl
has a problem with it. During the parsing, it reports:
Dimension LONGITUDE_U doesn't have a coordinate variable at LASNetCDF.pm line 
669

The header (or indeed whole file!) is available via DODS at
http://www.nerc-essc.ac.uk/cgi-bin/nph-dods/OCCAM/d4733.restart1_a.nc.html

I'd be very grateful if someone could suggest what's going wrong. I've almost
hit my limit of picking through the perl!

The file in question is very large (495MB), so the ncdump -h for it is below
if you don't want to inspect it via DODS.

Regards,
 - Andrew
 
 % ncdump -h d4733.restart1_a.nc
netcdf d4733.restart1_a {
dimensions:
        LONGITUDE_T = 1440 ;
        LATITUDE_T = 577 ;
        LONGITUDE_U = 1440 ;
        LATITUDE_U = 577 ;
        DEPTH = 36 ;
        DEPTH_EDGES = 37 ;
variables:
        int TIMESTEP ;
                TIMESTEP:long_name = "Timestep" ;
        float SECONDS ;
                SECONDS:long_name = "Model Seconds" ;
                SECONDS:units = "seconds" ;
        float DAY ;
                DAY:long_name = "Model Day" ;
                DAY:units = "days" ;
        float YEARS ;
                YEARS:long_name = "Model Year" ;
                YEARS:units = "years" ;
        int KMT(LATITUDE_T, LONGITUDE_T) ;
                KMT:long_name = "T-point mask" ;
                KMT:_FillValue = 0 ;
                KMT:T_GRID = 1 ;
        float LONGITUDE_T(LONGITUDE_T) ;
                LONGITUDE_T:long_name = "Longitude" ;
                LONGITUDE_T:units = "degrees_east" ;
                LONGITUDE_T:spacing = "even" ;
        float LATITUDE_T(LATITUDE_T) ;
                LATITUDE_T:long_name = "Latitude" ;
                LATITUDE_T:units = "degrees_north" ;
                LATITUDE_T:spacing = "even" ;
        int KMU(LATITUDE_U, LONGITUDE_U) ;
                KMU:long_name = "U-point mask" ;
                KMU:_FillValue = 0 ;
                KMU:T_GRID = 0 ;
        float LONGITUDE_U(LONGITUDE_U) ;
                LONGITUDE_U:long_name = "Longitude" ;
                LONGITUDE_U:units = "degrees_east" ;
                LONGITUDE_U:spacing = "even" ;
        float LATITUDE_U(LATITUDE_U) ;
                LATITUDE_U:long_name = "Latitude" ;
                LATITUDE_U:units = "degrees_north" ;
                LATITUDE_U:spacing = "even" ;
        float FREE_SURFACE_HEIGHT(LATITUDE_T, LONGITUDE_T) ;
                FREE_SURFACE_HEIGHT:long_name = "Free Surface Height" ;
                FREE_SURFACE_HEIGHT:units = "cm" ;
                FREE_SURFACE_HEIGHT:_FillValue = 1.e+07f ;
                FREE_SURFACE_HEIGHT:T_GRID = 1 ;
        float BAROTROPIC_U_VELOCITY(LATITUDE_U, LONGITUDE_U) ;
                BAROTROPIC_U_VELOCITY:long_name = "Barotropic U-Velocity" ;
                BAROTROPIC_U_VELOCITY:units = "cm/s" ;
                BAROTROPIC_U_VELOCITY:_FillValue = 1.e+07f ;
                BAROTROPIC_U_VELOCITY:T_GRID = 0 ;
        float BAROTROPIC_V_VELOCITY(LATITUDE_U, LONGITUDE_U) ;
                BAROTROPIC_V_VELOCITY:long_name = "Barotropic V-Velocity" ;
                BAROTROPIC_V_VELOCITY:units = "cm/s" ;
                BAROTROPIC_V_VELOCITY:_FillValue = 1.e+07f ;
                BAROTROPIC_V_VELOCITY:T_GRID = 0 ;
        float POTENTIAL_TEMPERATURE(DEPTH, LATITUDE_T, LONGITUDE_T) ;
                POTENTIAL_TEMPERATURE:long_name = "Potential Temperature" ;
                POTENTIAL_TEMPERATURE:units = "C" ;
                POTENTIAL_TEMPERATURE:_FillValue = 1.e+07f ;
                POTENTIAL_TEMPERATURE:T_GRID = 1 ;
        float DEPTH(DEPTH) ;
                DEPTH:long_name = "Depth" ;
                DEPTH:units = "cm" ;
                DEPTH:positive = "down" ;
                DEPTH:edges = "DEPTH_EDGES" ;
        float SALINITY(DEPTH, LATITUDE_T, LONGITUDE_T) ;
                SALINITY:long_name = "Salinity" ;
                SALINITY:units = "PSU" ;
                SALINITY:_FillValue = 1.e+10f ;
                SALINITY:scale_factor = 1000.f ;
                SALINITY:add_offset = 35.f ;
                SALINITY:T_GRID = 1 ;
        float U_VELOCITY(DEPTH, LATITUDE_U, LONGITUDE_U) ;
                U_VELOCITY:long_name = "U-Velocity" ;
                U_VELOCITY:units = "cm/s" ;
                U_VELOCITY:_FillValue = 1.e+07f ;
                U_VELOCITY:T_GRID = 0 ;
        float V_VELOCITY(DEPTH, LATITUDE_U, LONGITUDE_U) ;
                V_VELOCITY:long_name = "V-Velocity" ;
                V_VELOCITY:units = "cm/s" ;
                V_VELOCITY:_FillValue = 1.e+07f ;
                V_VELOCITY:T_GRID = 0 ;
        float DEPTH_EDGES(DEPTH_EDGES) ;
                DEPTH_EDGES:long_name = "Depth Edges" ;
                DEPTH_EDGES:units = "cm" ;
                DEPTH_EDGES:positive = "down" ;

// global attributes:
                :TITLE = "OCCAM Data" ;
                :FMODE = 2 ;
                :FTYPE = 2 ;
                :ROTATION = 1 ;
                :Conventions = "COARDS" ;
}




-----------------------------------------------------
Andrew Woolf  (awo@mail.nerc-essc.ac.uk)
Environmental Systems Science Centre (ESSC)
Reading University
3 Earley Gate
Whiteknights
Reading RG6 6AL
UNITED KINGDOM
Phone: +44 (0)118 931 8741   Fax: +44 (0)118 931 6413
-----------------------------------------------------



[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement