globals.f90 1.68 KB
Newer Older
1 2 3 4

MODULE globals
  implicit none

ulrich_y's avatar
ulrich_y committed
5 6 7 8 9 10
#ifndef KINDREAL
#define KINDREAL selected_real_kind(15,32)
#endif
#ifndef KINDINT
#define KINDINT 4
#endif
11

ulrich_y's avatar
ulrich_y committed
12 13
  integer, parameter :: prec = KINDREAL
  integer, parameter :: ikin = KINDINT
ulrich_y's avatar
ulrich_y committed
14 15
  real(kind=prec), parameter :: zero = 10._prec**(-precision(1._prec))     ! values smaller than this count as zero
  real(kind=prec), parameter :: pi = 3.1415926535897932384626433832795028841971693993751_prec
16

17
  ! The following parameters control the accuracy of the evaluation
ulrich_y's avatar
ulrich_y committed
18
  real(kind=prec), protected :: MPLdelta = zero          ! if the MPL sum changes less then del it is truncated.
ulrich_y's avatar
ulrich_y committed
19
  real(kind=prec), protected ::  Lidelta = 0._prec       ! like MPLdelta but for polylogs
ulrich_y's avatar
ulrich_y committed
20
  real(kind=prec), protected :: HoelderCircle = 1.1_prec ! when to apply Hoelder convolution?
ulrich_y's avatar
ulrich_y committed
21 22
  integer, parameter :: PolyLogCacheSize(2) = (/ 5, 100 /)
        ! = (/ mmax, n /). At most n polylogs with weight mmax will be cached
23

ulrich_y's avatar
ulrich_y committed
24
  complex(kind=prec), parameter :: i_ = (0.,1._prec)
Luca's avatar
readme  
Luca committed
25
  integer :: verb = 0
Luca's avatar
Luca committed
26 27

CONTAINS 
28
  
ulrich_y's avatar
ulrich_y committed
29
#ifdef DEBUG
Luca's avatar
Luca committed
30 31 32 33 34 35 36 37 38 39 40
  SUBROUTINE parse_cmd_args
    integer :: i
    character(len=32) :: arg
    i = 0
    do
      call get_command_argument(i, arg)
      if (len_trim(arg) == 0) exit

      ! parse verbosity
      if(trim(arg) == '-verb') then
        call get_command_argument(i+1,arg)
Luca's avatar
readme  
Luca committed
41
        read(arg,*) verb               ! str to int
Luca's avatar
Luca committed
42 43 44 45 46
      end if

      i = i+1
    end do
  END SUBROUTINE parse_cmd_args
ulrich_y's avatar
ulrich_y committed
47
#endif
48

49 50
  SUBROUTINE SET_OPTIONS(mpldel, lidel, hcircle)
    real(kind=prec), optional :: hcircle, mpldel, lidel
ulrich_y's avatar
ulrich_y committed
51
    if (present(MPLdel)) MPLdelta = mpldel
52
    if (present( Lidel)) LiDelta  =  lidel
ulrich_y's avatar
ulrich_y committed
53 54 55
    if (present(hcircle)) HoelderCircle = hcircle
  END SUBROUTINE

56
END MODULE globals