~ubuntu-branches/ubuntu/trusty/nwchem/trusty-proposed

« back to all changes in this revision

Viewing changes to src/nwdft/rt_tddft/init/rt_tddft_init_check_params.F

  • Committer: Package Import Robot
  • Author(s): Michael Banck, Daniel Leidert, Andreas Tille, Michael Banck
  • Date: 2013-07-04 12:14:55 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130704121455-5tvsx2qabor3nrui
Tags: 6.3-1
* New upstream release.
* Fixes anisotropic properties (Closes: #696361).
* New features include:
  + Multi-reference coupled cluster (MRCC) approaches
  + Hybrid DFT calculations with short-range HF 
  + New density-functionals including Minnesota (M08, M11) and HSE hybrid
    functionals
  + X-ray absorption spectroscopy (XAS) with TDDFT
  + Analytical gradients for the COSMO solvation model
  + Transition densities from TDDFT 
  + DFT+U and Electron-Transfer (ET) methods for plane wave calculations
  + Exploitation of space group symmetry in plane wave geometry optimizations
  + Local density of states (LDOS) collective variable added to Metadynamics
  + Various new XC functionals added for plane wave calculations, including
    hybrid and range-corrected ones
  + Electric field gradients with relativistic corrections 
  + Nudged Elastic Band optimization method
  + Updated basis sets and ECPs 

[ Daniel Leidert ]
* debian/watch: Fixed.

[ Andreas Tille ]
* debian/upstream: References

[ Michael Banck ]
* debian/upstream (Name): New field.
* debian/patches/02_makefile_flags.patch: Refreshed.
* debian/patches/06_statfs_kfreebsd.patch: Likewise.
* debian/patches/07_ga_target_force_linux.patch: Likewise.
* debian/patches/05_avoid_inline_assembler.patch: Removed, no longer needed.
* debian/patches/09_backported_6.1.1_fixes.patch: Likewise.
* debian/control (Build-Depends): Added gfortran-4.7 and gcc-4.7.
* debian/patches/10_force_gcc-4.7.patch: New patch, explicitly sets
  gfortran-4.7 and gcc-4.7, fixes test suite hang with gcc-4.8 (Closes:
  #701328, #713262).
* debian/testsuite: Added tests for COSMO analytical gradients and MRCC.
* debian/rules (MRCC_METHODS): New variable, required to enable MRCC methods.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
C     
 
2
C     Check that rt-tddft parameters are legal.
 
3
C     
 
4
      subroutine rt_tddft_init_check_params (params)
 
5
      implicit none
 
6
 
 
7
#include "errquit.fh"
 
8
#include "mafdecls.fh"
 
9
#include "stdio.fh"
 
10
#include "global.fh"
 
11
#include "cdft.fh"
 
12
#include "rt_tddft.fh"
 
13
 
 
14
 
 
15
C     == In/out ==
 
16
      type(rt_params_t) params
 
17
 
 
18
C     == Parameters ==
 
19
      character(*), parameter :: pname = "rt_tddft_init_check_params: "
 
20
      double precision, parameter :: max_tol = 1d-2
 
21
      integer, parameter :: max_terms = 100
 
22
 
 
23
 
 
24
C     == Variables ==
 
25
      double precision tol_schwartz
 
26
 
 
27
 
 
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)
 
31
      
 
32
      if (params%tmax.lt.0d0)
 
33
     $     call errquit(pname//"tmax must be > 0", 0, 0)
 
34
      
 
35
      if (params%dt.lt.0d0)
 
36
     $     call errquit(pname//"dt must be > 0", 0, 0)
 
37
      
 
38
      if (params%tmax.lt.params%tmin)
 
39
     $     call errquit(pname//"tmax must be > tmin", 0, 0)
 
40
      
 
41
      call rt_tddft_init_check_fields (params)
 
42
 
 
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)
 
48
 
 
49
 
 
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)
 
54
 
 
55
      
 
56
 
 
57
C     
 
58
C     Check tolerances, etc
 
59
C     
 
60
 
 
61
      if ( (params%tol_zero .lt. 0d0).or.(params%tol_zero .ge. max_tol))
 
62
     $     call errquit (pname//"bad tol_zero", 0, 0)
 
63
 
 
64
      if ( (params%tol_series .lt. 0d0).or.
 
65
     $     (params%tol_series .gt. max_tol))
 
66
     $     call errquit (pname//"bad tol_series", 0, 0)
 
67
 
 
68
      if ( (params%tol_interpol .lt. 0d0).or.
 
69
     $     (params%tol_interpol .gt. max_tol))
 
70
     $     call errquit (pname//"bad tol_interpol", 0, 0)
 
71
 
 
72
      if ( (params%terms_series .lt. 1).or.
 
73
     $     (params%terms_series .gt. max_terms))
 
74
     $     call errquit (pname//"bad terms_series", 0, 0)
 
75
 
 
76
      if ( (params%terms_interpol .lt. 1).or.
 
77
     $     (params%terms_interpol .gt. max_terms))
 
78
     $     call errquit (pname//"bad terms_interpol", 0, 0)
 
79
 
 
80
 
 
81
      tol_schwartz = 10d0**(-itol2e) 
 
82
 
 
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 "//
 
87
     $        "tol_interpol.")
 
88
         
 
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.")
 
94
 
 
95
      endif
 
96
 
 
97
      end subroutine
 
98
 
 
99
 
 
100
 
 
101
C====================================================================
 
102
C
 
103
C     Check that all fields have valid parameters
 
104
C
 
105
      subroutine rt_tddft_init_check_fields (params)
 
106
      implicit none
 
107
 
 
108
#include "errquit.fh"
 
109
#include "mafdecls.fh"
 
110
#include "stdio.fh"
 
111
#include "global.fh"
 
112
#include "cdft.fh"
 
113
#include "rt_tddft.fh"
 
114
 
 
115
 
 
116
C     == In/out ==
 
117
      type(rt_params_t) params
 
118
 
 
119
 
 
120
C     == Parameters ==
 
121
      character(len=*), parameter :: pname =
 
122
     $     "rt_tddft_init_check_fields: "
 
123
 
 
124
 
 
125
C     == Variables ==
 
126
      integer ifield
 
127
      type(rt_field_t) field
 
128
 
 
129
      do ifield = 1, params%nfields
 
130
         call rt_tddft_field_rtdb_get (params%rtdb, ifield, field)
 
131
 
 
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)
 
137
 
 
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)
 
141
 
 
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)
 
146
C         endif
 
147
 
 
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)
 
153
         endif
 
154
 
 
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)
 
159
         endif
 
160
         
 
161
      enddo
 
162
 
 
163
CXXX  [KAL]: check that field center is before tmax      
 
164
 
 
165
      end subroutine