1*
2* $Id$
3*
4
5
6*  exchange-correlation settings
7*
8*   gga = -1 off
9*
10*   **** LDAs ****
11*   gga = 0 vosko,
12*   gga = 1-9 (reserved for other lda's)
13*
14*   **** GGAs ****
15*   gga = 10 pbe96, pbe
16*   gga = 11 blyp
17*   gga = 12 revpbe
18*   gga = 13 pbesol
19*   gga = 14 hser remainder   (-0.25*Ex(w,pbe,sr) + Ex(pbe) + Ec(pbe))
20*   gga = 15 b3lypr remainder
21*   gga = 16 BEEF
22*   gga = 17 XBEEF-CPBE
23*   gga = 17-99 (reserved for other gga's)
24*
25*   **** hybrids ****
26*   gga = 100-109 (reserved for lda hybrids)
27*   gga = 110  pbe0
28*   gga = 111  ?????
29*   gga = 112  revpbe0
30*   gga = 113  bnl
31*   gga = 114  hse
32*   gga = 115  b3lyp
33*   gga = 116-199 (reserved for hybrids)
34*   gga = 200 hartree-fock
35*
36*   **** meta ggas and hybrid metagga ****
37*   gga = 300 vs98
38*   gga = 301 tpss03
39*   gga = 302 scan
40*   gga = 303 pkzb
41*   gga = 304 m06-l
42*   gga = 305  m06
43*   gga = 306  m06-2x
44*
45      has_disp = .false.
46      has_vdw  = .false.
47
48*
49*     no exchange-correlation functions
50*
51      if (inp_compare(.false.,exchange_correlation,'off')) then
52        gga = -1
53
54*     *** LDAs ***
55      else if (inp_compare(.false.,exchange_correlation,'vosko')) then
56        gga = 0
57      else if (inp_compare(.false.,exchange_correlation,'svwn5')) then
58        gga = 0
59      else if (inp_compare(.false.,exchange_correlation,'lda')) then
60        gga = 0
61      else if (inp_compare(.false.,exchange_correlation,'lsda')) then
62        gga = 0
63        value = rtdb_put(rtdb,'cpsd:ispin',mt_int,1,2)
64        value = rtdb_put(rtdb,'cpmd:ispin',mt_int,1,2)
65        value = rtdb_put(rtdb,'cgsd:ispin',mt_int,1,2)
66
67
68*     **** GGAs ****
69      else if (inp_compare(.false.,exchange_correlation,'pbe96')) then
70        gga = 10
71      else if (inp_compare(.false.,exchange_correlation,'pbe')) then
72        gga = 10
73      else if (inp_compare(.false.,exchange_correlation,'blyp')) then
74        gga = 11
75      else if (inp_compare(.false.,exchange_correlation,'revpbe')) then
76        gga = 12
77      else if (inp_compare(.false.,exchange_correlation,'pbesol')) then
78        gga = 13
79      else if (inp_compare(.false.,exchange_correlation,'hser')) then
80        gga = 14
81      else if (inp_compare(.false.,exchange_correlation,'b3lypr')) then
82        gga = 15
83      else if (inp_compare(.false.,exchange_correlation,'beef')) then
84        gga = 16
85      else if (inp_compare(.false.,exchange_correlation,'xbeef-cpbe'))
86     >     then
87        gga = 17
88
89      else if (inp_compare(.false.,exchange_correlation,
90     >                     'pbe96-grimme2') .or.
91     >         inp_compare(.false.,exchange_correlation,
92     >                     'pbe-grimme2')) then
93        gga = 10
94        options_disp  = '-func pbe -old -noprint'
95        has_disp   = .true.
96        is_grimme2 = .true.
97      else if (inp_compare(.false.,exchange_correlation,
98     >                     'pbe96-grimme3').or.
99     >         inp_compare(.false.,exchange_correlation,
100     >                     'pbe-grimme3')) then
101        gga = 10
102        options_disp  = '-func pbe -zero -noprint'
103        has_disp   = .true.
104        is_grimme2 = .false.
105      else if (inp_compare(.false.,exchange_correlation,
106     >                     'pbe96-grimme4').or.
107     >         inp_compare(.false.,exchange_correlation,
108     >                     'pbe-grimme4')) then
109        gga = 10
110        options_disp  = '-func pbe -bj -num -noprint'
111        has_disp   = .true.
112        is_grimme2 = .false.
113      else if (inp_compare(.false.,exchange_correlation,
114     >                     'pbe96-grimme5').or.
115     >         inp_compare(.false.,exchange_correlation,
116     >                     'pbe-grimme5')) then
117        gga = 10
118        options_disp  = '-func pbe -zerom -noprint'
119        has_disp   = .true.
120        is_grimme2 = .false.
121      else if (inp_compare(.false.,exchange_correlation,
122     >                     'pbe96-grimme6').or.
123     >         inp_compare(.false.,exchange_correlation,
124     >                     'pbe-grimme6')) then
125        gga = 10
126        options_disp  = '-func pbe -bjm -num -noprint'
127        has_disp   = .true.
128        is_grimme2 = .false.
129
130      else if (inp_compare(.false.,exchange_correlation,
131     >                     'pbe96-vdw2') .or.
132     >         inp_compare(.false.,exchange_correlation,
133     >                     'pbe-vdw2')) then
134        gga = 10
135        has_vdw = .true.
136        is_vdw2 = .true.
137      else if (inp_compare(.false.,exchange_correlation,
138     >                     'pbe96-vdw') .or.
139     >         inp_compare(.false.,exchange_correlation,
140     >                     'pbe-vdw')) then
141        gga = 10
142        has_vdw = .true.
143        is_vdw2 = .false.
144
145
146      else if (inp_compare(.false.,exchange_correlation,
147     >                     'blyp-grimme2')) then
148        gga = 11
149        options_disp  = '-func b-lyp -old -noprint'
150        has_disp   = .true.
151        is_grimme2 = .true.
152      else if (inp_compare(.false.,exchange_correlation,
153     >                     'blyp-grimme3')) then
154        gga = 11
155        options_disp  = '-func b-lyp -zero -noprint'
156        has_disp   = .true.
157        is_grimme2 = .false.
158      else if (inp_compare(.false.,exchange_correlation,
159     >                     'blyp-grimme4')) then
160        gga = 11
161        options_disp  = '-func b-lyp -bj -num -noprint'
162        has_disp   = .true.
163        is_grimme2 = .false.
164
165      else if (inp_compare(.false.,exchange_correlation,
166     >                     'blyp-grimme5')) then
167        gga = 11
168        options_disp  = '-func b-lyp -zerom -noprint'
169        has_disp   = .true.
170        is_grimme2 = .false.
171      else if (inp_compare(.false.,exchange_correlation,
172     >                     'blyp-grimme6')) then
173        gga = 11
174        options_disp  = '-func b-lyp -bjm -num -noprint'
175        has_disp   = .true.
176        is_grimme2 = .false.
177
178      else if (inp_compare(.false.,exchange_correlation,
179     >                     'blyp-vdw2')) then
180        gga = 11
181        has_vdw = .true.
182        is_vdw2 = .true.
183
184      else if (inp_compare(.false.,exchange_correlation,
185     >                     'blyp-vdw')) then
186        gga = 11
187        has_vdw = .true.
188        is_vdw2 = .false.
189
190
191      else if (inp_compare(.false.,exchange_correlation,
192     >                     'revpbe-grimme2')) then
193        gga = 12
194        options_disp  = '-func revpbe -old -noprint'
195        has_disp   = .true.
196        is_grimme2 = .true.
197      else if (inp_compare(.false.,exchange_correlation,
198     >                     'revpbe-grimme3')) then
199        gga = 12
200        options_disp  = '-func revpbe -zero -noprint'
201        has_disp   = .true.
202        is_grimme2 = .false.
203      else if (inp_compare(.false.,exchange_correlation,
204     >                     'revpbe-grimme4')) then
205        gga = 12
206        options_disp  = '-func revpbe -bj -num -noprint'
207        has_disp   = .true.
208        is_grimme2 = .false.
209
210      else if (inp_compare(.false.,exchange_correlation,
211     >                     'revpbe-grimme5')) then
212        gga = 12
213        options_disp  = '-func revpbe -zerom -noprint'
214        has_disp   = .true.
215        is_grimme2 = .false.
216      else if (inp_compare(.false.,exchange_correlation,
217     >                     'revpbe-grimme6')) then
218        gga = 12
219        options_disp  = '-func revpbe -bjm -num -noprint'
220        has_disp   = .true.
221        is_grimme2 = .false.
222
223      else if (inp_compare(.false.,exchange_correlation,
224     >                     'revpbe-vdw2')) then
225        gga = 12
226        has_vdw = .true.
227        is_vdw2 = .true.
228      else if (inp_compare(.false.,exchange_correlation,
229     >                     'revpbe-vdw')) then
230        gga = 12
231        has_vdw = .true.
232        is_vdw2 = .false.
233
234
235      else if (inp_compare(.false.,exchange_correlation,
236     >                     'pbesol-grimme2')) then
237        gga = 13
238        options_disp  = '-func pbe -old -noprint'
239        has_disp   = .true.
240        is_grimme2 = .true.
241      else if (inp_compare(.false.,exchange_correlation,
242     >                     'pbesol-grimme3')) then
243        gga = 13
244        options_disp  = '-func pbesol -zero -noprint'
245        has_disp   = .true.
246        is_grimme2 = .false.
247      else if (inp_compare(.false.,exchange_correlation,
248     >                     'pbesol-grimme4')) then
249        gga = 13
250        options_disp  = '-func pbesol -bj -num -noprint'
251        has_disp   = .true.
252        is_grimme2 = .false.
253      else if (inp_compare(.false.,exchange_correlation,
254     >                     'pbesol-grimme5')) then
255        gga = 13
256        options_disp  = '-func pbesol -zerom -noprint'
257        has_disp   = .true.
258        is_grimme2 = .false.
259      else if (inp_compare(.false.,exchange_correlation,
260     >                     'pbesol-grimme6')) then
261        gga = 13
262        options_disp  = '-func pbesol -bjm -num -noprint'
263        has_disp   = .true.
264        is_grimme2 = .false.
265
266      else if (inp_compare(.false.,exchange_correlation,
267     >                     'pbesol-vdw2')) then
268        gga = 13
269        has_vdw = .true.
270        is_vdw2 = .true.
271      else if (inp_compare(.false.,exchange_correlation,
272     >                     'pbesol-vdw')) then
273        gga = 13
274        has_vdw = .true.
275        is_vdw2 = .false.
276
277      else if (inp_compare(.false.,exchange_correlation,
278     >                     'beef-grimme2')) then
279        gga = 16
280        options_disp  = '-func pbesol -old -noprint'
281        has_disp   = .true.
282        is_grimme2 = .true.
283      else if (inp_compare(.false.,exchange_correlation,
284     >                     'beef-grimme3')) then
285        gga = 16
286        options_disp  = '-func pbesol -zero -noprint'
287        has_disp   = .true.
288        is_grimme2 = .false.
289      else if (inp_compare(.false.,exchange_correlation,
290     >                     'beef-grimme4')) then
291        gga = 16
292        options_disp  = '-func pbesol -bj -num -noprint'
293        has_disp   = .true.
294        is_grimme2 = .false.
295      else if (inp_compare(.false.,exchange_correlation,
296     >                     'beef-grimme5')) then
297        gga = 16
298        options_disp  = '-func pbesol -zerom -noprint'
299        has_disp   = .true.
300        is_grimme2 = .false.
301      else if (inp_compare(.false.,exchange_correlation,
302     >                     'beef-grimme6')) then
303        gga = 16
304        options_disp  = '-func pbesol -bjm -num -noprint'
305        has_disp   = .true.
306        is_grimme2 = .false.
307      else if (inp_compare(.false.,exchange_correlation,
308     >                     'beef-vdw2')) then
309        gga = 16
310        has_vdw = .true.
311        is_vdw2 = .true.
312      else if (inp_compare(.false.,exchange_correlation,
313     >                     'beef-vdw')) then
314        gga = 16
315        has_vdw = .true.
316        is_vdw2 = .false.
317
318
319      else if (inp_compare(.false.,exchange_correlation,
320     >                     'xbeef-cpbe-grimme2')) then
321        gga = 17
322        options_disp  = '-func pbesol -old -noprint'
323        has_disp   = .true.
324        is_grimme2 = .true.
325      else if (inp_compare(.false.,exchange_correlation,
326     >                     'xbeef-cpbe-grimme3')) then
327        gga = 17
328        options_disp  = '-func pbesol -zero -noprint'
329        has_disp   = .true.
330        is_grimme2 = .false.
331      else if (inp_compare(.false.,exchange_correlation,
332     >                     'xbeef-cpbe-grimme4')) then
333        gga = 17
334        options_disp  = '-func pbesol -bj -num -noprint'
335        has_disp   = .true.
336        is_grimme2 = .false.
337      else if (inp_compare(.false.,exchange_correlation,
338     >                     'xbeef-cpbe-grimme5')) then
339        gga = 17
340        options_disp  = '-func pbesol -zerom -noprint'
341        has_disp   = .true.
342        is_grimme2 = .false.
343      else if (inp_compare(.false.,exchange_correlation,
344     >                     'xbeef-cpbe-grimme6')) then
345        gga = 17
346        options_disp  = '-func pbesol -bjm -num -noprint'
347        has_disp   = .true.
348        is_grimme2 = .false.
349
350      else if (inp_compare(.false.,exchange_correlation,
351     >                     'xbeef-cpbe-vdw2')) then
352        gga = 17
353        has_vdw = .true.
354        is_vdw2 = .true.
355      else if (inp_compare(.false.,exchange_correlation,
356     >                     'xbeef-cpbe-vdw')) then
357        gga = 17
358        has_vdw = .true.
359        is_vdw2 = .false.
360
361
362
363
364
365
366
367
368*     **** Hartree-Fock ***
369      else if (inp_compare(.false.,exchange_correlation,'hf')) then
370        gga = 200
371        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
372        value = value.and.rtdb_put(rtdb,'band:HFX',mt_log,1,.true.)
373      else if (inp_compare(.false.,exchange_correlation,'uhf')) then
374        gga = 200
375        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
376        value = value.and.rtdb_put(rtdb,'band:HFX',mt_log,1,.true.)
377      else if (inp_compare(.false.,exchange_correlation,'rhf')) then
378        gga = 200
379        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
380        value = value.and.rtdb_put(rtdb,'band:HFX',mt_log,1,.true.)
381      else if (inp_compare(.false.,exchange_correlation,
382     >                     'hartree-fock')) then
383        gga = 200
384        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
385        value = value.and.rtdb_put(rtdb,'band:HFX',mt_log,1,.true.)
386
387
388*     **** hybrid functionals ****
389      else if (inp_compare(.false.,exchange_correlation,'pbe0')) then
390        gga = 110
391        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
392        value = value.and.
393     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.25d0)
394
395      else if (inp_compare(.false.,exchange_correlation,
396     >                     'pbe0-grimme2')) then
397        gga = 110
398        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
399        value = value.and.
400     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.25d0)
401        options_disp  = '-func pbe0 -old -noprint'
402        has_disp   = .true.
403        is_grimme2 = .true.
404      else if (inp_compare(.false.,exchange_correlation,
405     >                     'pbe0-grimme3')) then
406        gga = 110
407        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
408        value = value.and.
409     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.25d0)
410        options_disp  = '-func pbe0 -zero -noprint'
411        has_disp   = .true.
412        is_grimme2 = .false.
413      else if (inp_compare(.false.,exchange_correlation,
414     >                     'pbe0-grimme4')) then
415        gga = 110
416        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
417        value = value.and.
418     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.25d0)
419        options_disp  = '-func pbe0 -bj -num -noprint'
420        has_disp   = .true.
421        is_grimme2 = .false.
422      else if (inp_compare(.false.,exchange_correlation,
423     >                     'pbe0-grimme5')) then
424        gga = 110
425        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
426        value = value.and.
427     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.25d0)
428        options_disp  = '-func pbe0 -zerom -noprint'
429        has_disp   = .true.
430        is_grimme2 = .false.
431      else if (inp_compare(.false.,exchange_correlation,
432     >                     'pbe0-grimme6')) then
433        gga = 110
434        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
435        value = value.and.
436     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.25d0)
437        options_disp  = '-func pbe0 -bjm -num -noprint'
438        has_disp   = .true.
439        is_grimme2 = .false.
440      else if (inp_compare(.false.,exchange_correlation,
441     >                     'pbe0-vdw2')) then
442        gga = 110
443        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
444        value = value.and.
445     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.25d0)
446        has_vdw = .true.
447        is_vdw2 = .true.
448      else if (inp_compare(.false.,exchange_correlation,
449     >                     'pbe0-vdw')) then
450        gga = 110
451        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
452        value = value.and.
453     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.25d0)
454        has_vdw = .true.
455        is_vdw2 = .false.
456
457
458      else if (inp_compare(.false.,exchange_correlation,'blyp0')) then
459        gga = 111
460        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
461        value = value.and.
462     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.25d0)
463
464
465      else if (inp_compare(.false.,exchange_correlation,'revpbe0')) then
466        gga = 112
467        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
468        value = value.and.
469     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.25d0)
470      else if (inp_compare(.false.,exchange_correlation,
471     >                     'revpbe0-grimme2')) then
472        gga = 112
473        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
474        value = value.and.
475     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.25d0)
476        options_disp  = '-func revpbe0 -old -noprint'
477        has_disp   = .true.
478        is_grimme2 = .true.
479      else if (inp_compare(.false.,exchange_correlation,
480     >                      'revpbe0-grimme3')) then
481        gga = 112
482        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
483        value = value.and.
484     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.25d0)
485        options_disp  = '-func revpbe0 -zero -noprint'
486        has_disp   = .true.
487        is_grimme2 = .false.
488      else if (inp_compare(.false.,exchange_correlation,
489     >                     'revpbe0-grimme4')) then
490        gga = 112
491        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
492        value = value.and.
493     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.25d0)
494        options_disp  = '-func revpbe0 -bj -num -noprint'
495        has_disp   = .true.
496        is_grimme2 = .false.
497      else if (inp_compare(.false.,exchange_correlation,
498     >                     'revpbe0-grimme5')) then
499        gga = 112
500        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
501        value = value.and.
502     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.25d0)
503        options_disp  = '-func revpbe0 -zerom -noprint'
504        has_disp   = .true.
505        is_grimme2 = .false.
506      else if (inp_compare(.false.,exchange_correlation,
507     >                     'revpbe0-grimme6')) then
508        gga = 112
509        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
510        value = value.and.
511     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.25d0)
512        options_disp  = '-func revpbe0 -bjm -num -noprint'
513        has_disp   = .true.
514        is_grimme2 = .false.
515      else if (inp_compare(.false.,exchange_correlation,
516     >                     'revpbe0-vdw2')) then
517        gga = 112
518        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
519        value = value.and.
520     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.25d0)
521        has_vdw = .true.
522        is_vdw2 = .true.
523      else if (inp_compare(.false.,exchange_correlation,
524     >                     'revpbe0-vdw')) then
525        gga = 112
526        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
527        value = value.and.
528     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.25d0)
529        has_vdw = .true.
530        is_vdw2 = .false.
531
532
533
534      else if (inp_compare(.false.,exchange_correlation,'bnl')) then
535        gga = 113
536        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
537        value = value.and.
538     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,1.00d0)
539        value = value.and.
540     >          rtdb_put(rtdb,'pspw:HFX_screening_type',mt_int,1,2)
541
542
543      else if (inp_compare(.false.,exchange_correlation,'hse')) then
544        gga = 114
545        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
546        value = value.and.rtdb_put(rtdb,'band:HFX',mt_log,1,.true.)
547        value = value.and.
548     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.25d0)
549        value = value.and.
550     >          rtdb_put(rtdb,'band:HFX_parameter',mt_dbl,1,0.25d0)
551        value = value.and.
552     >          rtdb_put(rtdb,'pspw:HFX_screening_radius',
553     >                   mt_dbl,1,(1.0d0/0.207d0))
554        value = value.and.
555     >          rtdb_put(rtdb,'band:HFX_screening_radius',
556     >                   mt_dbl,1,(1.0d0/0.207d0))
557        value = value.and.
558     >          rtdb_put(rtdb,'pspw:HFX_screening_type',mt_int,1,4)
559        value = value.and.
560     >          rtdb_put(rtdb,'band:HFX_screening_type',mt_int,1,4)
561      else if (inp_compare(.false.,exchange_correlation,
562     >                       'hse-grimme2')) then
563        gga = 114
564        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
565        value = value.and.rtdb_put(rtdb,'band:HFX',mt_log,1,.true.)
566        value = value.and.
567     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.25d0)
568        value = value.and.
569     >          rtdb_put(rtdb,'band:HFX_parameter',mt_dbl,1,0.25d0)
570        value = value.and.
571     >          rtdb_put(rtdb,'pspw:HFX_screening_radius',
572     >                   mt_dbl,1,(1.0d0/0.207d0))
573        value = value.and.
574     >          rtdb_put(rtdb,'band:HFX_screening_radius',
575     >                   mt_dbl,1,(1.0d0/0.207d0))
576        value = value.and.
577     >          rtdb_put(rtdb,'pspw:HFX_screening_type',mt_int,1,4)
578        value = value.and.
579     >          rtdb_put(rtdb,'band:HFX_screening_type',mt_int,1,4)
580        options_disp  = '-func hse06 -old -noprint'
581        has_disp   = .true.
582        is_grimme2 = .true.
583      else if (inp_compare(.false.,exchange_correlation,
584     >                      'hse-grimme3')) then
585        gga = 114
586        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
587        value = value.and.rtdb_put(rtdb,'band:HFX',mt_log,1,.true.)
588        value = value.and.
589     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.25d0)
590        value = value.and.
591     >          rtdb_put(rtdb,'band:HFX_parameter',mt_dbl,1,0.25d0)
592        value = value.and.
593     >          rtdb_put(rtdb,'pspw:HFX_screening_radius',
594     >                   mt_dbl,1,(1.0d0/0.207d0))
595        value = value.and.
596     >          rtdb_put(rtdb,'band:HFX_screening_radius',
597     >                   mt_dbl,1,(1.0d0/0.207d0))
598        value = value.and.
599     >          rtdb_put(rtdb,'pspw:HFX_screening_type',mt_int,1,4)
600        value = value.and.
601     >          rtdb_put(rtdb,'band:HFX_screening_type',mt_int,1,4)
602        options_disp  = '-func hse06 -zero -noprint'
603        has_disp   = .true.
604        is_grimme2 = .false.
605      else if (inp_compare(.false.,exchange_correlation,
606     >                      'hse-grimme4')) then
607        gga = 114
608        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
609        value = value.and.rtdb_put(rtdb,'band:HFX',mt_log,1,.true.)
610        value = value.and.
611     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.25d0)
612        value = value.and.
613     >          rtdb_put(rtdb,'band:HFX_parameter',mt_dbl,1,0.25d0)
614        value = value.and.
615     >          rtdb_put(rtdb,'pspw:HFX_screening_radius',
616     >                   mt_dbl,1,(1.0d0/0.207d0))
617        value = value.and.
618     >          rtdb_put(rtdb,'band:HFX_screening_radius',
619     >                   mt_dbl,1,(1.0d0/0.207d0))
620        value = value.and.
621     >          rtdb_put(rtdb,'pspw:HFX_screening_type',mt_int,1,4)
622        value = value.and.
623     >          rtdb_put(rtdb,'band:HFX_screening_type',mt_int,1,4)
624        options_disp  = '-func hse06 -bj -num -noprint'
625        has_disp   = .true.
626        is_grimme2 = .false.
627      else if (inp_compare(.false.,exchange_correlation,
628     >                      'hse-grimme5')) then
629        gga = 114
630        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
631        value = value.and.rtdb_put(rtdb,'band:HFX',mt_log,1,.true.)
632        value = value.and.
633     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.25d0)
634        value = value.and.
635     >          rtdb_put(rtdb,'band:HFX_parameter',mt_dbl,1,0.25d0)
636        value = value.and.
637     >          rtdb_put(rtdb,'pspw:HFX_screening_radius',
638     >                   mt_dbl,1,(1.0d0/0.207d0))
639        value = value.and.
640     >          rtdb_put(rtdb,'band:HFX_screening_radius',
641     >                   mt_dbl,1,(1.0d0/0.207d0))
642        value = value.and.
643     >          rtdb_put(rtdb,'pspw:HFX_screening_type',mt_int,1,4)
644        value = value.and.
645     >          rtdb_put(rtdb,'band:HFX_screening_type',mt_int,1,4)
646        options_disp  = '-func hse06 -zerom -noprint'
647        has_disp   = .true.
648        is_grimme2 = .false.
649      else if (inp_compare(.false.,exchange_correlation,
650     >                      'hse-grimme6')) then
651        gga = 114
652        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
653        value = value.and.rtdb_put(rtdb,'band:HFX',mt_log,1,.true.)
654        value = value.and.
655     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.25d0)
656        value = value.and.
657     >          rtdb_put(rtdb,'band:HFX_parameter',mt_dbl,1,0.25d0)
658        value = value.and.
659     >          rtdb_put(rtdb,'pspw:HFX_screening_radius',
660     >                   mt_dbl,1,(1.0d0/0.207d0))
661        value = value.and.
662     >          rtdb_put(rtdb,'band:HFX_screening_radius',
663     >                   mt_dbl,1,(1.0d0/0.207d0))
664        value = value.and.
665     >          rtdb_put(rtdb,'pspw:HFX_screening_type',mt_int,1,4)
666        value = value.and.
667     >          rtdb_put(rtdb,'band:HFX_screening_type',mt_int,1,4)
668        options_disp  = '-func hse06 -bjm -num -noprint'
669        has_disp   = .true.
670        is_grimme2 = .false.
671      else if (inp_compare(.false.,exchange_correlation,
672     >                       'hse-vdw2')) then
673        gga = 114
674        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
675        value = value.and.rtdb_put(rtdb,'band:HFX',mt_log,1,.true.)
676        value = value.and.
677     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.25d0)
678        value = value.and.
679     >          rtdb_put(rtdb,'band:HFX_parameter',mt_dbl,1,0.25d0)
680        value = value.and.
681     >          rtdb_put(rtdb,'pspw:HFX_screening_radius',
682     >                   mt_dbl,1,(1.0d0/0.207d0))
683        value = value.and.
684     >          rtdb_put(rtdb,'band:HFX_screening_radius',
685     >                   mt_dbl,1,(1.0d0/0.207d0))
686        value = value.and.
687     >          rtdb_put(rtdb,'pspw:HFX_screening_type',mt_int,1,4)
688        value = value.and.
689     >          rtdb_put(rtdb,'band:HFX_screening_type',mt_int,1,4)
690        has_vdw = .true.
691        is_vdw2 = .true.
692      else if (inp_compare(.false.,exchange_correlation,
693     >                       'hse-vdw')) then
694        gga = 114
695        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
696        value = value.and.rtdb_put(rtdb,'band:HFX',mt_log,1,.true.)
697        value = value.and.
698     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.25d0)
699        value = value.and.
700     >          rtdb_put(rtdb,'band:HFX_parameter',mt_dbl,1,0.25d0)
701        value = value.and.
702     >          rtdb_put(rtdb,'pspw:HFX_screening_radius',
703     >                   mt_dbl,1,(1.0d0/0.207d0))
704        value = value.and.
705     >          rtdb_put(rtdb,'band:HFX_screening_radius',
706     >                   mt_dbl,1,(1.0d0/0.207d0))
707        value = value.and.
708     >          rtdb_put(rtdb,'pspw:HFX_screening_type',mt_int,1,4)
709        value = value.and.
710     >          rtdb_put(rtdb,'band:HFX_screening_type',mt_int,1,4)
711        has_vdw = .true.
712        is_vdw2 = .false.
713
714
715
716      else if (inp_compare(.false.,exchange_correlation,'b3lyp')) then
717        gga = 115
718        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
719        value = value.and.
720     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.20d0)
721      else if (inp_compare(.false.,exchange_correlation,
722     >                     'b3lyp-grimme2')) then
723        gga = 115
724        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
725        value = value.and.
726     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.20d0)
727        options_disp  = '-func b3-lyp -old -noprint'
728        has_disp   = .true.
729        is_grimme2 = .true.
730      else if (inp_compare(.false.,exchange_correlation,
731     >                     'b3lyp-grimme3')) then
732        gga = 115
733        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
734        value = value.and.
735     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.20d0)
736        options_disp  = '-func b3-lyp -zero -noprint'
737        has_disp   = .true.
738        is_grimme2 = .false.
739      else if (inp_compare(.false.,exchange_correlation,
740     >                     'b3lyp-grimme4')) then
741        gga = 115
742        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
743        value = value.and.
744     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.20d0)
745        options_disp  = '-func b3-lyp -bj -num -noprint'
746        has_disp   = .true.
747        is_grimme2 = .false.
748      else if (inp_compare(.false.,exchange_correlation,
749     >                     'b3lyp-grimme5')) then
750        gga = 115
751        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
752        value = value.and.
753     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.20d0)
754        options_disp  = '-func b3-lyp -zerom -noprint'
755        has_disp   = .true.
756        is_grimme2 = .false.
757      else if (inp_compare(.false.,exchange_correlation,
758     >                     'b3lyp-grimme6')) then
759        gga = 115
760        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
761        value = value.and.
762     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.20d0)
763        options_disp  = '-func b3-lyp -bjm -num -noprint'
764        has_disp   = .true.
765        is_grimme2 = .false.
766      else if (inp_compare(.false.,exchange_correlation,
767     >                     'b3lyp-vdw2')) then
768        gga = 115
769        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
770        value = value.and.
771     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.20d0)
772        has_vdw = .true.
773        is_vdw2 = .true.
774      else if (inp_compare(.false.,exchange_correlation,
775     >                     'b3lyp-vdw')) then
776        gga = 115
777        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
778        value = value.and.
779     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.20d0)
780        has_vdw = .true.
781        is_vdw2 = .false.
782
783
784
785
786*     **** SIC hybrids ****
787      else if (inp_compare(.false.,exchange_correlation,'lda-sic')) then
788        gga = 0
789        value = value.and.rtdb_put(rtdb,'pspw:SIC_all',mt_log,1,.true.)
790      else if (inp_compare(.false.,exchange_correlation,
791     >                     'pbe96-sic')) then
792        gga = 10
793        value = value.and.rtdb_put(rtdb,'pspw:SIC_all',mt_log,1,.true.)
794      else if (inp_compare(.false.,exchange_correlation,
795     >                     'blyp-sic')) then
796        gga = 11
797        value = value.and.rtdb_put(rtdb,'pspw:SIC_all',mt_log,1,.true.)
798      else if (inp_compare(.false.,exchange_correlation,
799     >                     'revpbe-sic')) then
800        gga = 12
801        value = value.and.rtdb_put(rtdb,'pspw:SIC_all',mt_log,1,.true.)
802
803
804      else if (inp_compare(.false.,exchange_correlation,
805     >                    'lda-0.5sic')) then
806        gga = 0
807        value = value.and.rtdb_put(rtdb,'pspw:SIC_all',mt_log,1,.true.)
808        value = value.and.
809     >          rtdb_put(rtdb,'pspw:SIC_xc_parameter',mt_dbl,1,0.50d0)
810        value = value.and.
811     >          rtdb_put(rtdb,'pspw:SIC_h_parameter',mt_dbl,1,0.50d0)
812      else if (inp_compare(.false.,exchange_correlation,
813     >         'pbe96-0.5sic')) then
814        gga = 10
815        value = value.and.rtdb_put(rtdb,'pspw:SIC_all',mt_log,1,.true.)
816        value = value.and.
817     >          rtdb_put(rtdb,'pspw:SIC_xc_parameter',mt_dbl,1,0.50d0)
818        value = value.and.
819     >          rtdb_put(rtdb,'pspw:SIC_h_parameter',mt_dbl,1,0.50d0)
820      else if (inp_compare(.false.,exchange_correlation,
821     >         'blyp-0.5sic')) then
822        gga = 11
823        value = value.and.rtdb_put(rtdb,'pspw:SIC_all',mt_log,1,.true.)
824        value = value.and.
825     >          rtdb_put(rtdb,'pspw:SIC_xc_parameter',mt_dbl,1,0.50d0)
826        value = value.and.
827     >          rtdb_put(rtdb,'pspw:SIC_h_parameter',mt_dbl,1,0.50d0)
828      else if (inp_compare(.false.,exchange_correlation,
829     >         'revpbe-0.5sic')) then
830        gga = 12
831        value = value.and.rtdb_put(rtdb,'pspw:SIC_all',mt_log,1,.true.)
832        value = value.and.
833     >          rtdb_put(rtdb,'pspw:SIC_xc_parameter',mt_dbl,1,0.50d0)
834        value = value.and.
835     >          rtdb_put(rtdb,'pspw:SIC_h_parameter',mt_dbl,1,0.50d0)
836
837
838
839      else if (inp_compare(.false.,exchange_correlation,
840     >                    'lda-sic/2')) then
841        gga = 0
842        value = value.and.rtdb_put(rtdb,'pspw:SIC_all',mt_log,1,.true.)
843        value = value.and.
844     >          rtdb_put(rtdb,'pspw:SIC_xc_parameter',mt_dbl,1,0.50d0)
845        value = value.and.
846     >          rtdb_put(rtdb,'pspw:SIC_h_parameter',mt_dbl,1,0.50d0)
847      else if (inp_compare(.false.,exchange_correlation,
848     >         'pbe96-sic/2')) then
849        gga = 10
850        value = value.and.rtdb_put(rtdb,'pspw:SIC_all',mt_log,1,.true.)
851        value = value.and.
852     >          rtdb_put(rtdb,'pspw:SIC_xc_parameter',mt_dbl,1,0.50d0)
853        value = value.and.
854     >          rtdb_put(rtdb,'pspw:SIC_h_parameter',mt_dbl,1,0.50d0)
855      else if (inp_compare(.false.,exchange_correlation,
856     >         'blyp-0.5sic')) then
857        gga = 11
858        value = value.and.rtdb_put(rtdb,'pspw:SIC_all',mt_log,1,.true.)
859        value = value.and.
860     >          rtdb_put(rtdb,'pspw:SIC_xc_parameter',mt_dbl,1,0.50d0)
861        value = value.and.
862     >          rtdb_put(rtdb,'pspw:SIC_h_parameter',mt_dbl,1,0.50d0)
863      else if (inp_compare(.false.,exchange_correlation,
864     >         'revpbe-0.5sic')) then
865        gga = 12
866        value = value.and.rtdb_put(rtdb,'pspw:SIC_all',mt_log,1,.true.)
867        value = value.and.
868     >          rtdb_put(rtdb,'pspw:SIC_xc_parameter',mt_dbl,1,0.50d0)
869        value = value.and.
870     >          rtdb_put(rtdb,'pspw:SIC_h_parameter',mt_dbl,1,0.50d0)
871
872
873
874
875      else if (inp_compare(.false.,exchange_correlation,
876     >                    'lda-0.4sic')) then
877        gga = 0
878        value = value.and.rtdb_put(rtdb,'pspw:SIC_all',mt_log,1,.true.)
879        value = value.and.
880     >          rtdb_put(rtdb,'pspw:SIC_xc_parameter',mt_dbl,1,0.40d0)
881        value = value.and.
882     >          rtdb_put(rtdb,'pspw:SIC_h_parameter',mt_dbl,1,0.40d0)
883      else if (inp_compare(.false.,exchange_correlation,
884     >         'pbe96-0.4sic')) then
885        gga = 10
886        value = value.and.rtdb_put(rtdb,'pspw:SIC_all',mt_log,1,.true.)
887        value = value.and.
888     >          rtdb_put(rtdb,'pspw:SIC_xc_parameter',mt_dbl,1,0.40d0)
889        value = value.and.
890     >          rtdb_put(rtdb,'pspw:SIC_h_parameter',mt_dbl,1,0.40d0)
891      else if (inp_compare(.false.,exchange_correlation,
892     >         'blyp-0.4sic')) then
893        gga = 11
894        value = value.and.rtdb_put(rtdb,'pspw:SIC_all',mt_log,1,.true.)
895        value = value.and.
896     >          rtdb_put(rtdb,'pspw:SIC_xc_parameter',mt_dbl,1,0.40d0)
897        value = value.and.
898     >          rtdb_put(rtdb,'pspw:SIC_h_parameter',mt_dbl,1,0.40d0)
899      else if (inp_compare(.false.,exchange_correlation,
900     >         'revpbe-0.4sic')) then
901        gga = 12
902        value = value.and.rtdb_put(rtdb,'pspw:SIC_all',mt_log,1,.true.)
903        value = value.and.
904     >          rtdb_put(rtdb,'pspw:SIC_xc_parameter',mt_dbl,1,0.40d0)
905        value = value.and.
906     >          rtdb_put(rtdb,'pspw:SIC_h_parameter',mt_dbl,1,0.40d0)
907
908
909
910
911      else if (inp_compare(.false.,exchange_correlation,
912     >                    'lda-0.25sic')) then
913        gga = 0
914        value = value.and.rtdb_put(rtdb,'pspw:SIC_all',mt_log,1,.true.)
915        value = value.and.
916     >          rtdb_put(rtdb,'pspw:SIC_xc_parameter',mt_dbl,1,0.25d0)
917        value = value.and.
918     >          rtdb_put(rtdb,'pspw:SIC_h_parameter',mt_dbl,1,0.25d0)
919      else if (inp_compare(.false.,exchange_correlation,
920     >         'pbe96-0.25sic')) then
921        gga = 10
922        value = value.and.rtdb_put(rtdb,'pspw:SIC_all',mt_log,1,.true.)
923        value = value.and.
924     >          rtdb_put(rtdb,'pspw:SIC_xc_parameter',mt_dbl,1,0.25d0)
925        value = value.and.
926     >          rtdb_put(rtdb,'pspw:SIC_h_parameter',mt_dbl,1,0.25d0)
927      else if (inp_compare(.false.,exchange_correlation,
928     >         'blyp-0.25sic')) then
929        gga = 11
930        value = value.and.rtdb_put(rtdb,'pspw:SIC_all',mt_log,1,.true.)
931        value = value.and.
932     >          rtdb_put(rtdb,'pspw:SIC_xc_parameter',mt_dbl,1,0.25d0)
933        value = value.and.
934     >          rtdb_put(rtdb,'pspw:SIC_h_parameter',mt_dbl,1,0.25d0)
935
936      else if (inp_compare(.false.,exchange_correlation,
937     >         'revpbe-0.25sic')) then
938        gga = 12
939        value = value.and.rtdb_put(rtdb,'pspw:SIC_all',mt_log,1,.true.)
940        value = value.and.
941     >          rtdb_put(rtdb,'pspw:SIC_xc_parameter',mt_dbl,1,0.25d0)
942        value = value.and.
943     >          rtdb_put(rtdb,'pspw:SIC_h_parameter',mt_dbl,1,0.25d0)
944
945
946      else if (inp_compare(.false.,exchange_correlation,
947     >                    'lda-sic/4')) then
948        gga = 0
949        value = value.and.rtdb_put(rtdb,'pspw:SIC_all',mt_log,1,.true.)
950        value = value.and.
951     >          rtdb_put(rtdb,'pspw:SIC_xc_parameter',mt_dbl,1,0.25d0)
952        value = value.and.
953     >          rtdb_put(rtdb,'pspw:SIC_h_parameter',mt_dbl,1,0.25d0)
954      else if (inp_compare(.false.,exchange_correlation,
955     >         'pbe96-sic/4')) then
956        gga = 10
957        value = value.and.rtdb_put(rtdb,'pspw:SIC_all',mt_log,1,.true.)
958        value = value.and.
959     >          rtdb_put(rtdb,'pspw:SIC_xc_parameter',mt_dbl,1,0.25d0)
960        value = value.and.
961     >          rtdb_put(rtdb,'pspw:SIC_h_parameter',mt_dbl,1,0.25d0)
962      else if (inp_compare(.false.,exchange_correlation,
963     >         'blyp-sic/4')) then
964        gga = 11
965        value = value.and.rtdb_put(rtdb,'pspw:SIC_all',mt_log,1,.true.)
966        value = value.and.
967     >          rtdb_put(rtdb,'pspw:SIC_xc_parameter',mt_dbl,1,0.25d0)
968        value = value.and.
969     >          rtdb_put(rtdb,'pspw:SIC_h_parameter',mt_dbl,1,0.25d0)
970
971      else if (inp_compare(.false.,exchange_correlation,
972     >         'revpbe-sic/4')) then
973        gga = 12
974        value = value.and.rtdb_put(rtdb,'pspw:SIC_all',mt_log,1,.true.)
975        value = value.and.
976     >          rtdb_put(rtdb,'pspw:SIC_xc_parameter',mt_dbl,1,0.25d0)
977        value = value.and.
978     >          rtdb_put(rtdb,'pspw:SIC_h_parameter',mt_dbl,1,0.25d0)
979
980
981      else if (inp_compare(.false.,exchange_correlation,
982     >                    'lda-0.2sic')) then
983        gga = 0
984        value = value.and.rtdb_put(rtdb,'pspw:SIC_all',mt_log,1,.true.)
985        value = value.and.
986     >          rtdb_put(rtdb,'pspw:SIC_xc_parameter',mt_dbl,1,0.20d0)
987        value = value.and.
988     >          rtdb_put(rtdb,'pspw:SIC_h_parameter',mt_dbl,1,0.20d0)
989      else if (inp_compare(.false.,exchange_correlation,
990     >         'pbe96-0.2sic')) then
991        gga = 10
992        value = value.and.rtdb_put(rtdb,'pspw:SIC_all',mt_log,1,.true.)
993        value = value.and.
994     >          rtdb_put(rtdb,'pspw:SIC_xc_parameter',mt_dbl,1,0.20d0)
995        value = value.and.
996     >          rtdb_put(rtdb,'pspw:SIC_h_parameter',mt_dbl,1,0.20d0)
997      else if (inp_compare(.false.,exchange_correlation,
998     >         'blyp-0.2sic')) then
999        gga = 11
1000        value = value.and.rtdb_put(rtdb,'pspw:SIC_all',mt_log,1,.true.)
1001        value = value.and.
1002     >          rtdb_put(rtdb,'pspw:SIC_xc_parameter',mt_dbl,1,0.20d0)
1003        value = value.and.
1004     >          rtdb_put(rtdb,'pspw:SIC_h_parameter',mt_dbl,1,0.20d0)
1005
1006      else if (inp_compare(.false.,exchange_correlation,
1007     >         'revpbe-0.2sic')) then
1008        gga = 12
1009        value = value.and.rtdb_put(rtdb,'pspw:SIC_all',mt_log,1,.true.)
1010        value = value.and.
1011     >          rtdb_put(rtdb,'pspw:SIC_xc_parameter',mt_dbl,1,0.20d0)
1012        value = value.and.
1013     >          rtdb_put(rtdb,'pspw:SIC_h_parameter',mt_dbl,1,0.20d0)
1014
1015
1016*     **** Meta-GGAs ****
1017      else if (inp_compare(.false.,exchange_correlation,'vs98')) then
1018        gga = 300
1019      else if (inp_compare(.false.,exchange_correlation,'tpss03')) then
1020        gga = 301
1021      else if (inp_compare(.false.,exchange_correlation,'scan')) then
1022        gga = 302
1023      else if (inp_compare(.false.,exchange_correlation,'pkzb')) then
1024        gga = 303
1025      else if (inp_compare(.false.,exchange_correlation,'m06-l')) then
1026        gga = 304
1027
1028      else if (inp_compare(.false.,exchange_correlation,'m06')) then
1029        gga = 305
1030        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
1031        value = value.and.
1032     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.27d0)
1033      !*** add grimmes here
1034
1035      else if (inp_compare(.false.,exchange_correlation,'m06-2x')) then
1036        gga = 306
1037        value = value.and.rtdb_put(rtdb,'pspw:HFX',mt_log,1,.true.)
1038        value = value.and.
1039     >          rtdb_put(rtdb,'pspw:HFX_parameter',mt_dbl,1,0.54d0)
1040      !*** add grimmes here
1041
1042      else
1043        gga = 0
1044      end if
1045
1046