MODFLOW 6  version 6.7.0.dev0
USGS Modular Hydrologic Model
DevFeature.f90
Go to the documentation of this file.
1 !> @brief Disable development features in release mode
3  use kindmodule, only: i4b
4  use versionmodule, only: idevelopmode
6  implicit none
7  private
8  public :: dev_feature
9 
10 contains
11 
12  !> @brief Terminate if in release mode (guard development features)
13  !!
14  !! Terminate the program with an error if the IDEVELOPMODE flag
15  !! is set to 0. This allows developing features on the mainline
16  !! while disabling them in release builds. An optional file unit
17  !! may be specified to associate the feature with an input file.
18  !!
19  !<
20  subroutine dev_feature(errmsg, iunit)
21  ! -- dummy
22  character(len=*), intent(in) :: errmsg
23  integer(I4B), intent(in), optional :: iunit
24 
25  ! -- store error and terminate if in release mode
26  if (idevelopmode == 0) then
27  if (present(iunit)) then
28  call store_error(errmsg, terminate=.false.)
29  call store_error_unit(iunit, terminate=.true.)
30  else
31  call store_error(errmsg, terminate=.true.)
32  end if
33  end if
34 
35  end subroutine dev_feature
36 
37 end module devfeaturemodule
Disable development features in release mode.
Definition: DevFeature.f90:2
subroutine, public dev_feature(errmsg, iunit)
Terminate if in release mode (guard development features)
Definition: DevFeature.f90:21
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:168
This module contains version information.
Definition: version.f90:7
integer(i4b), parameter idevelopmode
Definition: version.f90:19