~ubuntu-branches/ubuntu/precise/psicode/precise

« back to all changes in this revision

Viewing changes to src/bin/oeprop/main.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck, Michael Banck, Daniel Leidert
  • Date: 2009-02-23 00:12:02 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090223001202-rutldoy3dimfpesc
Tags: 3.4.0-1
* New upstream release.

[ Michael Banck ]
* debian/patches/01_DESTDIR.dpatch: Refreshed.
* debian/patches/02_FHS.dpatch: Removed, applied upstream.
* debian/patches/03_debian_docdir: Likewise.
* debian/patches/04_man.dpatch: Likewise.
* debian/patches/06_466828_fix_gcc_43_ftbfs.dpatch: Likewise.
* debian/patches/07_464867_move_executables: Fixed and refreshed.
* debian/patches/00list: Adjusted.
* debian/control: Improved description.
* debian/patches-held: Removed.
* debian/rules (install/psi3): Do not ship the ruby bindings for now.

[ Daniel Leidert ]
* debian/rules: Fix txtdir via DEB_MAKE_INSTALL_TARGET.
* debian/patches/01_DESTDIR.dpatch: Refreshed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include "includes.h"
2
 
#include "prototypes.h"
3
 
#include "globals.h"
4
 
 
5
 
 
6
 
