1C
2C     Read rt-tddft parameters from rtdb and load into params struct.
3C
4      subroutine rt_tddft_init_rtdb (params)
5      implicit none
6
7#include "errquit.fh"
8#include "mafdecls.fh"
9#include "stdio.fh"
10#include "global.fh"
11#include "rtdb.fh"
12#include "rt_tddft.fh"
13
14
15C     == In/out ==
16      type(rt_params_t) params
17
18C     == Parameters ==
19      character(*), parameter :: pname = "rt_tddft_init_rtdb: "
20
21C     == Variables ==
22      integer ifield, iexcite
23
24
25      if (.not. rtdb_get (params%rtdb, "rt_tddft:dt",
26     $     mt_dbl, 1, params%dt)) call errquit (pname//
27     $     "failed to read dt from rtdb", 0, RTDB_ERR)
28
29      if (.not. rtdb_get (params%rtdb, "rt_tddft:tmin",
30     $     mt_dbl, 1, params%tmin)) call errquit (pname//
31     $     "failed to read tmin from rtdb", 0, RTDB_ERR)
32
33      if (.not. rtdb_get (params%rtdb, "rt_tddft:tmax",
34     $     mt_dbl, 1, params%tmax)) call errquit (pname//
35     $     "failed to read tmax from rtdb", 0, RTDB_ERR)
36
37      if (.not.rtdb_get(params%rtdb, "rt_tddft:nchecks",
38     $     mt_int, 1, params%nchecks)) call errquit (pname//
39     $     "failed to read nchecks from rtdb", 0, RTDB_ERR)
40
41      if (.not.rtdb_get(params%rtdb, "rt_tddft:checklvl",
42     $     mt_int, 1, params%checklvl)) call errquit (pname//
43     $     "failed to read nchecks from rtdb", 0, RTDB_ERR)
44
45      if (.not.rtdb_get(params%rtdb, "rt_tddft:nprints",
46     $     mt_int, 1, params%nprints)) call errquit (pname//
47     $     "failed to read nprints from rtdb", 0, RTDB_ERR)
48
49c$$$      if (.not.rtdb_get(params%rtdb, "rt_tddft:nsnapshots",
50c$$$     $     mt_int, 1, params%nsnapshots)) call errquit (pname//
51c$$$     $     "failed to read nsnapshots from rtdb", 0, RTDB_ERR)
52
53      if (.not.rtdb_get(params%rtdb, "rt_tddft:nrestarts",
54     $     mt_int, 1, params%nrestarts)) call errquit (pname//
55     $     "failed to read nrestarts from rtdb", 0, RTDB_ERR)
56
57      if (.not. rtdb_get (params%rtdb, "rt_tddft:prop_method",
58     $     mt_int, 1, params%prop_method)) call errquit (pname//
59     $     "failed to read prop_method from rtdb", 0, RTDB_ERR)
60
61      if (.not.rtdb_get(params%rtdb, "rt_tddft:prof",
62     $     mt_log, 1, params%prof)) call errquit (pname//
63     $     "failed to read prof from rtdb", 0, RTDB_ERR)
64
65      if (.not.rtdb_get(params%rtdb, "rt_tddft:matrix_checks",
66     $     mt_log, 1, params%matrix_checks)) call errquit (pname//
67     $     "failed to read matrix_checks from rtdb", 0, RTDB_ERR)
68
69      if (.not.rtdb_get(params%rtdb, "rt_tddft:nodisk",
70     $     mt_log, 1, params%nodisk)) call errquit (pname//
71     $     "failed to read nodisk from rtdb", 0, RTDB_ERR)
72
73      if (.not.rtdb_get(params%rtdb, "rt_tddft:noprop",
74     $     mt_log, 1, params%noprop)) call errquit (pname//
75     $     "failed to read noprop from rtdb", 0, RTDB_ERR)
76
77      if (.not.rtdb_get(params%rtdb, "rt_tddft:static",
78     $     mt_log, 1, params%static)) call errquit (pname//
79     $     "failed to read static from rtdb", 0, RTDB_ERR)
80
81      if (.not.rtdb_get(params%rtdb, "rt_tddft:use_dmat",
82     $     mt_log, 1, params%use_dmat)) call errquit (pname//
83     $     "failed to read use_dmat from rtdb", 0, RTDB_ERR)
84
85      if (.not.rtdb_get(params%rtdb, "rt_tddft:viz_active",
86     $     mt_log, 1, params%viz_active)) call errquit (pname//
87     $     "failed to read viz_active from rtdb", 0, RTDB_ERR)
88
89      if (params%viz_active) then
90         if (.not.rtdb_get(params%rtdb, "rt_tddft:viz_dplot",
91     $        mt_log, 1, params%viz_dplot)) call errquit (pname//
92     $        "failed to read viz_dplot from rtdb", 0, RTDB_ERR)
93
94         if (.not.rtdb_get(params%rtdb, "rt_tddft:viz_subgs",
95     $        mt_log, 1, params%viz_subgs)) call errquit (pname//
96     $        "failed to read viz_subgs from rtdb", 0, RTDB_ERR)
97
98         if (.not. rtdb_get (params%rtdb, "rt_tddft:viz_tstart",
99     $        mt_dbl, 1, params%viz_tstart)) call errquit (pname//
100     $        "failed to read viz_tstart from rtdb", 0, RTDB_ERR)
101
102         if (.not. rtdb_get (params%rtdb, "rt_tddft:viz_tend",
103     $        mt_dbl, 1, params%viz_tend)) call errquit (pname//
104     $        "failed to read viz_tend from rtdb", 0, RTDB_ERR)
105
106         if (.not. rtdb_get (params%rtdb, "rt_tddft:viz_treference",
107     $        mt_dbl, 1, params%viz_treference)) call errquit (pname//
108     $        "failed to read viz_treference from rtdb", 0, RTDB_ERR)
109
110      endif
111
112      if (.not.rtdb_get(params%rtdb, "rt_tddft:print_dipole",
113     $     mt_log, 1, params%print_dipole)) call errquit (pname//
114     $     "failed to read print_dipole from rtdb", 0, RTDB_ERR)
115
116      if (.not.rtdb_get(params%rtdb, "rt_tddft:print_quad",
117     $     mt_log, 1, params%print_quad)) call errquit (pname//
118     $     "failed to read print_quad from rtdb", 0, RTDB_ERR)
119
120      if (.not.rtdb_get(params%rtdb, "rt_tddft:print_field",
121     $     mt_log, 1, params%print_field)) call errquit (pname//
122     $     "failed to read print_field from rtdb", 0, RTDB_ERR)
123
124      if (.not.rtdb_get(params%rtdb, "rt_tddft:print_moocc",
125     $     mt_log, 1, params%print_moocc)) call errquit (pname//
126     $     "failed to read print_moocc from rtdb", 0, RTDB_ERR)
127
128      if (.not.rtdb_get(params%rtdb, "rt_tddft:print_dipcontribs",
129     $     mt_log, 1, params%print_dipcontribs)) call errquit (pname//
130     $     "failed to read print_dipcontribs from rtdb", 0, RTDB_ERR)
131
132      if (.not.rtdb_get(params%rtdb, "rt_tddft:print_energy",
133     $     mt_log, 1, params%print_energy)) call errquit (pname//
134     $     "failed to read print_energy from rtdb", 0, RTDB_ERR)
135
136      if (.not.rtdb_get(params%rtdb, "rt_tddft:print_cputime",
137     $     mt_log, 1, params%print_cputime)) call errquit (pname//
138     $     "failed to read print_cputime from rtdb", 0, RTDB_ERR)
139
140      if (.not.rtdb_get(params%rtdb, "rt_tddft:print_charge",
141     $     mt_log, 1, params%print_charge)) call errquit (pname//
142     $     "failed to read print_charge from rtdb", 0, RTDB_ERR)
143
144      if (.not.rtdb_get(params%rtdb, "rt_tddft:print_convergence",
145     $     mt_log, 1, params%print_convergence)) call errquit (pname//
146     $     "failed to read print_convergence from rtdb", 0, RTDB_ERR)
147
148      if (.not.rtdb_get(params%rtdb, "rt_tddft:print_s2",
149     $     mt_log, 1, params%print_s2)) call errquit (pname//
150     $     "failed to read print_s2 from rtdb", 0, RTDB_ERR)
151
152      if (.not. rtdb_get (params%rtdb, "rt_tddft:exp_method",
153     $     mt_int, 1, params%exp_method))
154     $     call errquit (pname//"failed to read exp_method from rtdb",
155     $     0, RTDB_ERR)
156
157      if (.not. rtdb_get (params%rtdb, "rt_tddft:tol_zero",
158     $     mt_dbl, 1, params%tol_zero)) call errquit (pname//
159     $     "failed to read tol_zero from rtdb", 0, RTDB_ERR)
160
161      if (.not. rtdb_get (params%rtdb, "rt_tddft:tol_series",
162     $     mt_dbl, 1, params%tol_series)) call errquit (pname//
163     $     "failed to read tol_series from rtdb", 0, RTDB_ERR)
164
165      if (.not. rtdb_get (params%rtdb, "rt_tddft:tol_interpol",
166     $     mt_dbl, 1, params%tol_interpol)) call errquit (pname//
167     $     "failed to read tol_interpol from rtdb", 0, RTDB_ERR)
168
169      if (.not.rtdb_get(params%rtdb, "rt_tddft:terms_series",
170     $     mt_int, 1, params%terms_series)) call errquit (pname//
171     $     "failed to read terms_series from rtdb", 0, RTDB_ERR)
172
173      if (.not.rtdb_get(params%rtdb, "rt_tddft:terms_interpol",
174     $     mt_int, 1, params%terms_interpol)) call errquit (pname//
175     $     "failed to read interpol from rtdb", 0, RTDB_ERR)
176
177      if (.not.rtdb_cget(params%rtdb,"rt_tddft:tag",1,params%tag))
178     $     call errquit(pname//'Read failed for tag from rtdb',
179     $     0,RTDB_ERR)
180
181
182C
183C     Read in fields
184C
185      if (.not.rtdb_get(params%rtdb, "rt_tddft:nfields",
186     $     mt_int, 1, params%nfields)) call errquit (pname//
187     $     "failed to read nfields from rtdb", 0, RTDB_ERR)
188
189      if (params%nfields .gt. rt_max_fields)
190     $     call errquit (pname//"nfields > rt_max_fields", 0, 0)
191
192      do ifield = 1, params%nfields
193         call rt_tddft_field_rtdb_get (params%rtdb, ifield,
194     $        params%field(ifield))
195      enddo
196
197
198C
199C     Read in excitation rules
200C
201      if (.not.rtdb_get(params%rtdb, "rt_tddft:nexcites",
202     $     mt_int, 1, params%nexcites)) call errquit (pname//
203     $     "failed to read nexcites from rtdb", 0, RTDB_ERR)
204
205      if (params%nexcites .gt. rt_max_excites)
206     $     call errquit (pname//"nexcites > rt_max_excites", 0, 0)
207
208      do iexcite = 1, params%nexcites
209         call rt_tddft_excite_rtdb_get (params%rtdb, iexcite,
210     $        params%excite(iexcite))
211      enddo
212
213
214C
215C     MO CAP
216C
217      if (.not.rtdb_get(params%rtdb, "rt_tddft:mocap_active",
218     $     mt_log, 1, params%mocap_active)) call errquit (pname//
219     $     "failed to read mocap_active from rtdb", 0, RTDB_ERR)
220
221      if (params%mocap_active) then
222         if (.not. rtdb_get (params%rtdb, "rt_tddft:mocap_emin",
223     $        mt_dbl, 1, params%mocap_emin)) call errquit (pname//
224     $        "failed to read mocap_emin from rtdb", 0, RTDB_ERR)
225
226         if (.not. rtdb_get (params%rtdb, "rt_tddft:mocap_maxval",
227     $        mt_dbl, 1, params%mocap_maxval)) call errquit (pname//
228     $        "failed to read mocap_maxval from rtdb", 0, RTDB_ERR)
229
230         if (.not. rtdb_get (params%rtdb, "rt_tddft:mocap_prefac",
231     $        mt_dbl, 1, params%mocap_prefac)) call errquit (pname//
232     $        "failed to read mocap_prefac from rtdb", 0, RTDB_ERR)
233
234         if (.not. rtdb_get (params%rtdb, "rt_tddft:mocap_expconst",
235     $        mt_dbl, 1, params%mocap_expconst)) call errquit (pname//
236     $        "failed to read mocap_expconst from rtdb", 0, RTDB_ERR)
237
238         if (.not.rtdb_get(params%rtdb, "rt_tddft:mocap_checks",
239     $        mt_log, 1, params%mocap_checks)) call errquit (pname//
240     $        "failed to read mocap_checks from rtdb", 0, RTDB_ERR)
241
242         if (.not.rtdb_get(params%rtdb, "rt_tddft:mocap_print",
243     $        mt_log, 1, params%mocap_print)) call errquit (pname//
244     $        "failed to read mocap_print from rtdb", 0, RTDB_ERR)
245      endif
246
247
248C
249C     Spatial CAP
250C
251      if (.not.rtdb_get(params%rtdb, "rt_tddft:cap_active",
252     $     mt_log, 1, params%cap_active)) call errquit (pname//
253     $     "failed to read cap_active from rtdb", 0, RTDB_ERR)
254
255C     if (params%cap_active) then
256C     XXX LOAD PARAMS
257
258
259      end subroutine
260c $Id$
261