ncdf2vdf does nothing

7 posts / 0 new
Last post
leigh.orf
ncdf2vdf does nothing

I am using the latest Vapor code (2.6.0.RC0). I create a bunch of netcdf4 files that look like the following:

(ncdump -c output):

netcdf fs8.07800.000000 {
dimensions:
xh = 601 ;
yh = 701 ;
zh = 201 ;
xf = 601 ;
yf = 701 ;
zf = 201 ;
time = UNLIMITED ; // (1 currently)
variables:
float xh(xh) ;
xh:units = "km" ;
float yh(yh) ;
yh:units = "km" ;
float zh(zh) ;
zh:units = "km" ;
float xf(xf) ;
xf:units = "km" ;
float yf(yf) ;
yf:units = "km" ;
float zf(zf) ;
zf:units = "km" ;
double time ;
time:units = "s" ;
int X0 ;
int Y0 ;
int X1 ;
int Y1 ;
int Z0 ;
int Z1 ;
float uinterp(time, zh, yh, xh) ;
float vinterp(time, zh, yh, xh) ;
float winterp(time, zh, yh, xh) ;
float xvort(time, zh, yh, xh) ;
float yvort(time, zh, yh, xh) ;
float zvort(time, zh, yh, xh) ;
float hvort(time, zh, yh, xh) ;
float vortmag(time, zh, yh, xh) ;
float streamvort(time, zh, yh, xh) ;
float qc(time, zh, yh, xh) ;
float qr(time, zh, yh, xh) ;
float qg(time, zh, yh, xh) ;
float dbz(time, zh, yh, xh) ;
float thrhopert(time, zh, yh, xh) ;
float prespert(time, zh, yh, xh) ;

I create a vdf file as such:

vdfcreate -vdc2 -dimension ${nx}x${ny}x${nz} -extents ${gx0}:${gy0}:${gz0}:${gx1}:${gy1}:${gz1} \
-startt $t0 -deltat $dt -numts $numtimes -vars3d $varlist \
-level 2 ${base}-${vdfs}.vdf

(this is from a script).

The vdf file looks reasonable.

Then, following the instructions from the man page, I try all sorts of things to create the vdf files and they all fail silently, doing nothing.

For instance:

ncdf2vdf -timedims time -timevar times nc/*.nc fs8-fromscratch8.vdf

It will return in about 5 seconds and nothing happens - no VDC files are created, nothing is output.

I ran strace on the command and it is indeed reading data from the netCDF files.

I have tried many variations on the ncdf2vdf command and I always get no result.

Here is a link to my .vdf file if it helps:

http://www.ssec.wisc.edu/~lorf/fs8-fromscratch8.vdf

Thanks,

Leigh

pearse

Hey Leigh, can I pull one of these files off of the SSEC grid FTP to take a look?  Or is there another way that's easier for you?

-Scott

leigh.orf
Scott, thanks! I stuck three consecutive files in the NCAR/2017-ncdf2vdf folder.
pearse

It looks like the problem lies in the time variable we're using.  It needs to be an array with its dimension fillowing the time coordinate variable, otherwise ncdf2vdf does not register the time inervals.

I was able to convert one of your files after adding a 'scottTime' variable with the following command:

ncap2 -D5 -Oh -s 'defdim("scottTime",1);scottTime[time]={5460};scottTime@long_name="scooter";' fs8.05460.000000.nc scottTime.nc

But this isn't going to suit your needs since your 3D vars still reference the original 'time' variable (not scottTime, the newly defined array).  Do you know of an easy way to achieve this?

Basically we need something like the following to describe time:

        float time(time) ;

                time:units = "s" ;

Instead of:

        float time;

                time:units = "s" ;

 

leigh.orf
Scott, thanks for the information. I don't think it will be a problem for me to create netCDF files this way. I will modify my netCDF creation code and see if I can get over this hurdle. Thanks!
leigh.orf
Scott, Ah-hah! I finally got this to work. I discovered that I needed to use nc_put_vara_double (instead of nc_put_var_double) for the time variable (which needs to be a 1D array of length 1 in my case since I have 1 netcdf file per time level), since it is unlimited, and now I have netcdf files with the proper time dimension and time data. Your help was invaluable, thanks!
pearse

I'm happy to help :)  

 
Please let us know if there's anything else we can do and also let us know if you have more animations coming out soon.
 
Cheers,
Scott