protected void replaceDataVars ( StructureMembers sm ) { for ( StructureMembers . Member m : sm . getMembers ( ) ) { VariableSimpleIF org = this . cols . get ( m . getName ( ) ) ; int rank = org . getRank ( ) ; List < Dimension > orgDims = org . getDimensions ( ) ; // only keep the last n int n = m . getShape ( ) . length ; List < Dimension > dims = orgDims . subList ( rank - n , rank ) ; VariableSimpleImpl result = new VariableSimpleImpl ( org . getShortName ( ) , org . getDescription ( ) , org . getUnitsString ( ) , org . getDataType ( ) , dims ) ; for ( Attribute att : org . getAttributes ( ) ) result . ( att ) ; this . cols . put ( m . getName ( ) , result ) ; } }
change shape of the data variables