MODFLOW 6  version 6.5.0.dev2
MODFLOW 6 Code Documentation
defmacro.F90
Go to the documentation of this file.
2  ! -- modules
3  use kindmodule, only: lgp, i4b
5  implicit none
6  private
8 contains
9 
10  !> @brief Get operating system
11  !!
12  !! Function to get the integer operating system enum value.
13  !!
14  !! @return ios operating system enum
15  !<
16  function get_os() result(ios)
17  ! -- local variables
18  integer(I4B) :: ios !< operating system
19  !
20  ! -- initialize ios
21  ios = osundef
22  !
23  ! -- set operating system variables
24 #ifdef __GFORTRAN__
25 # ifdef __linux__
26  ios = oslinux
27 # endif
28 # ifdef __APPLE__
29  ios = osmac
30 # endif
31 # ifdef _WIN32
32  ios = oswin
33 # endif
34 #endif
35 #ifdef __INTEL_COMPILER
36 # ifdef __linux__
37  ios = oslinux
38 # endif
39 # ifdef __APPLE__
40  ios = osmac
41 # endif
42 # ifdef _WIN32
43  ios = oswin
44 # endif
45 #endif
46  !
47  ! return
48  return
49  end function get_os
50 
51  !> @brief Determine if this is the extended version
52  !!
53  !! Function to get a logical indicating if this is the
54  !! extended version of MODFLOW.
55  !!
56  !! @return isextended extended version logical
57  !<
58  function is_extended() result(isextended)
59  ! -- return variables
60  logical(LGP) :: isextended !< extended version logical
61  ! -- local variables
62  logical(LGP) :: ispetsc
63  logical(LGP) :: isnetcdf
64  !
65  ! -- initialize isextended
66  isextended = .false.
67  !
68  ! -- check if using petsc
69  ispetsc = using_petsc()
70  !
71  ! -- check if using netcf
72  isnetcdf = using_netcdf()
73  !
74  !
75  if (ispetsc .EQV. .true. .OR. isnetcdf .EQV. .true.) then
76  isextended = .true.
77  end if
78  !
79  ! return
80  return
81  end function is_extended
82 
83  !> @brief Determine if using petsc
84  !!
85  !! Function to get a logical indicating if petsc is
86  !! being used.
87  !!
88  !! @return petscused petsc used logical
89  !<
90  function using_petsc() result(petscused)
91  ! -- return variable
92  logical(LGP) :: petscused !< petsc used logical
93  !
94  ! -- initialize petscavail
95  petscused = .false.
96  !
97  ! -- set operating system variables
98 #ifdef __WITH_PETSC__
99  petscused = .true.
100 #endif
101  !
102  ! return
103  return
104  end function using_petsc
105 
106  !> @brief Determine if using netcdf
107  !!
108  !! Function to get a logical indicating if netcdf is
109  !! being used.
110  !!
111  !! @return netcdfused netcdf used logical
112  !<
113  function using_netcdf() result(netcdfused)
114  ! -- return variable
115  logical(LGP) :: netcdfused !< netcdf used logical
116  !
117  ! -- initialize petscavail
118  netcdfused = .false.
119  !
120  ! -- set operating system variables
121 #ifdef __WITH_NETCDF__
122  netcdfused = .true.
123 #endif
124  !
125  ! return
126  return
127  end function using_netcdf
128 
129 end module definedmacros
This module contains simulation constants.
Definition: Constants.f90:9
@ oslinux
Linux operating system.
Definition: Constants.f90:196
@ osundef
unknown operating system
Definition: Constants.f90:195
@ oswin
Windows operating system.
Definition: Constants.f90:198
@ osmac
MacOS operating system.
Definition: Constants.f90:197
logical(lgp) function, public is_extended()
Determine if this is the extended version.
Definition: defmacro.F90:59
logical(lgp) function, public using_petsc()
Determine if using petsc.
Definition: defmacro.F90:91
logical(lgp) function, public using_netcdf()
Determine if using netcdf.
Definition: defmacro.F90:114
integer(i4b) function, public get_os()
Get operating system.
Definition: defmacro.F90:17
This module defines variable data types.
Definition: kind.f90:8