|
|
|
@ -194,6 +194,7 @@ LayeredData::Data LayeredData::Read(const MString& vname, const BaseParameters*
|
|
|
|
|
auto sal = Read("sal", ip, i); |
|
|
|
|
if(!(temp && sal)) return Data(); |
|
|
|
|
auto out = temp; |
|
|
|
|
out.SetUnit("degrees_C"); |
|
|
|
|
for(size_t ind = 0; ind < out.N(); ind++) |
|
|
|
|
{ |
|
|
|
|
if(temp.IsFill(ind) || sal.IsFill(ind)) |
|
|
|
@ -210,6 +211,7 @@ LayeredData::Data LayeredData::Read(const MString& vname, const BaseParameters*
|
|
|
|
|
auto sal = Read("sal", ip, i); |
|
|
|
|
if(!(temp && sal)) return Data(); |
|
|
|
|
auto out = temp; |
|
|
|
|
out.SetUnit("degrees_C"); |
|
|
|
|
for(size_t ind = 0; ind < out.N(); ind++) |
|
|
|
|
{ |
|
|
|
|
if(temp.IsFill(ind) || sal.IsFill(ind)) |
|
|
|
@ -227,6 +229,7 @@ LayeredData::Data LayeredData::Read(const MString& vname, const BaseParameters*
|
|
|
|
|
auto sal = Read("sal", ip, i); |
|
|
|
|
if(!(temp && sal)) return Data(); |
|
|
|
|
auto out = temp; |
|
|
|
|
out.SetUnit("kg m-3"); |
|
|
|
|
for(size_t ind = 0; ind < out.N(); ind++) |
|
|
|
|
{ |
|
|
|
|
if(temp.IsFill(ind) || sal.IsFill(ind)) |
|
|
|
@ -245,6 +248,7 @@ LayeredData::Data LayeredData::Read(const MString& vname, const BaseParameters*
|
|
|
|
|
auto v = Read("v", ip, i); |
|
|
|
|
if(!(u && v)) return Data(); |
|
|
|
|
auto out = u; |
|
|
|
|
out.SetUnit(square ? ("(" + u.Unit() + ")2") : u.Unit()); |
|
|
|
|
for(size_t ind = 0; ind < out.N(); ind++) |
|
|
|
|
{ |
|
|
|
|
if(u.IsFill(ind) || v.IsFill(ind)) |
|
|
|
@ -299,10 +303,18 @@ template<class DataType> LayeredData::Data LayeredData::ReadVarRaw(const NC& f,
|
|
|
|
|
if(a_scale_f) scale = a_scale_f; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
auto unit = f->A<MString>(name, "units"); |
|
|
|
|
if(unit && (unit.Get() == "m s-1" || unit.Get() == "m/s")) unitmul = 100.0; |
|
|
|
|
MString unit; |
|
|
|
|
{ |
|
|
|
|
auto unitatt = f->A<MString>(name, "units"); |
|
|
|
|
if(unitatt) unit = unitatt; |
|
|
|
|
} |
|
|
|
|
if(unit == "m s-1" || unit == "m/s") |
|
|
|
|
{ |
|
|
|
|
unitmul = 100.0; |
|
|
|
|
unit = "cm/s"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Data data((p->xb < p->xe) ? (p->xe - p->xb + 1) : (dname.nx + p->xe - p->xb + 1), p->ye - p->yb + 1, Lon(p->xb), Lat(p->yb), lonstep, latstep); |
|
|
|
|
Data data((p->xb < p->xe) ? (p->xe - p->xb + 1) : (dname.nx + p->xe - p->xb + 1), p->ye - p->yb + 1, Lon(p->xb), Lat(p->yb), lonstep, latstep, std::move(unit)); |
|
|
|
|
|
|
|
|
|
if(p->xb < p->xe) |
|
|
|
|
{ |
|
|
|
|