1 /*
2 * Copyright (C) 2013 Qiming Sun <osirpt.sun@gmail.com>
3 *
4 * c to fortran interface
5 */
6
7 #ifdef WITH_FORTRAN
8 #include <stdlib.h>
9 #include <math.h>
10 #include "cint_bas.h"
11 #include "g1e.h"
12 #include "misc.h"
13 #include "c2f.h"
14 #include "optimizer.h"
15
16
17 /*
18 * * * * * * * * * * * * * * * * * * * * *
19 * for cint_bas.c
20 */
21
cintlen_spinor_(const FINT * bas_id,const FINT * bas)22 FINT cintlen_spinor_(const FINT *bas_id, const FINT *bas)
23 {
24 return CINTlen_spinor(*bas_id, bas);
25 }
26
cintcgtos_cart_(const FINT * bas_id,const FINT * bas)27 FINT cintcgtos_cart_(const FINT *bas_id, const FINT *bas)
28 {
29 return CINTcgto_cart(*bas_id, bas);
30 }
cintcgto_cart_(const FINT * bas_id,const FINT * bas)31 FINT cintcgto_cart_(const FINT *bas_id, const FINT *bas)
32 {
33 return CINTcgto_cart(*bas_id, bas);
34 }
35
cintcgtos_spheric_(const FINT * bas_id,const FINT * bas)36 FINT cintcgtos_spheric_(const FINT *bas_id, const FINT *bas)
37 {
38 return CINTcgto_spheric(*bas_id, bas);
39 }
cintcgto_spheric_(const FINT * bas_id,const FINT * bas)40 FINT cintcgto_spheric_(const FINT *bas_id, const FINT *bas)
41 {
42 return CINTcgto_spheric(*bas_id, bas);
43 }
44
cintcgtos_spinor_(const FINT * bas_id,const FINT * bas)45 FINT cintcgtos_spinor_(const FINT *bas_id, const FINT *bas)
46 {
47 return CINTcgto_spinor(*bas_id, bas);
48 }
cintcgto_spinor_(const FINT * bas_id,const FINT * bas)49 FINT cintcgto_spinor_(const FINT *bas_id, const FINT *bas)
50 {
51 return CINTcgto_spinor(*bas_id, bas);
52 }
53
54 /*
55 * tot. primitive atomic spheric GTOs in a shell
56 */
cinttot_pgto_spheric_(const FINT * bas,const FINT * nbas)57 FINT cinttot_pgto_spheric_(const FINT *bas, const FINT *nbas)
58 {
59 return CINTtot_pgto_spheric(bas, *nbas);
60 }
61
62 /*
63 * tot. primitive atomic spinors in a shell
64 */
cinttot_pgto_spinor_(const FINT * bas,const FINT * nbas)65 FINT cinttot_pgto_spinor_(const FINT *bas, const FINT *nbas)
66 {
67 return CINTtot_pgto_spinor(bas, *nbas);
68 }
69
70 /*
71 * tot. contracted atomic cartesian GTOs in a shell
72 */
cinttot_cgto_cart_(const FINT * bas,const FINT * nbas)73 FINT cinttot_cgto_cart_(const FINT *bas, const FINT *nbas)
74 {
75 return CINTtot_cgto_cart(bas, *nbas);
76 }
77
78 /*
79 * tot. contracted atomic spheric GTOs in a shell
80 */
cinttot_cgto_spheric_(const FINT * bas,const FINT * nbas)81 FINT cinttot_cgto_spheric_(const FINT *bas, const FINT *nbas)
82 {
83 return CINTtot_cgto_spheric(bas, *nbas);
84 }
85
86 /*
87 * tot. contracted atomic spinors in a shell
88 */
cinttot_cgto_spinor_(const FINT * bas,const FINT * nbas)89 FINT cinttot_cgto_spinor_(const FINT *bas, const FINT *nbas)
90 {
91 return CINTtot_cgto_spinor(bas, *nbas);
92 }
93
94 /*
95 * offset of each shell for cartesian GTOs
96 */
cintshells_cart_offset_(FINT ao_loc[],const FINT * bas,const FINT * nbas)97 void cintshells_cart_offset_(FINT ao_loc[], const FINT *bas, const FINT *nbas)
98 {
99 CINTshells_cart_offset(ao_loc, bas, *nbas);
100 }
101
102 /*
103 * offset of each shell for real spheric GTOs
104 */
cintshells_spheric_offset_(FINT ao_loc[],const FINT * bas,const FINT * nbas)105 void cintshells_spheric_offset_(FINT ao_loc[], const FINT *bas, const FINT *nbas)
106 {
107 CINTshells_spheric_offset(ao_loc, bas, *nbas);
108 }
109
110 /*
111 * offset of each shell for AO spinors
112 */
cintshells_spinor_offset_(FINT ao_loc[],const FINT * bas,const FINT * nbas)113 void cintshells_spinor_offset_(FINT ao_loc[], const FINT *bas, const FINT *nbas)
114 {
115 CINTshells_spinor_offset(ao_loc, bas, *nbas);
116 }
117
118
cintgto_norm_(FINT * n,double * a)119 double cintgto_norm_(FINT *n, double *a)
120 {
121 return CINTgto_norm(*n, *a);
122 }
123
124 /*
125 * * * * * * * * * * * * * * * * * * * * *
126 * let Fortran be able to change CINTOpt
127 */
128 /* in Fortran, pass an integer(8) to hold the pointer of CINTOpt */
129 //typedef long CINTOptPtrAsInteger8;
cintinit_2e_optimizer_(CINTOpt ** opt,FINT * atm,FINT * natm,FINT * bas,FINT * nbas,double * env)130 void cintinit_2e_optimizer_(CINTOpt **opt,
131 FINT *atm, FINT *natm,
132 FINT *bas, FINT *nbas, double *env)
133 {
134 CINTinit_2e_optimizer(opt, atm, *natm, bas, *nbas, env);
135 }
cintinit_optimizer_(CINTOpt ** opt,FINT * atm,FINT * natm,FINT * bas,FINT * nbas,double * env)136 void cintinit_optimizer_(CINTOpt **opt,
137 FINT *atm, FINT *natm,
138 FINT *bas, FINT *nbas, double *env)
139 {
140 cintinit_2e_optimizer_(opt, atm, natm, bas, nbas, env);
141 }
cintdel_2e_optimizer_(CINTOpt ** opt)142 void cintdel_2e_optimizer_(CINTOpt **opt)
143 {
144 CINTdel_2e_optimizer(opt);
145 }
cintdel_optimizer_(CINTOpt ** opt)146 void cintdel_optimizer_(CINTOpt **opt)
147 {
148 cintdel_2e_optimizer_(opt);
149 }
150 #endif
151