[UP]


Manual Reference Pages  - assert (3)

NAME

assert(3f) - [M_verify] print filename, linenumber, and message to stderr and stop program (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Examples
Author
License

SYNOPSIS

function assert(file,linenum,expr,g1,g2g3,g4,g5,g6,g7,g8,g9)

    character(len=*),intent(in)  :: file
    character(len=*),intent(in)  :: linenum
    logical,intent(in)           :: expr
    class(*),intent(in),optional :: g1,g2,g3,g4,g5,g6,g7,g8,g9

DESCRIPTION

assert(3f) prints strings to stderr and then stops program with exit code 1 It labels the first string as the filename, the next integer parameter as the linenumber, and then up to nine scalar values.

It is primarily intended for use by the ufpp(1) preprocessor $ASSERT directive

OPTIONS

filename
  a string assumed to be the current filename when compiling
linenum
  assumed to be the line number of the source code the ASSERT(3f) procedure was called at.
expr logical value
g[1-9] optional value(s) to print as a message before stopping. May be of type INTEGER, LOGICAL, REAL, DOUBLEPRECISION, COMPLEX, or CHARACTER.

EXAMPLES

Sample program:

   program demo_assert
   use M_verify, only : assert
   implicit none
   real :: a, toobig=1024
   a=2000
   call assert(’myroutine’, 101, a.gt.toobig, ’The value is too large’, a, ’.gt.’, toobig)
   end program demo_assert

AUTHOR

John S. Urban

LICENSE

Public Domain


assert (3) March 11, 2021
Generated by manServer 1.08 from 12039530-980c-4488-8f6b-dabd74fa989f using man macros.