constants.f90

View source code here on GitHub!

constants/i1t [integer]
constants/i2t [integer]
constants/i4t [integer]
constants/i18t [integer]

A set of digit type constraints that denote how many decimal digits a number can support. They are given as i<len>t or r<len>_<exp>t

constants/errort [integer(i1t)]
constants/int64t [integer(i1t)]
constants/stringt [integer(i1t)]

Denotes the type of an AnswerT

constants/ERROR_ANSWER_MISMATCH [integer]
constants/ERROR_ANSWER_TIMEOUT [integer]
constants/ERROR_ANSWER_TYPE_MISMATCH [integer]
constants/ERROR_ALLOCATE_FAILED [integer]
constants/ERROR_FILE_READ_FAILED [integer]

Denotes the exit codes of different failure modes, counting up from 1

constants/DATA_MAX_NAME_SIZE [integer]
constants/ANSWERT_STR_SIZE [integer]

Denotes the size of certain variables

 1module constants
 2    implicit none
 3
 4    ! kinds
 5    integer, parameter :: i1t = selected_int_kind(1)
 6    integer, parameter :: i2t = selected_int_kind(2)
 7    integer, parameter :: i4t = selected_int_kind(4)
 8    integer, parameter :: i18t = selected_int_kind(18)
 9
10    ! type codes
11    integer(i1t), parameter :: errort = 0
12    integer(i1t), parameter :: int64t = 1
13    integer(i1t), parameter :: stringt = 2
14
15    ! error codes
16    integer, parameter :: ERROR_ANSWER_MISMATCH = 1
17    integer, parameter :: ERROR_ANSWER_TIMEOUT = 2
18    integer, parameter :: ERROR_ANSWER_TYPE_MISMATCH = 3
19    integer, parameter :: ERROR_ALLOCATE_FAILED = 4
20    integer, parameter :: ERROR_FILE_READ_FAILED = 5
21
22    ! file/string sizes
23    integer, parameter :: DATA_MAX_NAME_SIZE = 32
24    integer, parameter :: ANSWERT_STR_SIZE = 16
25
26    ! misc
27    integer, parameter :: MAX_FACTORIAL_64 = 20
28    integer(i18t), parameter :: ten16 = 10000000000000000_i18t
29    integer(i18t), parameter :: ten17 = 100000000000000000_i18t
30end module constants

Tags: constants