-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathS3M_Module_Args.f90
68 lines (52 loc) · 2.94 KB
/
S3M_Module_Args.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
!--------------------------------------------------------------------------------
! File: S3M_Module_Args.f90
! Author(s): Fabio Delogu, Francesco Silvestro, Simone Gabellani, Francesco Avanzi
!
! Created on February 15, 2017, 4:40 PM
! Last update on Oct 27, 2020 11:45 AM
!
! Module to read argument(s) defined by command-line
!--------------------------------------------------------------------------------
!--------------------------------------------------------------------------------
! Module Args
module S3M_Module_Args
!--------------------------------------------------------------------------------
! External module(s) and implicit none
use S3M_Module_Tools_Debug ! to import global variable(s) declaration
implicit none
!--------------------------------------------------------------------------------
contains
!--------------------------------------------------------------------------------
! Subroutine to read argument(s)
subroutine S3M_Args_Read(sFileInfo, iArgsType)
!------------------------------------------------------------------------------------------
! Variable(s)
integer(kind = 4) :: iArgsN, iArgsType
character(len = 700) :: sLineBuffer
character(len = 700) :: sFileInfo
!------------------------------------------------------------------------------------------
!------------------------------------------------------------------------------------------
! Variable(s) initialization
iArgsN = -9999;
iArgsType = -9999
sFileInfo = "";
!------------------------------------------------------------------------------------------
!------------------------------------------------------------------------------------------
! Get number of argument(s)
iArgsN = iargc()
!------------------------------------------------------------------------------------------
if (iArgsN == 1) then
!------------------------------------------------------------------------------------------
! Get information file name
call getarg(1, sLineBuffer); sFileInfo = sLineBuffer
! Define argument(s) type
iArgsType = 2
!------------------------------------------------------------------------------------------
else
call mprintf(.true., iERROR, 'Too many arguments in the command line, see S3M_Args_Read subroutine')
endif
!------------------------------------------------------------------------------------------
end subroutine S3M_Args_Read
!--------------------------------------------------------------------------------
end module S3M_Module_Args
!--------------------------------------------------------------------------------