MODFLOW 6  version 6.6.0.dev0
USGS Modular Hydrologic Model
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  end function get_os
48 
49  !> @brief Determine if this is the extended version
50  !!
51  !! Function to get a logical indicating if this is the
52  !! extended version of MODFLOW.
53  !!
54  !! @return isextended extended version logical
55  !<
56  function is_extended() result(isextended)
57  ! -- return variables
58  logical(LGP) :: isextended !< extended version logical
59  ! -- local variables
60  logical(LGP) :: ispetsc
61  logical(LGP) :: isnetcdf
62  !
63  ! -- initialize isextended
64  isextended = .false.
65  !
66  ! -- check if using petsc
67  ispetsc = using_petsc()
68  !
69  ! -- check if using netcf
70  isnetcdf = using_netcdf()
71  !
72  !
73  if (ispetsc .EQV. .true. .OR. isnetcdf .EQV. .true.) then
74  isextended = .true.
75  end if
76  !
77  end function is_extended
78 
79  !> @brief Determine if using petsc
80  !!
81  !! Function to get a logical indicating if petsc is
82  !! being used.
83  !!
84  !! @return petscused petsc used logical
85  !<
86  function using_petsc() result(petscused)
87  ! -- return variable
88  logical(LGP) :: petscused !< petsc used logical
89  !
90  ! -- initialize petscavail
91  petscused = .false.
92  !
93  ! -- set operating system variables
94 #ifdef __WITH_PETSC__
95  petscused = .true.
96 #endif
97  !
98  end function using_petsc
99 
100  !> @brief Determine if using netcdf
101  !!
102  !! Function to get a logical indicating if netcdf is
103  !! being used.
104  !!
105  !! @return netcdfused netcdf used logical
106  !<
107  function using_netcdf() result(netcdfused)
108  ! -- return variable
109  logical(LGP) :: netcdfused !< netcdf used logical
110  !
111  ! -- initialize petscavail
112  netcdfused = .false.
113  !
114  ! -- set operating system variables
115 #ifdef __WITH_NETCDF__
116  netcdfused = .true.
117 #endif
118  !
119  end function using_netcdf
120 
121 end module definedmacros
This module contains simulation constants.
Definition: Constants.f90:9
@ oslinux
Linux operating system.
Definition: Constants.f90:197
@ osundef
unknown operating system
Definition: Constants.f90:196
@ oswin
Windows operating system.
Definition: Constants.f90:199
@ osmac
MacOS operating system.
Definition: Constants.f90:198
logical(lgp) function, public is_extended()
Determine if this is the extended version.
Definition: defmacro.F90:57
logical(lgp) function, public using_petsc()
Determine if using petsc.
Definition: defmacro.F90:87
logical(lgp) function, public using_netcdf()
Determine if using netcdf.
Definition: defmacro.F90:108
integer(i4b) function, public get_os()
Get operating system.
Definition: defmacro.F90:17
This module defines variable data types.
Definition: kind.f90:8