public Variable addVariable ( Variable oldVar ) { List < Dimension > newDims = getNewDimensions ( oldVar ) ; Variable newVar ; if ( ( oldVar . getDataType ( ) . equals ( DataType . STRING ) ) && ( ! version . isExtendedModel ( ) ) ) { newVar = writer . addStringVariable ( null , oldVar , newDims ) ; } else { newVar = writer . addVariable ( null , oldVar . getShortName ( ) , oldVar . getDataType ( ) , newDims ) ; } varMap . put ( oldVar , newVar ) ; varList . add ( oldVar ) ; for ( Attribute orgAtt : oldVar . getAttributes ( ) ) writer . addVariableAttribute ( newVar , convertAttribute ( orgAtt ) ) ; return newVar ; }
Specify which variable will get written