The ParaMonte Documentation Website
Current view: top level - kernel - SpecBase_OverwriteRequested_mod.f90 (source / functions) Hit Total Coverage
Test: ParaMonte 1.5.1 :: Coarray Parallel Kernel - Code Coverage Report Lines: 10 10 100.0 %
Date: 2021-01-08 12:59:07 Functions: 3 3 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 `overwriteRequested` 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_OverwriteRequested_mod
      49             : 
      50             :     implicit none
      51             : 
      52             :     ! namelist input
      53             :     logical                         :: overwriteRequested
      54             : 
      55             :     type                            :: OverwriteRequested_type
      56             :         logical                     :: val
      57             :         logical                     :: def
      58             :         character(:), allocatable   :: desc
      59             :     contains
      60             :         procedure, pass             :: set => setOverwriteRequested, nullifyNameListVar
      61             :     end type OverwriteRequested_type
      62             : 
      63             :     interface OverwriteRequested_type
      64             :         module procedure            :: constructOverwriteRequested
      65             :     end interface OverwriteRequested_type
      66             : 
      67             :     private :: constructOverwriteRequested, setOverwriteRequested
      68             : 
      69             : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      70             : 
      71             : contains
      72             : 
      73             : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      74             : 
      75        1047 :     function constructOverwriteRequested(methodName) result(OverwriteRequestedObj)
      76             : #if INTEL_COMPILER_ENABLED && defined DLL_ENABLED && (OS_IS_WINDOWS || defined OS_IS_DARWIN)
      77             :         !DEC$ ATTRIBUTES DLLEXPORT :: constructOverwriteRequested
      78             : #endif
      79             :         use String_mod, only: log2str
      80             :         implicit none
      81             :         character(*), intent(in)        :: methodName
      82             :         type(OverwriteRequested_type)   :: OverwriteRequestedObj
      83        1047 :         OverwriteRequestedObj%def = .false.
      84             :         OverwriteRequestedObj%desc = &
      85             :         "A logical (boolean) variable. If true (or .true. or TRUE or .t. from within an input file), then any existing old &
      86             :         &simulation files with the same name as the current simulation will be overwritten with the new simulation output files. &
      87             :         &Note that if overwriteRequested is set to TRUE, then the restart functionality is automatically turned off and any &
      88             :         &existing old simulation output files with the same name as the current simulation will be overwritten by "//methodName//". &
      89        1047 :         &The default value is " // log2str(OverwriteRequestedObj%def) // "."
      90        1047 :     end function constructOverwriteRequested
      91             : 
      92             : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      93             : 
      94        1047 :     subroutine nullifyNameListVar(OverwriteRequestedObj)
      95             : #if INTEL_COMPILER_ENABLED && defined DLL_ENABLED && (OS_IS_WINDOWS || defined OS_IS_DARWIN)
      96             :         !DEC$ ATTRIBUTES DLLEXPORT :: nullifyNameListVar
      97             : #endif
      98             :         implicit none
      99             :         class(OverwriteRequested_type), intent(in) :: OverwriteRequestedObj
     100        1047 :         overwriteRequested = OverwriteRequestedObj%def
     101        2094 :     end subroutine nullifyNameListVar
     102             : 
     103             : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     104             : 
     105        1059 :     subroutine setOverwriteRequested(OverwriteRequestedObj,overwriteRequested)
     106             : #if INTEL_COMPILER_ENABLED && defined DLL_ENABLED && (OS_IS_WINDOWS || defined OS_IS_DARWIN)
     107             :         !DEC$ ATTRIBUTES DLLEXPORT :: setOverwriteRequested
     108             : #endif
     109             :         implicit none
     110             :         class(OverwriteRequested_type), intent(inout)   :: OverwriteRequestedObj
     111             :         logical, intent(in)                             :: overwriteRequested
     112        1059 :         OverwriteRequestedObj%val = overwriteRequested
     113             : 
     114        2106 :     end subroutine setOverwriteRequested
     115             : 
     116             : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     117             : 
     118             : end module SpecBase_OverwriteRequested_mod ! LCOV_EXCL_LINE

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