Line data Source code
1 : !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2 : !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 : !!!!
4 : !!!! MIT License
5 : !!!!
6 : !!!! ParaMonte: plain powerful parallel Monte Carlo library.
7 : !!!!
8 : !!!! Copyright (C) 2012-present, The Computational Data Science Lab
9 : !!!!
10 : !!!! This file is part of the ParaMonte library.
11 : !!!!
12 : !!!! Permission is hereby granted, free of charge, to any person obtaining a
13 : !!!! copy of this software and associated documentation files (the "Software"),
14 : !!!! to deal in the Software without restriction, including without limitation
15 : !!!! the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 : !!!! and/or sell copies of the Software, and to permit persons to whom the
17 : !!!! Software is furnished to do so, subject to the following conditions:
18 : !!!!
19 : !!!! The above copyright notice and this permission notice shall be
20 : !!!! included in all copies or substantial portions of the Software.
21 : !!!!
22 : !!!! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 : !!!! EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 : !!!! MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25 : !!!! IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
26 : !!!! DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
27 : !!!! OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
28 : !!!! OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 : !!!!
30 : !!!! ACKNOWLEDGMENT
31 : !!!!
32 : !!!! ParaMonte is an honor-ware and its currency is acknowledgment and citations.
33 : !!!! As per the ParaMonte library license agreement terms, if you use any parts of
34 : !!!! this library for any purposes, kindly acknowledge the use of ParaMonte in your
35 : !!!! work (education/research/industry/development/...) by citing the ParaMonte
36 : !!!! library as described on this page:
37 : !!!!
38 : !!!! https://github.com/cdslaborg/paramonte/blob/main/ACKNOWLEDGMENT.md
39 : !!!!
40 : !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
41 : !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
42 :
43 : !> \brief This include file contains the body of the submodules
44 : !> [ParaDRAM_mod@Test_SpecDRAM_smod](@ref paradram_mod@test_specdram_smod) and
45 : !> [ParaDISE_mod@@Test_SpecDRAM_smod](@ref paradise_mod@@test_specdram_smod).
46 : !> \author Amir Shahmoradi
47 :
48 : contains
49 :
50 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
51 :
52 : !> \brief
53 : !> Test the ParaDXXX sampler with a wrong input value for `daptiveUpdateCount < 0`.
54 4 : module function test_SpecDRAM_AdaptiveUpdateCount_type_1() result(assertion)
55 : use Constants_mod, only: IK, RK
56 : implicit none
57 : logical :: assertion
58 2 : type(ParaDXXX_type) :: PD
59 2 : assertion = .true.
60 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
61 : call PD%runSampler ( ndim = 1_IK &
62 : , getLogFunc = getLogFuncMVN &
63 : , mpiFinalizeRequested = .false. &
64 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecDRAM/test_SpecDRAM_AdaptiveUpdateCount_type_1" &
65 : , adaptiveUpdateCount = -1_IK &
66 2 : )
67 2 : assertion = assertion .and. PD%Err%occurred
68 : #endif
69 10 : end function test_SpecDRAM_AdaptiveUpdateCount_type_1
70 :
71 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
72 :
73 : !> \brief
74 : !> Test the ParaDXXX sampler with a valid input value for `daptiveUpdateCount`.
75 2 : module function test_SpecDRAM_AdaptiveUpdateCount_type_2() result(assertion)
76 2 : use Constants_mod, only: IK, RK
77 : implicit none
78 : logical :: assertion
79 2 : type(ParaDXXX_type) :: PD
80 2 : assertion = .true.
81 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
82 : call PD%runSampler ( ndim = 1_IK &
83 : , getLogFunc = getLogFuncMVN &
84 : , mpiFinalizeRequested = .false. &
85 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecDRAM/test_SpecDRAM_AdaptiveUpdateCount_type_2" &
86 : , adaptiveUpdateCount = 0_IK &
87 2 : )
88 2 : assertion = assertion .and. .not. PD%Err%occurred
89 : #endif
90 30 : end function test_SpecDRAM_AdaptiveUpdateCount_type_2
91 :
92 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
93 :
94 : !> \brief
95 : !> Test the ParaDXXX sampler with a valid input value for `daptiveUpdateCount`.
96 2 : module function test_SpecDRAM_AdaptiveUpdateCount_type_3() result(assertion)
97 2 : use Constants_mod, only: IK, RK
98 : implicit none
99 : logical :: assertion
100 2 : type(ParaDXXX_type) :: PD
101 2 : assertion = .true.
102 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
103 : call PD%runSampler ( ndim = 1_IK &
104 : , getLogFunc = getLogFuncMVN &
105 : , mpiFinalizeRequested = .false. &
106 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecDRAM/test_SpecDRAM_AdaptiveUpdateCount_type_3" &
107 : , inputFile = ParaDXXX_NML//" adaptiveUpdateCount = 0 /" &
108 2 : )
109 2 : assertion = assertion .and. .not. PD%Err%occurred
110 : #endif
111 30 : end function test_SpecDRAM_AdaptiveUpdateCount_type_3
112 :
113 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
114 :
115 : !> \brief
116 : !> Test the ParaDXXX sampler with a wrong input value for `adaptiveUpdatePeriod < 0`.
117 2 : module function test_SpecDRAM_AdaptiveUpdatePeriod_type_1() result(assertion)
118 2 : use Constants_mod, only: IK, RK
119 : implicit none
120 : logical :: assertion
121 2 : type(ParaDXXX_type) :: PD
122 2 : assertion = .true.
123 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
124 : call PD%runSampler ( ndim = 1_IK &
125 : , getLogFunc = getLogFuncMVN &
126 : , mpiFinalizeRequested = .false. &
127 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecDRAM/test_SpecDRAM_AdaptiveUpdatePeriod_type_1" &
128 : , adaptiveUpdatePeriod = 0_IK &
129 2 : )
130 2 : assertion = assertion .and. PD%Err%occurred
131 : #endif
132 10 : end function test_SpecDRAM_AdaptiveUpdatePeriod_type_1
133 :
134 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
135 :
136 : !> \brief
137 : !> Test the ParaDXXX sampler with a valid input value for `adaptiveUpdatePeriod`.
138 2 : module function test_SpecDRAM_AdaptiveUpdatePeriod_type_2() result(assertion)
139 2 : use Constants_mod, only: IK, RK
140 : implicit none
141 : logical :: assertion
142 2 : type(ParaDXXX_type) :: PD
143 2 : assertion = .true.
144 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
145 : call PD%runSampler ( ndim = 1_IK &
146 : , getLogFunc = getLogFuncMVN &
147 : , mpiFinalizeRequested = .false. &
148 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecDRAM/test_SpecDRAM_AdaptiveUpdatePeriod_type_2" &
149 : , adaptiveUpdatePeriod = 1_IK &
150 2 : )
151 2 : assertion = assertion .and. .not. PD%Err%occurred
152 : #endif
153 30 : end function test_SpecDRAM_AdaptiveUpdatePeriod_type_2
154 :
155 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
156 :
157 : !> \brief
158 : !> Test the ParaDXXX sampler with a valid input value for `adaptiveUpdatePeriod`.
159 2 : module function test_SpecDRAM_AdaptiveUpdatePeriod_type_3() result(assertion)
160 2 : use Constants_mod, only: IK, RK
161 : implicit none
162 : logical :: assertion
163 2 : type(ParaDXXX_type) :: PD
164 2 : assertion = .true.
165 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
166 : call PD%runSampler ( ndim = 1_IK &
167 : , getLogFunc = getLogFuncMVN &
168 : , mpiFinalizeRequested = .false. &
169 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecDRAM/test_SpecDRAM_AdaptiveUpdatePeriod_type_3" &
170 : , inputFile = ParaDXXX_NML//" adaptiveUpdatePeriod = 1 /" &
171 2 : )
172 2 : assertion = assertion .and. .not. PD%Err%occurred
173 : #endif
174 30 : end function test_SpecDRAM_AdaptiveUpdatePeriod_type_3
175 :
176 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
177 :
178 : !> \brief
179 : !> Test the ParaDXXX sampler with a wrong input value for `burninAdaptationMeasure < 0.`.
180 2 : module function test_SpecDRAM_BurninAdaptationMeasure_type_1() result(assertion)
181 2 : use Constants_mod, only: IK, RK
182 : implicit none
183 : logical :: assertion
184 2 : type(ParaDXXX_type) :: PD
185 2 : assertion = .true.
186 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
187 : call PD%runSampler ( ndim = 1_IK &
188 : , getLogFunc = getLogFuncMVN &
189 : , mpiFinalizeRequested = .false. &
190 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecDRAM/test_SpecDRAM_BurninAdaptationMeasure_type_1" &
191 : , burninAdaptationMeasure = -0.1_RK &
192 2 : )
193 2 : assertion = assertion .and. PD%Err%occurred
194 : #endif
195 10 : end function test_SpecDRAM_BurninAdaptationMeasure_type_1
196 :
197 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
198 :
199 : !> \brief
200 : !> Test the ParaDXXX sampler with a wrong input value for `burninAdaptationMeasure > 1.`.
201 2 : module function test_SpecDRAM_BurninAdaptationMeasure_type_2() result(assertion)
202 2 : use Constants_mod, only: IK, RK
203 : implicit none
204 : logical :: assertion
205 2 : type(ParaDXXX_type) :: PD
206 2 : assertion = .true.
207 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
208 : call PD%runSampler ( ndim = 1_IK &
209 : , getLogFunc = getLogFuncMVN &
210 : , mpiFinalizeRequested = .false. &
211 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecDRAM/test_SpecDRAM_BurninAdaptationMeasure_type_2" &
212 : , burninAdaptationMeasure = 1.1_RK &
213 2 : )
214 2 : assertion = assertion .and. PD%Err%occurred
215 : #endif
216 10 : end function test_SpecDRAM_BurninAdaptationMeasure_type_2
217 :
218 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
219 :
220 : !> \brief
221 : !> Test the ParaDXXX sampler with a valid input value for `adaptiveUpdatePeriod`.
222 2 : module function test_SpecDRAM_BurninAdaptationMeasure_type_3() result(assertion)
223 2 : use Constants_mod, only: IK, RK
224 : implicit none
225 : logical :: assertion
226 2 : type(ParaDXXX_type) :: PD
227 2 : assertion = .true.
228 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
229 : call PD%runSampler ( ndim = 1_IK &
230 : , getLogFunc = getLogFuncMVN &
231 : , mpiFinalizeRequested = .false. &
232 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecDRAM/test_SpecDRAM_BurninAdaptationMeasure_type_3" &
233 : , burninAdaptationMeasure = 1._RK &
234 2 : )
235 2 : assertion = assertion .and. .not. PD%Err%occurred
236 : #endif
237 30 : end function test_SpecDRAM_BurninAdaptationMeasure_type_3
238 :
239 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
240 :
241 : !> \brief
242 : !> Test the ParaDXXX sampler with a valid input value for `adaptiveUpdatePeriod`.
243 2 : module function test_SpecDRAM_BurninAdaptationMeasure_type_4() result(assertion)
244 2 : use Constants_mod, only: IK, RK
245 : implicit none
246 : logical :: assertion
247 2 : type(ParaDXXX_type) :: PD
248 2 : assertion = .true.
249 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
250 : call PD%runSampler ( ndim = 1_IK &
251 : , getLogFunc = getLogFuncMVN &
252 : , mpiFinalizeRequested = .false. &
253 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecDRAM/test_SpecDRAM_BurninAdaptationMeasure_type_4" &
254 : , inputFile = ParaDXXX_NML//" burninAdaptationMeasure = 0.5 /" &
255 2 : )
256 2 : assertion = assertion .and. .not. PD%Err%occurred
257 : #endif
258 30 : end function test_SpecDRAM_BurninAdaptationMeasure_type_4
259 :
260 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
261 :
262 : !> \brief
263 : !> Test the ParaDXXX sampler with a wrong input value for `burninAdaptationMeasure < 0.`.
264 2 : module function test_SpecDRAM_DelayedRejectionCount_type_1() result(assertion)
265 2 : use SpecDRAM_DelayedRejectionCount_mod, only: MIN_DELAYED_REJECTION_COUNT
266 : use Constants_mod, only: IK, RK
267 : implicit none
268 : logical :: assertion
269 2 : type(ParaDXXX_type) :: PD
270 2 : assertion = .true.
271 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
272 : call PD%runSampler ( ndim = 1_IK &
273 : , getLogFunc = getLogFuncMVN &
274 : , mpiFinalizeRequested = .false. &
275 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecDRAM/test_SpecDRAM_DelayedRejectionCount_type_1" &
276 : , delayedRejectionCount = MIN_DELAYED_REJECTION_COUNT - 1_IK &
277 2 : )
278 2 : assertion = assertion .and. PD%Err%occurred
279 : #endif
280 10 : end function test_SpecDRAM_DelayedRejectionCount_type_1
281 :
282 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
283 :
284 : !> \brief
285 : !> Test the ParaDXXX sampler with a wrong input value for `DelayedRejectionCount > 1.`.
286 2 : module function test_SpecDRAM_DelayedRejectionCount_type_2() result(assertion)
287 2 : use Constants_mod, only: IK, RK
288 : use SpecDRAM_DelayedRejectionCount_mod, only: MAX_DELAYED_REJECTION_COUNT
289 : implicit none
290 : logical :: assertion
291 2 : type(ParaDXXX_type) :: PD
292 2 : assertion = .true.
293 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
294 : call PD%runSampler ( ndim = 1_IK &
295 : , getLogFunc = getLogFuncMVN &
296 : , mpiFinalizeRequested = .false. &
297 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecDRAM/test_SpecDRAM_DelayedRejectionCount_type_2" &
298 : , delayedRejectionCount = MAX_DELAYED_REJECTION_COUNT + 1_IK &
299 2 : )
300 2 : assertion = assertion .and. PD%Err%occurred
301 : #endif
302 10 : end function test_SpecDRAM_DelayedRejectionCount_type_2
303 :
304 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
305 :
306 : !> \brief
307 : !> Test the ParaDXXX sampler with a valid input value for `adaptiveUpdatePeriod`.
308 2 : module function test_SpecDRAM_DelayedRejectionCount_type_3() result(assertion)
309 2 : use Constants_mod, only: IK, RK
310 : implicit none
311 : logical :: assertion
312 2 : type(ParaDXXX_type) :: PD
313 2 : assertion = .true.
314 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
315 : call PD%runSampler ( ndim = 1_IK &
316 : , getLogFunc = getLogFuncMVN &
317 : , mpiFinalizeRequested = .false. &
318 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecDRAM/test_SpecDRAM_DelayedRejectionCount_type_3" &
319 : , delayedRejectionCount = 0_IK &
320 2 : )
321 2 : assertion = assertion .and. .not. PD%Err%occurred
322 : #endif
323 30 : end function test_SpecDRAM_DelayedRejectionCount_type_3
324 :
325 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
326 :
327 : !> \brief
328 : !> Test the ParaDXXX sampler with a valid input value for `adaptiveUpdatePeriod`.
329 2 : module function test_SpecDRAM_DelayedRejectionCount_type_4() result(assertion)
330 2 : use Constants_mod, only: IK, RK
331 : implicit none
332 : logical :: assertion
333 2 : type(ParaDXXX_type) :: PD
334 2 : assertion = .true.
335 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
336 : call PD%runSampler ( ndim = 1_IK &
337 : , getLogFunc = getLogFuncMVN &
338 : , mpiFinalizeRequested = .false. &
339 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecDRAM/test_SpecDRAM_DelayedRejectionCount_type_4" &
340 : , inputFile = ParaDXXX_NML//" delayedRejectionCount = 3 /" &
341 2 : )
342 2 : assertion = assertion .and. .not. PD%Err%occurred
343 : #endif
344 30 : end function test_SpecDRAM_DelayedRejectionCount_type_4
345 :
346 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
347 :
348 : !> \brief
349 : !> Test the ParaDXXX sampler with a valid input value for `DelayedRejectionScaleFactorVec`.
350 2 : module function test_SpecDRAM_DelayedRejectionScaleFactorVec_type_1() result(assertion)
351 2 : use Constants_mod, only: IK, RK
352 : implicit none
353 : logical :: assertion
354 2 : type(ParaDXXX_type) :: PD
355 2 : assertion = .true.
356 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
357 : call PD%runSampler ( ndim = 1_IK &
358 : , getLogFunc = getLogFuncMVN &
359 : , mpiFinalizeRequested = .false. &
360 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecDRAM/test_SpecDRAM_DelayedRejectionScaleFactorVec_type_1" &
361 : , delayedRejectionCount = 3_IK &
362 : , inputFile = ParaDXXX_NML//" DelayedRejectionScaleFactorVec = 3., 2., 1., /" &
363 2 : )
364 2 : assertion = assertion .and. .not. PD%Err%occurred
365 : #endif
366 30 : end function test_SpecDRAM_DelayedRejectionScaleFactorVec_type_1
367 :
368 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
369 :
370 : !> \brief
371 : !> Test the ParaDXXX sampler with a valid input value for `delayedRejectionCount`, which should lead to default values for
372 : !> the vector `DelayedRejectionScaleFactorVec`.
373 2 : module function test_SpecDRAM_DelayedRejectionScaleFactorVec_type_2() result(assertion)
374 2 : use Constants_mod, only: IK, RK
375 : implicit none
376 : logical :: assertion
377 2 : type(ParaDXXX_type) :: PD
378 : integer(IK), parameter :: NDIM = 2_IK
379 2 : assertion = .true.
380 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
381 : call PD%runSampler ( ndim = 2_IK &
382 : , getLogFunc = getLogFuncMVN &
383 : , mpiFinalizeRequested = .false. &
384 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecDRAM/test_SpecDRAM_DelayedRejectionScaleFactorVec_type_2" &
385 : , inputFile = ParaDXXX_NML//" delayedRejectionCount = 3 /" &
386 2 : )
387 8 : assertion = assertion .and. .not. PD%Err%occurred .and. all(abs(PD%SpecDRAM%DelayedRejectionScaleFactorVec%Val-0.5_RK**(1._RK/real(NDIM,kind=RK)))<1.e-12_RK)
388 : #endif
389 34 : end function test_SpecDRAM_DelayedRejectionScaleFactorVec_type_2
390 :
391 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
392 :
393 : !> \brief
394 : !> Test the ParaDXXX sampler with a valid input value for `DelayedRejectionScaleFactorVec`.
395 2 : module function test_SpecDRAM_DelayedRejectionScaleFactorVec_type_3() result(assertion)
396 2 : use Constants_mod, only: IK, RK
397 : use String_mod, only: num2str
398 : implicit none
399 : logical :: assertion
400 2 : type(ParaDXXX_type) :: PD
401 : real(RK), parameter :: DelayedRejectionScaleFactorVec(*) = [3._RK, 2._RK]
402 : integer(IK), parameter :: delayedRejectionCount = 2_IK
403 2 : assertion = .true.
404 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
405 : call PD%runSampler ( ndim = 1_IK &
406 : , getLogFunc = getLogFuncMVN &
407 : , mpiFinalizeRequested = .false. &
408 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecDRAM/test_SpecDRAM_DelayedRejectionScaleFactorVec_type_3" &
409 : , DelayedRejectionScaleFactorVec = DelayedRejectionScaleFactorVec &
410 : , inputFile = ParaDXXX_NML//" delayedRejectionCount = "//num2str(delayedRejectionCount)//" /" &
411 2 : )
412 6 : assertion = assertion .and. .not. PD%Err%occurred .and. all(PD%SpecDRAM%DelayedRejectionScaleFactorVec%Val==DelayedRejectionScaleFactorVec(1:delayedRejectionCount))
413 : #endif
414 30 : end function test_SpecDRAM_DelayedRejectionScaleFactorVec_type_3
415 :
416 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
417 :
418 : !> \brief
419 : !> Test the ParaDXXX sampler with a valid input value for `DelayedRejectionScaleFactorVec`.
420 2 : module function test_SpecDRAM_DelayedRejectionScaleFactorVec_type_4() result(assertion)
421 2 : use Constants_mod, only: IK, RK
422 : implicit none
423 : logical :: assertion
424 2 : type(ParaDXXX_type) :: PD
425 : real(RK), parameter :: DelayedRejectionScaleFactorVec(*) = [-1._RK, 2._RK]
426 2 : assertion = .true.
427 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
428 : call PD%runSampler ( ndim = 1_IK &
429 : , getLogFunc = getLogFuncMVN &
430 : , mpiFinalizeRequested = .false. &
431 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecDRAM/test_SpecDRAM_DelayedRejectionScaleFactorVec_type_4" &
432 : , DelayedRejectionScaleFactorVec = DelayedRejectionScaleFactorVec &
433 : , inputFile = ParaDXXX_NML//" delayedRejectionCount = 2 /" &
434 2 : )
435 2 : assertion = assertion .and. PD%Err%occurred
436 : #endif
437 10 : end function test_SpecDRAM_DelayedRejectionScaleFactorVec_type_4
438 :
439 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
440 :
441 : !> \brief
442 : !> Test the ParaDXXX sampler with a valid input value for `DelayedRejectionScaleFactorVec`.
443 2 : module function test_SpecDRAM_DelayedRejectionScaleFactorVec_type_5() result(assertion)
444 2 : use Constants_mod, only: IK, RK
445 : implicit none
446 : logical :: assertion
447 2 : type(ParaDXXX_type) :: PD
448 : real(RK), parameter :: DelayedRejectionScaleFactorVec(*) = [2._RK, 0._RK, 1._RK]
449 2 : assertion = .true.
450 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
451 : call PD%runSampler ( ndim = 1_IK &
452 : , getLogFunc = getLogFuncMVN &
453 : , mpiFinalizeRequested = .false. &
454 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecDRAM/test_SpecDRAM_DelayedRejectionScaleFactorVec_type_5" &
455 : , DelayedRejectionScaleFactorVec = DelayedRejectionScaleFactorVec &
456 : , inputFile = ParaDXXX_NML//" delayedRejectionCount = 2 /" &
457 2 : )
458 2 : assertion = assertion .and. PD%Err%occurred
459 : #endif
460 10 : end function test_SpecDRAM_DelayedRejectionScaleFactorVec_type_5
461 :
462 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
463 :
464 : !> \brief
465 : !> Test the ParaDXXX sampler with a valid input value for `greedyAdaptationCount >= 0`.
466 2 : module function test_SpecDRAM_GreedyAdaptationCount_type_1() result(assertion)
467 2 : use Constants_mod, only: IK, RK
468 : implicit none
469 : logical :: assertion
470 2 : type(ParaDXXX_type) :: PD
471 : integer(IK), parameter :: greedyAdaptationCount = 10_IK
472 2 : assertion = .true.
473 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
474 : call PD%runSampler ( ndim = 1_IK &
475 : , getLogFunc = getLogFuncMVN &
476 : , mpiFinalizeRequested = .false. &
477 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecDRAM/test_SpecDRAM_GreedyAdaptationCount_type_1" &
478 : , greedyAdaptationCount = greedyAdaptationCount &
479 2 : )
480 2 : assertion = assertion .and. .not. PD%Err%occurred .and. PD%SpecDRAM%greedyAdaptationCount%val==greedyAdaptationCount
481 : #endif
482 30 : end function test_SpecDRAM_GreedyAdaptationCount_type_1
483 :
484 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
485 :
486 : !> \brief
487 : !> Test the ParaDXXX sampler with a valid input value for `greedyAdaptationCount >= 0`.
488 2 : module function test_SpecDRAM_GreedyAdaptationCount_type_2() result(assertion)
489 2 : use Constants_mod, only: IK, RK
490 : use String_mod, only: num2str
491 : implicit none
492 : logical :: assertion
493 2 : type(ParaDXXX_type) :: PD
494 : integer(IK), parameter :: greedyAdaptationCount = 0_IK
495 2 : assertion = .true.
496 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
497 : call PD%runSampler ( ndim = 1_IK &
498 : , getLogFunc = getLogFuncMVN &
499 : , mpiFinalizeRequested = .false. &
500 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecDRAM/test_SpecDRAM_GreedyAdaptationCount_type_2" &
501 : , inputFile = ParaDXXX_NML//" greedyAdaptationCount = "//num2str(greedyAdaptationCount)//" /" &
502 2 : )
503 2 : assertion = assertion .and. .not. PD%Err%occurred .and. PD%SpecDRAM%greedyAdaptationCount%val==greedyAdaptationCount
504 : #endif
505 30 : end function test_SpecDRAM_GreedyAdaptationCount_type_2
506 :
507 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
508 :
509 : !> \brief
510 : !> Test the ParaDXXX sampler with an invalid input value for `greedyAdaptationCount >= 0`.
511 2 : module function test_SpecDRAM_GreedyAdaptationCount_type_3() result(assertion)
512 2 : use Constants_mod, only: IK, RK
513 : use String_mod, only: num2str
514 : implicit none
515 : logical :: assertion
516 2 : type(ParaDXXX_type) :: PD
517 : integer(IK), parameter :: greedyAdaptationCount = -1_IK
518 2 : assertion = .true.
519 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
520 : call PD%runSampler ( ndim = 1_IK &
521 : , getLogFunc = getLogFuncMVN &
522 : , mpiFinalizeRequested = .false. &
523 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecDRAM/test_SpecDRAM_GreedyAdaptationCount_type_3" &
524 : , inputFile = ParaDXXX_NML//" greedyAdaptationCount = "//num2str(greedyAdaptationCount)//" /" &
525 2 : )
526 2 : assertion = assertion .and. PD%Err%occurred
527 : #endif
528 10 : end function test_SpecDRAM_GreedyAdaptationCount_type_3
529 :
530 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|