You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.2 KiB

2 years ago
#include "odm.h"
inline void Usage(const MString& arg0)
{
message(arg0 + " (<key>=<value>...)");
message("Keys are:");
2 years ago
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, HYCOM");
2 years ago
message(" Keys for source=NEMO");
message(" dataset. Can be DT, NRT or NRT6. Default: DT");
message(" Keys for source=HYCOM");
message(" dataset. Can be Forecast, Hindcast or Reanalysis. Default: Forecast");
2 years ago
message(" Keys for action=tsc. Get temperature, salinity, chlorofill from dataset.");
message(" source. Required. May be: NEMO");
message(" var. Required. May be: temp, ptemp, pdens, sal, chl, mld, ssh or w.");
2 years ago
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(" 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 or var=ssh. Default: layer=0");
message(" lonb, lone, latb, late. Required. Region of interest");
message(" Keys for source=HYCOM");
message(" dataset. Can be Forecast, Hindcast or Reanalysis. Default: Forecast");
message(" layer and/or depth. Layer or depth of HYCOM dataset. If depth is specified, layer is ignored. Both ignored, if var=mld or var=ssh. Default: layer=0");
2 years ago
message(" lonb, lone, latb, late. Required. Region of interest");
2 years ago
}
int main(int argc, char** argv)
{
if(argc == 1)
{
Usage(argv[0]);
return 2;
}
auto args = ParseArgs(argc, argv);
2 years ago
MString action = args.contains("action") ? args["action"] : "tsc";
2 years ago
Data data;
{
auto ret = data.Init(args);
if(ret.Exist())
{
errmessage(ret);
return 1;
}
}
MString ret;
2 years ago
if(action == "info")
ret = data.ActionInfo(args);
2 years ago
else if(action == "tsc")
ret = data.ActionTsc(args);
2 years ago
else
{
2 years ago
errmessage("Unknown action " + action);
2 years ago
return 1;
}
if(ret.Exist())
{
errmessage(ret);
return 1;
}
2 years ago
return 0;
2 years ago
}