1
c $Id: bq_input.F,v 1.8 2006-10-06 06:56:59 marat Exp $
5
c *** The (current) format of the bq input is as folllows:
7
c *** bq [units <string units default angstroms> ]
8
c *** [(angstrom_to_au || ang2au) <real angstrom_to_au default 1.8897265>]
10
c *** [bq_filename <string filename default bqcharges>]
11
c *** [bq_rtdb <string rtdb_charge_tag default cosmo:efcz> <string rtdb_coord_tag default cosmo:efcc>]
14
c *** { <real charge> <real x y z>
19
c *** units - keyword specifying that a value will be entered by the user
20
c *** for the string variable <units>. The default units for the geometry
21
c *** input are Angstr�ms (Note: atomic units or Bohr are used within the
22
c *** code, regardless of the option specified for the input units. The
23
c *** code recognizes the following possible values for the string variable <units>:
24
c *** angstroms or an -- Angstroms (�), the default (converts to A.U. using the �to A.U. conversion factor)
25
c *** au or atomic or bohr -- Atomic units (A.U.)
26
c *** nm or nanometers -- nanometers (converts to A.U. using a conversion factor computed as times the � to A.U. conversion factor)
27
c *** pm or picometers -- picometers (converts to A.U. using a conversion factor computed as times the � to A.U. conversion factor)
1
c $Id: bq_input.F 20074 2011-03-08 19:36:13Z niri $
30
3
subroutine bq_input(rtdb)
63
36
call util_print_get_level(print_level)
64
37
hprint = (ga_nodeid().eq.0).and.(print_high.le.print_level)
67
c write(*,*) "in "//pname
70
max_nbq = min( 4*7000, ma_inquire_avail(MT_INT))
39
max_nbq = 25000 ! temporary limit for now
73
41
if ( .not. ma_push_get( MT_DBL, 3*max_nbq,
87
55
call dfill(max_nbq,0.0d0,dbl_mb(i_qbq),1)
89
c if(inp_n_field().gt.2)
90
c > call errquit(pname//'too many fields',0,0)
57
if(inp_n_field().gt.2)
58
> call errquit(pname//'too many fields',0,0)
92
60
namespace = bq_default
97
65
c *** get scale using the form used in geometry ***
98
call bq_get_scalefrominput(scale)
66
c this is not right as it is ignoring the namespace
67
c call bq_get_scalefrominput(scale)
100
c scale = 1.88972598858d0
101
c do i=1,inp_n_field()-1
102
c call inp_set_field(i)
103
c if (.not. inp_a(field))
104
c & call errquit(pname//': inp_read failed',0,0)
105
c if (inp_compare(.false.,field,'au')) then
107
c else if (inp_compare(.false.,field,'angstroms')) then
108
c scale = 1.88972598858d0
69
scale = 1.88972598858d0
70
do i=1,inp_n_field()-1
72
if (.not. inp_a(field))
73
& call errquit(pname//': inp_read failed',0,0)
74
if (inp_compare(.false.,field,'au')) then
76
else if (inp_compare(.false.,field,'nm')) then
77
scale = 18.8972598858d0
78
else if (inp_compare(.false.,field,'angstroms')) then
79
scale = 1.88972598858d0
300
270
* *************************************************
302
272
* * bq_readfile *
304
274
* *************************************************
305
subroutine bq_readfile(filename,ncenter,s,charge,coord)
275
subroutine bq_readfile(filename,ncenter,q,c)
278
#include "errquit.fh"
307
280
character*(*) filename
314
double precision q,c(3)
317
open(unit=99,file=filename,status='old')
319
read(99,*,ERR=30,END=30) q,c(1),c(2),c(3)
320
charge(ncenter+1) = charge(ncenter+1)+s*q
321
coord(1,ncenter+1) = c(1)
322
coord(2,ncenter+1) = c(2)
323
coord(3,ncenter+1) = c(3)
324
ncenter = ncenter + 1
282
double precision q(ncenter)
283
double precision c(3,ncenter)
286
integer fn,fn1,k,i,ipos
288
character*30 pname,atag
291
external util_io_unit
293
pname = "bq_readfile"
295
if(.not.util_io_unit(80,90,fn))
296
+ call errquit(pname//"cannot get io unit",0,0)
297
open(unit=fn,file=filename,status='old',form="formatted")
300
read(fn,'(A180)',ERR=30,END=30) buffer
301
if(inp_contains(.false.,"bq",buffer,ipos)) then
304
+ call errquit(pname//"increase bq stack",i,0)
305
read(buffer,*) atag,(c(k,i),k=1,3),q(i)
333
312
* *************************************************
335
314
* * bq_fromrtdb *