5
#include <libipv1/ip_lib.h>
6
#include <libciomr/libciomr.h>
14
int i, errcod, ref, count, iconv, *tmpi;
15
char *junk, units[20];
18
errcod = ip_data("PRINT","%d",&(params.print),0);
20
fndcor(&(params.memory), infile, outfile);
23
errcod = ip_data("CACHELEV", "%d", &(params.cachelev),0);
26
errcod = ip_string("REFERENCE", &(junk),0);
27
/* if no reference is given, assume rhf */
28
if (errcod != IPE_OK) {
32
if(!strcmp(junk, "RHF")) ref = 0;
33
else if(!strcmp(junk, "ROHF")) ref = 1;
34
else if(!strcmp(junk, "UHF")) ref = 2;
36
printf("Invalid value of input keyword REFERENCE: %s\n", junk);
37
exit(PSI_RETURN_FAILURE);
42
/* Make sure the value of ref matches that from CC_INFO */
43
if(params.ref != ref) {
44
fprintf(outfile, "Value of REFERENCE from input.dat (%1d) and CC_INFO (%1d) do not match!\n",
46
fprintf(outfile, "Is this what you want to do?\n");
50
/* grab the field strength from input -- a few different units are converted to E_h */
51
params.omega = 0.0; /* static polarizability by default */
52
if(ip_exist("OMEGA",0)) {
53
errcod = ip_count("OMEGA", &count, 0);
55
if(errcod == IPE_NOT_AN_ARRAY) /* assume Hartrees */
56
errcod = ip_data("OMEGA", "%lf", &(params.omega), 0);
60
errcod = ip_data("OMEGA", "%lf", &(params.omega), 1, 0);
61
errcod = ip_data("OMEGA", "%s", units, 1, 1);
63
for(junk = units; *junk != '\0'; junk++)
64
if(*junk>='a' && *junk <= 'z') *junk += 'A' - 'a';
66
if(!strcmp(units, "HZ")) params.omega *= _h / _hartree2J;
67
else if(!strcmp(units, "NM")) params.omega = (_c*_h*1e9)/(params.omega*_hartree2J);
68
else if(!strcmp(units, "EV")) params.omega /= _hartree2ev;
72
moinfo.mu_irreps = init_int_array(3);
73
errcod = ip_int_array("MU_IRREPS", moinfo.mu_irreps, 3);
74
if(errcod == IPE_OK) {
75
moinfo.irrep_x = moinfo.mu_irreps[0];
76
moinfo.irrep_y = moinfo.mu_irreps[1];
77
moinfo.irrep_z = moinfo.mu_irreps[2];
80
fprintf(outfile, "\nYou must supply the irreps of x, y, and z with the MU_IRREPS keyword.\n");
81
exit(PSI_RETURN_FAILURE);
84
/* compute the irreps of the angular momentum operator while we're here */
85
moinfo.l_irreps = init_int_array(3);
87
moinfo.l_irreps[i] = moinfo.mu_irreps[(int) (i+1)%3] ^ moinfo.mu_irreps[(int) (i+2)%3];
89
moinfo.irrep_Rx = moinfo.l_irreps[0];
90
moinfo.irrep_Ry = moinfo.l_irreps[1];
91
moinfo.irrep_Rz = moinfo.l_irreps[2];
94
errcod = ip_data("MAXITER","%d",&(params.maxiter),0);
95
params.convergence = 1e-7;
96
errcod = ip_data("CONVERGENCE","%d",&(iconv),0);
97
if(errcod == IPE_OK) params.convergence = 1.0*pow(10.0,(double) -iconv);
99
errcod = ip_boolean("DIIS", &(params.diis), 0);
101
if(ip_exist("PROPERTY",0)) {
102
errcod = ip_string("PROPERTY", &(params.prop), 0);
103
if(strcmp(params.prop,"POLARIZABILITY") && strcmp(params.prop,"ROTATION") &&
104
strcmp(params.prop,"ALL")) {
105
fprintf(outfile, "Invalid choice of response property: %s\n", params.prop);
106
exit(PSI_RETURN_FAILURE);
109
else params.prop = strdup("POLARIZABILITY");
112
errcod = ip_boolean("LOCAL", &(params.local),0);
114
errcod = ip_data("LOCAL_CUTOFF", "%lf", &(local.cutoff), 0);
116
if(ip_exist("LOCAL_METHOD",0)) {
117
errcod = ip_string("LOCAL_METHOD", &(local.method), 0);
118
if(strcmp(local.method,"AOBASIS") && strcmp(local.method,"WERNER")) {
119
fprintf(outfile, "Invalid local correlation method: %s\n", local.method);
120
exit(PSI_RETURN_FAILURE);
123
else if(params.local) {
124
local.method = (char *) malloc(7 * sizeof(char));
125
sprintf(local.method, "%s", "WERNER");
128
if(ip_exist("LOCAL_WEAKP",0)) {
129
errcod = ip_string("LOCAL_WEAKP", &(local.weakp), 0);
130
if(strcmp(local.weakp,"MP2") && strcmp(local.weakp,"NEGLECT") && strcmp(local.weakp,"NONE")) {
131
fprintf(outfile, "Invalid method for treating local pairs: %s\n", local.weakp);
132
exit(PSI_RETURN_FAILURE);
135
else if(params.local) {
136
local.weakp = (char *) malloc(4 * sizeof(char));
137
sprintf(local.weakp, "%s", "NONE");
140
local.filter_singles = 1;
141
ip_boolean("LOCAL_FILTER_SINGLES", &(local.filter_singles), 0);
144
ip_boolean("ANALYZE", &(params.analyze), 0);
146
fprintf(outfile, "\n\tInput parameters:\n");
147
fprintf(outfile, "\t-----------------\n");
148
if(!strcmp(params.prop,"ALL"))
149
fprintf(outfile, "\tProperty = POLARIZABILITY + ROTATION\n");
151
fprintf(outfile, "\tProperty = %s\n", params.prop);
152
fprintf(outfile, "\tReference wfn = %5s\n",
153
(params.ref == 0) ? "RHF" : ((params.ref == 1) ? "ROHF" : "UHF"));
154
fprintf(outfile, "\tMemory (Mbytes) = %5.1f\n",params.memory/1e6);
155
fprintf(outfile, "\tCache Level = %1d\n", params.cachelev);
156
fprintf(outfile, "\tPrint Level = %1d\n", params.print);
157
fprintf(outfile, "\tMaxiter = %3d\n", params.maxiter);
158
fprintf(outfile, "\tConvergence = %3.1e\n", params.convergence);
159
fprintf(outfile, "\tDIIS = %s\n", params.diis ? "Yes" : "No");
160
fprintf(outfile, "\tIrrep X = %3s\n", moinfo.labels[moinfo.irrep_x]);
161
fprintf(outfile, "\tIrrep Y = %3s\n", moinfo.labels[moinfo.irrep_y]);
162
fprintf(outfile, "\tIrrep Z = %3s\n", moinfo.labels[moinfo.irrep_z]);
163
fprintf(outfile, "\tIrrep RX = %3s\n", moinfo.labels[moinfo.irrep_Rx]);
164
fprintf(outfile, "\tIrrep RY = %3s\n", moinfo.labels[moinfo.irrep_Ry]);
165
fprintf(outfile, "\tIrrep RZ = %3s\n", moinfo.labels[moinfo.irrep_Rz]);
166
if(params.omega == 0.0)
167
fprintf(outfile, "\tApplied field = none\n");
169
fprintf(outfile, "\tApplied field = %5.3f E_h (%6.2f nm, %5.3f eV, %8.2f cm-1)\n", params.omega,
170
(_c*_h*1e9)/(_hartree2J*params.omega), _hartree2ev*params.omega,
171
_hartree2wavenumbers*params.omega);
172
fprintf(outfile, "\tLocal CC = %s\n", params.local ? "Yes" : "No");
174
fprintf(outfile, "\tLocal Cutoff = %3.1e\n", local.cutoff);
175
fprintf(outfile, "\tLocal Method = %s\n", local.method);
176
fprintf(outfile, "\tWeak pairs = %s\n", local.weakp);
177
fprintf(outfile, "\tFilter singles = %s\n", local.filter_singles ? "Yes" : "No");
179
fprintf(outfile, "\tAnalyze X2 Amps = %s\n", params.analyze ? "Yes" : "No");
180
fprintf(outfile, "\n");