int main(int argc, char* argv[]) {
7
 
 
8
 
 int i,j,k,l,count;
9
 
 char buffer[80];       /* buffer string */
10
 
 
11
 
        /* Setting defaults */
12
 
 read_opdm = 0;
13
 
 opdm_file = 76;
14
 
 asymm_opdm = 0;
15
 
 wrtnos = 0;
16
 
 spin_prop = 0;
17
 
 print_lvl = 1;
18
 
 wrt_dipmom = 1;
19
 
 corr = 0;
20
 
 mpmax = 1;
21
 
 mp_ref = 0;
22
 
 nuc_esp = 1;
23
 
 grid = 0;
24
 
 grid3d = 0;
25
 
 nix = 10;
26
 
 niy = 10;
27
 
 niz = 10;
28
 
 grid_zmin = 0.0;
29
 
 grid_zmax = 3.0;
30
 
 edgrad_logscale = 5;
31
 
 zvec_file = 86;
32
 
 delete_zvec = 1;
33
 
 
34
 
 
35
 
        /* Initialization and printing intro */
36
 
 start_io(argc,argv);
37
 
 print_intro();
38
 
 
39
 
/*************************** Main Code *******************************/
40
 
 
41
 
        /* Reading in basic information from checkpoint file */
42
 
 
43
 
 title = chkpt_rd_label();
44
 
 natom = chkpt_rd_natom();
45
 
 natom3 = natom * 3;
46
 
 nmo = chkpt_rd_nmo();
47
 
 nbfso = chkpt_rd_nso();
48
 
 nbfao = chkpt_rd_nao();
49
 
 natri = nbfao * (nbfao+1)/2;
50
 
 nstri = nbfso * (nbfso+1)/2;
51
 
 nshell = chkpt_rd_nshell();
52
 
 nprim = chkpt_rd_nprim();
53
 
 iopen = chkpt_rd_iopen();
54
 
 nirreps = chkpt_rd_nirreps(); 
55
 
 nsym = chkpt_rd_nsymhf();
56
 
 orbspi = chkpt_rd_orbspi();
57
 
 sopi = chkpt_rd_sopi();
58
 
 clsdpi = chkpt_rd_clsdpi();    
59
 
 openpi = chkpt_rd_openpi();
60
 
 irr_labs = chkpt_rd_irr_labs();
61
 
 geom = chkpt_rd_geom();
62
 
 zvals = chkpt_rd_zvals();
63
 
 usotao = chkpt_rd_usotao();
64
 
    
65
 
 /* Parsing */
66
 
 parsing();
67
 
 
68
 
 if (strcmp(ref,"UHF") != 0) {
69
 
   scf_evec_so = chkpt_rd_scf();
70
 
   scf_evals = chkpt_rd_evals();
71
 
   scf_evec_ao = block_matrix(nbfao,nmo);
72
 
   mmult(usotao,1,scf_evec_so,0,scf_evec_ao,0,nbfao,nbfso,nmo,0);
73
 
 }
74
 
 
75
 
 /* parse the grid information */
76
 
 if (ip_exist("GRID",0))
77
 
   grid_parse();
78
 
 
79
 
 /* Computing total charge of the system */
80
 
 
81
 
 charge = 0;
82
 
 for(i=0;i<nirreps;i++)
83
 
   charge -= 2*clsdpi[i] + openpi[i];
84
 
 for(i=0;i<natom;i++)
85
 
   charge += zvals[i];
86
 
 
87
 
 /* Setting up an offset array */
88
 
 
89
 
 ioff = init_int_array(nbfao);
90
 
 ioff[0] = 0;
91
 
 for(i=1;i<nbfao;i++) {
92
 
   ioff[i] = ioff[i-1] + i;
93
 
 }
94
 
 
95
 
        /* Computing double factorials df[i] = (i-1)!! */
96
 
 df[0] = 1.0;
97
 
 df[1] = 1.0;
98
 
 df[2] = 1.0;
99
 
 for(i=3; i<MAXFACT*2; i++) {
100
 
   df[i] = (i-1)*df[i-2];
101
 
 }
102
 
                 
103
 
 /* Printing tasks and parameters */
104
 
 
105
 
 if (print_lvl >= PRINTTASKPARAMLEVEL) {
106
 
   print_tasks();
107
 
   print_params();
108
 
 }
109
 
 
110
 
 /* Reading in basis set inforamtion */
111
 
 
112
 
 read_basset_info();
113
 
 init_xyz(); 
114
 
 
115
 
 chkpt_close();
116
 
 
117
 
 /* RAK and CDS: Determine number of densities to analyze */
118
 
 get_opdm_lbl();
119
 
 
120
 
for (irho=0;irho<nrho;irho++) {
121
 
 
122
 
 if (transdens && irho == 0) continue;
123
 
 
124
 
 fprintf(outfile,"\t** Analyzing ");
125
 
 if (transdens)
126
 
   fprintf(outfile, "transition ");
127
 
 fprintf(outfile, "density number %d **\n", irho+1);
128
 
 
129
 
 chkpt_init(PSIO_OPEN_OLD);
130
 
 
131
 
 /* Obtain a density matrix */
132
 
 if (read_opdm)
133
 
   read_density();
134
 
 else
135
 
   compute_density();
136
 
 
137
 
  compute_overlap();
138
 
   
139
 
  /* Obtain natural orbitals */
140
 
  if (read_opdm && wrtnos) 
141
 
    get_nmo(); 
142
 
   
143
 
  chkpt_close();
144
 
   
145
 
  /* Mulliken population analysis */
146
 
  print_pop_header();
147
 
  populate();
148
 
 
149
 
  /* Compute coordinates of the MP reference point if needed */
150
 
  if (mp_ref != -1)
151
 
    compute_mp_ref_xyz();
152
 
 
153
 
  /* Moving molecule to the reference center!
154
 
   Attention, ever since coordinates of atoms and of the grid box 
155
 
   are stored in this new coordinate system. All coordinates are 
156
 
   transformed back at the moment of printing out. */
157
 
 
158
 
  for(i=0;i<natom;i++) {
159
 
    geom[i][0] -= mp_ref_xyz[0];
160
 
    geom[i][1] -= mp_ref_xyz[1];
161
 
    geom[i][2] -= mp_ref_xyz[2];
162
 
    Lm_ref_xyz[0] -= mp_ref_xyz[0];
163
 
    Lm_ref_xyz[1] -= mp_ref_xyz[1];
164
 
    Lm_ref_xyz[2] -= mp_ref_xyz[2];
165
 
  }
166
 
  if (grid) {
167
 
    grid_origin[0] -= mp_ref_xyz[0];
168
 
    grid_origin[1] -= mp_ref_xyz[1];
169
 
    grid_origin[2] -= mp_ref_xyz[2];
170
 
  }
171
 
 
172
 
        /* Computing one-electron integrals in 
173
 
           terms of Cartesian Gaussians, 
174
 
           electric first (dipole), second and third 
175
 
           moments W.R.T. origin, electrostatic potential,
176
 
           electric field and field gradients,
177
 
           electron and spin density at atomic centers,
178
 
           and various properties over a grid, if neccessary. */
179
 
 
180
 
 compute_oeprops();
181
 
 if (grid)
182
 
     compute_grid();
183
 
 
184
 
 print_mp();
185
 
 print_lm();
186
 
 if (nuc_esp)
187
 
   print_esp();
188
 
 if (grid) {
189
 
   grid_origin[0] += mp_ref_xyz[0];
190
 
   grid_origin[1] += mp_ref_xyz[1];
191
 
   grid_origin[2] += mp_ref_xyz[2];
192
 
   print_grid();
193
 
 }
194
 
 print_misc();
195
 
}
196
 
 
197
 
        /* Cleaning up */
198
 
 
199
 
 free_block(usotao);
200
 
 if (strcmp(ref,"UHF") != 0) {
201
 
   free_block(scf_evec_so);
202
 
   free_block(scf_evec_ao);
203
 
 }
204
 
 free(ioff);
205
 
 free(Ptot);
206
 
 free(phi);
207
 
 free(ex); free(ey); free(ez);
208
 
 free(dexx); free(deyy); free(dezz);
209
 
 free(dexy); free(dexz); free(deyz);
210
 
 if (spin_prop) {
211
 
   free(Pspin);
212
 
   free(ahfsxx);
213
 
   free(ahfsyy);
214
 
   free(ahfszz);
215
 
   free(ahfsxy);
216
 
   free(ahfsxz);
217
 
   free(ahfsyz);
218
 
 }
219
 
 free(S);
220
 
/*}  end non-UHF routines */
221
 
 stop_io();
222
 
 exit(PSI_RETURN_SUCCESS);
223
 
 
224
 
}
225
 
 
226
 
 
227
 
char *gprgid()
228
 
{
229
 
 char *prgid = "OEPROP";
230
 
   
231
 
 return(prgid);
232
 
}