This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Unidata Support wrote:
Hi John- I got the following from Rich SignellTo: address@hidden From: Rich Signell <address@hidden> Subject: IDV s-coordinate problem when elevation is packedHere's an teeny bug: I discovered that IDV 1.1 does not compute the vertical coordinate correctly when the sea surface height variable (used in the formula terms) is stored as a packed variable (nc_short w/ scale_factor & add_offset) instead of the usual floating point. It could be this holds for the bottom depth as well -- I didn't check.I'm guessing that the solution is to change: etaVar = ds.findVariable(etaName); sVar = ds.findVariable(sName); depthVar = ds.findVariable(depthName); to: etaVar = new VariableStandardized(ds.findVariable(etaName)); sVar = new VariableStandardized(ds.findVariable(sName)); depthVar = new VariableStandardized(ds.findVariable(depthName)); or should it be: etaVar = new VariableStandardized(ds.findVariable(etaName), true ); sVar = new VariableStandardized(ds.findVariable(sName), true); depthVar = new VariableStandardized(ds.findVariable(depthName), tr ue); with the true being used to set missing values to NaN?
yes, you're right, thanks for the report. both forms are equivilent, since useNaNs = tru is default.this is fixed systematically in netcdf-java version 2.2, as all variables in a NetcdfDataset automatically handle the scale/offset.
I will fix in the version 2.1.