Unidata Support wrote:
Hi John-
I got the following from Rich Signell
To: support@xxxxxxxxxxxxxxxx
From: Rich Signell <rsignell@xxxxxxxx>
Subject: IDV s-coordinate problem when elevation is packed
Here'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.