4
#include "prototypes.h"
9
void get_opdm_lbl(void) {
15
if (ip_exist("NUM_ROOTS",0)) {
17
errcod = ip_data("NUM_ROOTS","%d",&nrho,0);
18
if (errcod != IPE_OK) {
19
fprintf(outfile,"(oeprop): error parsing NUM_ROOTS keyword\n");
23
else if (cc_wfn(wfn)) {
25
psio_read_entry(CC_INFO, "Num. of CC densities", (char *) &(nrho),
27
psio_close(CC_INFO,1);
29
else if (ci_wfn(wfn)) {
30
psio_open(opdm_file,1);
32
psio_read_entry(opdm_file, "Num MO-basis TDM", (char *) &(nrho),
35
psio_read_entry(opdm_file, "Num MO-basis OPDM", (char *) &(nrho),
37
psio_close(opdm_file,1);
41
fprintf(outfile,"(oeprop): error - got nrho = %d\n", nrho);
45
/* if the ROOT keyword is specified, let's just analyze the ROOT given
46
and not however many there may be on disk */
47
if (ip_exist("ROOT",0)) {
49
errcod = ip_data("ROOT","%d",&root,0);
50
if (errcod != IPE_OK) {
51
fprintf(outfile,"(oeprop): error parsing ROOT keyword\n");
56
opdm_lbl = (char **) malloc(sizeof(char *) * nrho);
57
opdm_lbl[0] = (char *) malloc(32*sizeof(char));
60
sprintf(opdm_lbl[0],"MO-basis TDM Root %d",root);
62
sprintf(opdm_lbl[0],"MO-basis OPDM Root %d",root);
63
} /* end ROOT exists */
65
/* if ROOT is not given and only one density specified,
66
then let's analyze "THE" density */
68
if ( !strcmp(ref,"RHF") || !strcmp(ref,"ROHF") ) {
69
opdm_lbl = (char **) malloc(sizeof(char *) * nrho);
70
opdm_lbl[0] = (char *) malloc(32*sizeof(char));
71
sprintf(opdm_lbl[0], "MO-basis %s", transdens ? "TDM" : "OPDM");
74
opdm_a_lbl = (char **) malloc(sizeof(char *) * nrho);
75
opdm_a_lbl[0] = (char *) malloc(32*sizeof(char));
76
opdm_b_lbl = (char **) malloc(sizeof(char *) * nrho);
77
opdm_b_lbl[0] = (char *) malloc(32*sizeof(char));
78
sprintf(opdm_a_lbl[0], "MO-basis Alpha %s", transdens ? "TDM" : "OPDM");
79
sprintf(opdm_b_lbl[0], "MO-basis Beta %s", transdens ? "TDM" : "OPDM");
81
} /* end "THE" density */
84
fprintf(outfile, "\tTransition densities available up to root %d\n", nrho);
86
fprintf(outfile, "\tDensities available up to root %d\n", nrho);
88
if (nrho == 1) return;
90
if ( !strcmp(ref,"RHF") || !strcmp(ref,"ROHF") ) {
91
opdm_lbl = (char **) malloc(sizeof(char *) * nrho);
92
for (i=0;i<nrho;i++) {
93
opdm_lbl[i] = (char *) malloc(32*sizeof(char));
94
if (i==0 && cc_wfn(wfn)) sprintf(opdm_lbl[i], "MO-basis %s",
95
transdens ? "TDM" : "OPDM");
96
else sprintf(opdm_lbl[i], "MO-basis %s Root %d",
97
transdens ? "TDM" : "OPDM", i);
101
opdm_a_lbl = (char **) malloc(sizeof(char *) * nrho);
102
opdm_b_lbl = (char **) malloc(sizeof(char *) * nrho);
103
for (i=0;i<nrho;i++) {
104
opdm_a_lbl[i] = (char *) malloc(32*sizeof(char));
105
opdm_b_lbl[i] = (char *) malloc(32*sizeof(char));
106
if (i==0 && cc_wfn(wfn)) {
107
sprintf(opdm_a_lbl[i], "MO-basis Alpha %s",
108
transdens ? "TDM" : "OPDM");
109
sprintf(opdm_b_lbl[i], "MO-basis Beta %s",
110
transdens ? "TDM" : "OPDM");
113
sprintf(opdm_a_lbl[i], "MO-basis Alpha %s Root %d",
114
transdens ? "TDM" : "OPDM", i);
115
sprintf(opdm_b_lbl[i], "MO-basis Beta %s Root %d",
116
transdens ? "TDM" : "OPDM", i);