2
C Check that rt-tddft parameters are legal.
4
subroutine rt_tddft_init_check_params (params)
12
#include "rt_tddft.fh"
16
type(rt_params_t) params
19
character(*), parameter :: pname = "rt_tddft_init_check_params: "
20
double precision, parameter :: max_tol = 1d-2
21
integer, parameter :: max_terms = 100
25
double precision tol_schwartz
28
C (now hardcoded to be -5*dt)
29
C if (params%tmin.lt.0d0)
30
C $ call errquit(pname//"tmin must be > 0", 0, 0)
32
if (params%tmax.lt.0d0)
33
$ call errquit(pname//"tmax must be > 0", 0, 0)
36
$ call errquit(pname//"dt must be > 0", 0, 0)
38
if (params%tmax.lt.params%tmin)
39
$ call errquit(pname//"tmax must be > tmin", 0, 0)
41
call rt_tddft_init_check_fields (params)
43
if ((params%prop_method.ne.1.).and.
44
$ (params%prop_method.ne.2.).and.
45
$ (params%prop_method.ne.3.).and.
46
$ (params%prop_method.ne.4.))
47
$ call errquit (pname//"bad prop_method", 0, 0)
50
if ( (params%checklvl .ne. 1).and.
51
$ (params%checklvl .ne. 2).and.
52
$ (params%checklvl .ne. 3)) call errquit(pname//
53
$ "checklvl must be 1, 2, 3", 0, 0)
58
C Check tolerances, etc
61
if ( (params%tol_zero .lt. 0d0).or.(params%tol_zero .ge. max_tol))
62
$ call errquit (pname//"bad tol_zero", 0, 0)
64
if ( (params%tol_series .lt. 0d0).or.
65
$ (params%tol_series .gt. max_tol))
66
$ call errquit (pname//"bad tol_series", 0, 0)
68
if ( (params%tol_interpol .lt. 0d0).or.
69
$ (params%tol_interpol .gt. max_tol))
70
$ call errquit (pname//"bad tol_interpol", 0, 0)
72
if ( (params%terms_series .lt. 1).or.
73
$ (params%terms_series .gt. max_terms))
74
$ call errquit (pname//"bad terms_series", 0, 0)
76
if ( (params%terms_interpol .lt. 1).or.
77
$ (params%terms_interpol .gt. max_terms))
78
$ call errquit (pname//"bad terms_interpol", 0, 0)
81
tol_schwartz = 10d0**(-itol2e)
83
if (tol_schwartz .gt. params%tol_interpol) then
84
call rt_tddft_print_warning ("Schwartz screening tolerance "//
85
$ "is looser than Magnus interpolation tolerance--"//
86
$ "convergence will be difficult. You should loosen "//
89
elseif (10d0*tol_schwartz .gt. params%tol_interpol) then
90
call rt_tddft_print_warning ("Schwartz screening tolerance "//
91
$ "is similar to the Magnus interpolation tolerance--"//
92
$ "this may cause problems with convergence. If so, "//
93
$ "try loosening tol_interpol.")
101
C====================================================================
103
C Check that all fields have valid parameters
105
subroutine rt_tddft_init_check_fields (params)
108
#include "errquit.fh"
109
#include "mafdecls.fh"
113
#include "rt_tddft.fh"
117
type(rt_params_t) params
121
character(len=*), parameter :: pname =
122
$ "rt_tddft_init_check_fields: "
127
type(rt_field_t) field
129
do ifield = 1, params%nfields
130
call rt_tddft_field_rtdb_get (params%rtdb, ifield, field)
132
if ( (field%polarization .ne. "x").and.
133
$ (field%polarization .ne. "y").and.
134
$ (field%polarization .ne. "z") )
135
$ call errquit (pname//"invalid polarization: "//
136
$ field%polarization, 0, 0)
138
C (actually its ok to have a negative "max")
139
C if (field%max .lt. 0d0) call errquit (pname//
140
C $ "cannot have negative field max", 0, 0)
142
C (its ok to have a negative freq, too)
143
C if ( (field%type .eq. "cw").or.(field%type.eq."pulse") ) then
144
C if (field%frequency .lt. 0d0) call errquit (pname//
145
C $ "cannot have negative frequency",0,0)
148
if (field%type.eq."pulse") then
149
if (field%center .lt. params%tmin) call errquit (pname//
150
$ "pulse center must be after tmin",0,0)
151
if (field%width .lt. 0d0) call errquit (pname//
152
$ "pulse width must be positive",0,0)
155
if (params%theory.eq."CS") then
156
if (field%spin .ne. "t") call errquit (pname//
157
$ "fields can only act on total spin " //
158
$ "for a closed shell calculation: "//field%spin, 0, 0)
163
CXXX [KAL]: check that field center is before tmax