54 int main(
int argc,
char** argv )
59 double x = -0.784768, y = 0.594952, z = -0.173698;
60 double lat = 28.6551, lon = 61.0204;
64 opts.
addOpt<
string >(
"inFile,i",
"Specify the input file name string ", &inputFile );
66 string outFile =
"out.h5m";
67 opts.
addOpt<
string >(
"outFile,o",
"Specify the output file name string ", &outFile );
69 opts.
addOpt<
double >( string(
"xpos,x" ), string(
"x position" ), &x );
70 opts.
addOpt<
double >( string(
"ypos,y" ), string(
"y position" ), &y );
71 opts.
addOpt<
double >( string(
"zpos,z" ), string(
"z position" ), &z );
73 opts.
addOpt<
double >( string(
"latitude,t" ), string(
"north latitude in degrees" ), &lat );
74 opts.
addOpt<
double >( string(
"longitude,w" ), string(
"east longitude in degrees" ), &lon );
76 bool spherical =
false;
77 opts.
addOpt<
void >(
"spherical,s",
"use spherical coords input (default false) ", &spherical );
79 double distance = 0.01;
80 opts.
addOpt<
double >( string(
"distance,d" ), string(
"distance " ), &distance );
98 cout <<
" reading file " << inputFile <<
" on " << numProcesses <<
" task";
99 if( numProcesses > 1 ) cout <<
"s";
116 std::cout <<
" use spherical coordinates on the sphere of radius 1.\n";
119 pos.
lat = lat * M_PI / 180;
120 pos.
lon = lon * M_PI / 180;
131 if( dist <= distance )
133 closeByCells.
insert( cell );
139 int numCells = (int)closeByCells.
size();
144 std::cout <<
" no close cells to the point " << point <<
" at distance less than " << distance <<
"\n";
149 std::cout <<
" write file " << outFile <<
" with cells closer than " << distance <<
" from " << point
152 if( numProcesses > 1 ) writeOpts = string(
"PARALLEL=WRITE_PART;" );