|
|
|
#include "odm.h"
|
|
|
|
|
|
|
|
inline void Usage(const MString& arg0)
|
|
|
|
{
|
|
|
|
message(arg0 + " (<key>=<value>...)");
|
|
|
|
message("Keys are:");
|
|
|
|
message(" action. What the program should do. May be: info, tsc. Default: tsc.");
|
|
|
|
message(" Keys for action=info. Print some information about dataset.");
|
|
|
|
message(" source. Required. May be: NEMO");
|
|
|
|
message(" Keys for source=NEMO");
|
|
|
|
message(" dataset. Can be DT, NRT or NRT6. Default: DT");
|
|
|
|
message(" Keys for action=tsc. Get temperature, salinity, chlorofill from dataset.");
|
|
|
|
message(" source. Required. May be: NEMO");
|
|
|
|
message(" var. Required. May be: temp, sal, chl, mld, ssh or w.");
|
|
|
|
message(" time. Time moment or regular expression. If present, timeb and timee must be absent");
|
|
|
|
message(" timeb, timee. Time interval. If present, time must be absent");
|
|
|
|
message(" out. Output file. Default: out.bin");
|
|
|
|
message(" Keys for source=NEMO");
|
|
|
|
message(" var can be temp, sal, mld, ssh or w. Mld is not available for dataset=NRT6.");
|
|
|
|
message(" dataset. Can be DT, NRT or NRT6. Default: DT");
|
|
|
|
message(" layer and/or depth. Layer or depth of NEMO dataset. If depth is specified, layer is ignored. Both ignored, if var=mld. Default: layer=0");
|
|
|
|
message(" lonb, lone, latb, late. Required. Region of interest");
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char** argv)
|
|
|
|
{
|
|
|
|
if(argc == 1)
|
|
|
|
{
|
|
|
|
Usage(argv[0]);
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
auto args = ParseArgs(argc, argv);
|
|
|
|
|
|
|
|
MString action = args.contains("action") ? args["action"] : "tsc";
|
|
|
|
|
|
|
|
int ret = 1;
|
|
|
|
if(action == "info")
|
|
|
|
ret = actioninfo(args);
|
|
|
|
else if(action == "tsc")
|
|
|
|
ret = actiontsc(args);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
errmessage("Unknown action " + action);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|