28#if __has_include(<unistd.h>)
45#if defined(_POSIX_VERSION) && !defined(__hpux) && !defined(_AIX)
46#define HAVE_GETOPT_LONG 1
54void FC_FUNC_(set_number_clarg, SET_NUMBER_CLARG)(
int *nargc) {
56 argv = (
char **)malloc(argc *
sizeof(
char *));
63void FC_FUNC_(clean_clarg, CLEAN_CLARG)() {
65 for (
i = 0;
i < argc;
i++)
75 printf(
"Usage: oct-oscillator-strength [OPTIONS] [w]\n");
78 printf(
" -h Prints this help and exits.\n");
79 printf(
" -m <mode> Select the run mode:\n");
80 printf(
" 1 (default) analyzes the signal present in an "
82 printf(
" This should have been generated by this same "
84 printf(
" (run mode 2).\n");
85 printf(
" 2 Reads a number of 'multipoles' files, which "
87 printf(
" present in the working directory, and be "
89 printf(
" 'multipoles.1', 'multipoles.2', ..., and "
90 "generate an 'ot'\n");
91 printf(
" file with the k-th order response of a given "
93 printf(
" The order k is decided by the '-k' option. The "
95 printf(
" is decided by the '-O' option.\n");
96 printf(
" 3 Peforms an analysis of the second-order "
98 printf(
" operator O, present in the working directory, "
100 printf(
" previously generated with run mode 2. It also "
102 printf(
" file with a list of frequecies around which "
104 printf(
" for resonances is performed.\n");
105 printf(
" 4 Reads an 'ot' file, and generates an 'omega' "
107 printf(
" either the sine or cosine Fourier transform of "
109 printf(
" signal present in 'ot'.\n");
110 printf(
" -O <operator> Selects the operator to be analyzed:\n");
111 printf(
" o If <operator> is a pair of integers in the "
114 " then the operator will be the (l,m) multipole.\n");
115 printf(
" o If <operator> is x, y, or z, then the response "
117 printf(
" to be analyzed will be the dipole in the given "
119 printf(
" o If the -O option is not given in the command "
121 printf(
" the observation operator O will be the same as "
123 printf(
" perturbation operator that defines the initial "
125 printf(
" -f <file> This is the file where the frequencies needed in "
127 printf(
" 3 are stored.\n");
128 printf(
" -d <gamma> gamma is the damping factor used in the SOS "
130 printf(
" produce (hyper)-polarizabilities.\n");
131 printf(
" -s <dw> Limits of the search interval: [w-dw,w+dw]\n");
132 printf(
" -r <r> Number of resonances to search for.\n");
134 " -n <N> Number of frequencies in which the search interval\n");
135 printf(
" is discretized (default 1000)\n");
136 printf(
" -k <k> Process, or generate, the k-th order response.\n");
137 printf(
" -t <time> The signal analysis will be done by integrating in "
139 printf(
" time interval [0, <time>]. If this argument is "
141 printf(
" it makes use of all the time-window present in "
143 printf(
" multipoles files.\n");
147void FC_FUNC_(getopt_oscillator_strength, GETOPT_OSCILLATOR_STRENGTH)(
148 int *
mode,
double *omega,
double *searchinterval,
int *order,
149 int *nresonances,
int *nfrequencies,
double *time,
int *
l,
int *m,
150 double *damping,
char * ffile) {
158 c = getopt(argc, argv,
"hm:s:k:O:r:n:t:d:f:");
168 *
mode = (int)atoi(optarg);
172 *searchinterval = (double)atof(optarg);
176 c = sscanf(optarg,
"(%d,%d)",
l, m);
192 printf(
"Problem reading the -O option value.\n\n");
199 *order = (int)atoi(optarg);
203 *nresonances = (int)atoi(optarg);
207 *nfrequencies = (int)atoi(optarg);
211 *time = (double)atof(optarg);
215 strcpy(ffile, optarg);
219 *damping = (double)atof(optarg);
228 while (optind < argc)
229 *omega = (double)atof(argv[optind++]);
236 printf(
"Usage: oct-harmonic-spectrum [OPTIONS] \n");
238 printf(
"Options:\n");
239 printf(
" -h, --help Prints this help and exits.\n");
240 printf(
" -v, --version Prints octopus version.\n");
241 printf(
" -w, --freq=freq Specifies the fundamental frequency.\n");
243 " -p, --pol=pol Specifies the direction of the light polarization.\n");
244 printf(
" The oct-harmonic-spectrum utility program needs to "
246 printf(
" the direction along which the emission radiation "
248 printf(
" considered to be polarized. It may be linearly "
250 printf(
" or circularly polarized. The valid options are:\n");
251 printf(
" 'x' : Linearly polarized field in the x "
253 printf(
" 'y' : Linearly polarized field in the x "
255 printf(
" 'z' : Linearly polarized field in the x "
257 printf(
" '+' : Circularly polarized field, "
258 "counterclockwise.\n");
259 printf(
" '-' : Circularly polarized field, clockwise.\n");
260 printf(
" 'v' : Along a direction specified by -x X -y Y "
262 printf(
" The default is 'x'\n");
263 printf(
" -a, --ar Calculates the angle-resolved harmonic-spectrum "
266 " direction (X,Y,Z) specified by by -x X -y Y -z Z.\n");
267 printf(
" -m, --mode=mode Whether the harmonic spectrum is computed by "
269 printf(
" second derivative of the dipole moment "
270 "numerically, the \n");
271 printf(
" the time derivative of the current, or by making "
273 printf(
" the dipole acceleration.\n");
274 printf(
" ' The options are:\n");
275 printf(
" '1' : use the dipole, take second derivative "
277 printf(
" '2' : use the acceleration file.\n");
278 printf(
" '3' : use the total current file.\n");
279 printf(
" The default is '1'\n");
284 double *y,
double *z,
288#if defined(HAVE_GETOPT_LONG)
289 static struct option long_options[] = {
290 {
"help", no_argument, 0,
'h'}, {
"version", no_argument, 0,
'v'},
291 {
"freq", required_argument, 0,
'w'}, {
"pol", required_argument, 0,
'p'},
292 {
"mode", required_argument, 0,
'm'}, {
"ar", required_argument, 0,
'a'},
293 {
"x", required_argument, 0,
'x'}, {
"y", required_argument, 0,
'y'},
294 {
"z", required_argument, 0,
'z'}, {0, 0, 0, 0}};
298 int option_index = 0;
299#if defined(HAVE_GETOPT_LONG)
300 c =
getopt_long(argc, argv,
"hvw:p:m:x:y:z:a", long_options, &option_index);
302 c = getopt(argc, argv,
"hvw:p:m:x:y:z:a");
313 printf(
"octopus %s (git commit %s)\n", PACKAGE_VERSION, GIT_COMMIT);
317 *
w0 = (double)atof(optarg);
325 *m = (int)atoi(optarg);
333 *x = (double)atof(optarg);
337 *y = (double)atof(optarg);
341 *z = (double)atof(optarg);
350 printf(
"Usage: oct-help [options] \n");
352 printf(
"Options:\n");
353 printf(
" -h, --help Prints this help and exits.\n");
354 printf(
" -v, --version Prints octopus version.\n");
355 printf(
" -s, --search=STRING Search variables whose names contain string "
357 printf(
" -p, --print=VARNAME Prints description of variable 'VARNAME'.\n");
365#if defined(HAVE_GETOPT_LONG)
366 static struct option long_options[] = {{
"help", no_argument, 0,
'h'},
367 {
"version", no_argument, 0,
'v'},
368 {
"list", no_argument, 0,
'l'},
369 {
"search", required_argument, 0,
's'},
370 {
"print", required_argument, 0,
'p'},
375 int option_index = 0;
376#if defined(HAVE_GETOPT_LONG)
377 c =
getopt_long(argc, argv,
"hvls:p:", long_options, &option_index);
379 c = getopt(argc, argv,
"hvls:p:");
392 printf(
"octopus %s (git commit %s)\n", PACKAGE_VERSION, GIT_COMMIT);
396 strcpy(
mode,
"list");
400 strcpy(
mode,
"search");
401 strcpy(name, optarg);
405 strcpy(
mode,
"print");
406 strcpy(name, optarg);
418 printf(
"Usage: octopus [options] \n");
420 printf(
"Options:\n");
421 printf(
" -h, --help Prints this help and exits.\n");
422 printf(
" -v, --version Prints octopus version.\n");
423 printf(
" -c, --config Prints compilation configuration options.\n");
429#if defined(HAVE_GETOPT_LONG)
430 static struct option long_options[] = {{
"help", no_argument, 0,
'h'},
431 {
"version", no_argument, 0,
'v'},
432 {
"config", no_argument, 0,
'c'},
437 int option_index = 0;
438#if defined(HAVE_GETOPT_LONG)
439 c =
getopt_long(argc, argv,
"hvc", long_options, &option_index);
441 c = getopt(argc, argv,
"hvc");
450 printf(
"octopus %s (git commit %s)\n", PACKAGE_VERSION, GIT_COMMIT);
454 printf(
"%s\n", config_str_c);
467 printf(
"Usage: oct-casida_spectrum [options] \n");
469 printf(
"Options:\n");
470 printf(
" -h, --help Prints this help and exits.\n");
471 printf(
" -v, --version Prints octopus version.\n");
475void FC_FUNC_(getopt_casida_spectrum, GETOPT_CASIDA_SPECTRUM)() {
477#if defined(HAVE_GETOPT_LONG)
478 static struct option long_options[] = {{
"help", no_argument, 0,
'h'},
479 {
"version", no_argument, 0,
'v'},
484 int option_index = 0;
485#if defined(HAVE_GETOPT_LONG)
486 c =
getopt_long(argc, argv,
"hv", long_options, &option_index);
488 c = getopt(argc, argv,
"hv");
497 printf(
"octopus %s (git commit %s)\n", PACKAGE_VERSION, GIT_COMMIT);
509 printf(
"Usage: oct-center-geom [options] \n");
511 printf(
"Options:\n");
512 printf(
" -h, --help Prints this help and exits.\n");
513 printf(
" -v, --version Prints octopus version.\n");
517void FC_FUNC_(getopt_center_geom, GETOPT_CENTER_GEOM)() {
519#if defined(HAVE_GETOPT_LONG)
520 static struct option long_options[] = {{
"help", no_argument, 0,
'h'},
521 {
"version", no_argument, 0,
'v'},
526 int option_index = 0;
527#if defined(HAVE_GETOPT_LONG)
528 c =
getopt_long(argc, argv,
"hv", long_options, &option_index);
530 c = getopt(argc, argv,
"hv");
539 printf(
"octopus %s (git commit %s)\n", PACKAGE_VERSION, GIT_COMMIT);
551 printf(
"Usage: oct-dielectric-function [options] \n");
553 printf(
"Options:\n");
554 printf(
" -h, --help Prints this help and exits.\n");
555 printf(
" -v, --version Prints octopus version.\n");
559void FC_FUNC_(getopt_dielectric_function, GETOPT_DIELECTRIC_FUNCTION)() {
561#if defined(HAVE_GETOPT_LONG)
562 static struct option long_options[] = {{
"help", no_argument, 0,
'h'},
563 {
"version", no_argument, 0,
'v'},
568 int option_index = 0;
569#if defined(HAVE_GETOPT_LONG)
570 c =
getopt_long(argc, argv,
"hv", long_options, &option_index);
572 c = getopt(argc, argv,
"hv");
581 printf(
"octopus %s (git commit %s)\n", PACKAGE_VERSION, GIT_COMMIT);
593 printf(
"Usage: oct-propagation_spectrum [options] \n");
595 printf(
"Options:\n");
596 printf(
" -h, --help Prints this help and exits.\n");
597 printf(
" -v, --version Prints octopus version.\n");
598 printf(
" -r, --reference REF REF should be the name of the 'reference' "
599 "multipoles file,.\n");
600 printf(
" whenever you want to do a time-dependent "
601 "response function.\n");
602 printf(
" calculation.\n");
608#if defined(HAVE_GETOPT_LONG)
609 static struct option long_options[] = {
610 {
"help", no_argument, 0,
'h'},
611 {
"version", no_argument, 0,
'v'},
612 {
"reference", required_argument, 0,
'r'},
617 int option_index = 0;
618#if defined(HAVE_GETOPT_LONG)
619 c =
getopt_long(argc, argv,
"hvr:", long_options, &option_index);
621 c = getopt(argc, argv,
"hvr:");
630 printf(
"octopus %s (git commit %s)\n", PACKAGE_VERSION, GIT_COMMIT);
633 strcpy(fname, optarg);
645 printf(
"Usage: oct-xyz-anim [options] \n");
647 printf(
"Options:\n");
648 printf(
" -h, --help Prints this help and exits.\n");
649 printf(
" -v, --version Prints octopus version.\n");
653void FC_FUNC_(getopt_xyz_anim, GETOPT_XYZ_ANIM)() {
655#if defined(HAVE_GETOPT_LONG)
656 static struct option long_options[] = {{
"help", no_argument, 0,
'h'},
657 {
"version", no_argument, 0,
'v'},
662 int option_index = 0;
663#if defined(HAVE_GETOPT_LONG)
664 c =
getopt_long(argc, argv,
"hv", long_options, &option_index);
666 c = getopt(argc, argv,
"hv");
675 printf(
"octopus %s (git commit %s)\n", PACKAGE_VERSION, GIT_COMMIT);
687 printf(
"Usage: oct-photoelectron_spectrum [OPTIONS] \n");
689 printf(
"Options:\n");
690 printf(
" -h, --help Prints this help and exits.\n");
691 printf(
" -v, --version Prints octopus version.\n");
692 printf(
" -V, --vec=x,y,z The polar zenith direction in comma-separated "
694 printf(
" (without spaces). Default is the laser "
696 printf(
" -u, --pvec=x,y,z The plane cut vector in comma-separated "
698 printf(
" Default is 0,0,1 (px-py plane). \n");
699 printf(
" -C, --center=x,y,z Center of the coordinates in p-space in "
700 "comma-separated format \n");
701 printf(
" Default: 0,0,0. \n");
702 printf(
" -E, Maximum and minimum energy in colon-separated "
704 printf(
" --espan=Emin:Emax "
706 printf(
" -e, --de The resolution in energy.\n");
707 printf(
" -T, Maximum and minimum theta in colon-separated "
709 printf(
" --thspan=thetamin:thetamax "
711 printf(
" -t, --dth The resolution in theta.\n");
712 printf(
" -P, Maximum and minimum phi in colon separated "
714 printf(
" --phspan=phimin:phimax "
716 printf(
" -p, --dph The resolution in phi.\n");
717 printf(
" -I, --integr=var The spectrum is integrated over the specified "
719 printf(
" example \"-I phi\" integrates over phi. \n");
724void FC_FUNC_(getopt_photoelectron_spectrum,
725 GETOPT_PHOTOELECTRON_SPECTRUM)(
double *estep,
double *espan,
726 double *thstep,
double *thspan,
727 double *phstep,
double *phspan,
728 double *pol,
double *
center,
729 double *pvec,
int *integrate) {
731 char delims[] =
",:";
734#if defined(HAVE_GETOPT_LONG)
735 static struct option long_options[] = {{
"help", no_argument, 0,
'h'},
736 {
"version", no_argument, 0,
'v'},
737 {
"integr", required_argument, 0,
'I'},
738 {
"de", required_argument, 0,
'e'},
739 {
"espan", required_argument, 0,
'E'},
740 {
"dth", required_argument, 0,
't'},
741 {
"thspan", required_argument, 0,
'T'},
742 {
"dph", required_argument, 0,
'p'},
743 {
"phspan", required_argument, 0,
'P'},
744 {
"vec", required_argument, 0,
'V'},
745 {
"pvec", required_argument, 0,
'v'},
746 {
"center", required_argument, 0,
'C'},
751 int option_index = 0;
752#if defined(HAVE_GETOPT_LONG)
753 c =
getopt_long(argc, argv,
"hve:E:P:p:T:t:V:C:u:I:", long_options,
756 c = getopt(argc, argv,
"hve:E:P:p:T:t:V:C:u:I:");
767 printf(
"octopus %s (git commit %s)\n", PACKAGE_VERSION, GIT_COMMIT);
772 if ((strcmp(optarg,
"phi") == 0)) {
774 }
else if ((strcmp(optarg,
"theta") == 0)) {
776 }
else if ((strcmp(optarg,
"r") == 0)) {
778 }
else if ((strcmp(optarg,
"kx") == 0)) {
780 }
else if ((strcmp(optarg,
"ky") == 0)) {
782 }
else if ((strcmp(optarg,
"kz") == 0)) {
785 printf(
"Unrecognized integration variable %s.\n", optarg);
791 *estep = atof(optarg);
795 tok = strtok(optarg, delims);
796 espan[0] = atof(tok);
797 tok = strtok(NULL, delims);
798 espan[1] = atof(tok);
803 *thstep = atof(optarg);
807 tok = strtok(optarg, delims);
808 thspan[0] = atof(tok);
809 tok = strtok(NULL, delims);
810 thspan[1] = atof(tok);
815 *phstep = atof(optarg);
819 tok = strtok(optarg, delims);
820 phspan[0] = atof(tok);
821 tok = strtok(NULL, delims);
822 phspan[1] = atof(tok);
827 tok = strtok(optarg, delims);
829 tok = strtok(NULL, delims);
831 tok = strtok(NULL, delims);
837 tok = strtok(optarg, delims);
839 tok = strtok(NULL, delims);
841 tok = strtok(NULL, delims);
847 tok = strtok(optarg, delims);
849 tok = strtok(NULL, delims);
851 tok = strtok(NULL, delims);
void getopt_harmonic_spectrum(double *w0, int *m, int *ar, double *x, double *y, double *z, char *pol)
void FC_FUNC_(clean_clarg, CLEAN_CLARG)()
void getopt_propagation_spectrum(char *fname)
void set_clarg(int *i, char *c)
void getopt_octopus(char *config_str_c)
void casida_spectrum_help()
void dielectric_function_help()
void oscillator_strength_help()
void propagation_spectrum_help()
void harmonic_spectrum_help()
void photoelectron_spectrum_help()
int getopt_long(int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind) __attribute__((__nothrow__
if write to the Free Software Franklin Fifth USA !The assertions are ignored if the code is compiled in not debug mode(NDEBUG ! is defined). Otherwise it is merely a logical assertion that
pure real(real64) function center(this)
Center of the filter interval.