Project

General

Profile

import_binary: creating new z definitions in SDF

Added by Charles Manson almost 9 years ago

Hi everyone,

I'm using CDO to convert a binary netcdf through a GrADS descriptor file into a SDF netcdf file.
Specifically, I'm converting output from WRF's ARWpost into an SDF file.

cdo -f nc import_binary <infile> <outfile>

After converting, the SDF contains all the variables but they are defined using 3 different Z dimensions.
There's basically one for surface (lev), one for 3D (lev_2) and one for I assume subsurface (lev_3).

Here's my ARWpost ctl with one of the 3D variables:

dset ^wrfout_d03_2014010123.dat
options  byteswapped
undef 1.e30
title  OUTPUT FROM WRF V3.5.1 MODEL
xdef  180 linear   26.2775   0.0414
ydef  120 linear  -28.0995   0.0373
zdef   21 linear 1 1  
tdef    1 linear 23Z01JAN2014      60MN      
VARS   97
U             21  0  x-wind component (m s-1)

and here's a ncdump of the SDF with the same 3D variable:

netcdf wrfout_d03_2014010123 {
dimensions:
    lon = 180 ;
    lat = 120 ;
    lev = 1 ;
    lev_2 = 21 ;
    lev_3 = 4 ;
    time = UNLIMITED ; // (1 currently)
variables:
    float u(time, lev_2, lat, lon) ;
        u:long_name = "x-wind component (m s-1)" ;
        u:_FillValue = 1.e+30f ;
        u:missing_value = 1.e+30f ;

This doesn't go down well when trying to display in GrADS as it can't seem to find the variable.

Do I need to do something specifically in GrADS?
Or can I create a SDF with all variables using the same ZDEF in CDO?
If not I guess I could seperate them (3D vs surface variables) out at the ctl level and then create two SDFs.

ps. I'm using CDO 1.6.3 compiled with gfortran and netcdf4.1.3 (with hdf).