The ParaMonte Documentation Website
Current view: top level - kernel/tests - Test_ParaDXXX_mod@Test_SpecDRAM_smod.inc.f90 (source / functions) Hit Total Coverage
Test: ParaMonte 1.5.1 :: Coarray Parallel Kernel - Code Coverage Report Lines: 153 153 100.0 %
Date: 2021-01-08 12:59:07 Functions: 44 44 100.0 %
Legend: Lines: hit not hit

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

ParaMonte: Plain Powerful Parallel Monte Carlo Library 
The Computational Data Science Lab
© Copyright 2012 - 2021