Config trajConfig = new Config();
trajConfig.setTimeDim( d);
// Check that have variable time(time) 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 variable latitude(time) with units of "deg".
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 variable longitude(time) with units of "deg".
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 variable altitude(time) with units of "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 ( ! SimpleUnit.isCompatible( units, "meters")) return null;
trajConfig.setElevVar( var);
trajConfig.setTrajectoryId( trajId);