|
|
@ -119,7 +119,19 @@ template<class D> MString ActionUV::DoAction(const CLArgs& args, D& ds) |
|
|
|
pars.SetParameter("source", args.at("source")); |
|
|
|
pars.SetParameter("source", args.at("source")); |
|
|
|
pars.SetParameter("history", args.at("_cmdline")); |
|
|
|
pars.SetParameter("history", args.at("_cmdline")); |
|
|
|
|
|
|
|
|
|
|
|
bool mode = args.contains("geostrophic"); |
|
|
|
VelSource mode = VelSource::AUTOSEL; |
|
|
|
|
|
|
|
if(args.contains("geostrophic")) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
auto modestr = args.at("geostrophic"); |
|
|
|
|
|
|
|
if(modestr == "" || modestr == "ssh") |
|
|
|
|
|
|
|
mode = VelSource::GEOSTROPHICSSH; |
|
|
|
|
|
|
|
else if(modestr == "surf" || modestr == "surface") |
|
|
|
|
|
|
|
mode = VelSource::GEOSTROPHIC; |
|
|
|
|
|
|
|
else if(modestr == "nongeo") |
|
|
|
|
|
|
|
mode = VelSource::STANDART; |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
return "Parameter \"geostrophic\" have incorrect value " + modestr; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
auto [tindexes, err] = GetTIndexes(ds, args, pars); |
|
|
|
auto [tindexes, err] = GetTIndexes(ds, args, pars); |
|
|
|
if(err.Exist()) return err; |
|
|
|
if(err.Exist()) return err; |
|
|
@ -229,24 +241,12 @@ template<class D> MString ActionUV::DoAction(const CLArgs& args, D& ds) |
|
|
|
if(!err.Exist() && !headwrited) err = fw.AddVariable("eke", "", "Squared velocity dispersion aka eddy kinetic energy, <u^2+v^2>-<u>^2-<v>^2", "(" + velunit + ")2", ""); |
|
|
|
if(!err.Exist() && !headwrited) err = fw.AddVariable("eke", "", "Squared velocity dispersion aka eddy kinetic energy, <u^2+v^2>-<u>^2-<v>^2", "(" + velunit + ")2", ""); |
|
|
|
if(!err.Exist() && !headwrited) err = fw.WriteGrid(data); |
|
|
|
if(!err.Exist() && !headwrited) err = fw.WriteGrid(data); |
|
|
|
|
|
|
|
|
|
|
|
if(!err.Exist()) |
|
|
|
if(!err.Exist()) err = fw.WriteVariable(data, "u", [&data = std::as_const(data)](size_t i, size_t j) { return data.U(i, j); }, it); |
|
|
|
err = fw.WriteVariable( |
|
|
|
if(!err.Exist()) err = fw.WriteVariable(data, "v", [&data = std::as_const(data)](size_t i, size_t j) { return data.V(i, j); }, it); |
|
|
|
data, "u", [&data = std::as_const(data)](size_t i, size_t j) { return data.U(i, j); }, it); |
|
|
|
if(!err.Exist()) err = fw.WriteVariable(data, "div", [&data = std::as_const(data)](size_t i, size_t j) { return data.Div(i, j); }, it); |
|
|
|
if(!err.Exist()) |
|
|
|
if(!err.Exist()) err = fw.WriteVariable(data, "rot", [&data = std::as_const(data)](size_t i, size_t j) { return data.Rot(i, j); }, it); |
|
|
|
err = fw.WriteVariable( |
|
|
|
if(!err.Exist()) err = fw.WriteVariable(data, "ow", [&data = std::as_const(data)](size_t i, size_t j) { return data.OW(i, j); }, it); |
|
|
|
data, "v", [&data = std::as_const(data)](size_t i, size_t j) { return data.V(i, j); }, it); |
|
|
|
if(!err.Exist()) err = fw.WriteVariable(data, "ke", [&data = std::as_const(data)](size_t i, size_t j) { return data.U2(i, j); }, it); |
|
|
|
if(!err.Exist()) |
|
|
|
|
|
|
|
err = fw.WriteVariable( |
|
|
|
|
|
|
|
data, "div", [&data = std::as_const(data)](size_t i, size_t j) { return data.Div(i, j); }, it); |
|
|
|
|
|
|
|
if(!err.Exist()) |
|
|
|
|
|
|
|
err = fw.WriteVariable( |
|
|
|
|
|
|
|
data, "rot", [&data = std::as_const(data)](size_t i, size_t j) { return data.Rot(i, j); }, it); |
|
|
|
|
|
|
|
if(!err.Exist()) |
|
|
|
|
|
|
|
err = fw.WriteVariable( |
|
|
|
|
|
|
|
data, "ow", [&data = std::as_const(data)](size_t i, size_t j) { return data.OW(i, j); }, it); |
|
|
|
|
|
|
|
if(!err.Exist()) |
|
|
|
|
|
|
|
err = fw.WriteVariable( |
|
|
|
|
|
|
|
data, "ke", [&data = std::as_const(data)](size_t i, size_t j) { return data.U2(i, j); }, it); |
|
|
|
|
|
|
|
if(!err.Exist()) |
|
|
|
if(!err.Exist()) |
|
|
|
err = fw.WriteVariable( |
|
|
|
err = fw.WriteVariable( |
|
|
|
data, "eke", [&data = std::as_const(data)](size_t i, size_t j) { return data.U2(i, j) - (data.U(i, j) * data.U(i, j) + data.V(i, j) * data.V(i, j)); }, it); |
|
|
|
data, "eke", [&data = std::as_const(data)](size_t i, size_t j) { return data.U2(i, j) - (data.U(i, j) * data.U(i, j) + data.V(i, j) * data.V(i, j)); }, it); |
|
|
@ -292,12 +292,8 @@ template<class D> MString ActionUV::DoAction(const CLArgs& args, D& ds) |
|
|
|
if(!err.Exist() && !headwrited) err = fwfilt.AddVariable("v", "", "Northward velocity", velunit, ""); |
|
|
|
if(!err.Exist() && !headwrited) err = fwfilt.AddVariable("v", "", "Northward velocity", velunit, ""); |
|
|
|
if(!err.Exist() && !headwrited) err = fwfilt.WriteGrid(sdata); |
|
|
|
if(!err.Exist() && !headwrited) err = fwfilt.WriteGrid(sdata); |
|
|
|
|
|
|
|
|
|
|
|
if(!err.Exist()) |
|
|
|
if(!err.Exist()) err = fwfilt.WriteVariable(sdata, "u", [&data = std::as_const(sdata)](size_t i, size_t j) { return data.U(i, j); }, it); |
|
|
|
err = fwfilt.WriteVariable( |
|
|
|
if(!err.Exist()) err = fwfilt.WriteVariable(sdata, "v", [&data = std::as_const(sdata)](size_t i, size_t j) { return data.V(i, j); }, it); |
|
|
|
sdata, "u", [&data = std::as_const(sdata)](size_t i, size_t j) { return data.U(i, j); }, it); |
|
|
|
|
|
|
|
if(!err.Exist()) |
|
|
|
|
|
|
|
err = fwfilt.WriteVariable( |
|
|
|
|
|
|
|
sdata, "v", [&data = std::as_const(sdata)](size_t i, size_t j) { return data.V(i, j); }, it); |
|
|
|
|
|
|
|
if(err.Exist()) return err; |
|
|
|
if(err.Exist()) return err; |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|