assert_m.F90 Source File


Files dependent on this one

sourcefile~~assert_m.f90~~AfferentGraph sourcefile~assert_m.f90 assert_m.F90 sourcefile~sp_reference_counter_s.f90 sp_reference_counter_s.f90 sourcefile~sp_reference_counter_s.f90->sourcefile~assert_m.f90 sourcefile~assert_s.f90 assert_s.F90 sourcefile~assert_s.f90->sourcefile~assert_m.f90

Contents

Source Code


Source Code

module assert_m
  !! Enforce logical assertions that can be toggled on/off at compile-time
  !! To turn off assertions, building with the flag -DUSE_ASSERTIONS=.false.
  implicit none

  private
  public :: assert

#ifndef USE_ASSERTIONS
# define USE_ASSERTIONS .true.
#endif
  logical, parameter :: enforce_assertions = USE_ASSERTIONS

  interface 

     pure module subroutine assert(assertion, description)
       !! Error terminate on .false. assertion with the stop code given by description
       !! With IBM XL Fortran, the stop code is an integer due to character stop codes being unsupported.
       implicit none
       logical, intent(in) :: assertion
       character(len=*), intent(in) :: description
     end subroutine

  end interface

end module assert_m