The ParaMonte Documentation Website
Current view: top level - kernel - SpecBase_SystemInfoFilePath_mod.f90 (source / functions) Hit Total Coverage
Test: ParaMonte 1.5.1 :: MPI Parallel Kernel - Code Coverage Report Lines: 13 13 100.0 %
Date: 2021-01-08 13:07:16 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 `systemInfoFilePath` 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_SystemInfoFilePath_mod
      49             : 
      50             :     use Constants_mod, only: IK
      51             :     implicit none
      52             : 
      53             :     character(*), parameter         :: MODULE_NAME = "@SpecBase_SystemInfoFilePath_mod"
      54             : 
      55             :     character(:), allocatable       :: systemInfoFilePath ! namelist input
      56             : 
      57             :     type                            :: SystemInfoFilePath_type
      58             :         character(:), allocatable   :: def
      59             :         character(:), allocatable   :: val
      60             :         character(:), allocatable   :: null
      61             :     contains
      62             :         procedure, pass             :: set => setSystemInfoFilePath, nullifyNameListVar
      63             :     end type SystemInfoFilePath_type
      64             : 
      65             :     interface SystemInfoFilePath_type
      66             :         module procedure            :: constructSystemInfoFilePath
      67             :     end interface SystemInfoFilePath_type
      68             : 
      69             :     private :: constructSystemInfoFilePath, setSystemInfoFilePath, nullifyNameListVar
      70             : 
      71             : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      72             : 
      73             : contains
      74             : 
      75             : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      76             : 
      77        1047 :     function constructSystemInfoFilePath() result(SystemInfoFilePathObj)
      78             : #if INTEL_COMPILER_ENABLED && defined DLL_ENABLED && (OS_IS_WINDOWS || defined OS_IS_DARWIN)
      79             :         !DEC$ ATTRIBUTES DLLEXPORT :: constructSystemInfoFilePath
      80             : #endif
      81             :         use Path_mod, only: MAX_FILE_PATH_LEN
      82             :         use DateTime_mod, only: DateTime_type
      83             :         use Constants_mod, only: NULL_SK
      84             :         implicit none
      85             :         type(SystemInfoFilePath_type)   :: SystemInfoFilePathObj
      86             :         type(DateTime_type)             :: DateTime
      87        1047 :         call DateTime%query()
      88        1047 :         SystemInfoFilePathObj%def = ".paramonte.sysinfo."//DateTime%year//DateTime%month//DateTime%day//".cache"
      89        1047 :         SystemInfoFilePathObj%null = repeat(NULL_SK, MAX_FILE_PATH_LEN)
      90        1047 :     end function constructSystemInfoFilePath
      91             : 
      92             : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      93             : 
      94        1047 :     subroutine nullifyNameListVar(SystemInfoFilePathObj)
      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(SystemInfoFilePath_type), intent(in) :: SystemInfoFilePathObj
     100        1047 :         systemInfoFilePath = SystemInfoFilePathObj%null
     101        1047 :     end subroutine nullifyNameListVar
     102             : 
     103             : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     104             : 
     105        1047 :     subroutine setSystemInfoFilePath(SystemInfoFilePathObj,systemInfoFilePath)
     106             : #if INTEL_COMPILER_ENABLED && defined DLL_ENABLED && (OS_IS_WINDOWS || defined OS_IS_DARWIN)
     107             :         !DEC$ ATTRIBUTES DLLEXPORT :: setSystemInfoFilePath
     108             : #endif
     109             :         implicit none
     110             :         class(SystemInfoFilePath_type), intent(inout)   :: SystemInfoFilePathObj
     111             :         character(*)                                    :: systemInfoFilePath
     112        1047 :         SystemInfoFilePathObj%val = trim(adjustl(systemInfoFilePath))
     113        1047 :         if ( SystemInfoFilePathObj%val==SystemInfoFilePathObj%null ) SystemInfoFilePathObj%val = SystemInfoFilePathObj%def
     114        1047 :         deallocate(SystemInfoFilePathObj%null)
     115        1047 :     end subroutine setSystemInfoFilePath
     116             : 
     117             : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     118             : 
     119             : end module SpecBase_SystemInfoFilePath_mod ! LCOV_EXCL_LINE

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