1!--------------------------------------------------------------------------------------------------!
2!   CP2K: A general program to perform molecular dynamics simulations                              !
3!   Copyright (C) 2000 - 2020  CP2K developers group                                               !
4!--------------------------------------------------------------------------------------------------!
5
6! **************************************************************************************************
7!> \brief Filters for interpolating scaling functions .
8!> \author Florian Schiffmann (09.2007,fschiff)
9! **************************************************************************************************
10MODULE lazy
11
12   USE kinds,                           ONLY: dp
13#include "../base/base_uses.f90"
14
15   IMPLICIT NONE
16
17   PRIVATE
18
19   CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'lazy'
20
21! *** Public data types ***
22
23   PUBLIC :: lazy_arrays
24
25CONTAINS
26
27! **************************************************************************************************
28!> \brief ...
29!> \param itype ...
30!> \param m ...
31!> \param ch ...
32!> \param cg ...
33!> \param cgt ...
34!> \param cht ...
35!> \par History
36!>      09.2007 created [Florian Schiffmann]
37!> \author fschiff
38! **************************************************************************************************
39   SUBROUTINE lazy_arrays(itype, m, ch, cg, cgt, cht)
40      INTEGER, INTENT(in)                                :: itype, m
41      REAL(KIND=dp), DIMENSION(:), POINTER               :: ch, cg, cgt, cht
42
43      INTEGER                                            :: i
44
45      ALLOCATE (ch(-m:m))
46      ALLOCATE (cg(-m:m))
47      ALLOCATE (cgt(-m:m))
48      ALLOCATE (cht(-m:m))
49
50      SELECT CASE (itype)
51      CASE (8)
52
53         DO i = -m, m
54            ch(i) = 0._dp
55            cht(i) = 0._dp
56            cg(i) = 0._dp
57            cgt(i) = 0._dp
58         ENDDO
59
60         ! The normalization is chosen such that a constant function remains the same constant
61         ! on each level of the transform
62
63         ch(-7) = -5._dp/2048._dp
64         ch(-6) = 0._dp
65         ch(-5) = 49._dp/2048._dp
66         ch(-4) = 0._dp
67         ch(-3) = -245._dp/2048._dp
68         ch(-2) = 0._dp
69         ch(-1) = 1225._dp/2048._dp
70         ch(0) = 1._dp
71         ch(1) = 1225._dp/2048._dp
72         ch(2) = 0._dp
73         ch(3) = -245._dp/2048._dp
74         ch(4) = 0._dp
75         ch(5) = 49._dp/2048._dp
76         ch(6) = 0._dp
77         ch(7) = -5._dp/2048._dp
78         !
79         cht(0) = 1._dp
80
81         ! g coefficients from h coefficients
82         DO i = -m, m - 1
83            cg(i + 1) = cht(-i)*(-1)**(i + 1)
84            cgt(i + 1) = ch(-i)*(-1)**(i + 1)
85         ENDDO
86
87      CASE (14)
88         ch = (/ &
89              0._dp, 0._dp, 0._dp, 0.0000275373458862304687_dp, 0._dp, -0.000423073768615722656_dp, 0._dp, &
90              0.00310254096984863281_dp, 0._dp, -0.0146262645721435547_dp, 0._dp, &
91              0.0511919260025024414_dp, 0._dp, -0.153575778007507324_dp, 0._dp, 0.614303112030029297_dp, &
92              1._dp, 0.614303112030029297_dp, 0._dp, -0.153575778007507324_dp, 0._dp, &
93              0.0511919260025024414_dp, 0._dp, -0.0146262645721435547_dp, 0._dp, &
94              0.00310254096984863281_dp, 0._dp, -0.000423073768615722656_dp, 0._dp, &
95              0.0000275373458862304687_dp, 0._dp, 0._dp, 0._dp &
96              /)
97
98         DO i = -m, m
99            cht(i) = 0._dp
100            cg(i) = 0._dp
101            cgt(i) = 0._dp
102         ENDDO
103
104         ! the normalization is chosen such that a constant function remains the same constant
105         ! on each level of the transform
106
107         cht(0) = 1._dp
108
109         ! g coefficients from h coefficients
110         DO i = -m, m - 1
111            cg(i + 1) = cht(-i)*(-1)**(i + 1)
112            cgt(i + 1) = ch(-i)*(-1)**(i + 1)
113         ENDDO
114
115      CASE (16)
116         ch = (/ &
117              0._dp, 0._dp, 0._dp, -6.39259815216064453e-6_dp, 0._dp, 0.000110641121864318848_dp, 0._dp, &
118              -0.000915303826332092285_dp, 0._dp, 0.00484772026538848877_dp, 0._dp, &
119              -0.0186983495950698853_dp, 0._dp, 0.0575909167528152466_dp, 0._dp, &
120              -0.159974768757820129_dp, 0._dp, 0.617045536637306213_dp, 1._dp, 0.617045536637306213_dp, &
121              0._dp, -0.159974768757820129_dp, 0._dp, 0.0575909167528152466_dp, 0._dp, &
122              -0.0186983495950698853_dp, 0._dp, 0.00484772026538848877_dp, 0._dp, &
123              -0.000915303826332092285_dp, 0._dp, 0.000110641121864318848_dp, 0._dp, &
124              -6.39259815216064453e-6_dp, 0._dp, 0._dp, 0._dp &
125              /)
126
127         DO i = -m, m
128            cht(i) = 0._dp
129            cg(i) = 0._dp
130            cgt(i) = 0._dp
131         ENDDO
132
133         ! the normalization is chosen such that a constant function remains the same constant
134         ! on each level of the transform
135
136         cht(0) = 1._dp
137
138         ! g coefficients from h coefficients
139         DO i = -m, m - 1
140            cg(i + 1) = cht(-i)*(-1)**(i + 1)
141            cgt(i + 1) = ch(-i)*(-1)**(i + 1)
142         ENDDO
143
144      CASE (20)
145         ch = (/ &
146              0._dp, 0._dp, 0._dp, &
147              -3.53757059201598167e-7_dp, 0._dp, 7.51213519833981991e-6_dp, 0._dp, &
148              -0.0000766237790230661631_dp, 0._dp, 0.000501001632073894143_dp, 0._dp, &
149              -0.00236837135162204504_dp, 0._dp, 0.00868402828928083181_dp, 0._dp, &
150              -0.0260520848678424954_dp, 0._dp, 0.0677354206563904881_dp, 0._dp, &
151              -0.16933855164097622_dp, 0._dp, 0.620908022683579475_dp, 1._dp, 0.620908022683579475_dp, &
152              0._dp, -0.16933855164097622_dp, 0._dp, 0.0677354206563904881_dp, 0._dp, &
153              -0.0260520848678424954_dp, 0._dp, 0.00868402828928083181_dp, 0._dp, &
154              -0.00236837135162204504_dp, 0._dp, 0.000501001632073894143_dp, 0._dp, &
155              -0.0000766237790230661631_dp, 0._dp, 7.51213519833981991e-6_dp, 0._dp, &
156              -3.53757059201598167e-7_dp, &
157              0._dp, 0._dp, 0._dp/)
158
159         !******** coefficients for wavelet transform *********************
160         DO i = -m, m
161            cht(i) = 0._dp
162            cg(i) = 0._dp
163            cgt(i) = 0._dp
164         ENDDO
165
166         ! the normalization is chosen such that a constant function remains the same constant
167         ! on each level of the transform
168
169         cht(0) = 1._dp
170
171         ! g coefficients from h coefficients
172         DO i = -m, m - 1
173            cg(i + 1) = cht(-i)*(-1)**(i + 1)
174            cgt(i + 1) = ch(-i)*(-1)**(i + 1)
175         ENDDO
176
177      CASE (24)
178         ch = (/ &
179              0._dp, 0._dp, 0._dp, &
180              -2.00495833269087598e-8_dp, 0._dp, 5.0505855142546352e-7_dp, 0._dp, &
181              -6.14044870417274069e-6_dp, 0._dp, 0.0000480399810385279125_dp, 0._dp, &
182              -0.000272226559218324837_dp, 0._dp, 0.00119360875964957813_dp, 0._dp, &
183              -0.00423188560239395883_dp, 0._dp, 0.0125613112325027032_dp, 0._dp, &
184              -0.032300514597864094_dp, 0._dp, 0.0753678673950162192_dp, 0._dp, &
185              -0.175858357255037845_dp, 0._dp, 0.623497812086043268_dp, 1._dp, 0.623497812086043268_dp, &
186              0._dp, -0.175858357255037845_dp, 0._dp, 0.0753678673950162192_dp, 0._dp, &
187              -0.032300514597864094_dp, 0._dp, 0.0125613112325027032_dp, 0._dp, &
188              -0.00423188560239395883_dp, 0._dp, 0.00119360875964957813_dp, 0._dp, &
189              -0.000272226559218324837_dp, 0._dp, 0.0000480399810385279125_dp, 0._dp, &
190              -6.14044870417274069e-6_dp, 0._dp, 5.0505855142546352e-7_dp, 0._dp, &
191              -2.00495833269087598e-8_dp, &
192              0._dp, 0._dp, 0._dp/)
193
194         !******** coefficients for wavelet transform *********************
195         DO i = -m, m
196            cht(i) = 0._dp
197            cg(i) = 0._dp
198            cgt(i) = 0._dp
199         ENDDO
200
201         ! the normalization is chosen such that a constant function remains the same constant
202         ! on each level of the transform
203
204         cht(0) = 1._dp
205
206         ! g coefficients from h coefficients
207         DO i = -m, m - 1
208            cg(i + 1) = cht(-i)*(-1)**(i + 1)
209            cgt(i + 1) = ch(-i)*(-1)**(i + 1)
210         ENDDO
211
212      CASE (30)
213         ch = (/ &
214              0._dp, 0._dp, 0._dp, &
215              2.78364831185484718e-10_dp, 0._dp, -8.6705490009997277e-9_dp, 0._dp, &
216              1.31098700895115883e-7_dp, 0._dp, -1.28248729136526407e-6_dp, 0._dp, &
217              9.13008809805271326e-6_dp, 0._dp, -0.000050455750015554468_dp, 0._dp, &
218              0.000225566882422478798_dp, 0._dp, -0.00083996810502084962_dp, 0._dp, &
219              0.0026652834101623113_dp, 0._dp, -0.00734972091893243418_dp, 0._dp, &
220              0.0179659844685015058_dp, 0._dp, -0.039898484988490357_dp, 0._dp, &
221              0.0837868184758297496_dp, 0._dp, -0.18261229667809048_dp, 0._dp, 0.626099302896310217_dp, &
222              1._dp, 0.626099302896310217_dp, 0._dp, -0.18261229667809048_dp, 0._dp, &
223              0.0837868184758297496_dp, 0._dp, -0.039898484988490357_dp, 0._dp, &
224              0.0179659844685015058_dp, 0._dp, -0.00734972091893243418_dp, 0._dp, &
225              0.0026652834101623113_dp, 0._dp, -0.00083996810502084962_dp, 0._dp, &
226              0.000225566882422478798_dp, 0._dp, -0.000050455750015554468_dp, 0._dp, &
227              9.13008809805271326e-6_dp, 0._dp, -1.28248729136526407e-6_dp, 0._dp, &
228              1.31098700895115883e-7_dp, 0._dp, -8.6705490009997277e-9_dp, 0._dp, &
229              2.78364831185484718e-10_dp, &
230              0._dp, 0._dp, 0._dp/)
231
232         !******** coefficients for wavelet transform *********************
233         DO i = -m, m
234            cht(i) = 0._dp
235            cg(i) = 0._dp
236            cgt(i) = 0._dp
237         ENDDO
238
239         ! the normalization is chosen such that a constant function remains the same constant
240         ! on each level of the transform
241
242         cht(0) = 1._dp
243
244         ! g coefficients from h coefficients
245         DO i = -m, m - 1
246            cg(i + 1) = cht(-i)*(-1)**(i + 1)
247            cgt(i + 1) = ch(-i)*(-1)**(i + 1)
248         ENDDO
249
250      CASE (40)
251         ch = (/ &
252              0._dp, 0._dp, 0._dp, &
253              -2.33895335687458837e-13_dp, 0._dp, 9.61499474542229436e-12_dp, 0._dp, &
254              -1.9312403731519637e-10_dp, 0._dp, 2.52621846791090201e-9_dp, 0._dp, &
255              -2.42028027409528354e-8_dp, 0._dp, 1.81103730854716044e-7_dp, 0._dp, &
256              -1.10227332483179024e-6_dp, 0._dp, 5.61214589957214346e-6_dp, 0._dp, &
257              -0.0000244006343459658411_dp, 0._dp, 0.0000920510703104425647_dp, 0._dp, &
258              -0.000305221969976730609_dp, 0._dp, 0.000899343879450152758_dp, 0._dp, &
259              -0.00237826492565707063_dp, 0._dp, 0.00569939227746221067_dp, 0._dp, &
260              -0.0125090557778066702_dp, 0._dp, 0.0254814099177543281_dp, 0._dp, &
261              -0.0491427191270976329_dp, 0._dp, 0.0930820915230908105_dp, 0._dp, &
262              -0.189611667917407207_dp, 0._dp, 0.628712372568244948_dp, 1._dp, 0.628712372568244948_dp, &
263              0._dp, -0.189611667917407207_dp, 0._dp, 0.0930820915230908105_dp, 0._dp, &
264              -0.0491427191270976329_dp, 0._dp, 0.0254814099177543281_dp, 0._dp, &
265              -0.0125090557778066702_dp, 0._dp, 0.00569939227746221067_dp, 0._dp, &
266              -0.00237826492565707063_dp, 0._dp, 0.000899343879450152758_dp, 0._dp, &
267              -0.000305221969976730609_dp, 0._dp, 0.0000920510703104425647_dp, 0._dp, &
268              -0.0000244006343459658411_dp, 0._dp, 5.61214589957214346e-6_dp, 0._dp, &
269              -1.10227332483179024e-6_dp, 0._dp, 1.81103730854716044e-7_dp, 0._dp, &
270              -2.42028027409528354e-8_dp, 0._dp, 2.52621846791090201e-9_dp, 0._dp, &
271              -1.9312403731519637e-10_dp, 0._dp, 9.61499474542229436e-12_dp, 0._dp, &
272              -2.33895335687458837e-13_dp, &
273              0._dp, 0._dp, 0._dp/)
274
275         !******** coefficients for wavelet transform *********************
276         DO i = -m, m
277            cht(i) = 0._dp
278            cg(i) = 0._dp
279            cgt(i) = 0._dp
280         ENDDO
281
282         ! the normalization is chosen such that a constant function remains the same constant
283         ! on each level of the transform
284
285         cht(0) = 1._dp
286
287         ! g coefficients from h coefficients
288         DO i = -m, m - 1
289            cg(i + 1) = cht(-i)*(-1)**(i + 1)
290            cgt(i + 1) = ch(-i)*(-1)**(i + 1)
291         ENDDO
292
293      CASE (50)
294         !******** coefficients for wavelet transform *********************
295
296         ch(-m:0) = (/0._dp, 0._dp, 0._dp, &
297                      2.03510990661269603e-16_dp, 0._dp, -1.03963806080363471e-14_dp, 0._dp, &
298                      2.60602607241444435e-13_dp, 0._dp, -4.27267065360972853e-12_dp, 0._dp, &
299                      5.15325765417075794e-11_dp, 0._dp, -4.87577454971540944e-10_dp, 0._dp, &
300                      3.76884194923947865e-9_dp, 0._dp, -2.44743981275102471e-8_dp, 0._dp, &
301                      1.36277898664545694e-7_dp, 0._dp, -6.60874540835592558e-7_dp, 0._dp, &
302                      2.82580838150391301e-6_dp, 0._dp, -0.0000107609066649189415_dp, 0._dp, &
303                      0.0000368023007940227798_dp, 0._dp, -0.000113853271687194218_dp, 0._dp, &
304                      0.000320647989649649023_dp, 0._dp, -0.00082693428909646327_dp, 0._dp, &
305                      0.00196396893660410027_dp, 0._dp, -0.00432073166052902059_dp, 0._dp, &
306                      0.008863039303649273_dp, 0._dp, -0.0170899753079935742_dp, 0._dp, &
307                      0.0313316213979882195_dp, 0._dp, -0.0556296135025505121_dp, 0._dp, &
308                      0.0991218567863627306_dp, 0._dp, -0.193934067625492299_dp, 0._dp, &
309                      0.630285719782849972_dp, 1._dp/)
310         ch(1:m) = (/ &
311                   0.630285719782849972_dp, 0._dp, -0.193934067625492299_dp, 0._dp, &
312                   0.0991218567863627306_dp, 0._dp, -0.0556296135025505121_dp, 0._dp, &
313                   0.0313316213979882195_dp, 0._dp, -0.0170899753079935742_dp, 0._dp, &
314                   0.008863039303649273_dp, 0._dp, -0.00432073166052902059_dp, 0._dp, &
315                   0.00196396893660410027_dp, 0._dp, -0.00082693428909646327_dp, 0._dp, &
316                   0.000320647989649649023_dp, 0._dp, -0.000113853271687194218_dp, 0._dp, &
317                   0.0000368023007940227798_dp, 0._dp, -0.0000107609066649189415_dp, 0._dp, &
318                   2.82580838150391301e-6_dp, 0._dp, -6.60874540835592558e-7_dp, 0._dp, &
319                   1.36277898664545694e-7_dp, 0._dp, -2.44743981275102471e-8_dp, 0._dp, &
320                   3.76884194923947865e-9_dp, 0._dp, -4.87577454971540944e-10_dp, 0._dp, &
321                   5.15325765417075794e-11_dp, 0._dp, -4.27267065360972853e-12_dp, 0._dp, &
322                   2.60602607241444435e-13_dp, 0._dp, -1.03963806080363471e-14_dp, 0._dp, &
323                   2.03510990661269603e-16_dp, &
324                   0._dp, 0._dp, 0._dp/)
325         DO i = -m, m
326            cht(i) = 0._dp
327            cg(i) = 0._dp
328            cgt(i) = 0._dp
329         ENDDO
330
331         ! the normalization is chosen such that a constant function remains the same constant
332         ! on each level of the transform
333
334         cht(0) = 1._dp
335
336         ! g coefficients from h coefficients
337         DO i = -m, m - 1
338            cg(i + 1) = cht(-i)*(-1)**(i + 1)
339            cgt(i + 1) = ch(-i)*(-1)**(i + 1)
340         ENDDO
341
342      CASE (60)
343         !******** coefficients for wavelet transform *********************
344         ch(-m:0) = (/ &
345                    0._dp, 0._dp, 0._dp, &
346                    -1.80960777804178984e-19_dp, 0._dp, 1.10513064480060885e-17_dp, 0._dp, &
347                    -3.32141991973710259e-16_dp, 0._dp, 6.54883738891560793e-15_dp, 0._dp, &
348                    -9.5279163579909433e-14_dp, 0._dp, 1.09084919935365698e-12_dp, 0._dp, &
349                    -1.02354148279779304e-11_dp, 0._dp, 8.09410105920413478e-11_dp, 0._dp, &
350                    -5.50587106934234749e-10_dp, 0._dp, 3.27218841600752522e-9_dp, 0._dp, &
351                    -1.71999647508087864e-8_dp, 0._dp, 8.07595396530604197e-8_dp, 0._dp, &
352                    -3.41497481961512632e-7_dp, 0._dp, 1.30947169656570694e-6_dp, 0._dp, &
353                    -4.58013372208926991e-6_dp, 0._dp, 0.0000146880150398035208_dp, 0._dp, &
354                    -0.0000433840444231233622_dp, 0._dp, 0.000118515001353520526_dp, 0._dp, &
355                    -0.000300581525171972349_dp, 0._dp, 0.000710396937937769235_dp, 0._dp, &
356                    -0.00157035112596770041_dp, 0._dp, 0.00325946830347917649_dp, 0._dp, &
357                    -0.00638065613347741822_dp, 0._dp, 0.0118436928230099234_dp, 0._dp, &
358                    -0.0209956372771539552_dp, 0._dp, 0.0359258682297967678_dp, 0._dp, &
359                    -0.0604028333973506096_dp, 0._dp, 0.103355959368799932_dp, 0._dp, &
360                    -0.196868494035809394_dp, 0._dp, 0.631336894666561161_dp, 1._dp/)
361         ch(1:m) = (/0.631336894666561161_dp, &
362                     0._dp, -0.196868494035809394_dp, 0._dp, 0.103355959368799932_dp, 0._dp, &
363                     -0.0604028333973506096_dp, 0._dp, 0.0359258682297967678_dp, 0._dp, &
364                     -0.0209956372771539552_dp, 0._dp, 0.0118436928230099234_dp, 0._dp, &
365                     -0.00638065613347741822_dp, 0._dp, 0.00325946830347917649_dp, 0._dp, &
366                     -0.00157035112596770041_dp, 0._dp, 0.000710396937937769235_dp, 0._dp, &
367                     -0.000300581525171972349_dp, 0._dp, 0.000118515001353520526_dp, 0._dp, &
368                     -0.0000433840444231233622_dp, 0._dp, 0.0000146880150398035208_dp, 0._dp, &
369                     -4.58013372208926991e-6_dp, 0._dp, 1.30947169656570694e-6_dp, 0._dp, &
370                     -3.41497481961512632e-7_dp, 0._dp, 8.07595396530604197e-8_dp, 0._dp, &
371                     -1.71999647508087864e-8_dp, 0._dp, 3.27218841600752522e-9_dp, 0._dp, &
372                     -5.50587106934234749e-10_dp, 0._dp, 8.09410105920413478e-11_dp, 0._dp, &
373                     -1.02354148279779304e-11_dp, 0._dp, 1.09084919935365698e-12_dp, 0._dp, &
374                     -9.5279163579909433e-14_dp, 0._dp, 6.54883738891560793e-15_dp, 0._dp, &
375                     -3.32141991973710259e-16_dp, 0._dp, 1.10513064480060885e-17_dp, 0._dp, &
376                     -1.80960777804178984e-19_dp, &
377                     0._dp, 0._dp, 0._dp/)
378
379         DO i = -m, m
380            cht(i) = 0._dp
381            cg(i) = 0._dp
382            cgt(i) = 0._dp
383         ENDDO
384
385         ! the normalization is chosen such that a constant function remains the same constant
386         ! on each level of the transform
387
388         cht(0) = 1._dp
389
390         ! g coefficients from h coefficients
391         DO i = -m, m - 1
392            cg(i + 1) = cht(-i)*(-1)**(i + 1)
393            cgt(i + 1) = ch(-i)*(-1)**(i + 1)
394         ENDDO
395
396      CASE (100)
397         !******** coefficients for wavelet transform *********************
398         ch(-m:-m + 22) = (/ &
399                          0._dp, 0._dp, 0._dp, &
400                          -1.2683805626484815e-31_dp, 0._dp, 1.28158741180595538e-29_dp, 0._dp, &
401                          -6.41198417717232202e-28_dp, 0._dp, 2.11779334023809847e-26_dp, 0._dp, &
402                          -5.19441179715542395e-25_dp, 0._dp, 1.00911662890805933e-23_dp, 0._dp, &
403                          -1.61729304931893186e-22_dp, 0._dp, 2.19924673311587861e-21_dp, 0._dp, &
404                          -2.59007672484430282e-20_dp, 0._dp, 2.68351845030850743e-19_dp, 0._dp/)
405         ch(-m + 23:0) = (/ &
406                         -2.47631006363911635e-18_dp, 0._dp, 2.05560047903738218e-17_dp, 0._dp, &
407                         -1.54763876066192241e-16_dp, 0._dp, 1.06410357358472536e-15_dp, 0._dp, &
408                         -6.72076683598079057e-15_dp, 0._dp, 3.91882394735691508e-14_dp, 0._dp, &
409                         -2.1187969775075261e-13_dp, 0._dp, 1.06630135673478305e-12_dp, 0._dp, &
410                         -5.01180443685748998e-12_dp, 0._dp, 2.20666419683207691e-11_dp, 0._dp, &
411                         -9.1258654919835045e-11_dp, 0._dp, 3.55352205999457932e-10_dp, 0._dp, &
412                         -1.30569909741619005e-9_dp, 0._dp, 4.53620646231137398e-9_dp, 0._dp, &
413                         -1.49279735540769725e-8_dp, 0._dp, 4.66118357913015673e-8_dp, 0._dp, &
414                         -1.38309751701521672e-7_dp, 0._dp, 3.90568525175243503e-7_dp, 0._dp, &
415                         -1.05103157937523999e-6_dp, 0._dp, 2.69873794098621337e-6_dp, 0._dp, &
416                         -6.61998110310293365e-6_dp, 0._dp, 0.0000155312721433740143_dp, 0._dp, &
417                         -0.0000348898934935080536_dp, 0._dp, 0.0000751302114254144957_dp, 0._dp, &
418                         -0.000155250095336387829_dp, 0._dp, 0.000308205854288494064_dp, 0._dp, &
419                         -0.000588508297900663563_dp, 0._dp, 0.00108221904295030132_dp, 0._dp, &
420                         -0.00191926718143360074_dp, 0._dp, 0.00328782888345707184_dp, 0._dp, &
421                         -0.00545087420152093489_dp, 0._dp, 0.00876675750345045625_dp, 0._dp, &
422                         -0.0137206712673049998_dp, 0._dp, 0.0209859998811194541_dp, 0._dp, &
423                         -0.031565718829452402_dp, 0._dp, 0.0471537281279474153_dp, 0._dp, &
424                         -0.0711699126403181485_dp, 0._dp, 0.112357606764076737_dp, 0._dp, &
425                         -0.202867901101805219_dp, 0._dp, 0.633444670787269357_dp, 1._dp/)
426         ch(1:80) = (/0.633444670787269357_dp, &
427                      0._dp, -0.202867901101805219_dp, 0._dp, 0.112357606764076737_dp, 0._dp, &
428                      -0.0711699126403181485_dp, 0._dp, 0.0471537281279474153_dp, 0._dp, &
429                      -0.031565718829452402_dp, 0._dp, 0.0209859998811194541_dp, 0._dp, &
430                      -0.0137206712673049998_dp, 0._dp, 0.00876675750345045625_dp, 0._dp, &
431                      -0.00545087420152093489_dp, 0._dp, 0.00328782888345707184_dp, 0._dp, &
432                      -0.00191926718143360074_dp, 0._dp, 0.00108221904295030132_dp, 0._dp, &
433                      -0.000588508297900663563_dp, 0._dp, 0.000308205854288494064_dp, 0._dp, &
434                      -0.000155250095336387829_dp, 0._dp, 0.0000751302114254144957_dp, 0._dp, &
435                      -0.0000348898934935080536_dp, 0._dp, 0.0000155312721433740143_dp, 0._dp, &
436                      -6.61998110310293365e-6_dp, 0._dp, 2.69873794098621337e-6_dp, 0._dp, &
437                      -1.05103157937523999e-6_dp, 0._dp, 3.90568525175243503e-7_dp, 0._dp, &
438                      -1.38309751701521672e-7_dp, 0._dp, 4.66118357913015673e-8_dp, 0._dp, &
439                      -1.49279735540769725e-8_dp, 0._dp, 4.53620646231137398e-9_dp, 0._dp, &
440                      -1.30569909741619005e-9_dp, 0._dp, 3.55352205999457932e-10_dp, 0._dp, &
441                      -9.1258654919835045e-11_dp, 0._dp, 2.20666419683207691e-11_dp, 0._dp, &
442                      -5.01180443685748998e-12_dp, 0._dp, 1.06630135673478305e-12_dp, 0._dp, &
443                      -2.1187969775075261e-13_dp, 0._dp, 3.91882394735691508e-14_dp, 0._dp, &
444                      -6.72076683598079057e-15_dp, 0._dp, 1.06410357358472536e-15_dp, 0._dp, &
445                      -1.54763876066192241e-16_dp, 0._dp, 2.05560047903738218e-17_dp, 0._dp, &
446                      -2.47631006363911635e-18_dp, 0._dp/)
447         ch(81:m) = (/2.68351845030850743e-19_dp, 0._dp, &
448                      -2.59007672484430282e-20_dp, 0._dp, 2.19924673311587861e-21_dp, 0._dp, &
449                      -1.61729304931893186e-22_dp, 0._dp, 1.00911662890805933e-23_dp, 0._dp, &
450                      -5.19441179715542395e-25_dp, 0._dp, 2.11779334023809847e-26_dp, 0._dp, &
451                      -6.41198417717232202e-28_dp, 0._dp, 1.28158741180595538e-29_dp, 0._dp, &
452                      -1.2683805626484815e-31_dp, &
453                      0._dp, 0._dp, 0._dp/)
454
455         DO i = -m, m
456            cht(i) = 0._dp
457            cg(i) = 0._dp
458            cgt(i) = 0._dp
459         ENDDO
460
461         ! the normalization is chosen such that a constant function remains the same constant
462         ! on each level of the transform
463
464         cht(0) = 1._dp
465
466         ! g coefficients from h coefficients
467         DO i = -m, m - 1
468            cg(i + 1) = cht(-i)*(-1)**(i + 1)
469            cgt(i + 1) = ch(-i)*(-1)**(i + 1)
470         ENDDO
471
472      END SELECT
473
474   END SUBROUTINE lazy_arrays
475END MODULE lazy
476