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_SpecBase_smod](@ref paradram_mod@test_specbase_smod) and
45 : !> [ParaDISE_mod@@Test_SpecBase_smod](@ref paradise_mod@@test_specbase_smod).
46 : !> \author Amir Shahmoradi
47 :
48 : contains
49 :
50 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
51 :
52 : !> \brief
53 : !> Test the ParaDXXX sampler with a wrong input value for `chainFileFormat`.
54 4 : module function test_SpecBase_ChainFileFormat_type_1() result(assertion)
55 : implicit none
56 : logical :: assertion
57 2 : type(ParaDXXX_type) :: PD
58 2 : assertion = .true.
59 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
60 : call PD%runSampler ( ndim = 1_IK &
61 : , getLogFunc = getLogFuncMVN &
62 : , mpiFinalizeRequested = .false. &
63 : , chainFileFormat = "nonsense" &
64 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_ChainFileFormat_type_1" &
65 2 : )
66 2 : assertion = assertion .and. PD%Err%occurred
67 : #endif
68 10 : end function test_SpecBase_ChainFileFormat_type_1
69 :
70 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
71 :
72 : !> \brief
73 : !> Test the ParaDXXX sampler with a wrong input value for `chainFileFormat`.
74 2 : module function test_SpecBase_ChainFileFormat_type_2() result(assertion)
75 : implicit none
76 : logical :: assertion
77 2 : type(ParaDXXX_type) :: PD
78 2 : assertion = .true.
79 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
80 : call PD%runSampler ( ndim = 1_IK &
81 : , getLogFunc = getLogFuncMVN &
82 : , mpiFinalizeRequested = .false. &
83 : , inputFile = ParaDXXX_NML//" chainFileFormat = 'nonsense' /" &
84 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_ChainFileFormat_type_2" &
85 2 : )
86 2 : assertion = assertion .and. PD%Err%occurred
87 : #endif
88 12 : end function test_SpecBase_ChainFileFormat_type_2
89 :
90 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
91 :
92 : !> \brief
93 : !> Test the ParaDXXX sampler with a valid input value for `chainFileFormat`.
94 2 : module function test_SpecBase_ChainFileFormat_type_3() result(assertion)
95 : implicit none
96 : logical :: assertion
97 2 : type(ParaDXXX_type) :: PD
98 2 : assertion = .true.
99 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
100 : call PD%runSampler ( ndim = 1_IK &
101 : , getLogFunc = getLogFuncMVN &
102 : , mpiFinalizeRequested = .false. &
103 : , inputFile = ParaDXXX_NML//" chainFileFormat = 'VerBose' /" &
104 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_ChainFileFormat_type_3" &
105 2 : )
106 2 : assertion = assertion .and. .not. PD%Err%occurred
107 : #endif
108 32 : end function test_SpecBase_ChainFileFormat_type_3
109 :
110 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
111 :
112 : !> \brief
113 : !> Test the ParaDXXX sampler with a valid input value for `chainFileFormat`.
114 2 : module function test_SpecBase_ChainFileFormat_type_4() result(assertion)
115 : implicit none
116 : logical :: assertion
117 2 : type(ParaDXXX_type) :: PD
118 2 : assertion = .true.
119 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
120 : call PD%runSampler ( ndim = 1_IK &
121 : , getLogFunc = getLogFuncMVN &
122 : , mpiFinalizeRequested = .false. &
123 : , inputFile = ParaDXXX_NML//" chainFileFormat = 'Compact' /" &
124 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_ChainFileFormat_type_4" &
125 2 : )
126 2 : assertion = assertion .and. .not. PD%Err%occurred
127 : #endif
128 32 : end function test_SpecBase_ChainFileFormat_type_4
129 :
130 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
131 :
132 : !> \brief
133 : !> Test the ParaDXXX sampler with a valid input value for `chainFileFormat`.
134 2 : module function test_SpecBase_ChainFileFormat_type_5() result(assertion)
135 : implicit none
136 : logical :: assertion
137 2 : type(ParaDXXX_type) :: PD
138 2 : assertion = .true.
139 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
140 : call PD%runSampler ( ndim = 1_IK &
141 : , getLogFunc = getLogFuncMVN &
142 : , mpiFinalizeRequested = .false. &
143 : , inputFile = ParaDXXX_NML//" chainFileFormat = 'BiNaRy' /" &
144 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_ChainFileFormat_type_5" &
145 2 : )
146 2 : assertion = assertion .and. .not. PD%Err%occurred
147 : #endif
148 32 : end function test_SpecBase_ChainFileFormat_type_5
149 :
150 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
151 :
152 : !> \brief
153 : !> Test the ParaDXXX sampler with a too-small input value for `domainLowerLimitVec`.
154 2 : module function test_SpecBase_DomainLowerLimitVec_type_1() result(assertion)
155 2 : use Constants_mod, only: IK, RK, HUGE_RK
156 : implicit none
157 : logical :: assertion
158 : real(RK), parameter :: domainLowerLimitVec(*) = [-HUGE_RK/2._RK] ! NOTE: HUGE_RK is the null value.
159 2 : type(ParaDXXX_type) :: PD
160 2 : assertion = .true.
161 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
162 : call PD%runSampler ( ndim = 1_IK &
163 : , getLogFunc = getLogFuncMVN &
164 : , mpiFinalizeRequested = .false. &
165 : , domainLowerLimitVec = domainLowerLimitVec &
166 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_DomainLowerLimitVec_type_1" &
167 2 : )
168 2 : assertion = assertion .and. PD%Err%occurred
169 : #endif
170 10 : end function test_SpecBase_DomainLowerLimitVec_type_1
171 :
172 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
173 :
174 : !> \brief
175 : !> Test the ParaDXXX sampler with a too-small input value for `domainLowerLimitVec`.
176 2 : module function test_SpecBase_DomainLowerLimitVec_type_2() result(assertion)
177 2 : use Constants_mod, only: IK, RK, HUGE_RK
178 : use String_mod, only: num2str
179 : implicit none
180 : logical :: assertion
181 : real(RK), parameter :: domainLowerLimitVec(*) = [-HUGE_RK/2._RK] ! NOTE: HUGE_RK is the null value.
182 2 : type(ParaDXXX_type) :: PD
183 2 : assertion = .true.
184 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
185 : call PD%runSampler ( ndim = 1_IK &
186 : , getLogFunc = getLogFuncMVN &
187 : , mpiFinalizeRequested = .false. &
188 : , inputFile = ParaDXXX_NML//" domainLowerLimitVec = "//num2str(domainLowerLimitVec)//" /" &
189 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_DomainLowerLimitVec_type_2" &
190 2 : )
191 2 : assertion = assertion .and. PD%Err%occurred
192 : #endif
193 10 : end function test_SpecBase_DomainLowerLimitVec_type_2
194 :
195 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
196 :
197 : !> \brief
198 : !> Test the ParaDXXX sampler with a too-large input value for `domainUpperLimitVec`.
199 2 : module function test_SpecBase_DomainUpperLimitVec_type_1() result(assertion)
200 2 : use Constants_mod, only: IK, RK, HUGE_RK
201 : implicit none
202 : logical :: assertion
203 : real(RK), parameter :: domainUpperLimitVec(*) = [+HUGE_RK/2._RK] ! NOTE: HUGE_RK is the null value.
204 2 : type(ParaDXXX_type) :: PD
205 2 : assertion = .true.
206 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
207 : call PD%runSampler ( ndim = 1_IK &
208 : , getLogFunc = getLogFuncMVN &
209 : , mpiFinalizeRequested = .false. &
210 : , domainUpperLimitVec = domainUpperLimitVec &
211 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_DomainUpperLimitVec_type_1" &
212 2 : )
213 2 : assertion = assertion .and. PD%Err%occurred
214 : #endif
215 10 : end function test_SpecBase_DomainUpperLimitVec_type_1
216 :
217 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
218 :
219 : !> \brief
220 : !> Test the ParaDXXX sampler with a too-large input value for `domainUpperLimitVec`.
221 2 : module function test_SpecBase_DomainUpperLimitVec_type_2() result(assertion)
222 2 : use Constants_mod, only: IK, RK, HUGE_RK
223 : use String_mod, only: num2str
224 : implicit none
225 : logical :: assertion
226 : real(RK), parameter :: domainUpperLimitVec(*) = [+HUGE_RK/2._RK] ! NOTE: HUGE_RK is the null value.
227 2 : type(ParaDXXX_type) :: PD
228 2 : assertion = .true.
229 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
230 : call PD%runSampler ( ndim = 1_IK &
231 : , getLogFunc = getLogFuncMVN &
232 : , mpiFinalizeRequested = .false. &
233 : , inputFile = ParaDXXX_NML//" domainUpperLimitVec = "//num2str(domainUpperLimitVec)//" /" &
234 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_DomainUpperLimitVec_type_2" &
235 2 : )
236 2 : assertion = assertion .and. PD%Err%occurred
237 : #endif
238 10 : end function test_SpecBase_DomainUpperLimitVec_type_2
239 :
240 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
241 :
242 : !> \brief
243 : !> Test the ParaDXXX sampler with an input value for `domainUpperLimitVec`
244 : !> that is smaller than the input value for `domainLowerLimitVec`.
245 2 : module function test_SpecBase_DomainUpperLimitVec_type_3() result(assertion)
246 2 : use Constants_mod, only: IK, RK
247 : implicit none
248 : logical :: assertion
249 : real(RK), parameter :: domainLowerLimitVec(*) = [+2._RK]
250 : real(RK), parameter :: domainUpperLimitVec(*) = [-2._RK]
251 2 : type(ParaDXXX_type) :: PD
252 2 : assertion = .true.
253 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
254 : call PD%runSampler ( ndim = 1_IK &
255 : , getLogFunc = getLogFuncMVN &
256 : , mpiFinalizeRequested = .false. &
257 : , domainLowerLimitVec = domainLowerLimitVec &
258 : , domainUpperLimitVec = domainUpperLimitVec &
259 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_DomainUpperLimitVec_type_3" &
260 2 : )
261 2 : assertion = assertion .and. PD%Err%occurred
262 : #endif
263 10 : end function test_SpecBase_DomainUpperLimitVec_type_3
264 :
265 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
266 :
267 : !> \brief
268 : !> Test the ParaDXXX sampler with an input value for `domainUpperLimitVec`
269 : !> that is equal to the input value for `domainLowerLimitVec`.
270 2 : module function test_SpecBase_DomainUpperLimitVec_type_4() result(assertion)
271 2 : use Constants_mod, only: IK, RK
272 : implicit none
273 : logical :: assertion
274 : real(RK), parameter :: domainLowerLimitVec(*) = [+2._RK]
275 : real(RK), parameter :: domainUpperLimitVec(*) = [+2._RK]
276 2 : type(ParaDXXX_type) :: PD
277 2 : assertion = .true.
278 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
279 : call PD%runSampler ( ndim = 1_IK &
280 : , getLogFunc = getLogFuncMVN &
281 : , mpiFinalizeRequested = .false. &
282 : , domainLowerLimitVec = domainLowerLimitVec &
283 : , domainUpperLimitVec = domainUpperLimitVec &
284 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_DomainUpperLimitVec_type_4" &
285 2 : )
286 2 : assertion = assertion .and. PD%Err%occurred
287 : #endif
288 10 : end function test_SpecBase_DomainUpperLimitVec_type_4
289 :
290 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
291 :
292 : !> \brief
293 : !> Test whether the ParaDXXX sampler quits with an error message when `maxNumDomainCheckToWarn < 1`.
294 2 : module function test_SpecBase_MaxNumDomainCheckToWarn_type_1() result(assertion)
295 2 : use Constants_mod, only: IK, RK
296 : implicit none
297 : logical :: assertion
298 : real(RK), parameter :: domainLowerLimitVec(*) = [-1.e-1_RK]
299 : real(RK), parameter :: domainUpperLimitVec(*) = [+1.e+1_RK]
300 2 : type(ParaDXXX_type) :: PD
301 2 : assertion = .true.
302 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
303 : call PD%runSampler ( ndim = 1_IK &
304 : , getLogFunc = getLogFuncMVN &
305 : , mpiFinalizeRequested = .false. &
306 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_MaxNumDomainCheckToWarn_type_1" &
307 : , domainLowerLimitVec = domainLowerLimitVec &
308 : , domainUpperLimitVec = domainUpperLimitVec &
309 : , maxNumDomainCheckToWarn = 0_IK &
310 2 : )
311 2 : assertion = assertion .and. PD%Err%occurred
312 : #endif
313 10 : end function test_SpecBase_MaxNumDomainCheckToWarn_type_1
314 :
315 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
316 :
317 : !> \brief
318 : !> Test whether the ParaDXXX sampler quits with an error message when `maxNumDomainCheckToWarn < 1`.
319 2 : module function test_SpecBase_MaxNumDomainCheckToWarn_type_2() result(assertion)
320 2 : use Constants_mod, only: IK, RK
321 : implicit none
322 : logical :: assertion
323 : real(RK), parameter :: domainLowerLimitVec(*) = [-1.e-1_RK]
324 : real(RK), parameter :: domainUpperLimitVec(*) = [+1.e+1_RK]
325 2 : type(ParaDXXX_type) :: PD
326 2 : assertion = .true.
327 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
328 : call PD%runSampler ( ndim = 1_IK &
329 : , getLogFunc = getLogFuncMVN &
330 : , mpiFinalizeRequested = .false. &
331 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_MaxNumDomainCheckToWarn_type_2" &
332 : , domainLowerLimitVec = domainLowerLimitVec &
333 : , domainUpperLimitVec = domainUpperLimitVec &
334 : , inputFile = ParaDXXX_NML//" maxNumDomainCheckToWarn = 0 /" &
335 2 : )
336 2 : assertion = assertion .and. PD%Err%occurred
337 : #endif
338 10 : end function test_SpecBase_MaxNumDomainCheckToWarn_type_2
339 :
340 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
341 :
342 : !> \brief
343 : !> Test whether the ParaDXXX sampler quits with an error message when `maxNumDomainCheckToWarn < 1`.
344 2 : module function test_SpecBase_MaxNumDomainCheckToWarn_type_3() result(assertion)
345 2 : use Constants_mod, only: IK, RK
346 : implicit none
347 : logical :: assertion
348 : real(RK), parameter :: domainLowerLimitVec(*) = [-1.e-2_RK]
349 : real(RK), parameter :: domainUpperLimitVec(*) = [+1.e-2_RK]
350 2 : type(ParaDXXX_type) :: PD
351 2 : assertion = .true.
352 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
353 : call PD%runSampler ( ndim = 1_IK &
354 : , getLogFunc = getLogFuncMVN &
355 : , mpiFinalizeRequested = .false. &
356 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_MaxNumDomainCheckToWarn_type_3" &
357 : , inputFile = ParaDXXX_NML//" maxNumDomainCheckToWarn = 1 /" &
358 : , domainLowerLimitVec = domainLowerLimitVec &
359 : , domainUpperLimitVec = domainUpperLimitVec &
360 : , chainSize = 10_IK &
361 2 : )
362 2 : assertion = assertion .and. .not. PD%Err%occurred
363 : #endif
364 30 : end function test_SpecBase_MaxNumDomainCheckToWarn_type_3
365 :
366 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
367 :
368 : !> \brief
369 : !> Test whether the ParaDXXX sampler quits with an error message when `maxNumDomainCheckToStop < 1`.
370 : !>
371 : !> \todo
372 : !> When run in parallel, it is essential for the tests on `MaxNumDomainCheckToStop_type` to use `multichain` parallelism
373 : !> since fatal error communication and the subsequent exit from the simulation by all images is currently not implemented.
374 : !> This testing weakness, although rather insignificant can be fixed in the future.
375 2 : module function test_SpecBase_MaxNumDomainCheckToStop_type_1() result(assertion)
376 2 : use Constants_mod, only: IK, RK
377 : implicit none
378 : logical :: assertion
379 : real(RK), parameter :: domainLowerLimitVec(*) = [-1.e-2_RK]
380 : real(RK), parameter :: domainUpperLimitVec(*) = [+1.e-2_RK]
381 2 : type(ParaDXXX_type) :: PD
382 2 : assertion = .true.
383 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
384 : call PD%runSampler ( ndim = 1_IK &
385 : , getLogFunc = getLogFuncMVN &
386 : , mpiFinalizeRequested = .false. &
387 : , parallelizationModel = "multi chain" &
388 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_MaxNumDomainCheckToStop_type_1" &
389 : , domainLowerLimitVec = domainLowerLimitVec &
390 : , domainUpperLimitVec = domainUpperLimitVec &
391 : , maxNumDomainCheckToStop = 0_IK &
392 2 : )
393 2 : assertion = assertion .and. PD%Err%occurred
394 : #endif
395 10 : end function test_SpecBase_MaxNumDomainCheckToStop_type_1
396 :
397 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
398 :
399 : !> \brief
400 : !> Test whether the ParaDXXX sampler quits with an error message when `maxNumDomainCheckToStop` has reached.
401 : !>
402 : !> \todo
403 : !> When run in parallel, it is essential for the tests on `MaxNumDomainCheckToStop_type` to use `multichain` parallelism
404 : !> since fatal error communication and the subsequent exit from the simulation by all images is currently not implemented.
405 : !> This testing weakness, although rather insignificant can be fixed in the future.
406 2 : module function test_SpecBase_MaxNumDomainCheckToStop_type_2() result(assertion)
407 2 : use Constants_mod, only: IK, RK
408 : implicit none
409 : logical :: assertion
410 : real(RK), parameter :: domainLowerLimitVec(*) = [-1.e-2_RK]
411 : real(RK), parameter :: domainUpperLimitVec(*) = [+1.e-2_RK]
412 2 : type(ParaDXXX_type) :: PD
413 2 : assertion = .true.
414 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
415 : call PD%runSampler ( ndim = 1_IK &
416 : , getLogFunc = getLogFuncMVN &
417 : , mpiFinalizeRequested = .false. &
418 : , parallelizationModel = "multi chain" &
419 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_MaxNumDomainCheckToStop_type_2" &
420 : , domainLowerLimitVec = domainLowerLimitVec &
421 : , domainUpperLimitVec = domainUpperLimitVec &
422 : , inputFile = ParaDXXX_NML//" maxNumDomainCheckToStop = 0 /" &
423 2 : )
424 2 : assertion = assertion .and. PD%Err%occurred
425 : #endif
426 10 : end function test_SpecBase_MaxNumDomainCheckToStop_type_2
427 :
428 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
429 :
430 : !> \brief
431 : !> Test whether the ParaDXXX sampler quits with an error message when `maxNumDomainCheckToStop` has reached.
432 : !>
433 : !> \todo
434 : !> When run in parallel, it is essential for the tests on `MaxNumDomainCheckToStop_type` to use `multichain` parallelism
435 : !> since fatal error communication and the subsequent exit from the simulation by all images is currently not implemented.
436 : !> This testing weakness, although rather insignificant can be fixed in the future.
437 2 : module function test_SpecBase_MaxNumDomainCheckToStop_type_3() result(assertion)
438 2 : use Constants_mod, only: IK, RK
439 : implicit none
440 : logical :: assertion
441 : real(RK), parameter :: domainLowerLimitVec(*) = [-1.e-2_RK]
442 : real(RK), parameter :: domainUpperLimitVec(*) = [+1.e-2_RK]
443 2 : type(ParaDXXX_type) :: PD
444 2 : assertion = .true.
445 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
446 : call PD%runSampler ( ndim = 1_IK &
447 : , getLogFunc = getLogFuncMVN &
448 : , mpiFinalizeRequested = .false. &
449 : , parallelizationModel = "multi chain" &
450 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_MaxNumDomainCheckToStop_type_3" &
451 : , domainLowerLimitVec = domainLowerLimitVec &
452 : , domainUpperLimitVec = domainUpperLimitVec &
453 : , maxNumDomainCheckToStop = 1_IK &
454 2 : )
455 2 : assertion = assertion .and. PD%Err%occurred
456 : #endif
457 26 : end function test_SpecBase_MaxNumDomainCheckToStop_type_3
458 :
459 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
460 :
461 : !> \brief
462 : !> Test whether the ParaDXXX sampler quits with an error message when `outputColumnWidth < 0`.
463 2 : module function test_SpecBase_OutputColumnWidth_type_1() result(assertion)
464 2 : use Constants_mod, only: IK, RK
465 : implicit none
466 : logical :: assertion
467 2 : type(ParaDXXX_type) :: PD
468 2 : assertion = .true.
469 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
470 : call PD%runSampler ( ndim = 1_IK &
471 : , getLogFunc = getLogFuncMVN &
472 : , mpiFinalizeRequested = .false. &
473 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_OutputColumnWidth_type_1" &
474 : , outputColumnWidth = -1_IK &
475 2 : )
476 2 : assertion = assertion .and. PD%Err%occurred
477 : #endif
478 10 : end function test_SpecBase_OutputColumnWidth_type_1
479 :
480 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
481 :
482 : !> \brief
483 : !> Test whether the ParaDXXX sampler quits with an error message when `outputColumnWidth < 0`.
484 2 : module function test_SpecBase_OutputColumnWidth_type_2() result(assertion)
485 2 : use Constants_mod, only: IK, RK
486 : implicit none
487 : logical :: assertion
488 2 : type(ParaDXXX_type) :: PD
489 2 : assertion = .true.
490 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
491 : call PD%runSampler ( ndim = 1_IK &
492 : , getLogFunc = getLogFuncMVN &
493 : , mpiFinalizeRequested = .false. &
494 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_OutputColumnWidth_type_2" &
495 : , inputFile = ParaDXXX_NML//" outputColumnWidth = -1 /" &
496 2 : )
497 2 : assertion = assertion .and. PD%Err%occurred
498 : #endif
499 10 : end function test_SpecBase_OutputColumnWidth_type_2
500 :
501 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
502 :
503 : !> \brief
504 : !> Test whether the ParaDXXX sampler quits with an error message when `outputColumnWidth < outputRealPrecision + 7`.
505 2 : module function test_SpecBase_OutputColumnWidth_type_3() result(assertion)
506 2 : use Constants_mod, only: IK, RK
507 : implicit none
508 : logical :: assertion
509 2 : type(ParaDXXX_type) :: PD
510 2 : assertion = .true.
511 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
512 : call PD%runSampler ( ndim = 1_IK &
513 : , getLogFunc = getLogFuncMVN &
514 : , mpiFinalizeRequested = .false. &
515 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_OutputColumnWidth_type_3" &
516 : , outputRealPrecision = 8_IK &
517 : , outputColumnWidth = 14_IK &
518 2 : )
519 2 : assertion = assertion .and. PD%Err%occurred
520 : #endif
521 10 : end function test_SpecBase_OutputColumnWidth_type_3
522 :
523 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
524 :
525 : !> \brief
526 : !> Test whether the ParaDXXX sampler successfully return with a valid value for `outputColumnWidth`.
527 2 : module function test_SpecBase_OutputColumnWidth_type_4() result(assertion)
528 2 : use Constants_mod, only: IK, RK
529 : implicit none
530 : logical :: assertion
531 2 : type(ParaDXXX_type) :: PD
532 2 : assertion = .true.
533 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
534 : call PD%runSampler ( ndim = 1_IK &
535 : , getLogFunc = getLogFuncMVN &
536 : , mpiFinalizeRequested = .false. &
537 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_OutputColumnWidth_type_4" &
538 : , outputRealPrecision = 8_IK &
539 : , outputColumnWidth = 21_IK &
540 2 : )
541 2 : assertion = assertion .and. .not. PD%Err%occurred
542 : #endif
543 30 : end function test_SpecBase_OutputColumnWidth_type_4
544 :
545 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
546 :
547 : !> \brief
548 : !> Test whether the ParaDXXX sampler quits with an error message when `outputDelimiter` contains `.`.
549 2 : module function test_SpecBase_OutputDelimiter_type_1() result(assertion)
550 2 : use Constants_mod, only: IK, RK
551 : implicit none
552 : logical :: assertion
553 2 : type(ParaDXXX_type) :: PD
554 2 : assertion = .true.
555 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
556 : call PD%runSampler ( ndim = 1_IK &
557 : , getLogFunc = getLogFuncMVN &
558 : , mpiFinalizeRequested = .false. &
559 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_OutputDelimiter_type_1" &
560 : , outputDelimiter = "this.that" &
561 2 : )
562 2 : assertion = assertion .and. PD%Err%occurred
563 : #endif
564 10 : end function test_SpecBase_OutputDelimiter_type_1
565 :
566 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
567 :
568 : !> \brief
569 : !> Test whether the ParaDXXX sampler quits with an error message when `outputDelimiter` contains `+`.
570 2 : module function test_SpecBase_OutputDelimiter_type_2() result(assertion)
571 2 : use Constants_mod, only: IK, RK
572 : implicit none
573 : logical :: assertion
574 2 : type(ParaDXXX_type) :: PD
575 2 : assertion = .true.
576 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
577 : call PD%runSampler ( ndim = 1_IK &
578 : , getLogFunc = getLogFuncMVN &
579 : , mpiFinalizeRequested = .false. &
580 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_OutputDelimiter_type_2" &
581 : , inputFile = ParaDXXX_NML//" outputDelimiter = 'this+that' /" &
582 2 : )
583 2 : assertion = assertion .and. PD%Err%occurred
584 : #endif
585 10 : end function test_SpecBase_OutputDelimiter_type_2
586 :
587 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
588 :
589 : !> \brief
590 : !> Test whether the ParaDXXX sampler quits with an error message when `outputDelimiter` contains digit.
591 2 : module function test_SpecBase_OutputDelimiter_type_3() result(assertion)
592 2 : use Constants_mod, only: IK, RK
593 : implicit none
594 : logical :: assertion
595 2 : type(ParaDXXX_type) :: PD
596 2 : assertion = .true.
597 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
598 : call PD%runSampler ( ndim = 1_IK &
599 : , getLogFunc = getLogFuncMVN &
600 : , mpiFinalizeRequested = .false. &
601 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_OutputDelimiter_type_3" &
602 : , inputFile = ParaDXXX_NML//" outputDelimiter = 'this1234that' /" &
603 2 : )
604 2 : assertion = assertion .and. PD%Err%occurred
605 : #endif
606 10 : end function test_SpecBase_OutputDelimiter_type_3
607 :
608 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
609 :
610 : !> \brief
611 : !> Test whether the ParaDXXX sampler converts `\t` to tab character when `outputDelimiter = "\t"`.
612 2 : module function test_SpecBase_OutputDelimiter_type_4() result(assertion)
613 2 : use Constants_mod, only: IK, RK, TAB
614 : implicit none
615 : logical :: assertion
616 2 : type(ParaDXXX_type) :: PD
617 2 : assertion = .true.
618 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
619 : call PD%runSampler ( ndim = 1_IK &
620 : , getLogFunc = getLogFuncMVN &
621 : , mpiFinalizeRequested = .false. &
622 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_OutputDelimiter_type_4" &
623 : , outputDelimiter = "\t" &
624 2 : )
625 2 : assertion = assertion .and. .not. PD%Err%occurred .and. PD%SpecBase%OutputDelimiter%val == TAB
626 : #endif
627 30 : end function test_SpecBase_OutputDelimiter_type_4
628 :
629 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
630 :
631 : !> \brief
632 : !> Test whether the ParaDXXX sampler converts `\\t` to `\t` when `outputDelimiter = "\\t"`.
633 2 : module function test_SpecBase_OutputDelimiter_type_5() result(assertion)
634 2 : use Constants_mod, only: IK, RK
635 : implicit none
636 : logical :: assertion
637 2 : type(ParaDXXX_type) :: PD
638 2 : assertion = .true.
639 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
640 : call PD%runSampler ( ndim = 1_IK &
641 : , getLogFunc = getLogFuncMVN &
642 : , mpiFinalizeRequested = .false. &
643 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_OutputDelimiter_type_5" &
644 : , outputDelimiter = "\\t" &
645 2 : )
646 2 : assertion = assertion .and. .not. PD%Err%occurred .and. PD%SpecBase%OutputDelimiter%val == "\t"
647 : #endif
648 30 : end function test_SpecBase_OutputDelimiter_type_5
649 :
650 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
651 :
652 : !> \brief
653 : !> Test whether the ParaDXXX sampler converts `""` to `" "` when `outputDelimiter = ""` contains digit.
654 2 : module function test_SpecBase_OutputDelimiter_type_6() result(assertion)
655 2 : use Constants_mod, only: IK, RK
656 : implicit none
657 : logical :: assertion
658 2 : type(ParaDXXX_type) :: PD
659 2 : assertion = .true.
660 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
661 : call PD%runSampler ( ndim = 1_IK &
662 : , getLogFunc = getLogFuncMVN &
663 : , mpiFinalizeRequested = .false. &
664 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_OutputDelimiter_type_6" &
665 : , outputDelimiter = "" &
666 2 : )
667 2 : assertion = assertion .and. .not. PD%Err%occurred .and. PD%SpecBase%OutputDelimiter%val == " " .and. len(PD%SpecBase%OutputDelimiter%val) == 1
668 : #endif
669 30 : end function test_SpecBase_OutputDelimiter_type_6
670 :
671 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
672 :
673 : !> \brief
674 : !> Test whether the ParaDXXX sampler quits with an error message when `outputRealPrecision < 1`.
675 2 : module function test_SpecBase_OutputRealPrecision_type_1() result(assertion)
676 2 : use Constants_mod, only: IK, RK
677 : implicit none
678 : logical :: assertion
679 2 : type(ParaDXXX_type) :: PD
680 2 : assertion = .true.
681 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
682 : call PD%runSampler ( ndim = 1_IK &
683 : , getLogFunc = getLogFuncMVN &
684 : , mpiFinalizeRequested = .false. &
685 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_OutputRealPrecision_type_1" &
686 : , outputRealPrecision = 0_IK &
687 2 : )
688 2 : assertion = assertion .and. PD%Err%occurred
689 : #endif
690 10 : end function test_SpecBase_OutputRealPrecision_type_1
691 :
692 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
693 :
694 : !> \brief
695 : !> Test whether the ParaDXXX sampler quits with an error message when `outputRealPrecision < 1`.
696 2 : module function test_SpecBase_OutputRealPrecision_type_2() result(assertion)
697 2 : use Constants_mod, only: IK, RK
698 : implicit none
699 : logical :: assertion
700 2 : type(ParaDXXX_type) :: PD
701 2 : assertion = .true.
702 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
703 : call PD%runSampler ( ndim = 1_IK &
704 : , getLogFunc = getLogFuncMVN &
705 : , mpiFinalizeRequested = .false. &
706 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_OutputRealPrecision_type_1" &
707 : , inputFile = ParaDXXX_NML//" outputRealPrecision = 0 /" &
708 2 : )
709 2 : assertion = assertion .and. PD%Err%occurred
710 : #endif
711 2 : end function test_SpecBase_OutputRealPrecision_type_2
712 :
713 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
714 :
715 : !> \brief
716 : !> Test whether the ParaDXXX sampler overwrites existing simulation files when `overwriteRequested = .true.`.
717 2 : module function test_SpecBase_OverwriteRequested_type_1() result(assertion)
718 2 : use Constants_mod, only: IK, RK
719 : implicit none
720 : logical :: assertion
721 2 : type(ParaDXXX_type) :: PD
722 2 : assertion = .true.
723 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
724 : call PD%runSampler ( ndim = 1_IK &
725 : , getLogFunc = getLogFuncMVN &
726 : , mpiFinalizeRequested = .false. &
727 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_OverwriteRequested_type_1" &
728 : , overwriteRequested = .true. &
729 2 : )
730 2 : assertion = assertion .and. .not. PD%Err%occurred
731 : call PD%runSampler ( ndim = 1_IK &
732 : , getLogFunc = getLogFuncMVN &
733 : , mpiFinalizeRequested = .false. &
734 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_OverwriteRequested_type_1" &
735 : , inputFile = ParaDXXX_NML//" overwriteRequested = true /" &
736 2 : )
737 2 : assertion = assertion .and. .not. PD%Err%occurred
738 : #endif
739 30 : end function test_SpecBase_OverwriteRequested_type_1
740 :
741 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
742 :
743 : !> \brief
744 : !> Test whether the ParaDXXX sampler exits with an error message when attempting to overwrite an existing simulation with `overwriteRequested = .false.`.
745 2 : module function test_SpecBase_OverwriteRequested_type_2() result(assertion)
746 2 : use Constants_mod, only: IK, RK
747 : implicit none
748 : logical :: assertion
749 2 : type(ParaDXXX_type) :: PD
750 2 : assertion = .true.
751 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
752 : call PD%runSampler ( ndim = 1_IK &
753 : , getLogFunc = getLogFuncMVN &
754 : , mpiFinalizeRequested = .false. &
755 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_OverwriteRequested_type_2" &
756 : , overwriteRequested = .false. &
757 2 : )
758 2 : assertion = assertion .and. .not. PD%Err%occurred
759 : call PD%runSampler ( ndim = 1_IK &
760 : , getLogFunc = getLogFuncMVN &
761 : , mpiFinalizeRequested = .false. &
762 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_OverwriteRequested_type_2" &
763 : , inputFile = ParaDXXX_NML//" overwriteRequested = false /" &
764 2 : )
765 2 : assertion = assertion .and. PD%Err%occurred
766 : #endif
767 22 : end function test_SpecBase_OverwriteRequested_type_2
768 :
769 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
770 :
771 : !> \brief
772 : !> Test whether the ParaDXXX sampler handles properly the `singleChain` parallelization model.
773 2 : module function test_SpecBase_ParallelizationModel_type_1() result(assertion)
774 2 : use Constants_mod, only: IK, RK
775 : implicit none
776 : logical :: assertion
777 2 : type(ParaDXXX_type) :: PD
778 2 : assertion = .true.
779 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
780 : call PD%runSampler ( ndim = 1_IK &
781 : , getLogFunc = getLogFuncMVN &
782 : , mpiFinalizeRequested = .false. &
783 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_ParallelizationModel_type_1" &
784 : , parallelizationModel = "SinGleChAin" &
785 2 : )
786 2 : assertion = assertion .and. .not. PD%Err%occurred
787 : #endif
788 30 : end function test_SpecBase_ParallelizationModel_type_1
789 :
790 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
791 :
792 : !> \brief
793 : !> Test whether the ParaDXXX sampler handles properly the `multiChain` parallelization model.
794 2 : module function test_SpecBase_ParallelizationModel_type_2() result(assertion)
795 2 : use Constants_mod, only: IK, RK
796 : implicit none
797 : logical :: assertion
798 2 : type(ParaDXXX_type) :: PD
799 2 : assertion = .true.
800 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
801 : call PD%runSampler ( ndim = 1_IK &
802 : , getLogFunc = getLogFuncMVN &
803 : , mpiFinalizeRequested = .false. &
804 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_ParallelizationModel_type_2" &
805 : , inputFile = ParaDXXX_NML//" parallelizationModel = 'MULTI ChAin' /" &
806 2 : )
807 2 : assertion = assertion .and. .not. PD%Err%occurred
808 : #endif
809 30 : end function test_SpecBase_ParallelizationModel_type_2
810 :
811 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
812 :
813 : !> \brief
814 : !> Test whether the ParaDXXX sampler exits with an error message when the specified value for `parallelizationModel` is not recognized.
815 2 : module function test_SpecBase_ParallelizationModel_type_3() result(assertion)
816 2 : use Constants_mod, only: IK, RK
817 : implicit none
818 : logical :: assertion
819 2 : type(ParaDXXX_type) :: PD
820 2 : assertion = .true.
821 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
822 : call PD%runSampler ( ndim = 1_IK &
823 : , getLogFunc = getLogFuncMVN &
824 : , mpiFinalizeRequested = .false. &
825 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_ParallelizationModel_type_3" &
826 : , inputFile = ParaDXXX_NML//" parallelizationModel = 'nonsense' /" &
827 2 : )
828 2 : assertion = assertion .and. PD%Err%occurred
829 : #endif
830 10 : end function test_SpecBase_ParallelizationModel_type_3
831 :
832 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
833 :
834 : !> \brief
835 : !> Test whether the ParaDXXX sampler exits with an error message when the `progressReportPeriod < 1`.
836 2 : module function test_SpecBase_ProgressReportPeriod_type_1() result(assertion)
837 2 : use Constants_mod, only: IK, RK
838 : implicit none
839 : logical :: assertion
840 2 : type(ParaDXXX_type) :: PD
841 2 : assertion = .true.
842 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
843 : call PD%runSampler ( ndim = 1_IK &
844 : , getLogFunc = getLogFuncMVN &
845 : , mpiFinalizeRequested = .false. &
846 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_ProgressReportPeriod_type_1" &
847 : , progressReportPeriod = -1_IK &
848 2 : )
849 2 : assertion = assertion .and. PD%Err%occurred
850 : #endif
851 10 : end function test_SpecBase_ProgressReportPeriod_type_1
852 :
853 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
854 :
855 : !> \brief
856 : !> Test whether the ParaDXXX sampler exits with an error message when the `progressReportPeriod < 1`.
857 2 : module function test_SpecBase_ProgressReportPeriod_type_2() result(assertion)
858 2 : use Constants_mod, only: IK, RK
859 : implicit none
860 : logical :: assertion
861 2 : type(ParaDXXX_type) :: PD
862 2 : assertion = .true.
863 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
864 : call PD%runSampler ( ndim = 1_IK &
865 : , getLogFunc = getLogFuncMVN &
866 : , mpiFinalizeRequested = .false. &
867 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_ProgressReportPeriod_type_2" &
868 : , inputFile = ParaDXXX_NML//" progressReportPeriod = 0 /" &
869 2 : )
870 2 : assertion = assertion .and. PD%Err%occurred
871 : #endif
872 10 : end function test_SpecBase_ProgressReportPeriod_type_2
873 :
874 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
875 :
876 : !> \brief
877 : !> Test whether the ParaDXXX sampler appropriately considers the user's input random seed value.
878 2 : module function test_SpecBase_RandomSeed_type_1() result(assertion)
879 2 : use Constants_mod, only: IK, RK
880 : implicit none
881 : logical :: assertion
882 2 : type(ParaDXXX_type) :: PD
883 2 : assertion = .true.
884 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
885 : call PD%runSampler ( ndim = 1_IK &
886 : , getLogFunc = getLogFuncMVN &
887 : , mpiFinalizeRequested = .false. &
888 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_RandomSeed_type_1" &
889 : , randomSeed = -12345_IK &
890 2 : )
891 2 : assertion = assertion .and. .not. PD%Err%occurred
892 : #endif
893 30 : end function test_SpecBase_RandomSeed_type_1
894 :
895 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
896 :
897 : !> \brief
898 : !> Test whether the ParaDXXX sampler appropriately considers the user's input random seed value.
899 2 : module function test_SpecBase_RandomSeed_type_2() result(assertion)
900 2 : use Constants_mod, only: IK, RK
901 : implicit none
902 : logical :: assertion
903 2 : type(ParaDXXX_type) :: PD
904 2 : assertion = .true.
905 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
906 : call PD%runSampler ( ndim = 1_IK &
907 : , getLogFunc = getLogFuncMVN &
908 : , mpiFinalizeRequested = .false. &
909 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_RandomSeed_type_2" &
910 : , inputFile = ParaDXXX_NML//" randomSeed = 12345 /" &
911 2 : )
912 2 : assertion = assertion .and. .not. PD%Err%occurred
913 : #endif
914 30 : end function test_SpecBase_RandomSeed_type_2
915 :
916 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
917 :
918 : !> \brief
919 : !> Test whether the ParaDXXX sampler appropriately considers a binary restart file format.
920 2 : module function test_SpecBase_RestartFileFormat_type_1() result(assertion)
921 2 : use Constants_mod, only: IK, RK
922 : implicit none
923 : logical :: assertion
924 2 : type(ParaDXXX_type) :: PD
925 2 : assertion = .true.
926 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
927 : call PD%runSampler ( ndim = 1_IK &
928 : , getLogFunc = getLogFuncMVN &
929 : , mpiFinalizeRequested = .false. &
930 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_RestartFileFormat_type_1" &
931 : , restartFileFormat = "BINARY" &
932 2 : )
933 2 : assertion = assertion .and. .not. PD%Err%occurred
934 : #endif
935 30 : end function test_SpecBase_RestartFileFormat_type_1
936 :
937 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
938 :
939 : !> \brief
940 : !> Test whether the ParaDXXX sampler appropriately considers an ascii restart file format.
941 2 : module function test_SpecBase_RestartFileFormat_type_2() result(assertion)
942 2 : use Constants_mod, only: IK, RK
943 : implicit none
944 : logical :: assertion
945 2 : type(ParaDXXX_type) :: PD
946 2 : assertion = .true.
947 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
948 : call PD%runSampler ( ndim = 1_IK &
949 : , getLogFunc = getLogFuncMVN &
950 : , mpiFinalizeRequested = .false. &
951 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_RestartFileFormat_type_2" &
952 : , inputFile = ParaDXXX_NML//" restartFileFormat = 'asCII' /" &
953 2 : )
954 2 : assertion = assertion .and. .not. PD%Err%occurred
955 : #endif
956 30 : end function test_SpecBase_RestartFileFormat_type_2
957 :
958 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
959 :
960 : !> \brief
961 : !> Test whether the ParaDXXX sampler exits with an error message when the specified restart file format is not recognized.
962 2 : module function test_SpecBase_RestartFileFormat_type_3() result(assertion)
963 2 : use Constants_mod, only: IK, RK
964 : implicit none
965 : logical :: assertion
966 2 : type(ParaDXXX_type) :: PD
967 2 : assertion = .true.
968 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
969 : call PD%runSampler ( ndim = 1_IK &
970 : , getLogFunc = getLogFuncMVN &
971 : , mpiFinalizeRequested = .false. &
972 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_RestartFileFormat_type_3" &
973 : , inputFile = ParaDXXX_NML//" restartFileFormat = 'nonsense' /" &
974 2 : )
975 2 : assertion = assertion .and. PD%Err%occurred
976 : #endif
977 10 : end function test_SpecBase_RestartFileFormat_type_3
978 :
979 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
980 :
981 : !> \brief
982 : !> Test whether the ParaDXXX sampler succeeds with a valid value for `sampleSize`.
983 2 : module function test_SpecBase_SampleSize_type_1() result(assertion)
984 2 : use Constants_mod, only: IK, RK
985 : implicit none
986 : logical :: assertion
987 2 : type(ParaDXXX_type) :: PD
988 2 : assertion = .true.
989 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
990 : call PD%runSampler ( ndim = 1_IK &
991 : , getLogFunc = getLogFuncMVN &
992 : , mpiFinalizeRequested = .false. &
993 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_SampleSize_type_1" &
994 : , sampleSize = -1_IK &
995 2 : )
996 2 : assertion = assertion .and. .not. PD%Err%occurred
997 : #endif
998 30 : end function test_SpecBase_SampleSize_type_1
999 :
1000 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1001 :
1002 : !> \brief
1003 : !> Test whether the ParaDXXX sampler succeeds with a valid value for `sampleSize`.
1004 2 : module function test_SpecBase_SampleSize_type_2() result(assertion)
1005 2 : use Constants_mod, only: IK, RK
1006 : implicit none
1007 : logical :: assertion
1008 2 : type(ParaDXXX_type) :: PD
1009 2 : assertion = .true.
1010 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1011 : call PD%runSampler ( ndim = 1_IK &
1012 : , getLogFunc = getLogFuncMVN &
1013 : , mpiFinalizeRequested = .false. &
1014 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_SampleSize_type_2" &
1015 : , sampleSize = -2_IK &
1016 2 : )
1017 2 : assertion = assertion .and. .not. PD%Err%occurred
1018 : #endif
1019 30 : end function test_SpecBase_SampleSize_type_2
1020 :
1021 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1022 :
1023 : !> \brief
1024 : !> Test whether the ParaDXXX sampler succeeds with a valid value for `sampleSize`.
1025 2 : module function test_SpecBase_SampleSize_type_3() result(assertion)
1026 2 : use Constants_mod, only: IK, RK
1027 : implicit none
1028 : logical :: assertion
1029 2 : type(ParaDXXX_type) :: PD
1030 2 : assertion = .true.
1031 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1032 : call PD%runSampler ( ndim = 1_IK &
1033 : , getLogFunc = getLogFuncMVN &
1034 : , mpiFinalizeRequested = .false. &
1035 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_SampleSize_type_3" &
1036 : , sampleSize = 200_IK &
1037 2 : )
1038 2 : assertion = assertion .and. .not. PD%Err%occurred
1039 : #endif
1040 30 : end function test_SpecBase_SampleSize_type_3
1041 :
1042 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1043 :
1044 : !> \brief
1045 : !> Test whether the ParaDXXX sampler succeeds with a valid value for `sampleSize`.
1046 2 : module function test_SpecBase_SampleSize_type_4() result(assertion)
1047 2 : use Constants_mod, only: IK, RK
1048 : implicit none
1049 : logical :: assertion, exist
1050 : integer :: iostat
1051 2 : type(ParaDXXX_type) :: PD
1052 2 : assertion = .true.
1053 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1054 : call PD%runSampler ( ndim = 1_IK &
1055 : , getLogFunc = getLogFuncMVN &
1056 : , mpiFinalizeRequested = .false. &
1057 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_SampleSize_type_4" &
1058 : , sampleSize = 0_IK &
1059 2 : )
1060 2 : assertion = assertion .and. .not. PD%Err%occurred
1061 2 : inquire(file = PD%SampleFile%Path%original, exist = exist, iostat = iostat)
1062 2 : assertion = assertion .and. .not. exist .and. iostat == 0
1063 : #endif
1064 30 : end function test_SpecBase_SampleSize_type_4
1065 :
1066 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1067 :
1068 : !> \brief
1069 : !> Test whether the ParaDXXX sampler exits with an error message when the specified `targetAcceptanceRate` is out of range.
1070 2 : module function test_SpecBase_TargetAcceptanceRate_type_1() result(assertion)
1071 2 : use Constants_mod, only: IK, RK
1072 : implicit none
1073 : logical :: assertion
1074 2 : type(ParaDXXX_type) :: PD
1075 : real(RK), parameter :: targetAcceptanceRate(*) = [-1._RK, 0.5_RK]
1076 2 : assertion = .true.
1077 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1078 : call PD%runSampler ( ndim = 1_IK &
1079 : , getLogFunc = getLogFuncMVN &
1080 : , mpiFinalizeRequested = .false. &
1081 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_TargetAcceptanceRate_type_1" &
1082 : , targetAcceptanceRate = targetAcceptanceRate &
1083 2 : )
1084 2 : assertion = assertion .and. PD%Err%occurred
1085 : #endif
1086 10 : end function test_SpecBase_TargetAcceptanceRate_type_1
1087 :
1088 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1089 :
1090 : !> \brief
1091 : !> Test whether the ParaDXXX sampler exits with an error message when the specified `targetAcceptanceRate` is out of range.
1092 2 : module function test_SpecBase_TargetAcceptanceRate_type_2() result(assertion)
1093 2 : use Constants_mod, only: IK, RK
1094 : implicit none
1095 : logical :: assertion
1096 2 : type(ParaDXXX_type) :: PD
1097 2 : assertion = .true.
1098 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1099 : call PD%runSampler ( ndim = 1_IK &
1100 : , getLogFunc = getLogFuncMVN &
1101 : , mpiFinalizeRequested = .false. &
1102 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_TargetAcceptanceRate_type_2" &
1103 : , inputFile = ParaDXXX_NML//" targetAcceptanceRate = +2. /" &
1104 2 : )
1105 2 : assertion = assertion .and. PD%Err%occurred
1106 : #endif
1107 10 : end function test_SpecBase_TargetAcceptanceRate_type_2
1108 :
1109 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1110 :
1111 : !> \brief
1112 : !> Test whether the ParaDXXX sampler exits with an error message when the specified `targetAcceptanceRate` is out of range.
1113 2 : module function test_SpecBase_TargetAcceptanceRate_type_3() result(assertion)
1114 2 : use Constants_mod, only: IK, RK
1115 : implicit none
1116 : logical :: assertion
1117 2 : type(ParaDXXX_type) :: PD
1118 2 : assertion = .true.
1119 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1120 : call PD%runSampler ( ndim = 1_IK &
1121 : , getLogFunc = getLogFuncMVN &
1122 : , mpiFinalizeRequested = .false. &
1123 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_TargetAcceptanceRate_type_3" &
1124 : , inputFile = ParaDXXX_NML//" targetAcceptanceRate = +0.5d0, 0.2d0 /" &
1125 2 : )
1126 2 : assertion = assertion .and. PD%Err%occurred
1127 : #endif
1128 10 : end function test_SpecBase_TargetAcceptanceRate_type_3
1129 :
1130 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1131 :
1132 : !> \brief
1133 : !> Test whether the ParaDXXX sampler exits with an error message when the specified `targetAcceptanceRate` is out of range.
1134 2 : module function test_SpecBase_TargetAcceptanceRate_type_4() result(assertion)
1135 2 : use Constants_mod, only: IK, RK
1136 : implicit none
1137 : logical :: assertion
1138 2 : type(ParaDXXX_type) :: PD
1139 2 : assertion = .true.
1140 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1141 : call PD%runSampler ( ndim = 1_IK &
1142 : , getLogFunc = getLogFuncMVN &
1143 : , mpiFinalizeRequested = .false. &
1144 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_TargetAcceptanceRate_type_4" &
1145 : , inputFile = ParaDXXX_NML//" targetAcceptanceRate(1) = 1. /" &
1146 2 : )
1147 2 : assertion = assertion .and. PD%Err%occurred
1148 : #endif
1149 10 : end function test_SpecBase_TargetAcceptanceRate_type_4
1150 :
1151 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1152 :
1153 : !> \brief
1154 : !> Test whether the ParaDXXX sampler exits with an error message when the specified `targetAcceptanceRate` is out of range.
1155 2 : module function test_SpecBase_TargetAcceptanceRate_type_5() result(assertion)
1156 2 : use Constants_mod, only: IK, RK
1157 : implicit none
1158 : logical :: assertion
1159 2 : type(ParaDXXX_type) :: PD
1160 2 : assertion = .true.
1161 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1162 : call PD%runSampler ( ndim = 1_IK &
1163 : , getLogFunc = getLogFuncMVN &
1164 : , mpiFinalizeRequested = .false. &
1165 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_TargetAcceptanceRate_type_5" &
1166 : , inputFile = ParaDXXX_NML//" targetAcceptanceRate(2) = 0. /" &
1167 2 : )
1168 2 : assertion = assertion .and. PD%Err%occurred
1169 : #endif
1170 10 : end function test_SpecBase_TargetAcceptanceRate_type_5
1171 :
1172 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1173 :
1174 : !> \brief
1175 : !> Test whether the ParaDXXX sampler does not do scaling when the `targetAcceptanceRate = [0., 1.]`.
1176 2 : module function test_SpecBase_TargetAcceptanceRate_type_6() result(assertion)
1177 2 : use Constants_mod, only: IK, RK
1178 : implicit none
1179 : logical :: assertion
1180 2 : type(ParaDXXX_type) :: PD
1181 : real(RK), parameter :: targetAcceptanceRate(*) = [0._RK, 1._RK]
1182 2 : assertion = .true.
1183 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1184 : call PD%runSampler ( ndim = 1_IK &
1185 : , getLogFunc = getLogFuncMVN &
1186 : , mpiFinalizeRequested = .false. &
1187 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecBase/test_SpecBase_TargetAcceptanceRate_type_6" &
1188 : , targetAcceptanceRate = targetAcceptanceRate &
1189 2 : )
1190 2 : assertion = assertion .and. .not. PD%Err%occurred .and. .not. PD%SpecBase%TargetAcceptanceRate%scalingRequested
1191 : #endif
1192 30 : end function test_SpecBase_TargetAcceptanceRate_type_6
1193 :
1194 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|