tds/src/main/java/thredds/server/opendap/NcDDS.java
private BaseType createVariable(NetcdfFile ncfile, Variable v) {
    BaseType bt;
    if (v.getRank() == 0)  // scalar
      bt = createScalarVariable(ncfile, v);

    else if (v.getDataType() == DataType.CHAR) {
      if (v.getRank() > 1)
        bt = new NcSDCharArray(v);
      else
        bt = new NcSDString(v);

    } else if (v.getDataType() == DataType.STRING) {
      if (v.getRank() == 0)
        bt = new NcSDString(v);
      else
        bt = new NcSDArray(v, new NcSDString(v));

    } else  // non-char multidim array
      bt = createArray(ncfile, v);

    return bt;

  }
private BaseType createVariable(NetcdfFile ncfile, Variable v) {
    BaseType bt;
    if (v.getRank() == 0)  // scalar
      bt = createScalarVariable(ncfile, v);

    else if (v.getDataType() == DataType.CHAR) {
      if (v.getRank() > 1)
        bt = new NcSDCharArray(v);
      else
        bt = new NcSDString(v);

    } else if (v.getDataType() == DataType.STRING) {
      if (v.getRank() == 0)
        bt = new NcSDString(v);
      else
        bt = new NcSDArray(v, new NcSDString(v));

    } else  // non-char multidim array
      bt = createArray(ncfile, v);

    return bt;

  }
private BaseType createVariable ( NetcdfFile ncfile , Variable v ) { BaseType bt ; if ( v . getRank ( ) == 0 ) // scalar bt = createScalarVariable ( ncfile , v ) ; else if ( v . getDataType ( ) == DataType . CHAR ) { if ( v . getRank ( ) > 1 ) bt = new NcSDCharArray ( v ) ; else bt = new NcSDString ( v ) ; } else if ( v . getDataType ( ) == DataType . STRING ) { if ( v . getRank ( ) == 0 ) bt = new NcSDString ( v ) ; else bt = new NcSDArray ( v , new NcSDString ( v ) ) ; } else // non-char multidim array bt = createArray ( ncfile , v ) ; return bt ; }
turn Variable into opendap variable
turn Variable into opendap variable