2
** This functions gets an array of user specified charges (if it exists)
3
** Added to facilitate counterpoise corrections with ghost atoms
9
#include <libciomr/libciomr.h>
10
#include <libipv1/ip_lib.h>
19
/* INIT GLOBAL ARRAYS */
20
nuclear_charges = init_array(num_atoms);
21
element = (char **) malloc(sizeof(char *)*num_atoms);
23
if( ip_exist("CHARGES",0) ) {
24
ip_count("CHARGES", &i, 0) ;
26
punt("Number of charges not equal to number of atoms (excluding dummy)");
28
errcod = ip_double_array("CHARGES", nuclear_charges, num_atoms) ;
29
if (errcod != IPE_OK) {
30
punt("Problem reading the CHARGES array.");
32
for(i=0;i<num_atoms;i++)
33
element[i] = elem_name[(int)nuclear_charges[i]];
35
/* IF USER DOES NOT SPECIFY CHARGES, POINT TO DEFAULT CHARGES */
37
for(i=0;i<num_atoms;i++) {
38
nuclear_charges[i] = elemsymb_charges[i];
39
element[i] = elem_name[(int)elemsymb_charges[i]];