MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
Loading...
Searching...
No Matches
FeatureFlags.f90
Go to the documentation of this file.
1!> @brief Disable development features in release mode
3 use kindmodule, only: i4b
6 implicit none
7 private
9
10contains
11
12 !> @brief True if development features should be disabled
13 pure logical function is_release_mode()
15 end function is_release_mode
16
17 !> @brief Terminate if in release mode (guard development features)
18 !!
19 !! Terminate the program with an error if the IDEVELOPMODE flag
20 !! is set to 0. This allows developing features on the mainline
21 !! while disabling them in release builds. An optional file unit
22 !! may be specified to associate the feature with an input file.
23 !!
24 !<
25 subroutine developmode(errmsg, iunit)
26 ! -- dummy
27 character(len=*), intent(in) :: errmsg
28 integer(I4B), intent(in), optional :: iunit
29
30 ! -- store error and terminate if in release mode
31 if (is_release_mode()) then
32 if (present(iunit)) then
33 call store_error(errmsg, terminate=.false.)
34 call store_error_unit(iunit, terminate=.true.)
35 else
36 call store_error(errmsg, terminate=.true.)
37 end if
38 end if
39
40 end subroutine developmode
41
42end module featureflagsmodule
Disable development features in release mode.
pure logical function, public is_release_mode()
True if development features should be disabled.
subroutine, public developmode(errmsg, iunit)
Terminate if in release mode (guard development features).
This module defines variable data types.
Definition kind.f90:8
This module contains simulation methods.
Definition Sim.f90:10
subroutine, public store_error(msg, terminate)
Store an error message.
Definition Sim.f90:92
subroutine, public store_error_unit(iunit, terminate)
Store the file unit number.
Definition Sim.f90:169
This module contains version information.
Definition version.f90:7
integer(i4b), parameter idevelopmode
Definition version.f90:19