The ParaMonte Documentation Website
Current view: top level - kernel - SpecMCMC_mod.f90 (source / functions) Hit Total Coverage
Test: ParaMonte 1.5.1 :: Serial Kernel - Code Coverage Report Lines: 155 155 100.0 %
Date: 2021-01-08 13:03:42 Functions: 6 6 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
      44             : !> This module contains the classes and procedures for setting up the attributes of samplers of class [ParaMCMC_type](@ref paramcmc_mod::paramcmc_type).
      45             : !> For more information, see the description of this attributes in the body of the corresponding modules.
      46             : !> \author Amir Shahmoradi
      47             : 
      48             : module SpecMCMC_mod
      49             : 
      50             :     ! ParaMCMC Spec variable types
      51             :     use SpecMCMC_ChainSize_mod                          , only: ChainSize_type
      52             :     use SpecMCMC_ScaleFactor_mod                        , only: ScaleFactor_type
      53             :     use SpecMCMC_StartPointVec_mod                      , only: StartPointVec_type
      54             :     use SpecMCMC_ProposalModel_mod                      , only: ProposalModel_type
      55             :     use SpecMCMC_ProposalStartStdVec_mod                , only: ProposalStartStdVec_type
      56             :     use SpecMCMC_ProposalStartCorMat_mod                , only: ProposalStartCorMat_type
      57             :     use SpecMCMC_ProposalStartCovMat_mod                , only: ProposalStartCovMat_type
      58             :     use SpecMCMC_SampleRefinementCount_mod              , only: SampleRefinementCount_type
      59             :     use SpecMCMC_SampleRefinementMethod_mod             , only: SampleRefinementMethod_type
      60             :     use SpecMCMC_RandomStartPointRequested_mod          , only: RandomStartPointRequested_type
      61             :     use SpecMCMC_RandomStartPointDomainLowerLimitVec_mod, only: RandomStartPointDomainLowerLimitVec_type
      62             :     use SpecMCMC_RandomStartPointDomainUpperLimitVec_mod, only: RandomStartPointDomainUpperLimitVec_type
      63             : 
      64             :     ! ParaMCMC namelist variables
      65             :     use SpecMCMC_ChainSize_mod                          , only: ChainSize
      66             :     use SpecMCMC_ScaleFactor_mod                        , only: scaleFactor
      67             :     use SpecMCMC_StartPointVec_mod                      , only: startPointVec
      68             :     use SpecMCMC_ProposalModel_mod                      , only: proposalModel
      69             :     use SpecMCMC_ProposalStartStdVec_mod                , only: proposalStartStdVec
      70             :     use SpecMCMC_ProposalStartCorMat_mod                , only: proposalStartCorMat
      71             :     use SpecMCMC_ProposalStartCovMat_mod                , only: proposalStartCovMat
      72             :     use SpecMCMC_SampleRefinementCount_mod              , only: SampleRefinementCount
      73             :     use SpecMCMC_SampleRefinementMethod_mod             , only: sampleRefinementMethod
      74             :     use SpecMCMC_RandomStartPointRequested_mod          , only: randomStartPointRequested
      75             :     use SpecMCMC_RandomStartPointDomainLowerLimitVec_mod, only: randomStartPointDomainLowerLimitVec
      76             :     use SpecMCMC_RandomStartPointDomainUpperLimitVec_mod, only: randomStartPointDomainUpperLimitVec
      77             : 
      78             :     implicit none
      79             : 
      80             :     type                                                :: SpecMCMC_type
      81             :         type(ChainSize_type)                            :: ChainSize
      82             :         type(ScaleFactor_type)                          :: ScaleFactor
      83             :         type(StartPointVec_type)                        :: startPointVec
      84             :         type(ProposalModel_type)                        :: ProposalModel
      85             :         type(ProposalStartStdVec_type)                  :: proposalStartStdVec
      86             :         type(ProposalStartCorMat_type)                  :: proposalStartCorMat
      87             :         type(ProposalStartCovMat_type)                  :: proposalStartCovMat
      88             :         type(SampleRefinementCount_type)                :: SampleRefinementCount
      89             :         type(SampleRefinementMethod_type)               :: SampleRefinementMethod
      90             :         type(RandomStartPointRequested_type)            :: randomStartPointRequested
      91             :         type(RandomStartPointDomainLowerLimitVec_type)  :: RandomStartPointDomainLowerLimitVec
      92             :         type(RandomStartPointDomainUpperLimitVec_type)  :: RandomStartPointDomainUpperLimitVec
      93             :     contains
      94             :         procedure, pass                                 :: nullifyNameListVar
      95             :         procedure, pass                                 :: setFromInputFile
      96             :         procedure, pass                                 :: setFromInputArgs
      97             :         procedure, pass                                 :: checkForSanity
      98             :         procedure, pass                                 :: reportValues
      99             :     end type SpecMCMC_type
     100             : 
     101             :     interface SpecMCMC_type
     102             :         module procedure                                :: constructSpecMCMC
     103             :     end interface SpecMCMC_type
     104             : 
     105             : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     106             : 
     107             : contains
     108             : 
     109             : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     110             : 
     111         349 :     function constructSpecMCMC  ( nd &
     112             :                                 , methodName &
     113             :                                 ) result(SpecMCMC)
     114             : #if INTEL_COMPILER_ENABLED && defined DLL_ENABLED && (OS_IS_WINDOWS || defined OS_IS_DARWIN)
     115             :         !DEC$ ATTRIBUTES DLLEXPORT :: constructSpecMCMC
     116             : #endif
     117             :         use Constants_mod, only: IK, RK
     118             :         implicit none
     119             :         integer(IK) , intent(in)    :: nd
     120             :         character(*), intent(in)    :: methodName
     121             :         type(SpecMCMC_type)         :: SpecMCMC
     122         349 :         SpecMCMC%ChainSize                              = ChainSize_type                            (methodName)
     123         349 :         SpecMCMC%ScaleFactor                            = ScaleFactor_type                          (nd,methodName)
     124         349 :         SpecMCMC%startPointVec                          = StartPointVec_type                        ()
     125         349 :         SpecMCMC%ProposalModel                          = ProposalModel_type                        ()
     126         349 :         SpecMCMC%proposalStartStdVec                    = ProposalStartStdVec_type                  (nd,methodName)
     127         349 :         SpecMCMC%proposalStartCorMat                    = ProposalStartCorMat_type                  (nd,methodName)
     128         349 :         SpecMCMC%proposalStartCovMat                    = ProposalStartCovMat_type                  (nd,methodName)
     129         349 :         SpecMCMC%SampleRefinementCount                  = SampleRefinementCount_type                (methodName)
     130         349 :         SpecMCMC%SampleRefinementMethod                 = SampleRefinementMethod_type               (methodName)
     131         349 :         SpecMCMC%RandomStartPointRequested              = RandomStartPointRequested_type            (methodName)
     132         349 :         SpecMCMC%RandomStartPointDomainLowerLimitVec    = RandomStartPointDomainLowerLimitVec_type  (methodName)
     133         349 :         SpecMCMC%RandomStartPointDomainUpperLimitVec    = RandomStartPointDomainUpperLimitVec_type  (methodName)
     134         349 :     end function constructSpecMCMC
     135             : 
     136             : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     137             : 
     138         349 :     subroutine nullifyNameListVar( SpecMCMC, nd )
     139             : #if INTEL_COMPILER_ENABLED && defined DLL_ENABLED && (OS_IS_WINDOWS || defined OS_IS_DARWIN)
     140             :         !DEC$ ATTRIBUTES DLLEXPORT :: nullifyNameListVar
     141             : #endif
     142         349 :         use Constants_mod, only: IK, RK
     143             :         implicit none
     144             :         class(SpecMCMC_type), intent(in)    :: SpecMCMC
     145             :         integer(IK), intent(in)             :: nd
     146         349 :         call SpecMCMC%ChainSize                             %nullifyNameListVar()
     147         349 :         call SpecMCMC%ScaleFactor                           %nullifyNameListVar()
     148         349 :         call SpecMCMC%startPointVec                         %nullifyNameListVar(nd)
     149         349 :         call SpecMCMC%ProposalModel                         %nullifyNameListVar()
     150         349 :         call SpecMCMC%proposalStartStdVec                   %nullifyNameListVar(nd)
     151         349 :         call SpecMCMC%proposalStartCorMat                   %nullifyNameListVar(nd)
     152         349 :         call SpecMCMC%proposalStartCovMat                   %nullifyNameListVar(nd)
     153         349 :         call SpecMCMC%SampleRefinementCount                 %nullifyNameListVar()
     154         349 :         call SpecMCMC%SampleRefinementMethod                %nullifyNameListVar()
     155         349 :         call SpecMCMC%RandomStartPointRequested             %nullifyNameListVar()
     156         349 :         call SpecMCMC%RandomStartPointDomainLowerLimitVec   %nullifyNameListVar(nd)
     157         349 :         call SpecMCMC%RandomStartPointDomainUpperLimitVec   %nullifyNameListVar(nd)
     158         349 :     end subroutine nullifyNameListVar
     159             : 
     160             : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     161             : 
     162         349 :     subroutine setFromInputFile(SpecMCMC, Err) ! domainLowerLimitVec, domainUpperLimitVec )
     163             : #if INTEL_COMPILER_ENABLED && defined DLL_ENABLED && (OS_IS_WINDOWS || defined OS_IS_DARWIN)
     164             :         !DEC$ ATTRIBUTES DLLEXPORT :: setFromInputFile
     165             : #endif
     166         349 :         use SpecBase_mod, only: SpecBase_type
     167             :         use Constants_mod, only: IK, RK
     168             :         use Err_mod, only: Err_type
     169             : 
     170             :         implicit none
     171             : 
     172             :         class(SpecMCMC_type), intent(inout)     :: SpecMCMC
     173             :         type(Err_type), intent(out)             :: Err
     174             : 
     175         349 :         Err%occurred = .false.
     176         349 :         Err%msg = ""
     177             : 
     178         349 :         call SpecMCMC%ChainSize                             %set(chainSize)
     179         349 :         call SpecMCMC%ScaleFactor                           %set(scaleFactor)
     180         349 :         call SpecMCMC%ProposalModel                         %set(trim(adjustl(proposalModel)))
     181         349 :         call SpecMCMC%proposalStartStdVec                   %set(proposalStartStdVec)
     182         349 :         call SpecMCMC%proposalStartCorMat                   %set(proposalStartCorMat)
     183         349 :         call SpecMCMC%proposalStartCovMat                   %set(SpecMCMC%proposalStartStdVec%val, SpecMCMC%proposalStartCorMat%val, proposalStartCovMat)
     184         349 :         call SpecMCMC%SampleRefinementCount                 %set(sampleRefinementCount)
     185         349 :         call SpecMCMC%SampleRefinementMethod                %set(sampleRefinementMethod)
     186         349 :         call SpecMCMC%RandomStartPointRequested             %set(randomStartPointRequested)
     187         349 :         call SpecMCMC%RandomStartPointDomainLowerLimitVec   %set(randomStartPointDomainLowerLimitVec)
     188         349 :         call SpecMCMC%RandomStartPointDomainUpperLimitVec   %set(randomStartPointDomainUpperLimitVec)
     189         349 :         call SpecMCMC%startPointVec                         %set(startPointVec)
     190             : 
     191         349 :     end subroutine setFromInputFile
     192             : 
     193             : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     194             : 
     195         347 :     subroutine setFromInputArgs ( SpecMCMC &
     196             :                                 ! ParaMCMC variables
     197             :                                 , chainSize                             &
     198             :                                 , scaleFactor                           &
     199         347 :                                 , startPointVec                         &
     200             :                                 , proposalModel                         &
     201         347 :                                 , proposalStartStdVec                   &
     202         347 :                                 , proposalStartCorMat                   &
     203         347 :                                 , proposalStartCovMat                   &
     204             :                                 , sampleRefinementCount                 &
     205             :                                 , sampleRefinementMethod                &
     206             :                                 , randomStartPointRequested             &
     207         347 :                                 , randomStartPointDomainLowerLimitVec   &
     208         347 :                                 , randomStartPointDomainUpperLimitVec   &
     209             :                                 )
     210             : #if INTEL_COMPILER_ENABLED && defined DLL_ENABLED && (OS_IS_WINDOWS || defined OS_IS_DARWIN)
     211             :         !DEC$ ATTRIBUTES DLLEXPORT :: setFromInputArgs
     212             : #endif
     213             : 
     214         349 :         use SpecBase_mod, only: SpecBase_type
     215             :         use Constants_mod, only: IK, RK
     216             :         implicit none
     217             :         class(SpecMCMC_type), intent(inout) :: SpecMCMC
     218             : 
     219             :         ! ParaMCMC variables
     220             :         integer(IK) , intent(in), optional  :: chainSize
     221             :         character(*), intent(in), optional  :: scaleFactor
     222             :         real(RK)    , intent(in), optional  :: startPointVec(:)
     223             :         character(*), intent(in), optional  :: proposalModel
     224             :         real(RK)    , intent(in), optional  :: proposalStartStdVec(:)
     225             :         real(RK)    , intent(in), optional  :: proposalStartCorMat(:,:)
     226             :         real(RK)    , intent(in), optional  :: proposalStartCovMat(:,:)
     227             :         integer(IK) , intent(in), optional  :: sampleRefinementCount
     228             :         character(*), intent(in), optional  :: sampleRefinementMethod
     229             :         logical     , intent(in), optional  :: randomStartPointRequested
     230             :         real(RK)    , intent(in), optional  :: randomStartPointDomainLowerLimitVec(:)
     231             :         real(RK)    , intent(in), optional  :: randomStartPointDomainUpperLimitVec(:)
     232             : 
     233             :         logical                             :: proposalStartStdVecIsPresent
     234             :         logical                             :: proposalStartCorMatIsPresent
     235             :         logical                             :: proposalStartCovMatIsPresent
     236             : 
     237         347 :         proposalStartStdVecIsPresent = present(proposalStartStdVec)
     238         347 :         proposalStartCorMatIsPresent = present(proposalStartCorMat)
     239         347 :         proposalStartCovMatIsPresent = present(proposalStartCovMat) .or. proposalStartCorMatIsPresent .or. proposalStartStdVecIsPresent
     240             : 
     241             : 
     242         347 :         if (present(chainSize))                             call SpecMCMC%ChainSize                             %set(chainSize)
     243         347 :         if (present(scaleFactor))                           call SpecMCMC%ScaleFactor                           %set(scaleFactor)
     244         347 :         if (present(proposalModel))                         call SpecMCMC%ProposalModel                         %set(trim(adjustl(proposalModel)))
     245         347 :         if (proposalStartStdVecIsPresent)                   call SpecMCMC%proposalStartStdVec                   %set(proposalStartStdVec)
     246         347 :         if (proposalStartCorMatIsPresent)                   call SpecMCMC%proposalStartCorMat                   %set(proposalStartCorMat)
     247         347 :         if (proposalStartCovMatIsPresent)                   call SpecMCMC%proposalStartCovMat                   %set(SpecMCMC%proposalStartStdVec%val, SpecMCMC%proposalStartCorMat%val, proposalStartCovMat)
     248         347 :         if (present(sampleRefinementCount))                 call SpecMCMC%SampleRefinementCount                 %set(sampleRefinementCount)
     249         347 :         if (present(sampleRefinementMethod))                call SpecMCMC%SampleRefinementMethod                %set(sampleRefinementMethod)
     250         347 :         if (present(randomStartPointRequested))             call SpecMCMC%RandomStartPointRequested             %set(randomStartPointRequested)
     251             : 
     252         347 :         call SpecMCMC%RandomStartPointDomainLowerLimitVec   %set(randomStartPointDomainLowerLimitVec)
     253         347 :         call SpecMCMC%RandomStartPointDomainUpperLimitVec   %set(randomStartPointDomainUpperLimitVec)
     254         347 :         call SpecMCMC%startPointVec                         %set(startPointVec)
     255             : 
     256         694 :     end subroutine setFromInputArgs
     257             : 
     258             : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     259             : 
     260         323 :     subroutine reportValues ( SpecMCMC              &
     261             :                             , prefix                &
     262             :                             , methodName            &
     263             :                             , outputUnit            &
     264             :                             , isLeaderImage         &
     265             :                             , splashModeRequested   &
     266             :                             )
     267             : #if INTEL_COMPILER_ENABLED && defined DLL_ENABLED && (OS_IS_WINDOWS || defined OS_IS_DARWIN)
     268             :         !DEC$ ATTRIBUTES DLLEXPORT :: reportValues
     269             : #endif
     270         347 :         use Decoration_mod, only: GENERIC_OUTPUT_FORMAT
     271             :         use Decoration_mod, only: GENERIC_TABBED_FORMAT
     272             :         use Decoration_mod, only: TAB
     273             :         use Constants_mod, only: IK, RK
     274             :         use Err_mod, only: note
     275             :         implicit none
     276             :         class(SpecMCMC_type), intent(in)    :: SpecMCMC
     277             :         character(*), intent(in)            :: prefix, methodName
     278             :         integer(IK), intent(in)             :: outputUnit
     279             :         logical, intent(in)                 :: isLeaderImage, splashModeRequested
     280             :         integer(IK)                         :: ndim, i
     281             : 
     282         323 :         if (isLeaderImage) then
     283             : 
     284         323 :             ndim = size(SpecMCMC%proposalStartCovMat%val(:,1))
     285             : 
     286         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT)
     287         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT) "chainSize"
     288         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT)
     289         323 :             write(outputUnit,GENERIC_TABBED_FORMAT) SpecMCMC%ChainSize%val
     290         323 :             if (splashModeRequested) call note( prefix = prefix, outputUnit = outputUnit, newline = "\n", msg = SpecMCMC%ChainSize%desc )
     291             : 
     292             : 
     293         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT)
     294         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT) "randomStartPointDomainLowerLimitVec"
     295         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT)
     296         779 :             do i = 1, size(SpecMCMC%RandomStartPointDomainLowerLimitVec%val(:))
     297         779 :                 write(outputUnit,GENERIC_TABBED_FORMAT) SpecMCMC%RandomStartPointDomainLowerLimitVec%val(i)
     298             :             end do
     299         323 :             if (splashModeRequested) call note( prefix = prefix, outputUnit = outputUnit, newline = "\n", msg = SpecMCMC%RandomStartPointDomainLowerLimitVec%desc )
     300             : 
     301             : 
     302         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT)
     303         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT) "randomStartPointDomainUpperLimitVec"
     304         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT)
     305         779 :             do i = 1, size(SpecMCMC%RandomStartPointDomainUpperLimitVec%val(:))
     306         779 :                 write(outputUnit,GENERIC_TABBED_FORMAT) SpecMCMC%RandomStartPointDomainUpperLimitVec%val(i)
     307             :             end do
     308         323 :             if (splashModeRequested) call note( prefix = prefix, outputUnit = outputUnit, newline = "\n", msg = SpecMCMC%RandomStartPointDomainUpperLimitVec%desc )
     309             : 
     310             : 
     311         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT)
     312         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT) "startPointVec"
     313         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT)
     314         779 :             do i = 1, size(SpecMCMC%startPointVec%val(:))
     315         779 :                 write(outputUnit,GENERIC_TABBED_FORMAT) SpecMCMC%startPointVec%val(i)
     316             :             end do
     317         323 :             if (splashModeRequested) call note( prefix = prefix, outputUnit = outputUnit, newline = "\n", msg = SpecMCMC%startPointVec%desc )
     318             : 
     319             : 
     320         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT)
     321         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT) "randomStartPointRequested"
     322         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT)
     323         323 :             write(outputUnit,GENERIC_TABBED_FORMAT) SpecMCMC%RandomStartPointRequested%val
     324         323 :             if (splashModeRequested) call note( prefix = prefix, outputUnit = outputUnit, newline = "\n", msg = SpecMCMC%RandomStartPointRequested%desc )
     325             : 
     326             : 
     327         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT)
     328         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT) "sampleRefinementCount"
     329         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT)
     330         323 :             write(outputUnit,GENERIC_TABBED_FORMAT) SpecMCMC%SampleRefinementCount%val
     331         323 :             if (splashModeRequested) call note( prefix = prefix, outputUnit = outputUnit, newline = "\n", msg = SpecMCMC%SampleRefinementCount%desc )
     332             : 
     333             : 
     334         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT)
     335         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT) "sampleRefinementMethod"
     336         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT)
     337         323 :             write(outputUnit,GENERIC_TABBED_FORMAT) SpecMCMC%SampleRefinementMethod%val
     338         323 :             if (splashModeRequested) call note( prefix = prefix, outputUnit = outputUnit, newline = "\n", msg = SpecMCMC%SampleRefinementMethod%desc )
     339             : 
     340             : 
     341         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT)
     342         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT) "scaleFactor"
     343         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT)
     344         323 :             write(outputUnit,GENERIC_TABBED_FORMAT) SpecMCMC%ScaleFactor%str
     345         323 :             if (splashModeRequested) call note( prefix = prefix, outputUnit = outputUnit, newline = "\n", msg = SpecMCMC%ScaleFactor%desc )
     346             : 
     347             : 
     348             :             !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     349             :             ! proposal distribution
     350             :             !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     351             : 
     352             :             !block
     353             :             !    use Decoration_mod, only: writeDecoratedText
     354             :             !    call writeDecoratedText ( text = "\n" // methodName // " proposal specifications\n" &
     355             :             !                            , marginTop = 1     &
     356             :             !                            , marginBot = 1     &
     357             :             !                            , newline = "\n"    &
     358             :             !                            , outputUnit = outputUnit )
     359             :             !end block
     360             : 
     361             : 
     362         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT)
     363         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT) "proposalModel"
     364         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT)
     365         323 :             write(outputUnit,GENERIC_TABBED_FORMAT) SpecMCMC%ProposalModel%val
     366         323 :             if (splashModeRequested) call note( prefix = prefix, outputUnit = outputUnit, newline = "\n", msg = SpecMCMC%ProposalModel%desc )
     367             : 
     368             : 
     369         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT)
     370         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT) "proposalStartStdVec"
     371         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT)
     372         779 :             do i = 1, ndim
     373         779 :                 write(outputUnit,GENERIC_TABBED_FORMAT) SpecMCMC%proposalStartStdVec%val(i)
     374             :             end do
     375         323 :             if (splashModeRequested) call note( prefix = prefix, outputUnit = outputUnit, newline = "\n", msg = SpecMCMC%proposalStartStdVec%desc )
     376             : 
     377             : 
     378         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT)
     379         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT) "proposalStartCorMat"
     380         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT)
     381         779 :             do i = 1, ndim
     382         779 :                 write(outputUnit,GENERIC_TABBED_FORMAT) SpecMCMC%proposalStartCorMat%val(:,i)
     383             :             end do
     384         323 :             if (splashModeRequested) call note( prefix = prefix, outputUnit = outputUnit, newline = "\n", msg = SpecMCMC%proposalStartCorMat%desc )
     385             : 
     386             : 
     387         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT)
     388         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT) "proposalStartCovMat"
     389         323 :             write(outputUnit,GENERIC_OUTPUT_FORMAT)
     390         779 :             do i = 1, ndim
     391         779 :                 write(outputUnit,GENERIC_TABBED_FORMAT) SpecMCMC%proposalStartCovMat%val(:,i)
     392             :             end do
     393         323 :             if (splashModeRequested) call note( prefix = prefix, outputUnit = outputUnit, newline = "\n", msg = SpecMCMC%proposalStartCovMat%desc )
     394             : 
     395             :         end if
     396             : 
     397             : 
     398         646 :     end subroutine reportValues
     399             : 
     400             : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     401             : 
     402         345 :     subroutine checkForSanity(SpecMCMC, SpecBase, methodName, nd, Err) ! ,domainLowerLimitVec,domainUpperLimitVec)
     403             : #if INTEL_COMPILER_ENABLED && defined DLL_ENABLED && (OS_IS_WINDOWS || defined OS_IS_DARWIN)
     404             :         !DEC$ ATTRIBUTES DLLEXPORT :: checkForSanity
     405             : #endif
     406         323 :         use SpecBase_mod, only: SpecBase_type
     407             :         use Constants_mod, only: IK, RK
     408             :         use Err_mod, only: Err_type
     409             :         implicit none
     410             :         class(SpecMCMC_type), intent(inout) :: SpecMCMC
     411             :         type(SpecBase_type) , intent(in)    :: SpecBase
     412             :         character(*), intent(in)            :: methodName
     413             :         integer(IK), intent(in)             :: nd
     414             :         type(Err_type), intent(inout)       :: Err
     415             :         !real(RK), intent(in)                :: domainLowerLimitVec(:), domainUpperLimitVec(:)
     416         345 :         call SpecMCMC%ChainSize                             %checkForSanity(Err,methodName,nd)
     417         345 :         call SpecMCMC%ScaleFactor                           %checkForSanity(Err,methodName)
     418         345 :         call SpecMCMC%ProposalModel                         %checkForSanity(Err,methodName)
     419         345 :         call SpecMCMC%proposalStartCovMat                   %checkForSanity(Err,methodName,nd)
     420         345 :         call SpecMCMC%proposalStartCorMat                   %checkForSanity(Err,methodName,nd)
     421         345 :         call SpecMCMC%proposalStartStdVec                   %checkForSanity(Err,methodName,nd)
     422         345 :         call SpecMCMC%SampleRefinementCount                 %checkForSanity(Err,methodName)
     423         345 :         call SpecMCMC%SampleRefinementMethod                %checkForSanity(Err,methodName)
     424         345 :         call SpecMCMC%RandomStartPointDomainLowerLimitVec   %checkForSanity(Err,methodName, SpecBase, randomStartPointRequested = SpecMCMC%RandomStartPointRequested%val )
     425             :         call SpecMCMC%RandomStartPointDomainUpperLimitVec   %checkForSanity(Err,methodName, SpecBase, randomStartPointRequested = SpecMCMC%RandomStartPointRequested%val &
     426         345 :                                                                                                     , randomStartPointDomainLowerLimitVec = SpecMCMC%RandomStartPointDomainLowerLimitVec%val )
     427             :         call SpecMCMC%startPointVec                         %checkForSanity(Err,methodName, SpecBase, randomStartPointRequested = SpecMCMC%RandomStartPointRequested%val &
     428             :                                                                                                     , randomStartPointDomainLowerLimitVec = SpecMCMC%RandomStartPointDomainLowerLimitVec%Val & ! LCOV_EXCL_LINE
     429         345 :                                                                                                     , randomStartPointDomainUpperLimitVec = SpecMCMC%RandomStartPointDomainUpperLimitVec%val )
     430         690 :     end subroutine checkForSanity
     431             : 
     432             : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     433             : 
     434             : end module SpecMCMC_mod ! LCOV_EXCL_LINE

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