MODFLOW 6  version 6.5.0.dev2
MODFLOW 6 Code Documentation
compilerversion.F90
Go to the documentation of this file.
2  ! -- modules
3  use iso_fortran_env, only: compiler_options, compiler_version
4  use constantsmodule, only: lenbigline, &
6  use kindmodule, only: i4b
7  implicit none
8  private
9  ! -- compiler version
10  character(len=10) :: c_compiler !< compiler string
11  character(len=10) :: c_version !< compiler version string
12  character(len=20) :: c_date !< compilation date
13  integer(I4B) :: icompiler = cunknown !< compiler enum
15 contains
16 
17  !> @ brief Get compiler information
18  !!
19  !! Subroutine returns a string with compilation date and compiler.
20  !!
21  !<
22  subroutine get_compiler(txt)
23  ! -- dummy variables
24  character(len=LENBIGLINE), intent(inout) :: txt !< compiler information
25  !
26  ! -- set variables
27 #ifdef __GFORTRAN__
29  c_date = __date__//' '//__time__
30 #endif
31 #ifdef __INTEL_COMPILER
33  c_date = __date__//' '//__time__
34 #endif
35 #ifdef _CRAYFTN
37  c_date = __date__//' '//__time__
38 #endif
39  !
40  ! -- set compiler strings
41  if (icompiler == cunknown) then
42  c_compiler = 'UNKNOWN'
43  c_version = '??.??'
44  c_date = '??? ?? ???? ??:??:??'
45  end if
46  !
47  ! -- write string with compiler information
48  write (txt, '(a,3(1x,a))') &
49  'MODFLOW 6 compiled', trim(adjustl(c_date)), &
50  'with', trim(adjustl(compiler_version()))
51  !
52  ! -- return
53  return
54  end subroutine get_compiler
55 
56  !> @ brief Get compilation date
57  !!
58  !! Subroutine returns a string with compilation date
59  !!
60  !<
61  subroutine get_compile_date(txt)
62  ! -- dummy variables
63  character(len=20), intent(inout) :: txt !< compilation date
64  ! -- set variables
65 #ifdef __GFORTRAN__
66  c_date = __date__//' '//__time__
67 #endif
68 #ifdef __INTEL_COMPILER
69  c_date = __date__//' '//__time__
70 #endif
71 #ifdef _CRAYFTN
72  c_date = __date__//' '//__time__
73 #endif
74  !
75  ! -- write compilation date string
76  write (txt, '(a)') trim(adjustl(c_date))
77  !
78  ! -- return
79  return
80  end subroutine get_compile_date
81 
82  !> @ brief Get compilation options
83  !!
84  !! Subroutine returns a string with compilation options
85  !!
86  !<
87  subroutine get_compile_options(txt)
88  ! -- dummy variables
89  character(len=LENBIGLINE), intent(inout) :: txt !< compilation options
90  ! -- set variables
91  !
92  ! -- set txt string
93  write (txt, '(a)') &
94  'MODFLOW 6 compiler options:'//' '//trim(adjustl(compiler_options()))
95  !
96  ! -- return
97  return
98  end subroutine get_compile_options
99 
100 end module compilerversion
character(len=20) c_date
compilation date
character(len=10) c_compiler
compiler string
subroutine, public get_compiler(txt)
@ brief Get compiler information
integer(i4b) icompiler
compiler enum
subroutine, public get_compile_options(txt)
@ brief Get compilation options
character(len=10) c_version
compiler version string
subroutine, public get_compile_date(txt)
@ brief Get compilation date
This module contains simulation constants.
Definition: Constants.f90:9
integer(i4b), parameter lenbigline
maximum length of a big line
Definition: Constants.f90:15
@ cunknown
unknown compiler
Definition: Constants.f90:212
@ cgfortran
gfortran compiler
Definition: Constants.f90:213
@ ccrayftn
cray fortran compiler
Definition: Constants.f90:215
@ cintel
intel ifort compiler
Definition: Constants.f90:214
This module defines variable data types.
Definition: kind.f90:8