C Library Functions  - assert (3)

NAME

assert(3f) - [M_framework__msg] 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 prep(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_framework__msg, only : assert
   implicit none
   real :: a, toobig=1024
   a=2000
   call assert(’myroutine’, 101, a > toobig, &
           & ’The value is too large’, a, ’ > ’, toobig)
   end program demo_assert

AUTHOR

John S. Urban

LICENSE

Public Domain


Nemo Release 3.1 assert (3) July 22, 2023
Generated by manServer 1.08 from dfbddf88-50e7-48a6-972e-fe0bc7a9976a using man macros.