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_SpecMCMC_smod](@ref paradram_mod@test_specmcmc_smod) and
45 : !> [ParaDISE_mod@@Test_SpecMCMC_smod](@ref paradise_mod@@test_specmcmc_smod).
46 : !> \author Amir Shahmoradi
47 :
48 : contains
49 :
50 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
51 :
52 : !> \brief
53 : !> Test the ParaDXXX sampler with a wrong input value for `chainSize < ndim + 1`.
54 12 : module function test_SpecMCMC_ChainSize_type_1() result(assertion)
55 : implicit none
56 : logical :: assertion
57 6 : type(ParaDXXX_type) :: PD
58 6 : 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 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_ChainSize_type_1" &
64 : , chainSize = 0_IK &
65 6 : )
66 6 : assertion = assertion .and. PD%Err%occurred
67 : #endif
68 14 : end function test_SpecMCMC_ChainSize_type_1
69 :
70 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
71 :
72 : !> \brief
73 : !> Test the ParaDXXX sampler with a wrong input value for `chainSize < ndim + 1`.
74 6 : module function test_SpecMCMC_ChainSize_type_2() result(assertion)
75 : implicit none
76 : logical :: assertion
77 6 : type(ParaDXXX_type) :: PD
78 6 : 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 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_ChainSize_type_2" &
84 : , inputFile = ParaDXXX_NML//" chainSize = 1 /" &
85 6 : )
86 6 : assertion = assertion .and. PD%Err%occurred
87 : #endif
88 20 : end function test_SpecMCMC_ChainSize_type_2
89 :
90 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
91 :
92 : !> \brief
93 : !> Test the ParaDXXX sampler with a uniform proposal model.
94 6 : module function test_SpecMCMC_ProposalModel_type_1() result(assertion)
95 : implicit none
96 : logical :: assertion
97 6 : type(ParaDXXX_type) :: PD
98 6 : 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 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_ProposalModel_type_1" &
104 : , proposalModel = "UniForm" &
105 6 : )
106 6 : assertion = assertion .and. .not. PD%Err%occurred
107 : #endif
108 72 : end function test_SpecMCMC_ProposalModel_type_1
109 :
110 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
111 :
112 : !> \brief
113 : !> Test the ParaDXXX sampler with a uniform proposal model.
114 6 : module function test_SpecMCMC_ProposalModel_type_2() result(assertion)
115 : implicit none
116 : logical :: assertion
117 6 : type(ParaDXXX_type) :: PD
118 6 : 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 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_ProposalModel_type_2" &
124 : , inputFile = ParaDXXX_NML//" proposalModel = 'UNIFORM' /" &
125 6 : )
126 6 : assertion = assertion .and. .not. PD%Err%occurred
127 : #endif
128 72 : end function test_SpecMCMC_ProposalModel_type_2
129 :
130 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
131 :
132 : !> \brief
133 : !> Test the ParaDXXX sampler with a uniform proposal model.
134 6 : module function test_SpecMCMC_ProposalModel_type_3() result(assertion)
135 : implicit none
136 : logical :: assertion
137 6 : type(ParaDXXX_type) :: PD
138 6 : 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 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_ProposalModel_type_3" &
144 : , proposalModel = "Normal" &
145 6 : )
146 6 : assertion = assertion .and. .not. PD%Err%occurred
147 : #endif
148 72 : end function test_SpecMCMC_ProposalModel_type_3
149 :
150 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
151 :
152 : !> \brief
153 : !> Test the ParaDXXX sampler with a wrong unrecognized proposal model.
154 6 : module function test_SpecMCMC_ProposalModel_type_4() result(assertion)
155 : implicit none
156 : logical :: assertion
157 6 : type(ParaDXXX_type) :: PD
158 6 : assertion = .true.
159 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
160 : call PD%runSampler ( ndim = 1_IK &
161 : , getLogFunc = getLogFuncMVN &
162 : , mpiFinalizeRequested = .false. &
163 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_ProposalModel_type_4" &
164 : , inputFile = ParaDXXX_NML//" proposalModel = 'nonsense' /" &
165 6 : )
166 6 : assertion = assertion .and. PD%Err%occurred
167 : #endif
168 20 : end function test_SpecMCMC_ProposalModel_type_4
169 :
170 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
171 :
172 : !> \brief
173 : !> Test the ParaDXXX sampler with a valid unidimensional `ProposalStartCorMat`.
174 6 : module function test_SpecMCMC_ProposalStartCorMat_type_1() result(assertion)
175 6 : use Constants_mod, only: IK, RK
176 : implicit none
177 : logical :: assertion
178 6 : type(ParaDXXX_type) :: PD
179 : integer(IK) , parameter :: NDIM = 1_IK
180 : real(RK) , parameter :: ProposalStartCorMat(NDIM,NDIM) = reshape([1._RK], shape = shape(ProposalStartCorMat))
181 6 : assertion = .true.
182 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
183 : call PD%runSampler ( ndim = NDIM &
184 : , getLogFunc = getLogFuncMVN &
185 : , mpiFinalizeRequested = .false. &
186 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_ProposalStartCorMat_type_1" &
187 : , ProposalStartCorMat = ProposalStartCorMat &
188 6 : )
189 6 : assertion = assertion .and. .not. PD%Err%occurred
190 : #endif
191 66 : end function test_SpecMCMC_ProposalStartCorMat_type_1
192 :
193 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
194 :
195 : !> \brief
196 : !> Test the ParaDXXX sampler with a valid unidimensional `ProposalStartCorMat`.
197 6 : module function test_SpecMCMC_ProposalStartCorMat_type_2() result(assertion)
198 6 : use Constants_mod, only: IK, RK
199 : use String_mod, only: num2str
200 : implicit none
201 : logical :: assertion
202 6 : type(ParaDXXX_type) :: PD
203 : integer(IK) , parameter :: NDIM = 1_IK
204 : real(RK) , parameter :: ProposalStartCorMat(NDIM,NDIM) = reshape([1._RK], shape = shape(ProposalStartCorMat))
205 6 : assertion = .true.
206 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
207 : call PD%runSampler ( ndim = NDIM &
208 : , getLogFunc = getLogFuncMVN &
209 : , mpiFinalizeRequested = .false. &
210 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_ProposalStartCorMat_type_2" &
211 : , inputFile = ParaDXXX_NML//" ProposalStartCorMat = "//num2str(ProposalStartCorMat)//" /" &
212 6 : )
213 6 : assertion = assertion .and. .not. PD%Err%occurred
214 : #endif
215 66 : end function test_SpecMCMC_ProposalStartCorMat_type_2
216 :
217 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
218 :
219 : !> \brief
220 : !> Test the ParaDXXX sampler with a wrong value for the unidimensional `ProposalStartCorMat`.
221 6 : module function test_SpecMCMC_ProposalStartCorMat_type_3() result(assertion)
222 6 : use Constants_mod, only: IK, RK
223 : use String_mod, only: num2str
224 : implicit none
225 : logical :: assertion
226 6 : type(ParaDXXX_type) :: PD
227 : integer(IK) , parameter :: NDIM = 1_IK
228 : real(RK) , parameter :: ProposalStartCorMat(NDIM,NDIM) = reshape([0._RK], shape = shape(ProposalStartCorMat))
229 6 : assertion = .true.
230 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
231 : call PD%runSampler ( ndim = NDIM &
232 : , getLogFunc = getLogFuncMVN &
233 : , mpiFinalizeRequested = .false. &
234 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_ProposalStartCorMat_type_3" &
235 : , inputFile = ParaDXXX_NML//" ProposalStartCorMat = "//num2str(ProposalStartCorMat)//" /" &
236 6 : )
237 6 : assertion = assertion .and. PD%Err%occurred
238 : #endif
239 14 : end function test_SpecMCMC_ProposalStartCorMat_type_3
240 :
241 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
242 :
243 : !> \brief
244 : !> Test the ParaDXXX sampler with a multidimensional `ProposalStartCorMat`.
245 6 : module function test_SpecMCMC_ProposalStartCorMat_type_4() result(assertion)
246 6 : use Constants_mod, only: IK, RK
247 : use String_mod, only: num2str
248 : implicit none
249 : logical :: assertion
250 6 : type(ParaDXXX_type) :: PD
251 : integer(IK) , parameter :: NDIM = 2_IK
252 : real(RK) , parameter :: ProposalStartCorMat(NDIM,NDIM) = reshape([1._RK, 0.5_RK, 0.5_RK, 1._RK], shape = shape(ProposalStartCorMat))
253 6 : assertion = .true.
254 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
255 : call PD%runSampler ( ndim = NDIM &
256 : , getLogFunc = getLogFuncMVN &
257 : , mpiFinalizeRequested = .false. &
258 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_ProposalStartCorMat_type_4" &
259 : , inputFile = ParaDXXX_NML//" ProposalStartCorMat = "//num2str(ProposalStartCorMat)//" /" &
260 6 : )
261 42 : assertion = assertion .and. .not. PD%Err%occurred .and. all(PD%SpecMCMC%ProposalStartCorMat%Val==PD%SpecMCMC%ProposalStartCovMat%Val)
262 : #endif
263 74 : end function test_SpecMCMC_ProposalStartCorMat_type_4
264 :
265 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
266 :
267 : !> \brief
268 : !> Test the ParaDXXX sampler with a wrong multidimensional `ProposalStartCorMat`,
269 : !> which must be fine with the sampler, as long as it leads to a correct positive-definite covariance matrix.
270 6 : module function test_SpecMCMC_ProposalStartCorMat_type_5() result(assertion)
271 6 : use Constants_mod, only: IK, RK
272 : use String_mod, only: num2str
273 : implicit none
274 : logical :: assertion
275 6 : type(ParaDXXX_type) :: PD
276 : integer(IK) , parameter :: NDIM = 2_IK
277 : real(RK) , parameter :: ProposalStartCorMat(NDIM,NDIM) = reshape([2._RK, 0.5_RK, 0.5_RK, 2._RK], shape = shape(ProposalStartCorMat))
278 6 : assertion = .true.
279 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
280 : call PD%runSampler ( ndim = NDIM &
281 : , getLogFunc = getLogFuncMVN &
282 : , mpiFinalizeRequested = .false. &
283 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_ProposalStartCorMat_type_5" &
284 : , inputFile = ParaDXXX_NML//" ProposalStartCorMat = "//num2str(ProposalStartCorMat)//" /" &
285 6 : )
286 6 : assertion = assertion .and. .not. PD%Err%occurred
287 : #endif
288 74 : end function test_SpecMCMC_ProposalStartCorMat_type_5
289 :
290 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
291 :
292 : !> \brief
293 : !> Test the ParaDXXX sampler with a valid unidimensional `ProposalStartCorMat`.
294 6 : module function test_SpecMCMC_ProposalStartCovMat_type_1() result(assertion)
295 6 : use Constants_mod, only: IK, RK
296 : implicit none
297 : logical :: assertion
298 6 : type(ParaDXXX_type) :: PD
299 : integer(IK) , parameter :: NDIM = 1_IK
300 : real(RK) , parameter :: ProposalStartCovMat(NDIM,NDIM) = reshape([2._RK], shape = shape(ProposalStartCovMat))
301 6 : assertion = .true.
302 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
303 : call PD%runSampler ( ndim = NDIM &
304 : , getLogFunc = getLogFuncMVN &
305 : , mpiFinalizeRequested = .false. &
306 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_ProposalStartCovMat_type_1" &
307 : , ProposalStartCovMat = ProposalStartCovMat &
308 6 : )
309 6 : assertion = assertion .and. .not. PD%Err%occurred
310 : #endif
311 66 : end function test_SpecMCMC_ProposalStartCovMat_type_1
312 :
313 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
314 :
315 : !> \brief
316 : !> Test the ParaDXXX sampler with a valid unidimensional `ProposalStartCovMat`.
317 6 : module function test_SpecMCMC_ProposalStartCovMat_type_2() result(assertion)
318 6 : use Constants_mod, only: IK, RK
319 : use String_mod, only: num2str
320 : implicit none
321 : logical :: assertion
322 6 : type(ParaDXXX_type) :: PD
323 : integer(IK) , parameter :: NDIM = 1_IK
324 : real(RK) , parameter :: ProposalStartCovMat(NDIM,NDIM) = reshape([1._RK], shape = shape(ProposalStartCovMat))
325 6 : assertion = .true.
326 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
327 : call PD%runSampler ( ndim = NDIM &
328 : , getLogFunc = getLogFuncMVN &
329 : , mpiFinalizeRequested = .false. &
330 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_ProposalStartCovMat_type_2" &
331 : , inputFile = ParaDXXX_NML//" ProposalStartCovMat = "//num2str(ProposalStartCovMat)//" /" &
332 6 : )
333 6 : assertion = assertion .and. .not. PD%Err%occurred
334 : #endif
335 66 : end function test_SpecMCMC_ProposalStartCovMat_type_2
336 :
337 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
338 :
339 : !> \brief
340 : !> Test the ParaDXXX sampler with a wrong value for the unidimensional `ProposalStartCovMat`.
341 6 : module function test_SpecMCMC_ProposalStartCovMat_type_3() result(assertion)
342 6 : use Constants_mod, only: IK, RK
343 : use String_mod, only: num2str
344 : implicit none
345 : logical :: assertion
346 6 : type(ParaDXXX_type) :: PD
347 : integer(IK) , parameter :: NDIM = 1_IK
348 : real(RK) , parameter :: ProposalStartCovMat(NDIM,NDIM) = reshape([0._RK], shape = shape(ProposalStartCovMat))
349 6 : assertion = .true.
350 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
351 : call PD%runSampler ( ndim = NDIM &
352 : , getLogFunc = getLogFuncMVN &
353 : , mpiFinalizeRequested = .false. &
354 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_ProposalStartCovMat_type_3" &
355 : , inputFile = ParaDXXX_NML//" ProposalStartCovMat = "//num2str(ProposalStartCovMat)//" /" &
356 6 : )
357 6 : assertion = assertion .and. PD%Err%occurred
358 : #endif
359 14 : end function test_SpecMCMC_ProposalStartCovMat_type_3
360 :
361 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
362 :
363 : !> \brief
364 : !> Test the ParaDXXX sampler with a multidimensional `ProposalStartCovMat`.
365 6 : module function test_SpecMCMC_ProposalStartCovMat_type_4() result(assertion)
366 6 : use Constants_mod, only: IK, RK
367 : use String_mod, only: num2str
368 : implicit none
369 : logical :: assertion
370 6 : type(ParaDXXX_type) :: PD
371 : integer(IK) , parameter :: NDIM = 2_IK
372 : real(RK) , parameter :: ProposalStartCovMat(NDIM,NDIM) = reshape([1._RK, 0.5_RK, 0.5_RK, 1._RK], shape = shape(ProposalStartCovMat))
373 6 : assertion = .true.
374 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
375 : call PD%runSampler ( ndim = NDIM &
376 : , getLogFunc = getLogFuncMVN &
377 : , mpiFinalizeRequested = .false. &
378 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_ProposalStartCovMat_type_4" &
379 : , inputFile = ParaDXXX_NML//" ProposalStartCovMat = "//num2str(ProposalStartCovMat)//" /" &
380 6 : )
381 42 : assertion = assertion .and. .not. PD%Err%occurred .and. all(PD%SpecMCMC%ProposalStartCovMat%Val==PD%SpecMCMC%ProposalStartCovMat%Val)
382 : #endif
383 74 : end function test_SpecMCMC_ProposalStartCovMat_type_4
384 :
385 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
386 :
387 : !> \brief
388 : !> Test the ParaDXXX sampler with a multidimensional `ProposalStartCovMat`, in the presence of `ProposalStartCorMat`
389 : !> and `ProposalStartStdVec`, in which case, the `ProposalStartCovMat` must be preferred.
390 6 : module function test_SpecMCMC_ProposalStartCovMat_type_5() result(assertion)
391 6 : use Constants_mod, only: IK, RK
392 : use String_mod, only: num2str
393 : implicit none
394 : logical :: assertion
395 6 : type(ParaDXXX_type) :: PD
396 : integer(IK) , parameter :: NDIM = 2_IK
397 : real(RK) , parameter :: ProposalStartCovMat(NDIM,NDIM) = reshape([2._RK, 0.5_RK, 0.5_RK, 2._RK], shape = shape(ProposalStartCovMat))
398 : real(RK) , parameter :: ProposalStartCorMat(NDIM,NDIM) = reshape([1._RK, 0.0_RK, 0.0_RK, 1._RK], shape = shape(ProposalStartCovMat))
399 : real(RK) , parameter :: ProposalStartStdVec(NDIM) = [1._RK, 1._RK]
400 6 : assertion = .true.
401 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
402 : call PD%runSampler ( ndim = NDIM &
403 : , getLogFunc = getLogFuncMVN &
404 : , mpiFinalizeRequested = .false. &
405 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_ProposalStartCovMat_type_5" &
406 : , ProposalStartCovMat = ProposalStartCovMat &
407 : , ProposalStartCorMat = ProposalStartCorMat &
408 : , ProposalStartStdVec = ProposalStartStdVec &
409 6 : )
410 6 : assertion = assertion .and. .not. PD%Err%occurred
411 : #endif
412 74 : end function test_SpecMCMC_ProposalStartCovMat_type_5
413 :
414 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
415 :
416 : !> \brief
417 : !> Test the ParaDXXX sampler with a valid unidimensional `ProposalStartCorMat`.
418 6 : module function test_SpecMCMC_ProposalStartStdVec_type_1() result(assertion)
419 6 : use Constants_mod, only: IK, RK
420 : implicit none
421 : logical :: assertion
422 6 : type(ParaDXXX_type) :: PD
423 : integer(IK) , parameter :: NDIM = 1_IK
424 : real(RK) , parameter :: ProposalStartStdVec(NDIM) = [2._RK]
425 6 : assertion = .true.
426 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
427 : call PD%runSampler ( ndim = NDIM &
428 : , getLogFunc = getLogFuncMVN &
429 : , mpiFinalizeRequested = .false. &
430 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_ProposalStartStdVec_type_1" &
431 : , ProposalStartStdVec = ProposalStartStdVec &
432 6 : )
433 6 : assertion = assertion .and. .not. PD%Err%occurred
434 : #endif
435 66 : end function test_SpecMCMC_ProposalStartStdVec_type_1
436 :
437 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
438 :
439 : !> \brief
440 : !> Test the ParaDXXX sampler with a valid unidimensional `ProposalStartStdVec`.
441 6 : module function test_SpecMCMC_ProposalStartStdVec_type_2() result(assertion)
442 6 : use Constants_mod, only: IK, RK
443 : use String_mod, only: num2str
444 : implicit none
445 : logical :: assertion
446 6 : type(ParaDXXX_type) :: PD
447 : integer(IK) , parameter :: NDIM = 1_IK
448 : real(RK) , parameter :: ProposalStartStdVec(NDIM) = [1._RK]
449 6 : assertion = .true.
450 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
451 : call PD%runSampler ( ndim = NDIM &
452 : , getLogFunc = getLogFuncMVN &
453 : , mpiFinalizeRequested = .false. &
454 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_ProposalStartStdVec_type_2" &
455 : , inputFile = ParaDXXX_NML//" ProposalStartStdVec = "//num2str(ProposalStartStdVec)//" /" &
456 6 : )
457 6 : assertion = assertion .and. .not. PD%Err%occurred
458 : #endif
459 66 : end function test_SpecMCMC_ProposalStartStdVec_type_2
460 :
461 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
462 :
463 : !> \brief
464 : !> Test the ParaDXXX sampler with a wrong value for the unidimensional `ProposalStartStdVec`.
465 6 : module function test_SpecMCMC_ProposalStartStdVec_type_3() result(assertion)
466 6 : use Constants_mod, only: IK, RK
467 : use String_mod, only: num2str
468 : implicit none
469 : logical :: assertion
470 6 : type(ParaDXXX_type) :: PD
471 : integer(IK) , parameter :: NDIM = 1_IK
472 : real(RK) , parameter :: ProposalStartStdVec(NDIM) = [0._RK]
473 6 : assertion = .true.
474 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
475 : call PD%runSampler ( ndim = NDIM &
476 : , getLogFunc = getLogFuncMVN &
477 : , mpiFinalizeRequested = .false. &
478 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_ProposalStartStdVec_type_3" &
479 : , inputFile = ParaDXXX_NML//" ProposalStartStdVec = "//num2str(ProposalStartStdVec)//" /" &
480 6 : )
481 6 : assertion = assertion .and. PD%Err%occurred
482 : #endif
483 14 : end function test_SpecMCMC_ProposalStartStdVec_type_3
484 :
485 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
486 :
487 : !> \brief
488 : !> Test the ParaDXXX sampler with a multidimensional `ProposalStartStdVec`.
489 6 : module function test_SpecMCMC_ProposalStartStdVec_type_4() result(assertion)
490 6 : use Constants_mod, only: IK, RK
491 : use String_mod, only: num2str
492 : implicit none
493 : logical :: assertion
494 6 : type(ParaDXXX_type) :: PD
495 : integer(IK) , parameter :: NDIM = 2_IK
496 : real(RK) , parameter :: ProposalStartStdVec(NDIM) = reshape([1._RK, 0.5_RK], shape = shape(ProposalStartStdVec))
497 6 : assertion = .true.
498 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
499 : call PD%runSampler ( ndim = NDIM &
500 : , getLogFunc = getLogFuncMVN &
501 : , mpiFinalizeRequested = .false. &
502 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_ProposalStartStdVec_type_4" &
503 : , inputFile = ParaDXXX_NML//" ProposalStartStdVec = "//num2str(ProposalStartStdVec)//" /" &
504 6 : )
505 18 : assertion = assertion .and. .not. PD%Err%occurred .and. all(PD%SpecMCMC%ProposalStartStdVec%Val==PD%SpecMCMC%ProposalStartStdVec%Val)
506 : #endif
507 74 : end function test_SpecMCMC_ProposalStartStdVec_type_4
508 :
509 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
510 :
511 : !> \brief
512 : !> Test the ParaDXXX sampler with a multidimensional `ProposalStartStdVec`, in the presence of `ProposalStartCorMat`,
513 : !> in which case, the `ProposalStartStdVec` must be correctly computed.
514 6 : module function test_SpecMCMC_ProposalStartStdVec_type_5() result(assertion)
515 6 : use Constants_mod, only: IK, RK
516 : use String_mod, only: num2str
517 : implicit none
518 : logical :: assertion
519 6 : type(ParaDXXX_type) :: PD
520 : integer(IK) , parameter :: NDIM = 2_IK
521 : real(RK) , parameter :: tolerance = 1.e-12_RK
522 : real(RK) , parameter :: ProposalStartStdVec(NDIM) = reshape([1._RK, 2._RK], shape = shape(ProposalStartStdVec))
523 : real(RK) , parameter :: ProposalStartCorMat(NDIM,NDIM) = reshape([1._RK, 0.5_RK, 0.5_RK, 1._RK], shape = shape(ProposalStartCorMat))
524 : real(RK) , parameter :: ProposalStartCovMat(NDIM,NDIM) = reshape([1._RK, 1.0_RK, 1.0_RK, 4._RK], shape = shape(ProposalStartCovMat))
525 6 : assertion = .true.
526 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
527 : call PD%runSampler ( ndim = NDIM &
528 : , getLogFunc = getLogFuncMVN &
529 : , mpiFinalizeRequested = .false. &
530 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_ProposalStartStdVec_type_5" &
531 : , ProposalStartStdVec = ProposalStartStdVec &
532 : , ProposalStartCorMat = ProposalStartCorMat &
533 6 : )
534 42 : assertion = assertion .and. .not. PD%Err%occurred .and. all(abs(PD%SpecMCMC%ProposalStartCovMat%Val-ProposalStartCovMat) <= tolerance)
535 : #endif
536 74 : end function test_SpecMCMC_ProposalStartStdVec_type_5
537 :
538 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
539 :
540 : !> \brief
541 : !> Test whether the ParaDXXX sampler can correctly set the value of `RandomStartPointDomainLowerLimitVec` from input argument.
542 6 : module function test_RSPDLowerLimitVec_type_1() result(assertion)
543 6 : use Constants_mod, only: IK, RK
544 : use String_mod, only: num2str
545 : implicit none
546 : logical :: assertion
547 6 : type(ParaDXXX_type) :: PD
548 : integer(IK) , parameter :: NDIM = 2_IK
549 : real(RK) , parameter :: RandomStartPointDomainLowerLimitVec(NDIM) = [1._RK, 2._RK]
550 6 : assertion = .true.
551 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
552 : call PD%runSampler ( ndim = NDIM &
553 : , getLogFunc = getLogFuncMVN &
554 : , mpiFinalizeRequested = .false. &
555 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_RSPDLowerLimitVec_type_1" &
556 : , RandomStartPointDomainLowerLimitVec = RandomStartPointDomainLowerLimitVec &
557 6 : )
558 18 : assertion = assertion .and. .not. PD%Err%occurred .and. all(PD%SpecMCMC%RandomStartPointDomainLowerLimitVec%Val == RandomStartPointDomainLowerLimitVec)
559 : #endif
560 74 : end function test_RSPDLowerLimitVec_type_1
561 :
562 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
563 :
564 : !> \brief
565 : !> Test whether the ParaDXXX sampler can correctly set the value of
566 : !> `RandomStartPointDomainLowerLimitVec` for two consecutive simulations.
567 6 : module function test_RSPDLowerLimitVec_type_2() result(assertion)
568 6 : use Constants_mod, only: IK, RK
569 : use String_mod, only: num2str
570 : implicit none
571 : logical :: assertion
572 6 : type(ParaDXXX_type) :: PD
573 : integer(IK) , parameter :: NDIM = 2_IK
574 : real(RK) , parameter :: RandomStartPointDomainLowerLimitVec(NDIM) = [1._RK, 2._RK]
575 6 : assertion = .true.
576 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
577 : call PD%runSampler ( ndim = NDIM &
578 : , getLogFunc = getLogFuncMVN &
579 : , mpiFinalizeRequested = .false. &
580 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_RSPDLowerLimitVec_type_2A" &
581 : , inputFile = ParaDXXX_NML//" RandomStartPointDomainLowerLimitVec = "//num2str(-RandomStartPointDomainLowerLimitVec)//" /" &
582 6 : )
583 18 : assertion = assertion .and. .not. PD%Err%occurred .and. all(PD%SpecMCMC%RandomStartPointDomainLowerLimitVec%Val == -RandomStartPointDomainLowerLimitVec)
584 : call PD%runSampler ( ndim = NDIM &
585 : , getLogFunc = getLogFuncMVN &
586 : , mpiFinalizeRequested = .false. &
587 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_RSPDLowerLimitVec_type_2B" &
588 : , inputFile = ParaDXXX_NML//" RandomStartPointDomainLowerLimitVec = "//num2str(RandomStartPointDomainLowerLimitVec)//" /" &
589 6 : )
590 18 : assertion = assertion .and. .not. PD%Err%occurred .and. all(PD%SpecMCMC%RandomStartPointDomainLowerLimitVec%Val == RandomStartPointDomainLowerLimitVec)
591 : #endif
592 74 : end function test_RSPDLowerLimitVec_type_2
593 :
594 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
595 :
596 : !> \brief
597 : !> Test whether the ParaDXXX sampler returns with an error message when
598 : !> `RandomStartPointDomainLowerLimitVec` goes below the limits of `DomainLowerLimitVec`.
599 6 : module function test_RSPDLowerLimitVec_type_3() result(assertion)
600 6 : use Constants_mod, only: IK, RK
601 : use String_mod, only: num2str
602 : implicit none
603 : logical :: assertion
604 6 : type(ParaDXXX_type) :: PD
605 : integer(IK) , parameter :: NDIM = 2_IK
606 : real(RK) , parameter :: RandomStartPointDomainLowerLimitVec(NDIM) = [+1._RK, +2._RK]
607 : real(RK) , parameter :: DomainLowerLimitVec(NDIM) = [-1._RK, +3._RK]
608 6 : assertion = .true.
609 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
610 : call PD%runSampler ( ndim = NDIM &
611 : , getLogFunc = getLogFuncMVN &
612 : , mpiFinalizeRequested = .false. &
613 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_RSPDLowerLimitVec_type_3" &
614 : , RandomStartPointDomainLowerLimitVec = RandomStartPointDomainLowerLimitVec &
615 : , DomainLowerLimitVec = DomainLowerLimitVec &
616 6 : )
617 6 : assertion = assertion .and. PD%Err%occurred
618 : #endif
619 14 : end function test_RSPDLowerLimitVec_type_3
620 :
621 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
622 :
623 : !> \brief
624 : !> Test whether the ParaDXXX sampler can correctly set the value of `RandomStartPointDomainLowerLimitVec` from input argument.
625 6 : module function test_RSPDUpperLimitVec_type_1() result(assertion)
626 6 : use Constants_mod, only: IK, RK
627 : use String_mod, only: num2str
628 : implicit none
629 : logical :: assertion
630 6 : type(ParaDXXX_type) :: PD
631 : integer(IK) , parameter :: NDIM = 2_IK
632 : real(RK) , parameter :: RandomStartPointDomainUpperLimitVec(NDIM) = [1._RK, 2._RK]
633 6 : assertion = .true.
634 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
635 : call PD%runSampler ( ndim = NDIM &
636 : , getLogFunc = getLogFuncMVN &
637 : , mpiFinalizeRequested = .false. &
638 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_RSPDUpperLimitVec_type_1" &
639 : , RandomStartPointDomainUpperLimitVec = RandomStartPointDomainUpperLimitVec &
640 6 : )
641 18 : assertion = assertion .and. .not. PD%Err%occurred .and. all(PD%SpecMCMC%RandomStartPointDomainUpperLimitVec%Val == RandomStartPointDomainUpperLimitVec)
642 : #endif
643 74 : end function test_RSPDUpperLimitVec_type_1
644 :
645 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
646 :
647 : !> \brief
648 : !> Test whether the ParaDXXX sampler can correctly set the value of
649 : !> `RandomStartPointDomainUpperLimitVec` for two consecutive simulations.
650 6 : module function test_RSPDUpperLimitVec_type_2() result(assertion)
651 6 : use Constants_mod, only: IK, RK
652 : use String_mod, only: num2str
653 : implicit none
654 : logical :: assertion
655 6 : type(ParaDXXX_type) :: PD
656 : integer(IK) , parameter :: NDIM = 2_IK
657 : real(RK) , parameter :: RandomStartPointDomainUpperLimitVec(NDIM) = [1._RK, 2._RK]
658 6 : assertion = .true.
659 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
660 : call PD%runSampler ( ndim = NDIM &
661 : , getLogFunc = getLogFuncMVN &
662 : , mpiFinalizeRequested = .false. &
663 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_RSPDUpperLimitVec_type_2A" &
664 : , inputFile = ParaDXXX_NML//" RandomStartPointDomainUpperLimitVec = "//num2str(-RandomStartPointDomainUpperLimitVec)//" /" &
665 6 : )
666 18 : assertion = assertion .and. .not. PD%Err%occurred .and. all(PD%SpecMCMC%RandomStartPointDomainUpperLimitVec%Val == -RandomStartPointDomainUpperLimitVec)
667 : call PD%runSampler ( ndim = NDIM &
668 : , getLogFunc = getLogFuncMVN &
669 : , mpiFinalizeRequested = .false. &
670 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_RSPDUpperLimitVec_type_2B" &
671 : , inputFile = ParaDXXX_NML//" RandomStartPointDomainUpperLimitVec = "//num2str(RandomStartPointDomainUpperLimitVec)//" /" &
672 6 : )
673 18 : assertion = assertion .and. .not. PD%Err%occurred .and. all(PD%SpecMCMC%RandomStartPointDomainUpperLimitVec%Val == RandomStartPointDomainUpperLimitVec)
674 : #endif
675 74 : end function test_RSPDUpperLimitVec_type_2
676 :
677 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
678 :
679 : !> \brief
680 : !> Test whether the ParaDXXX sampler returns with an error message when
681 : !> `RandomStartPointDomainUpperLimitVec <= RandomStartPointDomainLowerLimitVec`.
682 6 : module function test_RSPDUpperLimitVec_type_3() result(assertion)
683 6 : use Constants_mod, only: IK, RK
684 : use String_mod, only: num2str
685 : implicit none
686 : logical :: assertion
687 6 : type(ParaDXXX_type) :: PD
688 : integer(IK) , parameter :: NDIM = 2_IK
689 : real(RK) , parameter :: RandomStartPointDomainLowerLimitVec(NDIM) = [1._RK, 2._RK]
690 : real(RK) , parameter :: RandomStartPointDomainUpperLimitVec(NDIM) = [-1._RK, -2._RK]
691 6 : assertion = .true.
692 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
693 : call PD%runSampler ( ndim = NDIM &
694 : , getLogFunc = getLogFuncMVN &
695 : , mpiFinalizeRequested = .false. &
696 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_RSPDUpperLimitVec_type_3" &
697 : , RandomStartPointDomainLowerLimitVec = RandomStartPointDomainLowerLimitVec &
698 : , RandomStartPointDomainUpperLimitVec = RandomStartPointDomainUpperLimitVec &
699 6 : )
700 6 : assertion = assertion .and. PD%Err%occurred
701 : #endif
702 14 : end function test_RSPDUpperLimitVec_type_3
703 :
704 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
705 :
706 : !> \brief
707 : !> Test whether the ParaDXXX sampler returns with an error message when
708 : !> `RandomStartPointDomainUpperLimitVec` goes beyond the limits of `DomainUpperLimitVec`.
709 6 : module function test_RSPDUpperLimitVec_type_4() result(assertion)
710 6 : use Constants_mod, only: IK, RK
711 : use String_mod, only: num2str
712 : implicit none
713 : logical :: assertion
714 6 : type(ParaDXXX_type) :: PD
715 : integer(IK) , parameter :: NDIM = 2_IK
716 : real(RK) , parameter :: RandomStartPointDomainUpperLimitVec(NDIM) = [+1._RK, +2._RK]
717 : real(RK) , parameter :: DomainUpperLimitVec(NDIM) = [-1._RK, +3._RK]
718 6 : assertion = .true.
719 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
720 : call PD%runSampler ( ndim = NDIM &
721 : , getLogFunc = getLogFuncMVN &
722 : , mpiFinalizeRequested = .false. &
723 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_RSPDUpperLimitVec_type_4" &
724 : , RandomStartPointDomainUpperLimitVec = RandomStartPointDomainUpperLimitVec &
725 : , DomainUpperLimitVec = DomainUpperLimitVec &
726 6 : )
727 6 : assertion = assertion .and. PD%Err%occurred
728 : #endif
729 14 : end function test_RSPDUpperLimitVec_type_4
730 :
731 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
732 :
733 : !> \brief
734 : !> Test whether the ParaDXXX sampler correctly randomizes the start point when requested.
735 6 : module function test_SpecMCMC_RandomStartPointRequested_type_1() result(assertion)
736 6 : use Constants_mod, only: IK, RK
737 : use String_mod, only: num2str
738 : implicit none
739 : logical :: assertion
740 6 : type(ParaDXXX_type) :: PD
741 : integer(IK) , parameter :: NDIM = 2_IK
742 6 : assertion = .true.
743 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
744 : call PD%runSampler ( ndim = NDIM &
745 : , getLogFunc = getLogFuncMVN &
746 : , mpiFinalizeRequested = .false. &
747 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_RandomStartPointRequested_type_1" &
748 : , randomStartPointRequested = .false. &
749 6 : )
750 6 : assertion = assertion .and. .not. PD%Err%occurred .and. .not. PD%SpecMCMC%RandomStartPointRequested%val
751 : #endif
752 74 : end function test_SpecMCMC_RandomStartPointRequested_type_1
753 :
754 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
755 :
756 : !> \brief
757 : !> Test `randomStartPointRequested = true`, the use must also specify domain of either the target or the random start point.
758 6 : module function test_SpecMCMC_RandomStartPointRequested_type_2() result(assertion)
759 6 : use Constants_mod, only: IK, RK
760 : use String_mod, only: num2str
761 : implicit none
762 : logical :: assertion
763 6 : type(ParaDXXX_type) :: PD
764 : integer(IK) , parameter :: NDIM = 2_IK
765 6 : assertion = .true.
766 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
767 : call PD%runSampler ( ndim = NDIM &
768 : , getLogFunc = getLogFuncMVN &
769 : , mpiFinalizeRequested = .false. &
770 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_RandomStartPointRequested_type_2" &
771 : , inputFile = ParaDXXX_NML//" randomStartPointRequested = true /" &
772 6 : )
773 6 : assertion = assertion .and. PD%Err%occurred .and. PD%SpecMCMC%RandomStartPointRequested%val
774 6 : if (Test%isDebugMode .and. .not. assertion) then
775 : ! LCOV_EXCL_START
776 : write(Test%outputUnit,"(*(g0,:,', '))")
777 : write(Test%outputUnit,"(*(g0,:,', '))") "PD%Err%occurred :", PD%Err%occurred
778 : write(Test%outputUnit,"(*(g0,:,', '))") "PD%SpecMCMC%RandomStartPointRequested%val :", PD%SpecMCMC%RandomStartPointRequested%val
779 : write(Test%outputUnit,"(*(g0,:,', '))")
780 : end if
781 : ! LCOV_EXCL_STOP
782 : #endif
783 14 : end function test_SpecMCMC_RandomStartPointRequested_type_2
784 :
785 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
786 :
787 : !> \brief
788 : !> When `randomStartPointRequested = true`, the user must also specify domain of either the target or the random start point.
789 6 : module function test_SpecMCMC_RandomStartPointRequested_type_3() result(assertion)
790 6 : use Constants_mod, only: IK, RK
791 : use String_mod, only: num2str
792 : implicit none
793 : logical :: assertion
794 6 : type(ParaDXXX_type) :: PD
795 : integer(IK) , parameter :: NDIM = 2_IK
796 : real(RK) , parameter :: RandomStartPointDomainLowerLimitVec(NDIM) = [-1.e0_RK, +1.e1_RK]
797 : real(RK) , parameter :: RandomStartPointDomainUpperLimitVec(NDIM) = [+2.e0_RK, +2.e1_RK]
798 6 : assertion = .true.
799 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
800 : call PD%runSampler ( ndim = NDIM &
801 : , getLogFunc = getLogFuncMVN &
802 : , mpiFinalizeRequested = .false. &
803 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_RandomStartPointRequested_type_3" &
804 : , inputFile = ParaDXXX_NML//" randomStartPointRequested = true /" &
805 : , RandomStartPointDomainLowerLimitVec = RandomStartPointDomainLowerLimitVec &
806 : , RandomStartPointDomainUpperLimitVec = RandomStartPointDomainUpperLimitVec &
807 6 : )
808 6 : assertion = assertion .and. .not. PD%Err%occurred .and. PD%SpecMCMC%RandomStartPointRequested%val
809 : #endif
810 74 : end function test_SpecMCMC_RandomStartPointRequested_type_3
811 :
812 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
813 :
814 : !> \brief
815 : !> When `randomStartPointRequested = true`, the user must also specify domain of either the target or the random start point.
816 6 : module function test_SpecMCMC_RandomStartPointRequested_type_4() result(assertion)
817 6 : use Constants_mod, only: IK, RK
818 : use String_mod, only: num2str
819 : implicit none
820 : logical :: assertion
821 6 : type(ParaDXXX_type) :: PD
822 : integer(IK) , parameter :: NDIM = 2_IK
823 : real(RK) , parameter :: DomainLowerLimitVec(NDIM) = [-1.e0_RK, +1.e2_RK]
824 : real(RK) , parameter :: DomainUpperLimitVec(NDIM) = [+2.e0_RK, +2.e2_RK]
825 6 : assertion = .true.
826 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
827 : call PD%runSampler ( ndim = NDIM &
828 : , getLogFunc = getLogFuncMVN &
829 : , mpiFinalizeRequested = .false. &
830 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_RandomStartPointRequested_type_4" &
831 : , inputFile = ParaDXXX_NML//" randomStartPointRequested = true /" &
832 : , DomainLowerLimitVec = DomainLowerLimitVec &
833 : , DomainUpperLimitVec = DomainUpperLimitVec &
834 : , chainSize = 100_IK &
835 6 : )
836 6 : assertion = assertion .and. .not. PD%Err%occurred .and. PD%SpecMCMC%RandomStartPointRequested%val
837 : #endif
838 74 : end function test_SpecMCMC_RandomStartPointRequested_type_4
839 :
840 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
841 :
842 : !> \brief
843 : !> Test whether the ParaDXXX sampler returns an error message when `sampleRefinementCount < 0`.
844 6 : module function test_SpecMCMC_SampleRefinementCount_type_1() result(assertion)
845 6 : use Constants_mod, only: IK, RK
846 : use String_mod, only: num2str
847 : implicit none
848 : logical :: assertion
849 6 : type(ParaDXXX_type) :: PD
850 : integer(IK) , parameter :: NDIM = 2_IK
851 6 : assertion = .true.
852 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
853 : call PD%runSampler ( ndim = NDIM &
854 : , getLogFunc = getLogFuncMVN &
855 : , mpiFinalizeRequested = .false. &
856 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_SampleRefinementCount_type_1" &
857 : , sampleRefinementCount = -1_IK &
858 6 : )
859 6 : assertion = assertion .and. PD%Err%occurred
860 : #endif
861 14 : end function test_SpecMCMC_SampleRefinementCount_type_1
862 :
863 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
864 :
865 : !> \brief
866 : !> Test whether the ParaDXXX sampler returns an error message when `sampleRefinementCount < 0`.
867 6 : module function test_SpecMCMC_SampleRefinementCount_type_2() result(assertion)
868 6 : use Constants_mod, only: IK, RK
869 : use String_mod, only: num2str
870 : implicit none
871 : logical :: assertion
872 6 : type(ParaDXXX_type) :: PD
873 : integer(IK) , parameter :: NDIM = 2_IK
874 6 : assertion = .true.
875 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
876 : call PD%runSampler ( ndim = NDIM &
877 : , getLogFunc = getLogFuncMVN &
878 : , mpiFinalizeRequested = .false. &
879 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_SampleRefinementCount_type_2" &
880 : , inputFile = ParaDXXX_NML//" sampleRefinementCount = -1 /" &
881 6 : )
882 6 : assertion = assertion .and. PD%Err%occurred
883 : #endif
884 14 : end function test_SpecMCMC_SampleRefinementCount_type_2
885 :
886 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
887 :
888 : !> \brief
889 : !> Test whether the ParaDXXX sampler succeeds with a valid `sampleRefinementCount >= 0`.
890 6 : module function test_SpecMCMC_SampleRefinementCount_type_3() result(assertion)
891 6 : use Constants_mod, only: IK, RK
892 : use String_mod, only: num2str
893 : implicit none
894 : logical :: assertion
895 6 : type(ParaDXXX_type) :: PD
896 : integer(IK) , parameter :: NDIM = 2_IK
897 6 : assertion = .true.
898 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
899 : call PD%runSampler ( ndim = NDIM &
900 : , getLogFunc = getLogFuncMVN &
901 : , mpiFinalizeRequested = .false. &
902 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_SampleRefinementCount_type_3" &
903 : , inputFile = ParaDXXX_NML//" sampleRefinementCount = 0 /" &
904 6 : )
905 6 : assertion = assertion .and. .not. PD%Err%occurred
906 : #endif
907 74 : end function test_SpecMCMC_SampleRefinementCount_type_3
908 :
909 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
910 :
911 : !> \brief
912 : !> Test whether the ParaDXXX sampler returns an error message with an unrecognized value for `sampleRefinementMethod`.
913 6 : module function test_SpecMCMC_SampleRefinementMethod_type_1() result(assertion)
914 6 : use Constants_mod, only: IK, RK
915 : use String_mod, only: num2str
916 : implicit none
917 : logical :: assertion
918 6 : type(ParaDXXX_type) :: PD
919 : integer(IK) , parameter :: NDIM = 2_IK
920 6 : assertion = .true.
921 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
922 : call PD%runSampler ( ndim = NDIM &
923 : , getLogFunc = getLogFuncMVN &
924 : , mpiFinalizeRequested = .false. &
925 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_SampleRefinementMethod_type_1" &
926 : , inputFile = ParaDXXX_NML//" sampleRefinementMethod = 'nonsense' /" &
927 6 : )
928 6 : assertion = assertion .and. PD%Err%occurred
929 : #endif
930 14 : end function test_SpecMCMC_SampleRefinementMethod_type_1
931 :
932 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
933 :
934 : !> \brief
935 : !> Test whether the ParaDXXX sampler succeeds with a valid value for `sampleRefinementMethod`.
936 6 : module function test_SpecMCMC_SampleRefinementMethod_type_2() result(assertion)
937 6 : use Constants_mod, only: IK, RK
938 : use String_mod, only: num2str
939 : implicit none
940 : logical :: assertion
941 6 : type(ParaDXXX_type) :: PD
942 : integer(IK) , parameter :: NDIM = 2_IK
943 6 : assertion = .true.
944 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
945 : call PD%runSampler ( ndim = NDIM &
946 : , getLogFunc = getLogFuncMVN &
947 : , mpiFinalizeRequested = .false. &
948 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_SampleRefinementMethod_type_2" &
949 : , sampleRefinementMethod = "Batch Means" &
950 6 : )
951 6 : assertion = assertion .and. .not. PD%Err%occurred
952 : #endif
953 74 : end function test_SpecMCMC_SampleRefinementMethod_type_2
954 :
955 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
956 :
957 : !> \brief
958 : !> Test whether the ParaDXXX sampler succeeds with a valid value for `sampleRefinementMethod`.
959 6 : module function test_SpecMCMC_SampleRefinementMethod_type_3() result(assertion)
960 6 : use Constants_mod, only: IK, RK
961 : use String_mod, only: num2str
962 : implicit none
963 : logical :: assertion
964 6 : type(ParaDXXX_type) :: PD
965 : integer(IK) , parameter :: NDIM = 2_IK
966 6 : assertion = .true.
967 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
968 : call PD%runSampler ( ndim = NDIM &
969 : , getLogFunc = getLogFuncMVN &
970 : , mpiFinalizeRequested = .false. &
971 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_SampleRefinementMethod_type_3" &
972 : , inputFile = ParaDXXX_NML//" sampleRefinementMethod = 'CutOffAutoCorr' /" &
973 6 : )
974 6 : assertion = assertion .and. .not. PD%Err%occurred
975 : #endif
976 74 : end function test_SpecMCMC_SampleRefinementMethod_type_3
977 :
978 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
979 :
980 : !> \brief
981 : !> Test whether the ParaDXXX sampler succeeds with a valid value for `sampleRefinementMethod`.
982 6 : module function test_SpecMCMC_SampleRefinementMethod_type_4() result(assertion)
983 6 : use Constants_mod, only: IK, RK
984 : use String_mod, only: num2str
985 : implicit none
986 : logical :: assertion
987 6 : type(ParaDXXX_type) :: PD
988 : integer(IK) , parameter :: NDIM = 2_IK
989 6 : assertion = .true.
990 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
991 : call PD%runSampler ( ndim = NDIM &
992 : , getLogFunc = getLogFuncMVN &
993 : , mpiFinalizeRequested = .false. &
994 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_SampleRefinementMethod_type_4" &
995 : , inputFile = ParaDXXX_NML//" sampleRefinementMethod = 'CutOf fAuto Corr' /" &
996 6 : )
997 6 : assertion = assertion .and. .not. PD%Err%occurred
998 : #endif
999 74 : end function test_SpecMCMC_SampleRefinementMethod_type_4
1000 :
1001 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1002 :
1003 : !> \brief
1004 : !> Test whether the ParaDXXX sampler succeeds with a valid value for `sampleRefinementMethod`.
1005 6 : module function test_SpecMCMC_SampleRefinementMethod_type_5() result(assertion)
1006 6 : use Constants_mod, only: IK, RK
1007 : use String_mod, only: num2str
1008 : implicit none
1009 : logical :: assertion
1010 6 : type(ParaDXXX_type) :: PD
1011 : integer(IK) , parameter :: NDIM = 2_IK
1012 6 : assertion = .true.
1013 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1014 : call PD%runSampler ( ndim = NDIM &
1015 : , getLogFunc = getLogFuncMVN &
1016 : , mpiFinalizeRequested = .false. &
1017 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_SampleRefinementMethod_type_5" &
1018 : , inputFile = ParaDXXX_NML//" sampleRefinementMethod = 'MaxCum SumAut oCorr' /" &
1019 6 : )
1020 6 : assertion = assertion .and. .not. PD%Err%occurred
1021 : #endif
1022 74 : end function test_SpecMCMC_SampleRefinementMethod_type_5
1023 :
1024 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1025 :
1026 : !> \brief
1027 : !> Test whether the ParaDXXX sampler succeeds with a valid value for `sampleRefinementMethod`.
1028 6 : module function test_SpecMCMC_SampleRefinementMethod_type_6() result(assertion)
1029 6 : use Constants_mod, only: IK, RK
1030 : use String_mod, only: num2str
1031 : implicit none
1032 : logical :: assertion
1033 6 : type(ParaDXXX_type) :: PD
1034 : integer(IK) , parameter :: NDIM = 2_IK
1035 6 : assertion = .true.
1036 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1037 : call PD%runSampler ( ndim = NDIM &
1038 : , getLogFunc = getLogFuncMVN &
1039 : , mpiFinalizeRequested = .false. &
1040 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_SampleRefinementMethod_type_6" &
1041 : , inputFile = ParaDXXX_NML//" sampleRefinementMethod = 'batchmeans-avg' /" &
1042 6 : )
1043 6 : assertion = assertion .and. .not. PD%Err%occurred
1044 : #endif
1045 74 : end function test_SpecMCMC_SampleRefinementMethod_type_6
1046 :
1047 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1048 :
1049 : !> \brief
1050 : !> Test whether the ParaDXXX sampler succeeds with a valid value for `sampleRefinementMethod`.
1051 6 : module function test_SpecMCMC_SampleRefinementMethod_type_7() result(assertion)
1052 6 : use Constants_mod, only: IK, RK
1053 : use String_mod, only: num2str
1054 : implicit none
1055 : logical :: assertion
1056 6 : type(ParaDXXX_type) :: PD
1057 : integer(IK) , parameter :: NDIM = 2_IK
1058 6 : assertion = .true.
1059 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1060 : call PD%runSampler ( ndim = NDIM &
1061 : , getLogFunc = getLogFuncMVN &
1062 : , mpiFinalizeRequested = .false. &
1063 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_SampleRefinementMethod_type_7" &
1064 : , inputFile = ParaDXXX_NML//" sampleRefinementMethod = 'batchmeans-average' /" &
1065 6 : )
1066 6 : assertion = assertion .and. .not. PD%Err%occurred
1067 : #endif
1068 74 : end function test_SpecMCMC_SampleRefinementMethod_type_7
1069 :
1070 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1071 :
1072 : !> \brief
1073 : !> Test whether the ParaDXXX sampler succeeds with a valid value for `sampleRefinementMethod`.
1074 6 : module function test_SpecMCMC_SampleRefinementMethod_type_8() result(assertion)
1075 6 : use Constants_mod, only: IK, RK
1076 : use String_mod, only: num2str
1077 : implicit none
1078 : logical :: assertion
1079 6 : type(ParaDXXX_type) :: PD
1080 : integer(IK) , parameter :: NDIM = 2_IK
1081 6 : assertion = .true.
1082 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1083 : call PD%runSampler ( ndim = NDIM &
1084 : , getLogFunc = getLogFuncMVN &
1085 : , mpiFinalizeRequested = .false. &
1086 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_SampleRefinementMethod_type_8" &
1087 : , inputFile = ParaDXXX_NML//" sampleRefinementMethod = 'batchmeans-med' /" &
1088 6 : )
1089 6 : assertion = assertion .and. .not. PD%Err%occurred
1090 : #endif
1091 74 : end function test_SpecMCMC_SampleRefinementMethod_type_8
1092 :
1093 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1094 :
1095 : !> \brief
1096 : !> Test whether the ParaDXXX sampler succeeds with a valid value for `sampleRefinementMethod`.
1097 6 : module function test_SpecMCMC_SampleRefinementMethod_type_9() result(assertion)
1098 6 : use Constants_mod, only: IK, RK
1099 : use String_mod, only: num2str
1100 : implicit none
1101 : logical :: assertion
1102 6 : type(ParaDXXX_type) :: PD
1103 : integer(IK) , parameter :: NDIM = 2_IK
1104 6 : assertion = .true.
1105 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1106 : call PD%runSampler ( ndim = NDIM &
1107 : , getLogFunc = getLogFuncMVN &
1108 : , mpiFinalizeRequested = .false. &
1109 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_SampleRefinementMethod_type_9" &
1110 : , inputFile = ParaDXXX_NML//" sampleRefinementMethod = 'batchmeans-median' /" &
1111 6 : )
1112 6 : assertion = assertion .and. .not. PD%Err%occurred
1113 : #endif
1114 74 : end function test_SpecMCMC_SampleRefinementMethod_type_9
1115 :
1116 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1117 :
1118 : !> \brief
1119 : !> Test whether the ParaDXXX sampler succeeds with a valid value for `sampleRefinementMethod`.
1120 6 : module function test_SpecMCMC_SampleRefinementMethod_type_10() result(assertion)
1121 6 : use Constants_mod, only: IK, RK
1122 : use String_mod, only: num2str
1123 : implicit none
1124 : logical :: assertion
1125 6 : type(ParaDXXX_type) :: PD
1126 : integer(IK) , parameter :: NDIM = 2_IK
1127 6 : assertion = .true.
1128 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1129 : call PD%runSampler ( ndim = NDIM &
1130 : , getLogFunc = getLogFuncMVN &
1131 : , mpiFinalizeRequested = .false. &
1132 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_SampleRefinementMethod_type_10" &
1133 : , inputFile = ParaDXXX_NML//" sampleRefinementMethod = 'batchmeans-min' /" &
1134 6 : )
1135 6 : assertion = assertion .and. .not. PD%Err%occurred
1136 : #endif
1137 74 : end function test_SpecMCMC_SampleRefinementMethod_type_10
1138 :
1139 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1140 :
1141 : !> \brief
1142 : !> Test whether the ParaDXXX sampler succeeds with a valid value for `sampleRefinementMethod`.
1143 6 : module function test_SpecMCMC_SampleRefinementMethod_type_11() result(assertion)
1144 6 : use Constants_mod, only: IK, RK
1145 : use String_mod, only: num2str
1146 : implicit none
1147 : logical :: assertion
1148 6 : type(ParaDXXX_type) :: PD
1149 : integer(IK) , parameter :: NDIM = 2_IK
1150 6 : assertion = .true.
1151 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1152 : call PD%runSampler ( ndim = NDIM &
1153 : , getLogFunc = getLogFuncMVN &
1154 : , mpiFinalizeRequested = .false. &
1155 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_SampleRefinementMethod_type_11" &
1156 : , inputFile = ParaDXXX_NML//" sampleRefinementMethod = 'batchmeans-minimum' /" &
1157 6 : )
1158 6 : assertion = assertion .and. .not. PD%Err%occurred
1159 : #endif
1160 74 : end function test_SpecMCMC_SampleRefinementMethod_type_11
1161 :
1162 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1163 :
1164 : !> \brief
1165 : !> Test whether the ParaDXXX sampler succeeds with a valid value for `sampleRefinementMethod`.
1166 6 : module function test_SpecMCMC_SampleRefinementMethod_type_12() result(assertion)
1167 6 : use Constants_mod, only: IK, RK
1168 : use String_mod, only: num2str
1169 : implicit none
1170 : logical :: assertion
1171 6 : type(ParaDXXX_type) :: PD
1172 : integer(IK) , parameter :: NDIM = 2_IK
1173 6 : assertion = .true.
1174 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1175 : call PD%runSampler ( ndim = NDIM &
1176 : , getLogFunc = getLogFuncMVN &
1177 : , mpiFinalizeRequested = .false. &
1178 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_SampleRefinementMethod_type_12" &
1179 : , inputFile = ParaDXXX_NML//" sampleRefinementMethod = 'batchmeans-max' /" &
1180 6 : )
1181 6 : assertion = assertion .and. .not. PD%Err%occurred
1182 : #endif
1183 74 : end function test_SpecMCMC_SampleRefinementMethod_type_12
1184 :
1185 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1186 :
1187 : !> \brief
1188 : !> Test whether the ParaDXXX sampler succeeds with a valid value for `sampleRefinementMethod`.
1189 6 : module function test_SpecMCMC_SampleRefinementMethod_type_13() result(assertion)
1190 6 : use Constants_mod, only: IK, RK
1191 : use String_mod, only: num2str
1192 : implicit none
1193 : logical :: assertion
1194 6 : type(ParaDXXX_type) :: PD
1195 : integer(IK) , parameter :: NDIM = 2_IK
1196 6 : assertion = .true.
1197 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1198 : call PD%runSampler ( ndim = NDIM &
1199 : , getLogFunc = getLogFuncMVN &
1200 : , mpiFinalizeRequested = .false. &
1201 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_SampleRefinementMethod_type_13" &
1202 : , inputFile = ParaDXXX_NML//" sampleRefinementMethod = 'batchmeans-maximum' /" &
1203 6 : )
1204 6 : assertion = assertion .and. .not. PD%Err%occurred
1205 : #endif
1206 74 : end function test_SpecMCMC_SampleRefinementMethod_type_13
1207 :
1208 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1209 :
1210 : !> \brief
1211 : !> Test whether the ParaDXXX sampler returns with an error message for a wrong input value for `scaleFactor`.
1212 6 : module function test_SpecMCMC_ScaleFactor_type_1() result(assertion)
1213 6 : use Constants_mod, only: IK, RK
1214 : use String_mod, only: num2str
1215 : implicit none
1216 : logical :: assertion
1217 6 : type(ParaDXXX_type) :: PD
1218 : integer(IK) , parameter :: NDIM = 2_IK
1219 6 : assertion = .true.
1220 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1221 : call PD%runSampler ( ndim = NDIM &
1222 : , getLogFunc = getLogFuncMVN &
1223 : , mpiFinalizeRequested = .false. &
1224 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_ScaleFactor_type_1" &
1225 : , inputFile = ParaDXXX_NML//" scaleFactor = 'nonsense' /" &
1226 6 : )
1227 6 : assertion = assertion .and. PD%Err%occurred
1228 : #endif
1229 14 : end function test_SpecMCMC_ScaleFactor_type_1
1230 :
1231 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1232 :
1233 : !> \brief
1234 : !> Test whether the ParaDXXX sampler returns with an error message for an empty input value for `scaleFactor`.
1235 6 : module function test_SpecMCMC_ScaleFactor_type_2() result(assertion)
1236 6 : use Constants_mod, only: IK, RK
1237 : use String_mod, only: num2str
1238 : implicit none
1239 : logical :: assertion
1240 6 : type(ParaDXXX_type) :: PD
1241 : integer(IK) , parameter :: NDIM = 2_IK
1242 6 : assertion = .true.
1243 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1244 : call PD%runSampler ( ndim = NDIM &
1245 : , getLogFunc = getLogFuncMVN &
1246 : , mpiFinalizeRequested = .false. &
1247 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_ScaleFactor_type_2" &
1248 : , scaleFactor = " " &
1249 6 : )
1250 6 : assertion = assertion .and. PD%Err%occurred
1251 : #endif
1252 14 : end function test_SpecMCMC_ScaleFactor_type_2
1253 :
1254 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1255 :
1256 : !> \brief
1257 : !> Test whether the ParaDXXX sampler returns with an error message for an empty input value for `scaleFactor`.
1258 6 : module function test_SpecMCMC_ScaleFactor_type_3() result(assertion)
1259 6 : use Constants_mod, only: IK, RK
1260 : use String_mod, only: num2str
1261 : implicit none
1262 : logical :: assertion
1263 6 : type(ParaDXXX_type) :: PD
1264 : integer(IK) , parameter :: NDIM = 2_IK
1265 6 : assertion = .true.
1266 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1267 : call PD%runSampler ( ndim = NDIM &
1268 : , getLogFunc = getLogFuncMVN &
1269 : , mpiFinalizeRequested = .false. &
1270 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_ScaleFactor_type_3" &
1271 : , scaleFactor = " " &
1272 6 : )
1273 6 : assertion = assertion .and. PD%Err%occurred
1274 : #endif
1275 14 : end function test_SpecMCMC_ScaleFactor_type_3
1276 :
1277 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1278 :
1279 : !> \brief
1280 : !> Test whether the ParaDXXX sampler returns with an error message for a wrong input value for `scaleFactor`.
1281 6 : module function test_SpecMCMC_ScaleFactor_type_4() result(assertion)
1282 6 : use Constants_mod, only: IK, RK
1283 : use String_mod, only: num2str
1284 : implicit none
1285 : logical :: assertion
1286 6 : type(ParaDXXX_type) :: PD
1287 : integer(IK) , parameter :: NDIM = 2_IK
1288 6 : assertion = .true.
1289 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1290 : call PD%runSampler ( ndim = NDIM &
1291 : , getLogFunc = getLogFuncMVN &
1292 : , mpiFinalizeRequested = .false. &
1293 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_ScaleFactor_type_4" &
1294 : , scaleFactor = "Gelman / 2" &
1295 6 : )
1296 6 : assertion = assertion .and. PD%Err%occurred
1297 : #endif
1298 14 : end function test_SpecMCMC_ScaleFactor_type_4
1299 :
1300 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1301 :
1302 : !> \brief
1303 : !> Test whether the ParaDXXX sampler returns successfully for a valid input value for `scaleFactor`.
1304 6 : module function test_SpecMCMC_ScaleFactor_type_5() result(assertion)
1305 6 : use Constants_mod, only: IK, RK
1306 : use String_mod, only: num2str
1307 : implicit none
1308 : logical :: assertion
1309 6 : type(ParaDXXX_type) :: PD
1310 : integer(IK) , parameter :: NDIM = 2_IK
1311 6 : assertion = .true.
1312 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1313 : call PD%runSampler ( ndim = NDIM &
1314 : , getLogFunc = getLogFuncMVN &
1315 : , mpiFinalizeRequested = .false. &
1316 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_ScaleFactor_type_5" &
1317 : , inputFile = ParaDXXX_NML//" scaleFactor = '2 * Gelman'" &
1318 6 : )
1319 6 : assertion = assertion .and. .not. PD%Err%occurred
1320 : #endif
1321 74 : end function test_SpecMCMC_ScaleFactor_type_5
1322 :
1323 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1324 :
1325 : !> \brief
1326 : !> Test whether the ParaDXXX sampler returns with an error message for a negative input value for `scaleFactor`.
1327 6 : module function test_SpecMCMC_ScaleFactor_type_6() result(assertion)
1328 6 : use Constants_mod, only: IK, RK
1329 : use String_mod, only: num2str
1330 : implicit none
1331 : logical :: assertion
1332 6 : type(ParaDXXX_type) :: PD
1333 : integer(IK) , parameter :: NDIM = 2_IK
1334 6 : assertion = .true.
1335 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1336 : call PD%runSampler ( ndim = NDIM &
1337 : , getLogFunc = getLogFuncMVN &
1338 : , mpiFinalizeRequested = .false. &
1339 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_ScaleFactor_type_6" &
1340 : , inputFile = ParaDXXX_NML//" scaleFactor = '-0.5 * Gelman'" &
1341 6 : )
1342 6 : assertion = assertion .and. PD%Err%occurred
1343 : #endif
1344 14 : end function test_SpecMCMC_ScaleFactor_type_6
1345 :
1346 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1347 :
1348 : !> \brief
1349 : !> Test whether the ParaDXXX sampler returns with an error message for a wrong input value for `scaleFactor`.
1350 6 : module function test_SpecMCMC_ScaleFactor_type_7() result(assertion)
1351 6 : use Constants_mod, only: IK, RK
1352 : use String_mod, only: num2str
1353 : implicit none
1354 : logical :: assertion
1355 6 : type(ParaDXXX_type) :: PD
1356 : integer(IK) , parameter :: NDIM = 2_IK
1357 6 : assertion = .true.
1358 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1359 : call PD%runSampler ( ndim = NDIM &
1360 : , getLogFunc = getLogFuncMVN &
1361 : , mpiFinalizeRequested = .false. &
1362 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_ScaleFactor_type_7" &
1363 : , inputFile = ParaDXXX_NML//" scaleFactor = '*GELMAN'" &
1364 6 : )
1365 6 : assertion = assertion .and. PD%Err%occurred
1366 : #endif
1367 14 : end function test_SpecMCMC_ScaleFactor_type_7
1368 :
1369 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1370 :
1371 : !> \brief
1372 : !> Test whether the ParaDXXX sampler returns successfully for a valid input value for `scaleFactor`.
1373 6 : module function test_SpecMCMC_ScaleFactor_type_8() result(assertion)
1374 6 : use Constants_mod, only: IK, RK
1375 : use String_mod, only: num2str
1376 : implicit none
1377 : logical :: assertion
1378 6 : type(ParaDXXX_type) :: PD
1379 : integer(IK) , parameter :: NDIM = 2_IK
1380 6 : assertion = .true.
1381 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1382 : call PD%runSampler ( ndim = NDIM &
1383 : , getLogFunc = getLogFuncMVN &
1384 : , mpiFinalizeRequested = .false. &
1385 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_ScaleFactor_type_8" &
1386 : , inputFile = ParaDXXX_NML//" scaleFactor = '2. * 0.5 * Gelman'" &
1387 6 : )
1388 6 : assertion = assertion .and. .not. PD%Err%occurred .and. abs(PD%SpecMCMC%ScaleFactor%val-2.38_RK/sqrt(real(NDIM,kind=RK)))<1.e-12_RK
1389 : #endif
1390 74 : end function test_SpecMCMC_ScaleFactor_type_8
1391 :
1392 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1393 :
1394 : !> \brief
1395 : !> Test whether the ParaDXXX sampler returns successfully for a valid input value for `StartPointVec`.
1396 6 : module function test_SpecMCMC_StartPointVec_type_1() result(assertion)
1397 6 : use Constants_mod, only: IK, RK
1398 : use String_mod, only: num2str
1399 : implicit none
1400 : logical :: assertion
1401 6 : type(ParaDXXX_type) :: PD
1402 : integer(IK) , parameter :: NDIM = 2_IK
1403 : real(RK) , parameter :: StartPointVec(NDIM) = [1._RK, -10._RK]
1404 6 : assertion = .true.
1405 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1406 : call PD%runSampler ( ndim = NDIM &
1407 : , getLogFunc = getLogFuncMVN &
1408 : , mpiFinalizeRequested = .false. &
1409 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_StartPointVec_type_1" &
1410 : , StartPointVec = StartPointVec &
1411 6 : )
1412 6 : assertion = assertion .and. .not. PD%Err%occurred .and. abs(PD%SpecMCMC%ScaleFactor%val-2.38_RK/sqrt(real(NDIM,kind=RK)))<1.e-12_RK
1413 : #endif
1414 74 : end function test_SpecMCMC_StartPointVec_type_1
1415 :
1416 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1417 :
1418 : !> \brief
1419 : !> Test whether the ParaDXXX sampler returns successfully for a valid input value for `StartPointVec`.
1420 6 : module function test_SpecMCMC_StartPointVec_type_2() result(assertion)
1421 6 : use Constants_mod, only: IK, RK
1422 : use String_mod, only: num2str
1423 : implicit none
1424 : logical :: assertion
1425 6 : type(ParaDXXX_type) :: PD
1426 : integer(IK) , parameter :: NDIM = 2_IK
1427 6 : assertion = .true.
1428 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1429 : call PD%runSampler ( ndim = NDIM &
1430 : , getLogFunc = getLogFuncMVN &
1431 : , mpiFinalizeRequested = .false. &
1432 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_StartPointVec_type_2" &
1433 : , inputFile = ParaDXXX_NML//" StartPointVec = 1., -10., /" &
1434 6 : )
1435 6 : assertion = assertion .and. .not. PD%Err%occurred
1436 : #endif
1437 74 : end function test_SpecMCMC_StartPointVec_type_2
1438 :
1439 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1440 :
1441 : !> \brief
1442 : !> Test whether the ParaDXXX sampler returns successfully and correctly computes `StartPointVec` when not provided.
1443 6 : module function test_SpecMCMC_StartPointVec_type_3() result(assertion)
1444 6 : use Constants_mod, only: IK, RK
1445 : use String_mod, only: num2str
1446 : implicit none
1447 : logical :: assertion
1448 6 : type(ParaDXXX_type) :: PD
1449 : integer(IK) , parameter :: NDIM = 2_IK
1450 6 : assertion = .true.
1451 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1452 : call PD%runSampler ( ndim = NDIM &
1453 : , getLogFunc = getLogFuncMVN &
1454 : , mpiFinalizeRequested = .false. &
1455 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_StartPointVec_type_3" &
1456 6 : )
1457 18 : assertion = assertion .and. .not. PD%Err%occurred .and. all( abs(PD%SpecMCMC%StartPointVec%Val) < 1.e-12_RK )
1458 : #endif
1459 74 : end function test_SpecMCMC_StartPointVec_type_3
1460 :
1461 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1462 :
1463 : !> \brief
1464 : !> Test whether the ParaDXXX sampler returns successfully and correctly computes `StartPointVec` when not provided.
1465 6 : module function test_SpecMCMC_StartPointVec_type_4() result(assertion)
1466 6 : use Constants_mod, only: IK, RK
1467 : use String_mod, only: num2str
1468 : implicit none
1469 : logical :: assertion
1470 6 : type(ParaDXXX_type) :: PD
1471 : integer(IK) , parameter :: NDIM = 2_IK
1472 : real(RK) , parameter :: DomainLowerLimitVec(NDIM) = [-1.e0_RK, +1.e1_RK]
1473 : real(RK) , parameter :: DomainUpperLimitVec(NDIM) = [+2.e0_RK, +2.e1_RK]
1474 6 : assertion = .true.
1475 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1476 : call PD%runSampler ( ndim = NDIM &
1477 : , getLogFunc = getLogFuncMVN &
1478 : , mpiFinalizeRequested = .false. &
1479 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_StartPointVec_type_4" &
1480 : , DomainLowerLimitVec = DomainLowerLimitVec &
1481 : , DomainUpperLimitVec = DomainUpperLimitVec &
1482 : , chainSize = 100_IK &
1483 6 : )
1484 18 : assertion = assertion .and. .not. PD%Err%occurred .and. all( abs(PD%SpecMCMC%StartPointVec%Val-0.5_RK*(DomainLowerLimitVec+DomainUpperLimitVec)) < 1.e-12_RK )
1485 6 : if (Test%isDebugMode .and. .not. assertion) then
1486 : ! LCOV_EXCL_START
1487 : write(Test%outputUnit,"(*(g0,:,' '))")
1488 : write(Test%outputUnit,"(*(g0,:,' '))") "PD%Err%occurred", PD%Err%occurred
1489 : write(Test%outputUnit,"(*(g0,:,' '))") "PD%SpecMCMC%StartPointVec%Val", PD%SpecMCMC%StartPointVec%Val
1490 : write(Test%outputUnit,"(*(g0,:,' '))") "DomainUpperLimitVec", DomainUpperLimitVec
1491 : write(Test%outputUnit,"(*(g0,:,' '))") "DomainLowerLimitVec", DomainLowerLimitVec
1492 : write(Test%outputUnit,"(*(g0,:,' '))")
1493 : end if
1494 : ! LCOV_EXCL_STOP
1495 : #endif
1496 74 : end function test_SpecMCMC_StartPointVec_type_4
1497 :
1498 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1499 :
1500 : !> \brief
1501 : !> Test whether the ParaDXXX sampler returns with an error message when `StartPointVec` is out of domain boundary.
1502 6 : module function test_SpecMCMC_StartPointVec_type_5() result(assertion)
1503 6 : use Constants_mod, only: IK, RK
1504 : use String_mod, only: num2str
1505 : implicit none
1506 : logical :: assertion
1507 6 : type(ParaDXXX_type) :: PD
1508 : integer(IK) , parameter :: NDIM = 2_IK
1509 : real(RK) , parameter :: DomainLowerLimitVec(NDIM) = [-1.e0_RK, +1.e1_RK]
1510 : real(RK) , parameter :: DomainUpperLimitVec(NDIM) = [+2.e0_RK, +2.e1_RK]
1511 : real(RK) , parameter :: StartPointVec(NDIM) = [-2.e1_RK, +2.e2_RK]
1512 6 : assertion = .true.
1513 : #if defined CODECOV_ENABLED || defined SAMPLER_TEST_ENABLED
1514 : call PD%runSampler ( ndim = NDIM &
1515 : , getLogFunc = getLogFuncMVN &
1516 : , mpiFinalizeRequested = .false. &
1517 : , outputFileName = Test%outDir//"/"//MODULE_NAME//"@SpecMCMC/test_SpecMCMC_StartPointVec_type_5" &
1518 : , DomainLowerLimitVec = DomainLowerLimitVec &
1519 : , DomainUpperLimitVec = DomainUpperLimitVec &
1520 : , StartPointVec = StartPointVec &
1521 : , chainSize = 100_IK &
1522 6 : )
1523 18 : assertion = assertion .and. PD%Err%occurred .and. all(PD%SpecMCMC%StartPointVec%Val==StartPointVec)
1524 6 : if (Test%isDebugMode .and. .not. assertion) then
1525 : ! LCOV_EXCL_START
1526 : write(Test%outputUnit,"(*(g0,:,' '))")
1527 : write(Test%outputUnit,"(*(g0,:,' '))") "PD%Err%occurred", PD%Err%occurred
1528 : write(Test%outputUnit,"(*(g0,:,' '))") "PD%SpecMCMC%StartPointVec%Val", PD%SpecMCMC%StartPointVec%Val
1529 : write(Test%outputUnit,"(*(g0,:,' '))") "DomainUpperLimitVec", DomainUpperLimitVec
1530 : write(Test%outputUnit,"(*(g0,:,' '))") "DomainLowerLimitVec", DomainLowerLimitVec
1531 : write(Test%outputUnit,"(*(g0,:,' '))")
1532 : end if
1533 : ! LCOV_EXCL_STOP
1534 : #endif
1535 14 : end function test_SpecMCMC_StartPointVec_type_5
1536 :
1537 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|