93 integer,
intent(in) :: nmax_in,ritmax_in
95 integer (kind=8) :: Binomial_DD
118 if (
allocated(
binc)) then
124 binc(n,k) = binomial_dd(n,k)
140 if (
allocated(
tid)) then
143 allocate(tid(0:2**nmax_in-1),ntid(0:nmax_in))
148 if (mod(id,2**(k+1))/2**k.eq.0) n=n+1
154 if (
allocated(aimacc)) then
155 deallocate(aimacc,erracc)
157 allocate(aimacc(nmax),erracc(nmax))
159 if (
allocated(resaccabs)) then
160 deallocate(resaccabs,resaccrel,resaccabs2,resaccrel2)
162 allocate(resaccabs(0:2**nmax,0:rmax),resaccrel(0:2**nmax,0:rmax))
163 allocate(resaccabs2(0:2**nmax,0:rmax),resaccrel2(0:2**nmax,0:rmax))
167 if (
allocated(b_cache)) then
168 deallocate(b_cache,buv_cache)
171 allocate(b_cache(ntid(2),0:r2max2,0:r2max2))
172 allocate(buv_cache(ntid(2),0:r2max2,0:r2max2))
175 if (
allocated(c_cache)) then
176 deallocate(c_cache,cuv_cache,c_new_cache,cuv_new_cache)
177 deallocate(cij_err,c00_err,cij_err2)
178 deallocate(cij_err_newprelim,c00_err_newprelim,cij_err_new,c00_err_new)
179 deallocate(accr2_aux,accr2_newprelim,accr2_new_aux)
182 allocate(c_cache(ntid(3),ncoefmax3_int))
183 allocate(cuv_cache(ntid(3),ncoefmax3_int))
184 allocate(c_new_cache(ntid(3),ncoefmax3_int))
185 allocate(cuv_new_cache(ntid(3),ncoefmax3_int))
186 allocate(cij_err(ntid(3),0:2*r2max3))
187 allocate(c00_err(ntid(3),0:2*r2max3))
188 allocate(cij_err2(ntid(3),0:2*r2max3))
189 allocate(cij_err_newprelim(ntid(3),0:2*r2max3))
190 allocate(c00_err_newprelim(ntid(3),0:2*r2max3))
191 allocate(cij_err_new(ntid(3),0:2*r2max3))
192 allocate(c00_err_new(ntid(3),0:2*r2max3))
193 allocate(accr2_aux(ntid(3),0:2*r2max3))
194 allocate(accr2_newprelim(ntid(3),0:2*r2max3))
195 allocate(accr2_new_aux(ntid(3),0:2*r2max3))
198 if (
allocated(d_cache)) then
199 deallocate(d_cache,duv_cache)
200 deallocate(dij_err,d00_err,dij_err_new,d00_err_new,dij_err2)
203 allocate(d_cache(ntid(4),ncoefmax4_int))
204 allocate(duv_cache(ntid(4),ncoefmax4_int))
205 allocate(dij_err(ntid(4),0:2*r2max4))
206 allocate(d00_err(ntid(4),0:2*r2max4))
207 allocate(dij_err_new(ntid(4),0:2*r2max4))
208 allocate(d00_err_new(ntid(4),0:2*r2max4))
209 allocate(dij_err2(ntid(4),0:2*r2max4))
212 if (
allocated(eij_err)) then
213 deallocate(eij_err,eij_err2)
216 allocate(eij_err(ntid(5),0:2*r2max5))
217 allocate(eij_err2(ntid(5),0:2*r2max5))
220 if (
allocated(fij_err)) then
221 deallocate(fij_err,fij_err2)
224 allocate(fij_err(ntid(6),0:2*r2max6))
225 allocate(fij_err2(ntid(6),0:2*r2max6))
230 if (
allocated(z2i_aux)) then
231 deallocate(z2_aux,tz2_aux,z2i_aux,ttz2_aux)
232 deallocate(x2_aux,tx2_aux,ttx2_aux)
235 allocate(z2i_aux(ntid(3),2,2),ttz2_aux(ntid(3),2,2,2,2))
236 allocate(z2_aux(ntid(3),2,2),tz2_aux(ntid(3),2,2))
237 allocate(x2_aux(ntid(3),0:2,0:2),tx2_aux(ntid(3),0:2,0:2))
238 allocate(ttx2_aux(ntid(3),0:2,0:2,0:2,0:2))
241 if (
allocated(scalint)) then
242 deallocate(scalint,scalint_err,scalintnew)
245 deallocate(acc_pave,acc_new)
246 deallocate(maxtxij,maxttx0klm,maxttx0ijm)
247 deallocate(maxtz_nj,maxttz_knlm,ttzff_kl)
248 deallocate(auxi,r2_aux,r2_new_aux,r2_newprelim,qmethod,qmethod_new)
251 allocate(scalint(0:2**nmax),scalint_err(0:2**nmax),scalintnew(0:2**nmax))
252 allocate(maxtxij(0:2**nmax),maxttx0klm(0:2**nmax),maxttx0ijm(0:2**nmax))
253 allocate(maxtz_nj(0:2**nmax),maxttz_knlm(0:2**nmax),ttzff_kl(0:2**nmax))
254 allocate(acc_pave(0:2**nmax),acc_new(0:2**nmax))
255 allocate(auxr(0:2**nmax,2))
256 allocate(auxc(0:2**nmax,7))
257 allocate(auxi(0:2**nmax,6))
258 allocate(r2_aux(0:2**nmax),r2_new_aux(0:2**nmax),r2_newprelim(0:2**nmax))
259 allocate(qmethod(0:2**nmax),qmethod_new(0:2**nmax))