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 `inputFileHasPriority` attribute of ParaMonte samplers.
45 : !> For more information, see the description of this attribute in the body of the module.
46 : !> \author Amir Shahmoradi
47 :
48 : module SpecBase_InputFileHasPriority_mod
49 :
50 : implicit none
51 :
52 : ! namelist input
53 : logical :: inputFileHasPriority
54 :
55 : type :: InputFileHasPriority_type
56 : logical :: val
57 : logical :: def
58 : character(:), allocatable :: desc
59 : contains
60 : procedure, pass :: set => setInputFileHasPriority, nullifyNameListVar
61 : end type InputFileHasPriority_type
62 :
63 : interface InputFileHasPriority_type
64 : module procedure :: constructInputFileHasPriority
65 : end interface InputFileHasPriority_type
66 :
67 : private :: constructInputFileHasPriority, setInputFileHasPriority
68 :
69 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
70 :
71 : contains
72 :
73 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
74 :
75 349 : function constructInputFileHasPriority(methodName) result(InputFileHasPriorityObj)
76 : #if INTEL_COMPILER_ENABLED && defined DLL_ENABLED && (OS_IS_WINDOWS || defined OS_IS_DARWIN)
77 : !DEC$ ATTRIBUTES DLLEXPORT :: constructInputFileHasPriority
78 : #endif
79 : use String_mod, only: log2str
80 : implicit none
81 : character(*), intent(in) :: methodName
82 : type(InputFileHasPriority_type) :: InputFileHasPriorityObj
83 349 : InputFileHasPriorityObj%def = .false.
84 : InputFileHasPriorityObj%desc = &
85 : "A logical (boolean) variable. If TRUE (or .true. or true or .t. from within an input file), then the &
86 : &input specifications of the sampler will be read from the input file provided by the user, and the &
87 : &simulation specification assignments from within the programming language environment (if any are made) &
88 : &will be completely ignored. If inputFileHasPriority is FALSE, then all simulation specifications of the "//methodName//" &
89 : &sampler that are taken from the user-specified input file will be overwritten by their &
90 : &corresponding input values that are set from within the user's programming environment (if any is provided). &
91 : &Note that this feature is useful when, for example, some simulation specifications have to computed and specified &
92 : &at runtime and therefore, cannot be specified before the program execution. Currently, this functionality &
93 : &(i.e., prioritizing the input file values to input-procedure-argument values) is available only in the &
94 349 : &Fortran-interface to the ParaMonte library routines. The default value is " // log2str(InputFileHasPriorityObj%def) // "."
95 349 : end function constructInputFileHasPriority
96 :
97 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
98 :
99 349 : subroutine nullifyNameListVar(InputFileHasPriorityObj)
100 : #if INTEL_COMPILER_ENABLED && defined DLL_ENABLED && (OS_IS_WINDOWS || defined OS_IS_DARWIN)
101 : !DEC$ ATTRIBUTES DLLEXPORT :: nullifyNameListVar
102 : #endif
103 : implicit none
104 : class(InputFileHasPriority_type), intent(in) :: InputFileHasPriorityObj
105 349 : inputFileHasPriority = InputFileHasPriorityObj%def
106 349 : end subroutine nullifyNameListVar
107 :
108 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
109 :
110 349 : subroutine setInputFileHasPriority(InputFileHasPriorityObj,inputFileHasPriority)
111 : #if INTEL_COMPILER_ENABLED && defined DLL_ENABLED && (OS_IS_WINDOWS || defined OS_IS_DARWIN)
112 : !DEC$ ATTRIBUTES DLLEXPORT :: setInputFileHasPriority
113 : #endif
114 : implicit none
115 : class(InputFileHasPriority_type), intent(inout) :: InputFileHasPriorityObj
116 : logical, intent(in) :: inputFileHasPriority
117 349 : InputFileHasPriorityObj%val = inputFileHasPriority
118 698 : end subroutine setInputFileHasPriority
119 :
120 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
121 :
122 : end module SpecBase_InputFileHasPriority_mod ! LCOV_EXCL_LINE
|