Config trajConfig = new Config();
trajConfig.setTimeDim( d);
// Check that have time variable with units that are udunits time
Variable var = ncd.getRootGroup().findVariable( timeVarName );
if ( var == null ) return null;
list = var.getDimensions();
if ( list.size() != 1 ) return null;
d = (Dimension) list.get( 0 );
if ( ! d.getName().equals( timeDimName ) ) return null;
String units = var.findAttribute( "units" ).getStringValue();
Date date = DateUnit.getStandardDate( "0 " + units );
if ( date == null ) return null;
trajConfig.setTimeVar( var);
// Check for latitude variable with time dimension and units convertable to "degrees_north".
var = ncd.getRootGroup().findVariable( latVarName );
if ( var == null ) return null;
list = var.getDimensions();
if ( list.size() != 1 ) return null;
d = (Dimension) list.get( 0 );
if ( ! d.getName().equals( timeDimName ) ) return null;
units = var.findAttribute( "units" ).getStringValue();
if ( ! SimpleUnit.isCompatible( units, "degrees_north" ) ) return null;
trajConfig.setLatVar( var );
// Check for longitude variable with time dimension and units convertable to "degrees_east".
var = ncd.getRootGroup().findVariable( lonVarName );
if ( var == null ) return null;
list = var.getDimensions();
if ( list.size() != 1 ) return null;
d = (Dimension) list.get( 0 );
if ( ! d.getName().equals( timeDimName ) ) return null;
units = var.findAttribute( "units" ).getStringValue();
if ( ! SimpleUnit.isCompatible( units, "degrees_east" ) ) return null;
trajConfig.setLonVar( var );
// Check for altitude variable with time dimension and units convertable to "m".
var = ncd.getRootGroup().findVariable( elevVarName );
if ( var == null ) return null;
list = var.getDimensions();
if ( list.size() != 1 ) return null;
d = (Dimension) list.get( 0 );
if ( ! d.getName().equals( timeDimName ) ) return null;
units = var.findAttribute( "units" ).getStringValue();
if ( units.indexOf( "meters" ) == -1 ) return null; // "meters above Mean Sea Level" not udunits convertible
// if ( ! SimpleUnit.isCompatible( units, "m")) return( false);
((VariableEnhanced)var).setUnitsString("meters" );