5
#include <libipv1/ip_lib.h>
6
#include <libciomr/libciomr.h>
13
int errcod, iconv, ref, forceit;
14
char *cachetype = NULL;
17
errcod = ip_string("WFN", &(params.wfn), 0);
18
if(strcmp(params.wfn, "CCSD") && strcmp(params.wfn, "CCSD_T") &&
19
strcmp(params.wfn, "EOM_CCSD") && strcmp(params.wfn, "LEOM_CCSD") &&
20
strcmp(params.wfn, "BCCD") && strcmp(params.wfn,"BCCD_T")) {
21
fprintf(outfile, "Invalid value of input keyword WFN: %s\n", params.wfn);
22
exit(PSI_RETURN_FAILURE);
25
if(!strcmp(params.wfn,"BCCD") || !strcmp(params.wfn,"BCCD_T"))
27
else params.brueckner = 0;
29
errcod = ip_string("REFERENCE", &(junk),0);
30
/* if no reference is given, assume rhf */
31
if (errcod != IPE_OK) {
35
if(!strcmp(junk, "RHF")) ref = 0;
36
else if(!strcmp(junk, "ROHF")) ref = 1;
37
else if(!strcmp(junk, "UHF")) ref = 2;
39
printf("Invalid value of input keyword REFERENCE: %s\n", junk);
40
exit(PSI_RETURN_FAILURE);
45
/* Make sure the value of ref matches that from CC_INFO */
46
if(params.ref != ref) {
47
printf("Value of REFERENCE from input.dat (%1d) and CC_INFO (%1d) do not match!\n",
49
exit(PSI_RETURN_FAILURE);
53
errcod = ip_data("PRINT", "%d", &(params.print),0);
56
errcod = ip_data("MAXITER","%d",&(params.maxiter),0);
57
params.convergence = 1e-7;
58
errcod = ip_data("CONVERGENCE","%d",&(iconv),0);
59
if(errcod == IPE_OK) params.convergence = 1.0*pow(10.0,(double) -iconv);
61
errcod = ip_boolean("RESTART", &(params.restart),0);
62
/* If the MO orbital phases are screwed up, don't restart */
63
if(!moinfo.phase) params.restart = 0;
64
/* BUT, the user can force an override of the phase problem */
66
errcod = ip_boolean("FORCE_RESTART", &forceit,0);
67
if(forceit) params.restart = 1;
69
fndcor(&(params.memory),infile,outfile);
71
if(ip_exist("AO_BASIS",0)) {
72
errcod = ip_string("AO_BASIS", &(params.aobasis),0);
74
else params.aobasis = strdup("NONE");
75
if(strcmp(params.aobasis,"DISK") && strcmp(params.aobasis,"DIRECT") &&
76
strcmp(params.aobasis,"NONE")) {
77
fprintf(outfile, "Error in input: invalid AO_BASIS = %s\n",
79
exit(PSI_RETURN_FAILURE);
83
errcod = ip_data("CACHELEV", "%d", &(params.cachelev),0);
86
errcod = ip_string("CACHETYPE", &(cachetype),0);
87
if(cachetype != NULL && strlen(cachetype)) {
88
if(!strcmp(cachetype,"LOW")) params.cachetype = 1;
89
else if(!strcmp(cachetype,"LRU")) params.cachetype = 0;
91
fprintf(outfile, "Error in input: invalid CACHETYPE = %s\n",
93
exit(PSI_RETURN_FAILURE);
97
if(params.ref == 2) /* No LOW cacheing yet for UHF references */
101
errcod = ip_boolean("DIIS", &(params.diis),0);
104
errcod = ip_boolean("LOCAL", &(params.local),0);
106
errcod = ip_data("LOCAL_CUTOFF", "%lf", &(local.cutoff), 0);
108
if(ip_exist("LOCAL_METHOD",0)) {
109
errcod = ip_string("LOCAL_METHOD", &(local.method), 0);
110
if(strcmp(local.method,"AOBASIS") && strcmp(local.method,"WERNER")) {
111
fprintf(outfile, "Invalid local correlation method: %s\n", local.method);
112
exit(PSI_RETURN_FAILURE);
115
else if(params.local) {
116
local.method = (char *) malloc(7 * sizeof(char));
117
sprintf(local.method, "%s", "WERNER");
120
if(ip_exist("LOCAL_WEAKP",0)) {
121
errcod = ip_string("LOCAL_WEAKP", &(local.weakp), 0);
122
if(strcmp(local.weakp,"MP2") && strcmp(local.weakp,"NEGLECT") && strcmp(local.weakp,"NONE")) {
123
fprintf(outfile, "Invalid method for treating local pairs: %s\n", local.weakp);
124
exit(PSI_RETURN_FAILURE);
127
else if(params.local) {
128
local.weakp = (char *) malloc(4 * sizeof(char));
129
sprintf(local.weakp, "%s", "MP2");
132
local.filter_singles = 1;
133
ip_boolean("LOCAL_FILTER_SINGLES", &(local.filter_singles), 0);
135
params.num_amps = 10;
136
if(ip_exist("NUM_AMPS",0)) {
137
errcod = ip_data("NUM_AMPS", "%d", &(params.num_amps), 0);
141
errcod = ip_data("BRUECKNER_CONV", "%d", &(iconv), 0);
142
if(errcod == IPE_OK) params.bconv = 1.0*pow(10.0,(double) -iconv);
144
params.print_mp2_amps = 0;
145
errcod = ip_boolean("PRINT_MP2_AMPS", &(params.print_mp2_amps), 0);
148
errcod = ip_boolean("ANALYZE", &(params.analyze), 0);
150
fprintf(outfile, "\n\tInput parameters:\n");
151
fprintf(outfile, "\t-----------------\n");
152
fprintf(outfile, "\tWave function = %6s\n", params.wfn);
153
fprintf(outfile, "\tReference wfn = %5s\n",
154
(params.ref == 0) ? "RHF" : ((params.ref == 1) ? "ROHF" : "UHF"));
156
fprintf(outfile, "\tBrueckner conv. = %3.1e\n", params.bconv);
157
fprintf(outfile, "\tMemory (Mbytes) = %5.1f\n",params.memory/1e6);
158
fprintf(outfile, "\tMaxiter = %4d\n", params.maxiter);
159
fprintf(outfile, "\tConvergence = %3.1e\n", params.convergence);
160
fprintf(outfile, "\tRestart = %s\n",
161
params.restart ? "Yes" : "No");
162
fprintf(outfile, "\tDIIS = %s\n", params.diis ? "Yes" : "No");
163
fprintf(outfile, "\tLocal CC = %s\n", params.local ? "Yes" : "No");
165
fprintf(outfile, "\tLocal Cutoff = %3.1e\n", local.cutoff);
166
fprintf(outfile, "\tLocal Method = %s\n", local.method);
167
fprintf(outfile, "\tWeak pairs = %s\n", local.weakp);
168
fprintf(outfile, "\tFilter singles = %s\n", local.filter_singles ? "Yes" : "No");
170
fprintf(outfile, "\tAO Basis = %s\n", params.aobasis);
171
fprintf(outfile, "\tCache Level = %1d\n", params.cachelev);
172
fprintf(outfile, "\tCache Type = %4s\n",
173
params.cachetype ? "LOW" : "LRU");
174
fprintf(outfile, "\tPrint Level = %1d\n", params.print);
175
fprintf(outfile, "\t# Amps to Print = %1d\n", params.num_amps);
176
fprintf(outfile, "\tPrint MP2 Amps? = %s\n", params.print_mp2_amps ?
178
fprintf(outfile, "\tAnalyze T2 Amps = %s\n", params.analyze ? "Yes" : "No" );
179
fprintf(outfile, "\n");